Repository navigation
Expand file tree
/
Copy pathmodel_create_submission_batch_request.go
More file actions
359 lines (294 loc) · 11.2 KB
/
Copy pathmodel_create_submission_batch_request.go
File metadata and controls
359 lines (294 loc) · 11.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
/*
DocSpring API
Use DocSpring's API to fill PDF forms, generate PDFs and Word documents from HTML or Word templates, merge PDFs, and request legally binding e-signatures.
API version: v2
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package docspring
import (
"encoding/json"
"fmt"
)
// checks if the CreateSubmissionBatchRequest type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &CreateSubmissionBatchRequest{}
// CreateSubmissionBatchRequest The submissions to create, and the settings they share.
type CreateSubmissionBatchRequest struct {
// Your own data about the batch, such as an ID from your app.
Metadata map[string]interface{} `json:"metadata,omitempty"`
// The template for each submission that doesn't name its own `template_id`.
TemplateId *string `json:"template_id,omitempty"`
// The template version to use: a published version (`1.2.0`, or `1` for the latest 1.x.x), `latest` (the newest published version, or the draft when none has been published) or `draft`. Default `latest`.
TemplateVersion *string `json:"template_version,omitempty"`
// The default `test` for each submission that doesn't set its own.
Test *bool `json:"test,omitempty"`
// The default `output_formats` for each submission that doesn't set its own.
OutputFormats []OutputFormat `json:"output_formats,omitempty"`
// Up to 50 submissions. Each one takes the properties of POST /templates/{template_id}/submissions except `signature_requests` and the options for DocSpring's emails to signers (`send_email`, `signing_order`, `email_subject`, `email_message`, `cc`, `reply_to`, `notification_emails`, `notify_when_signed` and `reminders`), plus `template_id` and `template_version` when it uses a different template from the batch.
Submissions []SubmissionInput `json:"submissions"`
AdditionalProperties map[string]interface{}
}
type _CreateSubmissionBatchRequest CreateSubmissionBatchRequest
// NewCreateSubmissionBatchRequest instantiates a new CreateSubmissionBatchRequest object
// This constructor will assign default values to properties that have it defined,
// and makes sure properties required by API are set, but the set of arguments
// will change when the set of required properties is changed
func NewCreateSubmissionBatchRequest(submissions []SubmissionInput) *CreateSubmissionBatchRequest {
this := CreateSubmissionBatchRequest{}
this.Submissions = submissions
return &this
}
// NewCreateSubmissionBatchRequestWithDefaults instantiates a new CreateSubmissionBatchRequest object
// This constructor will only assign default values to properties that have it defined,
// but it doesn't guarantee that properties required by API are set
func NewCreateSubmissionBatchRequestWithDefaults() *CreateSubmissionBatchRequest {
this := CreateSubmissionBatchRequest{}
return &this
}
// GetMetadata returns the Metadata field value if set, zero value otherwise.
func (o *CreateSubmissionBatchRequest) GetMetadata() map[string]interface{} {
if o == nil || IsNil(o.Metadata) {
var ret map[string]interface{}
return ret
}
return o.Metadata
}
// GetMetadataOk returns a tuple with the Metadata field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *CreateSubmissionBatchRequest) GetMetadataOk() (map[string]interface{}, bool) {
if o == nil || IsNil(o.Metadata) {
return map[string]interface{}{}, false
}
return o.Metadata, true
}
// HasMetadata returns a boolean if a field has been set.
func (o *CreateSubmissionBatchRequest) HasMetadata() bool {
if o != nil && !IsNil(o.Metadata) {
return true
}
return false
}
// SetMetadata gets a reference to the given map[string]interface{} and assigns it to the Metadata field.
func (o *CreateSubmissionBatchRequest) SetMetadata(v map[string]interface{}) {
o.Metadata = v
}
// GetTemplateId returns the TemplateId field value if set, zero value otherwise.
func (o *CreateSubmissionBatchRequest) GetTemplateId() string {
if o == nil || IsNil(o.TemplateId) {
var ret string
return ret
}
return *o.TemplateId
}
// GetTemplateIdOk returns a tuple with the TemplateId field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *CreateSubmissionBatchRequest) GetTemplateIdOk() (*string, bool) {
if o == nil || IsNil(o.TemplateId) {
return nil, false
}
return o.TemplateId, true
}
// HasTemplateId returns a boolean if a field has been set.
func (o *CreateSubmissionBatchRequest) HasTemplateId() bool {
if o != nil && !IsNil(o.TemplateId) {
return true
}
return false
}
// SetTemplateId gets a reference to the given string and assigns it to the TemplateId field.
func (o *CreateSubmissionBatchRequest) SetTemplateId(v string) {
o.TemplateId = &v
}
// GetTemplateVersion returns the TemplateVersion field value if set, zero value otherwise.
func (o *CreateSubmissionBatchRequest) GetTemplateVersion() string {
if o == nil || IsNil(o.TemplateVersion) {
var ret string
return ret
}
return *o.TemplateVersion
}
// GetTemplateVersionOk returns a tuple with the TemplateVersion field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *CreateSubmissionBatchRequest) GetTemplateVersionOk() (*string, bool) {
if o == nil || IsNil(o.TemplateVersion) {
return nil, false
}
return o.TemplateVersion, true
}
// HasTemplateVersion returns a boolean if a field has been set.
func (o *CreateSubmissionBatchRequest) HasTemplateVersion() bool {
if o != nil && !IsNil(o.TemplateVersion) {
return true
}
return false
}
// SetTemplateVersion gets a reference to the given string and assigns it to the TemplateVersion field.
func (o *CreateSubmissionBatchRequest) SetTemplateVersion(v string) {
o.TemplateVersion = &v
}
// GetTest returns the Test field value if set, zero value otherwise.
func (o *CreateSubmissionBatchRequest) GetTest() bool {
if o == nil || IsNil(o.Test) {
var ret bool
return ret
}
return *o.Test
}
// GetTestOk returns a tuple with the Test field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *CreateSubmissionBatchRequest) GetTestOk() (*bool, bool) {
if o == nil || IsNil(o.Test) {
return nil, false
}
return o.Test, true
}
// HasTest returns a boolean if a field has been set.
func (o *CreateSubmissionBatchRequest) HasTest() bool {
if o != nil && !IsNil(o.Test) {
return true
}
return false
}
// SetTest gets a reference to the given bool and assigns it to the Test field.
func (o *CreateSubmissionBatchRequest) SetTest(v bool) {
o.Test = &v
}
// GetOutputFormats returns the OutputFormats field value if set, zero value otherwise.
func (o *CreateSubmissionBatchRequest) GetOutputFormats() []OutputFormat {
if o == nil || IsNil(o.OutputFormats) {
var ret []OutputFormat
return ret
}
return o.OutputFormats
}
// GetOutputFormatsOk returns a tuple with the OutputFormats field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *CreateSubmissionBatchRequest) GetOutputFormatsOk() ([]OutputFormat, bool) {
if o == nil || IsNil(o.OutputFormats) {
return nil, false
}
return o.OutputFormats, true
}
// HasOutputFormats returns a boolean if a field has been set.
func (o *CreateSubmissionBatchRequest) HasOutputFormats() bool {
if o != nil && !IsNil(o.OutputFormats) {
return true
}
return false
}
// SetOutputFormats gets a reference to the given []OutputFormat and assigns it to the OutputFormats field.
func (o *CreateSubmissionBatchRequest) SetOutputFormats(v []OutputFormat) {
o.OutputFormats = v
}
// GetSubmissions returns the Submissions field value
func (o *CreateSubmissionBatchRequest) GetSubmissions() []SubmissionInput {
if o == nil {
var ret []SubmissionInput
return ret
}
return o.Submissions
}
// GetSubmissionsOk returns a tuple with the Submissions field value
// and a boolean to check if the value has been set.
func (o *CreateSubmissionBatchRequest) GetSubmissionsOk() ([]SubmissionInput, bool) {
if o == nil {
return nil, false
}
return o.Submissions, true
}
// SetSubmissions sets field value
func (o *CreateSubmissionBatchRequest) SetSubmissions(v []SubmissionInput) {
o.Submissions = v
}
func (o CreateSubmissionBatchRequest) MarshalJSON() ([]byte, error) {
toSerialize,err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o CreateSubmissionBatchRequest) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Metadata) {
toSerialize["metadata"] = o.Metadata
}
if !IsNil(o.TemplateId) {
toSerialize["template_id"] = o.TemplateId
}
if !IsNil(o.TemplateVersion) {
toSerialize["template_version"] = o.TemplateVersion
}
if !IsNil(o.Test) {
toSerialize["test"] = o.Test
}
if !IsNil(o.OutputFormats) {
toSerialize["output_formats"] = o.OutputFormats
}
toSerialize["submissions"] = o.Submissions
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *CreateSubmissionBatchRequest) UnmarshalJSON(data []byte) (err error) {
// This validates that all required properties are included in the JSON object
// by unmarshalling the object into a generic map with string keys and checking
// that every required field exists as a key in the generic map.
requiredProperties := []string{
"submissions",
}
allProperties := make(map[string]interface{})
err = json.Unmarshal(data, &allProperties)
if err != nil {
return err;
}
for _, requiredProperty := range(requiredProperties) {
if _, exists := allProperties[requiredProperty]; !exists {
return fmt.Errorf("no value given for required property %v", requiredProperty)
}
}
varCreateSubmissionBatchRequest := _CreateSubmissionBatchRequest{}
err = json.Unmarshal(data, &varCreateSubmissionBatchRequest)
if err != nil {
return err
}
*o = CreateSubmissionBatchRequest(varCreateSubmissionBatchRequest)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "metadata")
delete(additionalProperties, "template_id")
delete(additionalProperties, "template_version")
delete(additionalProperties, "test")
delete(additionalProperties, "output_formats")
delete(additionalProperties, "submissions")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableCreateSubmissionBatchRequest struct {
value *CreateSubmissionBatchRequest
isSet bool
}
func (v NullableCreateSubmissionBatchRequest) Get() *CreateSubmissionBatchRequest {
return v.value
}
func (v *NullableCreateSubmissionBatchRequest) Set(val *CreateSubmissionBatchRequest) {
v.value = val
v.isSet = true
}
func (v NullableCreateSubmissionBatchRequest) IsSet() bool {
return v.isSet
}
func (v *NullableCreateSubmissionBatchRequest) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableCreateSubmissionBatchRequest(val *CreateSubmissionBatchRequest) *NullableCreateSubmissionBatchRequest {
return &NullableCreateSubmissionBatchRequest{value: val, isSet: true}
}
func (v NullableCreateSubmissionBatchRequest) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableCreateSubmissionBatchRequest) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}