dropbox-sign 1.0.1 → 1.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/README.md +26 -9
- data/VERSION +1 -1
- data/docs/BulkSendJobApi.md +5 -3
- data/docs/SignatureRequestCreateEmbeddedRequest.md +1 -1
- data/docs/TeamResponse.md +1 -0
- data/docs/TemplateResponse.md +2 -2
- data/docs/TemplateResponseDocument.md +3 -3
- data/docs/{TemplateResponseCustomField.md → TemplateResponseDocumentCustomFieldBase.md} +5 -8
- data/docs/TemplateResponseDocumentCustomFieldCheckbox.md +10 -0
- data/docs/TemplateResponseDocumentCustomFieldText.md +14 -0
- data/docs/TemplateResponseDocumentFieldGroup.md +1 -1
- data/docs/TemplateResponseDocumentFieldGroupRule.md +11 -0
- data/docs/{TemplateResponseDocumentFormField.md → TemplateResponseDocumentFormFieldBase.md} +4 -8
- data/docs/TemplateResponseDocumentFormFieldCheckbox.md +10 -0
- data/docs/TemplateResponseDocumentFormFieldDateSigned.md +10 -0
- data/docs/TemplateResponseDocumentFormFieldDropdown.md +10 -0
- data/docs/TemplateResponseDocumentFormFieldHyperlink.md +14 -0
- data/docs/TemplateResponseDocumentFormFieldInitials.md +10 -0
- data/docs/TemplateResponseDocumentFormFieldRadio.md +10 -0
- data/docs/TemplateResponseDocumentFormFieldSignature.md +10 -0
- data/docs/TemplateResponseDocumentFormFieldText.md +15 -0
- data/docs/{TemplateResponseDocumentStaticField.md → TemplateResponseDocumentStaticFieldBase.md} +5 -5
- data/docs/TemplateResponseDocumentStaticFieldCheckbox.md +10 -0
- data/docs/TemplateResponseDocumentStaticFieldDateSigned.md +10 -0
- data/docs/TemplateResponseDocumentStaticFieldDropdown.md +10 -0
- data/docs/TemplateResponseDocumentStaticFieldHyperlink.md +10 -0
- data/docs/TemplateResponseDocumentStaticFieldInitials.md +10 -0
- data/docs/TemplateResponseDocumentStaticFieldRadio.md +10 -0
- data/docs/TemplateResponseDocumentStaticFieldSignature.md +10 -0
- data/docs/TemplateResponseDocumentStaticFieldText.md +10 -0
- data/docs/TemplateResponseFieldAvgTextLength.md +1 -1
- data/lib/dropbox-sign/api/bulk_send_job_api.rb +6 -0
- data/lib/dropbox-sign/models/signature_request_create_embedded_request.rb +1 -1
- data/lib/dropbox-sign/models/team_response.rb +17 -4
- data/lib/dropbox-sign/models/template_response.rb +5 -5
- data/lib/dropbox-sign/models/template_response_document.rb +9 -9
- data/lib/dropbox-sign/models/{template_response_document_static_field.rb → template_response_document_custom_field_base.rb} +60 -39
- data/lib/dropbox-sign/models/template_response_document_custom_field_checkbox.rb +263 -0
- data/lib/dropbox-sign/models/template_response_document_custom_field_text.rb +306 -0
- data/lib/dropbox-sign/models/template_response_document_field_group.rb +2 -3
- data/lib/dropbox-sign/models/template_response_document_field_group_rule.rb +263 -0
- data/lib/dropbox-sign/models/{template_response_named_form_field.rb → template_response_document_form_field_base.rb} +78 -86
- data/lib/dropbox-sign/models/template_response_document_form_field_checkbox.rb +263 -0
- data/lib/dropbox-sign/models/template_response_document_form_field_date_signed.rb +263 -0
- data/lib/dropbox-sign/models/template_response_document_form_field_dropdown.rb +263 -0
- data/lib/dropbox-sign/models/template_response_document_form_field_hyperlink.rb +306 -0
- data/lib/dropbox-sign/models/template_response_document_form_field_initials.rb +263 -0
- data/lib/dropbox-sign/models/template_response_document_form_field_radio.rb +263 -0
- data/lib/dropbox-sign/models/template_response_document_form_field_signature.rb +263 -0
- data/lib/dropbox-sign/models/{template_response_document_form_field.rb → template_response_document_form_field_text.rb} +53 -132
- data/lib/dropbox-sign/models/{template_response_custom_field.rb → template_response_document_static_field_base.rb} +90 -119
- data/lib/dropbox-sign/models/template_response_document_static_field_checkbox.rb +263 -0
- data/lib/dropbox-sign/models/template_response_document_static_field_date_signed.rb +263 -0
- data/lib/dropbox-sign/models/template_response_document_static_field_dropdown.rb +263 -0
- data/lib/dropbox-sign/models/template_response_document_static_field_hyperlink.rb +263 -0
- data/lib/dropbox-sign/models/template_response_document_static_field_initials.rb +263 -0
- data/lib/dropbox-sign/models/template_response_document_static_field_radio.rb +263 -0
- data/lib/dropbox-sign/models/template_response_document_static_field_signature.rb +263 -0
- data/lib/dropbox-sign/models/template_response_document_static_field_text.rb +263 -0
- data/lib/dropbox-sign/models/template_response_field_avg_text_length.rb +1 -1
- data/lib/dropbox-sign/version.rb +1 -1
- data/lib/dropbox-sign.rb +22 -5
- data/openapi-config.yaml +1 -1
- data/openapi-sdk.yaml +586 -182
- data/test_fixtures/AccountCreateResponse.json +1 -0
- data/test_fixtures/ApiAppGetResponse.json +1 -0
- data/test_fixtures/ApiAppListResponse.json +1 -0
- data/test_fixtures/BulkSendJobGetResponse.json +8 -3
- data/test_fixtures/SignatureRequestGetResponse.json +65 -65
- data/test_fixtures/SignatureRequestListResponse.json +11 -4
- data/test_fixtures/TemplateGetResponse.json +1002 -41
- data/test_fixtures/TemplateListResponse.json +483 -44
- metadata +52 -18
- data/docs/TemplateResponseDocumentCustomField.md +0 -25
- data/docs/TemplateResponseNamedFormField.md +0 -23
- data/lib/dropbox-sign/models/template_response_document_custom_field.rb +0 -454
@@ -17,62 +17,31 @@ module Dropbox
|
|
17
17
|
end
|
18
18
|
|
19
19
|
module Dropbox::Sign
|
20
|
-
class
|
21
|
-
|
22
|
-
#
|
23
|
-
attr_accessor :api_id
|
24
|
-
|
25
|
-
# The name of the form field.
|
26
|
-
# @return [String]
|
27
|
-
attr_accessor :name
|
28
|
-
|
29
|
-
# The type of this form field. See [field types](/api/reference/constants/#field-types).
|
20
|
+
# This class extends `TemplateResponseDocumentFormFieldBase`
|
21
|
+
class TemplateResponseDocumentFormFieldText < TemplateResponseDocumentFormFieldBase
|
22
|
+
# The type of this form field. See [field types](/api/reference/constants/#field-types). * Text Field uses `TemplateResponseDocumentFormFieldText` * Dropdown Field uses `TemplateResponseDocumentFormFieldDropdown` * Hyperlink Field uses `TemplateResponseDocumentFormFieldHyperlink` * Checkbox Field uses `TemplateResponseDocumentFormFieldCheckbox` * Radio Field uses `TemplateResponseDocumentFormFieldRadio` * Signature Field uses `TemplateResponseDocumentFormFieldSignature` * Date Signed Field uses `TemplateResponseDocumentFormFieldDateSigned` * Initials Field uses `TemplateResponseDocumentFormFieldInitials`
|
30
23
|
# @return [String]
|
31
24
|
attr_accessor :type
|
32
25
|
|
33
|
-
# The signer of the Form Field.
|
34
|
-
# @return [String]
|
35
|
-
attr_accessor :signer
|
36
|
-
|
37
|
-
# The horizontal offset in pixels for this form field.
|
38
|
-
# @return [Integer]
|
39
|
-
attr_accessor :x
|
40
|
-
|
41
|
-
# The vertical offset in pixels for this form field.
|
42
|
-
# @return [Integer]
|
43
|
-
attr_accessor :y
|
44
|
-
|
45
|
-
# The width in pixels of this form field.
|
46
|
-
# @return [Integer]
|
47
|
-
attr_accessor :width
|
48
|
-
|
49
|
-
# The height in pixels of this form field.
|
50
|
-
# @return [Integer]
|
51
|
-
attr_accessor :height
|
52
|
-
|
53
|
-
# Boolean showing whether or not this field is required.
|
54
|
-
# @return [Boolean]
|
55
|
-
attr_accessor :required
|
56
|
-
|
57
|
-
# The name of the group this field is in. If this field is not a group, this defaults to `null`.
|
58
|
-
# @return [String, nil]
|
59
|
-
attr_accessor :group
|
60
|
-
|
61
26
|
# @return [TemplateResponseFieldAvgTextLength]
|
62
27
|
attr_accessor :avg_text_length
|
63
28
|
|
64
29
|
# Whether this form field is multiline text.
|
65
|
-
# @return [Boolean
|
30
|
+
# @return [Boolean]
|
66
31
|
attr_accessor :is_multiline
|
67
32
|
|
68
33
|
# Original font size used in this form field's text.
|
69
|
-
# @return [Integer
|
34
|
+
# @return [Integer]
|
70
35
|
attr_accessor :original_font_size
|
71
36
|
|
72
37
|
# Font family used in this form field's text.
|
73
|
-
# @return [String
|
38
|
+
# @return [String]
|
74
39
|
attr_accessor :font_family
|
75
40
|
|
41
|
+
# Each text field may contain a `validation_type` parameter. Check out the list of [validation types](https://faq.hellosign.com/hc/en-us/articles/217115577) to learn more about the possible values.
|
42
|
+
# @return [String, nil]
|
43
|
+
attr_accessor :validation_type
|
44
|
+
|
76
45
|
class EnumAttributeValidator
|
77
46
|
attr_reader :datatype
|
78
47
|
attr_reader :allowable_values
|
@@ -98,136 +67,86 @@ module Dropbox::Sign
|
|
98
67
|
# Attribute mapping from ruby-style variable name to JSON key.
|
99
68
|
def self.attribute_map
|
100
69
|
{
|
101
|
-
:'api_id' => :'api_id',
|
102
|
-
:'name' => :'name',
|
103
70
|
:'type' => :'type',
|
104
|
-
:'signer' => :'signer',
|
105
|
-
:'x' => :'x',
|
106
|
-
:'y' => :'y',
|
107
|
-
:'width' => :'width',
|
108
|
-
:'height' => :'height',
|
109
|
-
:'required' => :'required',
|
110
|
-
:'group' => :'group',
|
111
71
|
:'avg_text_length' => :'avg_text_length',
|
112
72
|
:'is_multiline' => :'isMultiline',
|
113
73
|
:'original_font_size' => :'originalFontSize',
|
114
|
-
:'font_family' => :'fontFamily'
|
74
|
+
:'font_family' => :'fontFamily',
|
75
|
+
:'validation_type' => :'validation_type'
|
115
76
|
}
|
116
77
|
end
|
117
78
|
|
118
|
-
# Returns all the JSON keys this model knows about
|
79
|
+
# Returns all the JSON keys this model knows about, including the ones defined in its parent(s)
|
119
80
|
def self.acceptable_attributes
|
120
|
-
attribute_map.values
|
81
|
+
attribute_map.values.concat(superclass.acceptable_attributes)
|
121
82
|
end
|
122
83
|
|
123
84
|
# Returns attribute map of this model + parent
|
124
85
|
def self.merged_attributes
|
125
|
-
self.attribute_map
|
86
|
+
self.superclass.attribute_map.merge(self.attribute_map)
|
126
87
|
end
|
127
88
|
|
128
89
|
# Attribute type mapping.
|
129
90
|
def self.openapi_types
|
130
91
|
{
|
131
|
-
:'api_id' => :'String',
|
132
|
-
:'name' => :'String',
|
133
92
|
:'type' => :'String',
|
134
|
-
:'signer' => :'String',
|
135
|
-
:'x' => :'Integer',
|
136
|
-
:'y' => :'Integer',
|
137
|
-
:'width' => :'Integer',
|
138
|
-
:'height' => :'Integer',
|
139
|
-
:'required' => :'Boolean',
|
140
|
-
:'group' => :'String',
|
141
93
|
:'avg_text_length' => :'TemplateResponseFieldAvgTextLength',
|
142
94
|
:'is_multiline' => :'Boolean',
|
143
95
|
:'original_font_size' => :'Integer',
|
144
|
-
:'font_family' => :'String'
|
96
|
+
:'font_family' => :'String',
|
97
|
+
:'validation_type' => :'String'
|
145
98
|
}
|
146
99
|
end
|
147
100
|
|
148
101
|
# Attribute type mapping of this model + parent
|
149
102
|
def self.merged_types
|
150
|
-
self.openapi_types
|
103
|
+
self.superclass.openapi_types.merge(self.openapi_types)
|
151
104
|
end
|
152
105
|
|
153
106
|
# List of attributes with nullable: true
|
154
107
|
def self.openapi_nullable
|
155
108
|
Set.new([
|
156
|
-
:'
|
157
|
-
:'is_multiline',
|
158
|
-
:'original_font_size',
|
159
|
-
:'font_family'
|
109
|
+
:'validation_type'
|
160
110
|
])
|
161
111
|
end
|
162
112
|
|
163
113
|
# Returns list of attributes with nullable: true of this model + parent
|
164
114
|
def self.merged_nullable
|
165
|
-
self.openapi_nullable
|
115
|
+
self.superclass.openapi_nullable.merge(self.openapi_nullable)
|
166
116
|
end
|
167
117
|
|
168
118
|
# Attempt to instantiate and hydrate a new instance of this class
|
169
119
|
# @param [Object] data Data to be converted
|
170
|
-
# @return [
|
120
|
+
# @return [TemplateResponseDocumentFormFieldText]
|
171
121
|
def self.init(data)
|
172
122
|
return ApiClient.default.convert_to_type(
|
173
123
|
data,
|
174
|
-
"
|
175
|
-
) ||
|
124
|
+
"TemplateResponseDocumentFormFieldText"
|
125
|
+
) || TemplateResponseDocumentFormFieldText.new
|
176
126
|
end
|
177
127
|
|
178
128
|
# Initializes the object
|
179
129
|
# @param [Hash] attributes Model attributes in the form of hash
|
180
130
|
def initialize(attributes = {})
|
181
131
|
if (!attributes.is_a?(Hash))
|
182
|
-
fail ArgumentError, "The input argument (attributes) must be a hash in `Dropbox::Sign::
|
132
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Dropbox::Sign::TemplateResponseDocumentFormFieldText` initialize method"
|
183
133
|
end
|
184
134
|
|
185
135
|
# check to see if the attribute exists and convert string to symbol for hash key
|
186
136
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
187
137
|
if (!self.class.merged_attributes.key?(k.to_sym))
|
188
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `Dropbox::Sign::
|
138
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Dropbox::Sign::TemplateResponseDocumentFormFieldText`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
189
139
|
end
|
190
140
|
h[k.to_sym] = v
|
191
141
|
}
|
192
142
|
|
193
|
-
|
194
|
-
|
195
|
-
end
|
196
|
-
|
197
|
-
if attributes.key?(:'name')
|
198
|
-
self.name = attributes[:'name']
|
199
|
-
end
|
143
|
+
# call parent's initialize
|
144
|
+
super(attributes)
|
200
145
|
|
201
146
|
if attributes.key?(:'type')
|
202
147
|
self.type = attributes[:'type']
|
203
|
-
|
204
|
-
|
205
|
-
if attributes.key?(:'signer')
|
206
|
-
self.signer = attributes[:'signer']
|
207
|
-
end
|
208
|
-
|
209
|
-
if attributes.key?(:'x')
|
210
|
-
self.x = attributes[:'x']
|
211
|
-
end
|
212
|
-
|
213
|
-
if attributes.key?(:'y')
|
214
|
-
self.y = attributes[:'y']
|
215
|
-
end
|
216
|
-
|
217
|
-
if attributes.key?(:'width')
|
218
|
-
self.width = attributes[:'width']
|
219
|
-
end
|
220
|
-
|
221
|
-
if attributes.key?(:'height')
|
222
|
-
self.height = attributes[:'height']
|
223
|
-
end
|
224
|
-
|
225
|
-
if attributes.key?(:'required')
|
226
|
-
self.required = attributes[:'required']
|
227
|
-
end
|
228
|
-
|
229
|
-
if attributes.key?(:'group')
|
230
|
-
self.group = attributes[:'group']
|
148
|
+
else
|
149
|
+
self.type = 'text'
|
231
150
|
end
|
232
151
|
|
233
152
|
if attributes.key?(:'avg_text_length')
|
@@ -245,31 +164,40 @@ module Dropbox::Sign
|
|
245
164
|
if attributes.key?(:'font_family')
|
246
165
|
self.font_family = attributes[:'font_family']
|
247
166
|
end
|
167
|
+
|
168
|
+
if attributes.key?(:'validation_type')
|
169
|
+
self.validation_type = attributes[:'validation_type']
|
170
|
+
end
|
248
171
|
end
|
249
172
|
|
250
173
|
# Show invalid properties with the reasons. Usually used together with valid?
|
251
174
|
# @return Array for valid properties with the reasons
|
252
175
|
def list_invalid_properties
|
253
|
-
invalid_properties =
|
176
|
+
invalid_properties = super
|
177
|
+
if @type.nil?
|
178
|
+
invalid_properties.push('invalid value for "type", type cannot be nil.')
|
179
|
+
end
|
180
|
+
|
254
181
|
invalid_properties
|
255
182
|
end
|
256
183
|
|
257
184
|
# Check to see if the all the properties in the model are valid
|
258
185
|
# @return true if the model is valid
|
259
186
|
def valid?
|
260
|
-
|
261
|
-
|
262
|
-
|
187
|
+
return false if @type.nil?
|
188
|
+
validation_type_validator = EnumAttributeValidator.new('String', ["numbers_only", "letters_only", "phone_number", "bank_routing_number", "bank_account_number", "email_address", "zip_code", "social_security_number", "employer_identification_number", "custom_regex"])
|
189
|
+
return false unless validation_type_validator.valid?(@validation_type)
|
190
|
+
true && super
|
263
191
|
end
|
264
192
|
|
265
193
|
# Custom attribute writer method checking allowed values (enum).
|
266
|
-
# @param [Object]
|
267
|
-
def
|
268
|
-
validator = EnumAttributeValidator.new('String', ["
|
269
|
-
unless validator.valid?(
|
270
|
-
fail ArgumentError, "invalid value for \"
|
194
|
+
# @param [Object] validation_type Object to be assigned
|
195
|
+
def validation_type=(validation_type)
|
196
|
+
validator = EnumAttributeValidator.new('String', ["numbers_only", "letters_only", "phone_number", "bank_routing_number", "bank_account_number", "email_address", "zip_code", "social_security_number", "employer_identification_number", "custom_regex"])
|
197
|
+
unless validator.valid?(validation_type)
|
198
|
+
fail ArgumentError, "invalid value for \"validation_type\", must be one of #{validator.allowable_values}."
|
271
199
|
end
|
272
|
-
@
|
200
|
+
@validation_type = validation_type
|
273
201
|
end
|
274
202
|
|
275
203
|
# Checks equality by comparing each attribute.
|
@@ -277,20 +205,12 @@ module Dropbox::Sign
|
|
277
205
|
def ==(o)
|
278
206
|
return true if self.equal?(o)
|
279
207
|
self.class == o.class &&
|
280
|
-
api_id == o.api_id &&
|
281
|
-
name == o.name &&
|
282
208
|
type == o.type &&
|
283
|
-
signer == o.signer &&
|
284
|
-
x == o.x &&
|
285
|
-
y == o.y &&
|
286
|
-
width == o.width &&
|
287
|
-
height == o.height &&
|
288
|
-
required == o.required &&
|
289
|
-
group == o.group &&
|
290
209
|
avg_text_length == o.avg_text_length &&
|
291
210
|
is_multiline == o.is_multiline &&
|
292
211
|
original_font_size == o.original_font_size &&
|
293
|
-
font_family == o.font_family
|
212
|
+
font_family == o.font_family &&
|
213
|
+
validation_type == o.validation_type && super(o)
|
294
214
|
end
|
295
215
|
|
296
216
|
# @see the `==` method
|
@@ -302,7 +222,7 @@ module Dropbox::Sign
|
|
302
222
|
# Calculates hash code according to all attributes.
|
303
223
|
# @return [Integer] Hash code
|
304
224
|
def hash
|
305
|
-
[
|
225
|
+
[type, avg_text_length, is_multiline, original_font_size, font_family, validation_type].hash
|
306
226
|
end
|
307
227
|
|
308
228
|
# Builds the object from hash
|
@@ -317,6 +237,7 @@ module Dropbox::Sign
|
|
317
237
|
# @return [Object] Returns the model itself
|
318
238
|
def build_from_hash(attributes)
|
319
239
|
return nil unless attributes.is_a?(Hash)
|
240
|
+
super(attributes)
|
320
241
|
attribute_map = self.class.merged_attributes
|
321
242
|
|
322
243
|
self.class.merged_types.each_pair do |key, type|
|
@@ -394,7 +315,7 @@ module Dropbox::Sign
|
|
394
315
|
# Returns the object in the form of hash
|
395
316
|
# @return [Hash] Returns the object in the form of hash
|
396
317
|
def to_hash(include_nil = true)
|
397
|
-
hash =
|
318
|
+
hash = super
|
398
319
|
self.class.merged_attributes.each_pair do |attr, param|
|
399
320
|
value = self.send(attr)
|
400
321
|
if value.nil?
|
@@ -17,28 +17,36 @@ module Dropbox
|
|
17
17
|
end
|
18
18
|
|
19
19
|
module Dropbox::Sign
|
20
|
-
|
21
|
-
|
20
|
+
# An array describing static overlay fields. **Note** only available for certain subscriptions.
|
21
|
+
class TemplateResponseDocumentStaticFieldBase
|
22
|
+
# @return [String]
|
23
|
+
attr_accessor :type
|
24
|
+
|
25
|
+
# A unique id for the static field.
|
26
|
+
# @return [String]
|
27
|
+
attr_accessor :api_id
|
28
|
+
|
29
|
+
# The name of the static field.
|
22
30
|
# @return [String]
|
23
31
|
attr_accessor :name
|
24
32
|
|
25
|
-
# The
|
33
|
+
# The signer of the Static Field.
|
26
34
|
# @return [String]
|
27
|
-
attr_accessor :
|
35
|
+
attr_accessor :signer
|
28
36
|
|
29
|
-
# The horizontal offset in pixels for this
|
37
|
+
# The horizontal offset in pixels for this static field.
|
30
38
|
# @return [Integer]
|
31
39
|
attr_accessor :x
|
32
40
|
|
33
|
-
# The vertical offset in pixels for this
|
41
|
+
# The vertical offset in pixels for this static field.
|
34
42
|
# @return [Integer]
|
35
43
|
attr_accessor :y
|
36
44
|
|
37
|
-
# The width in pixels of this
|
45
|
+
# The width in pixels of this static field.
|
38
46
|
# @return [Integer]
|
39
47
|
attr_accessor :width
|
40
48
|
|
41
|
-
# The height in pixels of this
|
49
|
+
# The height in pixels of this static field.
|
42
50
|
# @return [Integer]
|
43
51
|
attr_accessor :height
|
44
52
|
|
@@ -46,67 +54,23 @@ module Dropbox::Sign
|
|
46
54
|
# @return [Boolean]
|
47
55
|
attr_accessor :required
|
48
56
|
|
49
|
-
# The unique ID for this field.
|
50
|
-
# @return [String]
|
51
|
-
attr_accessor :api_id
|
52
|
-
|
53
57
|
# The name of the group this field is in. If this field is not a group, this defaults to `null`.
|
54
58
|
# @return [String, nil]
|
55
59
|
attr_accessor :group
|
56
60
|
|
57
|
-
# @return [TemplateResponseFieldAvgTextLength]
|
58
|
-
attr_accessor :avg_text_length
|
59
|
-
|
60
|
-
# Whether this form field is multiline text.
|
61
|
-
# @return [Boolean, nil]
|
62
|
-
attr_accessor :is_multiline
|
63
|
-
|
64
|
-
# Original font size used in this form field's text.
|
65
|
-
# @return [Integer, nil]
|
66
|
-
attr_accessor :original_font_size
|
67
|
-
|
68
|
-
# Font family used in this form field's text.
|
69
|
-
# @return [String, nil]
|
70
|
-
attr_accessor :font_family
|
71
|
-
|
72
|
-
class EnumAttributeValidator
|
73
|
-
attr_reader :datatype
|
74
|
-
attr_reader :allowable_values
|
75
|
-
|
76
|
-
def initialize(datatype, allowable_values)
|
77
|
-
@allowable_values = allowable_values.map do |value|
|
78
|
-
case datatype.to_s
|
79
|
-
when /Integer/i
|
80
|
-
value.to_i
|
81
|
-
when /Float/i
|
82
|
-
value.to_f
|
83
|
-
else
|
84
|
-
value
|
85
|
-
end
|
86
|
-
end
|
87
|
-
end
|
88
|
-
|
89
|
-
def valid?(value)
|
90
|
-
!value || allowable_values.include?(value)
|
91
|
-
end
|
92
|
-
end
|
93
|
-
|
94
61
|
# Attribute mapping from ruby-style variable name to JSON key.
|
95
62
|
def self.attribute_map
|
96
63
|
{
|
97
|
-
:'name' => :'name',
|
98
64
|
:'type' => :'type',
|
65
|
+
:'api_id' => :'api_id',
|
66
|
+
:'name' => :'name',
|
67
|
+
:'signer' => :'signer',
|
99
68
|
:'x' => :'x',
|
100
69
|
:'y' => :'y',
|
101
70
|
:'width' => :'width',
|
102
71
|
:'height' => :'height',
|
103
72
|
:'required' => :'required',
|
104
|
-
:'
|
105
|
-
:'group' => :'group',
|
106
|
-
:'avg_text_length' => :'avg_text_length',
|
107
|
-
:'is_multiline' => :'isMultiline',
|
108
|
-
:'original_font_size' => :'originalFontSize',
|
109
|
-
:'font_family' => :'fontFamily'
|
73
|
+
:'group' => :'group'
|
110
74
|
}
|
111
75
|
end
|
112
76
|
|
@@ -123,19 +87,16 @@ module Dropbox::Sign
|
|
123
87
|
# Attribute type mapping.
|
124
88
|
def self.openapi_types
|
125
89
|
{
|
126
|
-
:'name' => :'String',
|
127
90
|
:'type' => :'String',
|
91
|
+
:'api_id' => :'String',
|
92
|
+
:'name' => :'String',
|
93
|
+
:'signer' => :'String',
|
128
94
|
:'x' => :'Integer',
|
129
95
|
:'y' => :'Integer',
|
130
96
|
:'width' => :'Integer',
|
131
97
|
:'height' => :'Integer',
|
132
98
|
:'required' => :'Boolean',
|
133
|
-
:'
|
134
|
-
:'group' => :'String',
|
135
|
-
:'avg_text_length' => :'TemplateResponseFieldAvgTextLength',
|
136
|
-
:'is_multiline' => :'Boolean',
|
137
|
-
:'original_font_size' => :'Integer',
|
138
|
-
:'font_family' => :'String'
|
99
|
+
:'group' => :'String'
|
139
100
|
}
|
140
101
|
end
|
141
102
|
|
@@ -147,10 +108,7 @@ module Dropbox::Sign
|
|
147
108
|
# List of attributes with nullable: true
|
148
109
|
def self.openapi_nullable
|
149
110
|
Set.new([
|
150
|
-
:'group'
|
151
|
-
:'is_multiline',
|
152
|
-
:'original_font_size',
|
153
|
-
:'font_family'
|
111
|
+
:'group'
|
154
112
|
])
|
155
113
|
end
|
156
114
|
|
@@ -159,37 +117,73 @@ module Dropbox::Sign
|
|
159
117
|
self.openapi_nullable
|
160
118
|
end
|
161
119
|
|
162
|
-
#
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
120
|
+
# discriminator's property name in OpenAPI v3
|
121
|
+
def self.openapi_discriminator_name
|
122
|
+
:'type'
|
123
|
+
end
|
124
|
+
|
125
|
+
def self.discriminator_class_name(value)
|
126
|
+
return nil unless value.is_a?(String)
|
127
|
+
|
128
|
+
if value == 'checkbox'
|
129
|
+
return "Dropbox::Sign::TemplateResponseDocumentStaticFieldCheckbox"
|
130
|
+
end
|
131
|
+
if value == 'date_signed'
|
132
|
+
return "Dropbox::Sign::TemplateResponseDocumentStaticFieldDateSigned"
|
133
|
+
end
|
134
|
+
if value == 'dropdown'
|
135
|
+
return "Dropbox::Sign::TemplateResponseDocumentStaticFieldDropdown"
|
136
|
+
end
|
137
|
+
if value == 'hyperlink'
|
138
|
+
return "Dropbox::Sign::TemplateResponseDocumentStaticFieldHyperlink"
|
139
|
+
end
|
140
|
+
if value == 'initials'
|
141
|
+
return "Dropbox::Sign::TemplateResponseDocumentStaticFieldInitials"
|
142
|
+
end
|
143
|
+
if value == 'radio'
|
144
|
+
return "Dropbox::Sign::TemplateResponseDocumentStaticFieldRadio"
|
145
|
+
end
|
146
|
+
if value == 'signature'
|
147
|
+
return "Dropbox::Sign::TemplateResponseDocumentStaticFieldSignature"
|
148
|
+
end
|
149
|
+
if value == 'text'
|
150
|
+
return "Dropbox::Sign::TemplateResponseDocumentStaticFieldText"
|
151
|
+
end
|
152
|
+
|
153
|
+
return nil
|
170
154
|
end
|
171
155
|
|
172
156
|
# Initializes the object
|
173
157
|
# @param [Hash] attributes Model attributes in the form of hash
|
174
158
|
def initialize(attributes = {})
|
175
159
|
if (!attributes.is_a?(Hash))
|
176
|
-
fail ArgumentError, "The input argument (attributes) must be a hash in `Dropbox::Sign::
|
160
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Dropbox::Sign::TemplateResponseDocumentStaticFieldBase` initialize method"
|
177
161
|
end
|
178
162
|
|
179
163
|
# check to see if the attribute exists and convert string to symbol for hash key
|
180
164
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
181
165
|
if (!self.class.merged_attributes.key?(k.to_sym))
|
182
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `Dropbox::Sign::
|
166
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Dropbox::Sign::TemplateResponseDocumentStaticFieldBase`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
183
167
|
end
|
184
168
|
h[k.to_sym] = v
|
185
169
|
}
|
186
170
|
|
171
|
+
if attributes.key?(:'type')
|
172
|
+
self.type = attributes[:'type']
|
173
|
+
end
|
174
|
+
|
175
|
+
if attributes.key?(:'api_id')
|
176
|
+
self.api_id = attributes[:'api_id']
|
177
|
+
end
|
178
|
+
|
187
179
|
if attributes.key?(:'name')
|
188
180
|
self.name = attributes[:'name']
|
189
181
|
end
|
190
182
|
|
191
|
-
if attributes.key?(:'
|
192
|
-
self.
|
183
|
+
if attributes.key?(:'signer')
|
184
|
+
self.signer = attributes[:'signer']
|
185
|
+
else
|
186
|
+
self.signer = 'me_now'
|
193
187
|
end
|
194
188
|
|
195
189
|
if attributes.key?(:'x')
|
@@ -212,74 +206,44 @@ module Dropbox::Sign
|
|
212
206
|
self.required = attributes[:'required']
|
213
207
|
end
|
214
208
|
|
215
|
-
if attributes.key?(:'api_id')
|
216
|
-
self.api_id = attributes[:'api_id']
|
217
|
-
end
|
218
|
-
|
219
209
|
if attributes.key?(:'group')
|
220
210
|
self.group = attributes[:'group']
|
221
211
|
end
|
222
|
-
|
223
|
-
if attributes.key?(:'avg_text_length')
|
224
|
-
self.avg_text_length = attributes[:'avg_text_length']
|
225
|
-
end
|
226
|
-
|
227
|
-
if attributes.key?(:'is_multiline')
|
228
|
-
self.is_multiline = attributes[:'is_multiline']
|
229
|
-
end
|
230
|
-
|
231
|
-
if attributes.key?(:'original_font_size')
|
232
|
-
self.original_font_size = attributes[:'original_font_size']
|
233
|
-
end
|
234
|
-
|
235
|
-
if attributes.key?(:'font_family')
|
236
|
-
self.font_family = attributes[:'font_family']
|
237
|
-
end
|
238
212
|
end
|
239
213
|
|
240
214
|
# Show invalid properties with the reasons. Usually used together with valid?
|
241
215
|
# @return Array for valid properties with the reasons
|
242
216
|
def list_invalid_properties
|
243
217
|
invalid_properties = Array.new
|
218
|
+
if @type.nil?
|
219
|
+
invalid_properties.push('invalid value for "type", type cannot be nil.')
|
220
|
+
end
|
221
|
+
|
244
222
|
invalid_properties
|
245
223
|
end
|
246
224
|
|
247
225
|
# Check to see if the all the properties in the model are valid
|
248
226
|
# @return true if the model is valid
|
249
227
|
def valid?
|
250
|
-
|
251
|
-
return false unless type_validator.valid?(@type)
|
228
|
+
return false if @type.nil?
|
252
229
|
true
|
253
230
|
end
|
254
231
|
|
255
|
-
# Custom attribute writer method checking allowed values (enum).
|
256
|
-
# @param [Object] type Object to be assigned
|
257
|
-
def type=(type)
|
258
|
-
validator = EnumAttributeValidator.new('String', ["text", "checkbox"])
|
259
|
-
unless validator.valid?(type)
|
260
|
-
fail ArgumentError, "invalid value for \"type\", must be one of #{validator.allowable_values}."
|
261
|
-
end
|
262
|
-
@type = type
|
263
|
-
end
|
264
|
-
|
265
232
|
# Checks equality by comparing each attribute.
|
266
233
|
# @param [Object] Object to be compared
|
267
234
|
def ==(o)
|
268
235
|
return true if self.equal?(o)
|
269
236
|
self.class == o.class &&
|
270
|
-
name == o.name &&
|
271
237
|
type == o.type &&
|
238
|
+
api_id == o.api_id &&
|
239
|
+
name == o.name &&
|
240
|
+
signer == o.signer &&
|
272
241
|
x == o.x &&
|
273
242
|
y == o.y &&
|
274
243
|
width == o.width &&
|
275
244
|
height == o.height &&
|
276
245
|
required == o.required &&
|
277
|
-
|
278
|
-
group == o.group &&
|
279
|
-
avg_text_length == o.avg_text_length &&
|
280
|
-
is_multiline == o.is_multiline &&
|
281
|
-
original_font_size == o.original_font_size &&
|
282
|
-
font_family == o.font_family
|
246
|
+
group == o.group
|
283
247
|
end
|
284
248
|
|
285
249
|
# @see the `==` method
|
@@ -291,13 +255,20 @@ module Dropbox::Sign
|
|
291
255
|
# Calculates hash code according to all attributes.
|
292
256
|
# @return [Integer] Hash code
|
293
257
|
def hash
|
294
|
-
[name,
|
258
|
+
[type, api_id, name, signer, x, y, width, height, required, group].hash
|
295
259
|
end
|
296
260
|
|
297
261
|
# Builds the object from hash
|
298
262
|
# @param [Hash] attributes Model attributes in the form of hash
|
299
263
|
# @return [Object] Returns the model itself
|
300
264
|
def self.build_from_hash(attributes)
|
265
|
+
if !attributes[self.openapi_discriminator_name].nil?
|
266
|
+
klass = self.discriminator_class_name(attributes[self.openapi_discriminator_name])
|
267
|
+
if klass != new.class.to_s
|
268
|
+
obj = Object.const_get(klass).new.build_from_hash(attributes)
|
269
|
+
return obj
|
270
|
+
end
|
271
|
+
end
|
301
272
|
new.build_from_hash(attributes)
|
302
273
|
end
|
303
274
|
|