dropbox-sign 1.0.0 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (139) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +1 -1
  3. data/README.md +26 -9
  4. data/VERSION +1 -0
  5. data/bin/release +39 -0
  6. data/bin/ruby +1 -0
  7. data/docs/BulkSendJobApi.md +5 -3
  8. data/docs/SignatureRequestApi.md +3 -3
  9. data/docs/SignatureRequestCreateEmbeddedRequest.md +1 -1
  10. data/docs/SignatureRequestSendRequest.md +1 -1
  11. data/docs/SubFormFieldsPerDocumentBase.md +1 -1
  12. data/docs/TeamResponse.md +1 -0
  13. data/docs/TemplateCreateEmbeddedDraftRequest.md +1 -1
  14. data/docs/TemplateResponse.md +2 -2
  15. data/docs/TemplateResponseDocument.md +3 -3
  16. data/docs/{TemplateResponseCustomField.md → TemplateResponseDocumentCustomFieldBase.md} +6 -8
  17. data/docs/TemplateResponseDocumentCustomFieldCheckbox.md +10 -0
  18. data/docs/TemplateResponseDocumentCustomFieldText.md +14 -0
  19. data/docs/TemplateResponseDocumentFieldGroup.md +1 -1
  20. data/docs/TemplateResponseDocumentFieldGroupRule.md +11 -0
  21. data/docs/{TemplateResponseDocumentFormField.md → TemplateResponseDocumentFormFieldBase.md} +5 -8
  22. data/docs/TemplateResponseDocumentFormFieldCheckbox.md +10 -0
  23. data/docs/TemplateResponseDocumentFormFieldDateSigned.md +10 -0
  24. data/docs/TemplateResponseDocumentFormFieldDropdown.md +10 -0
  25. data/docs/TemplateResponseDocumentFormFieldHyperlink.md +14 -0
  26. data/docs/TemplateResponseDocumentFormFieldInitials.md +10 -0
  27. data/docs/TemplateResponseDocumentFormFieldRadio.md +10 -0
  28. data/docs/TemplateResponseDocumentFormFieldSignature.md +10 -0
  29. data/docs/TemplateResponseDocumentFormFieldText.md +15 -0
  30. data/docs/{TemplateResponseDocumentStaticField.md → TemplateResponseDocumentStaticFieldBase.md} +6 -5
  31. data/docs/TemplateResponseDocumentStaticFieldCheckbox.md +10 -0
  32. data/docs/TemplateResponseDocumentStaticFieldDateSigned.md +10 -0
  33. data/docs/TemplateResponseDocumentStaticFieldDropdown.md +10 -0
  34. data/docs/TemplateResponseDocumentStaticFieldHyperlink.md +10 -0
  35. data/docs/TemplateResponseDocumentStaticFieldInitials.md +10 -0
  36. data/docs/TemplateResponseDocumentStaticFieldRadio.md +10 -0
  37. data/docs/TemplateResponseDocumentStaticFieldSignature.md +10 -0
  38. data/docs/TemplateResponseDocumentStaticFieldText.md +10 -0
  39. data/docs/TemplateResponseFieldAvgTextLength.md +1 -1
  40. data/docs/UnclaimedDraftApi.md +2 -2
  41. data/docs/UnclaimedDraftCreateEmbeddedRequest.md +1 -1
  42. data/docs/UnclaimedDraftCreateRequest.md +1 -1
  43. data/examples/SignatureRequestCreateEmbedded.rb +1 -1
  44. data/examples/SignatureRequestSend.rb +2 -2
  45. data/examples/UnclaimedDraftCreate.rb +2 -2
  46. data/lib/dropbox-sign/api/bulk_send_job_api.rb +6 -0
  47. data/lib/dropbox-sign/models/signature_request_create_embedded_request.rb +1 -1
  48. data/lib/dropbox-sign/models/signature_request_send_request.rb +1 -1
  49. data/lib/dropbox-sign/models/sub_form_fields_per_document_base.rb +1 -1
  50. data/lib/dropbox-sign/models/team_response.rb +17 -4
  51. data/lib/dropbox-sign/models/template_create_embedded_draft_request.rb +1 -1
  52. data/lib/dropbox-sign/models/template_response.rb +5 -5
  53. data/lib/dropbox-sign/models/template_response_document.rb +9 -9
  54. data/lib/dropbox-sign/models/{template_response_document_static_field.rb → template_response_document_custom_field_base.rb} +75 -43
  55. data/lib/dropbox-sign/models/template_response_document_custom_field_checkbox.rb +263 -0
  56. data/lib/dropbox-sign/models/template_response_document_custom_field_text.rb +306 -0
  57. data/lib/dropbox-sign/models/template_response_document_field_group.rb +2 -3
  58. data/lib/dropbox-sign/models/template_response_document_field_group_rule.rb +263 -0
  59. data/lib/dropbox-sign/models/{template_response_named_form_field.rb → template_response_document_form_field_base.rb} +82 -79
  60. data/lib/dropbox-sign/models/template_response_document_form_field_checkbox.rb +263 -0
  61. data/lib/dropbox-sign/models/template_response_document_form_field_date_signed.rb +263 -0
  62. data/lib/dropbox-sign/models/template_response_document_form_field_dropdown.rb +263 -0
  63. data/lib/dropbox-sign/models/template_response_document_form_field_hyperlink.rb +306 -0
  64. data/lib/dropbox-sign/models/template_response_document_form_field_initials.rb +263 -0
  65. data/lib/dropbox-sign/models/template_response_document_form_field_radio.rb +263 -0
  66. data/lib/dropbox-sign/models/template_response_document_form_field_signature.rb +263 -0
  67. data/lib/dropbox-sign/models/{template_response_document_form_field.rb → template_response_document_form_field_text.rb} +53 -132
  68. data/lib/dropbox-sign/models/{template_response_custom_field.rb → template_response_document_static_field_base.rb} +94 -112
  69. data/lib/dropbox-sign/models/template_response_document_static_field_checkbox.rb +263 -0
  70. data/lib/dropbox-sign/models/template_response_document_static_field_date_signed.rb +263 -0
  71. data/lib/dropbox-sign/models/template_response_document_static_field_dropdown.rb +263 -0
  72. data/lib/dropbox-sign/models/template_response_document_static_field_hyperlink.rb +263 -0
  73. data/lib/dropbox-sign/models/template_response_document_static_field_initials.rb +263 -0
  74. data/lib/dropbox-sign/models/template_response_document_static_field_radio.rb +263 -0
  75. data/lib/dropbox-sign/models/template_response_document_static_field_signature.rb +263 -0
  76. data/lib/dropbox-sign/models/template_response_document_static_field_text.rb +263 -0
  77. data/lib/dropbox-sign/models/template_response_field_avg_text_length.rb +1 -1
  78. data/lib/dropbox-sign/models/unclaimed_draft_create_embedded_request.rb +1 -1
  79. data/lib/dropbox-sign/models/unclaimed_draft_create_request.rb +1 -1
  80. data/lib/dropbox-sign/version.rb +1 -1
  81. data/lib/dropbox-sign.rb +22 -5
  82. data/openapi-config.yaml +4 -1
  83. data/openapi-sdk.yaml +598 -186
  84. data/templates/VERSION-root.mustache +1 -0
  85. data/test_fixtures/AccountCreateResponse.json +1 -0
  86. data/test_fixtures/ApiAppGetResponse.json +1 -0
  87. data/test_fixtures/ApiAppListResponse.json +1 -0
  88. data/test_fixtures/BulkSendJobGetResponse.json +8 -3
  89. data/test_fixtures/SignatureRequestGetResponse.json +65 -65
  90. data/test_fixtures/SignatureRequestListResponse.json +11 -4
  91. data/test_fixtures/TemplateGetResponse.json +1064 -41
  92. data/test_fixtures/TemplateListResponse.json +513 -44
  93. metadata +58 -64
  94. data/docs/TemplateResponseDocumentCustomField.md +0 -25
  95. data/docs/TemplateResponseNamedFormField.md +0 -23
  96. data/lib/dropbox-sign/models/template_response_document_custom_field.rb +0 -454
  97. data/vendor/autoload.php +0 -7
  98. data/vendor/bin/yaml-lint +0 -117
  99. data/vendor/composer/ClassLoader.php +0 -572
  100. data/vendor/composer/InstalledVersions.php +0 -350
  101. data/vendor/composer/LICENSE +0 -21
  102. data/vendor/composer/autoload_classmap.php +0 -10
  103. data/vendor/composer/autoload_files.php +0 -11
  104. data/vendor/composer/autoload_namespaces.php +0 -9
  105. data/vendor/composer/autoload_psr4.php +0 -11
  106. data/vendor/composer/autoload_real.php +0 -80
  107. data/vendor/composer/autoload_static.php +0 -46
  108. data/vendor/composer/installed.json +0 -239
  109. data/vendor/composer/installed.php +0 -50
  110. data/vendor/composer/platform_check.php +0 -26
  111. data/vendor/symfony/deprecation-contracts/.gitignore +0 -3
  112. data/vendor/symfony/deprecation-contracts/CHANGELOG.md +0 -5
  113. data/vendor/symfony/deprecation-contracts/LICENSE +0 -19
  114. data/vendor/symfony/deprecation-contracts/README.md +0 -26
  115. data/vendor/symfony/deprecation-contracts/composer.json +0 -35
  116. data/vendor/symfony/deprecation-contracts/function.php +0 -27
  117. data/vendor/symfony/polyfill-ctype/Ctype.php +0 -232
  118. data/vendor/symfony/polyfill-ctype/LICENSE +0 -19
  119. data/vendor/symfony/polyfill-ctype/README.md +0 -12
  120. data/vendor/symfony/polyfill-ctype/bootstrap.php +0 -50
  121. data/vendor/symfony/polyfill-ctype/bootstrap80.php +0 -46
  122. data/vendor/symfony/polyfill-ctype/composer.json +0 -41
  123. data/vendor/symfony/yaml/CHANGELOG.md +0 -237
  124. data/vendor/symfony/yaml/Command/LintCommand.php +0 -289
  125. data/vendor/symfony/yaml/Dumper.php +0 -140
  126. data/vendor/symfony/yaml/Escaper.php +0 -95
  127. data/vendor/symfony/yaml/Exception/DumpException.php +0 -21
  128. data/vendor/symfony/yaml/Exception/ExceptionInterface.php +0 -21
  129. data/vendor/symfony/yaml/Exception/ParseException.php +0 -132
  130. data/vendor/symfony/yaml/Exception/RuntimeException.php +0 -21
  131. data/vendor/symfony/yaml/Inline.php +0 -812
  132. data/vendor/symfony/yaml/LICENSE +0 -19
  133. data/vendor/symfony/yaml/Parser.php +0 -1305
  134. data/vendor/symfony/yaml/README.md +0 -13
  135. data/vendor/symfony/yaml/Resources/bin/yaml-lint +0 -45
  136. data/vendor/symfony/yaml/Tag/TaggedValue.php +0 -38
  137. data/vendor/symfony/yaml/Unescaper.php +0 -132
  138. data/vendor/symfony/yaml/Yaml.php +0 -100
  139. data/vendor/symfony/yaml/composer.json +0 -42
@@ -0,0 +1,263 @@
1
+ =begin
2
+ #Dropbox Sign API
3
+
4
+ #Dropbox Sign v3 API
5
+
6
+ The version of the OpenAPI document: 3.0.0
7
+ Contact: apisupport@hellosign.com
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 5.3.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module Dropbox
17
+ end
18
+
19
+ module Dropbox::Sign
20
+ # This class extends `TemplateResponseDocumentFormFieldBase`
21
+ class TemplateResponseDocumentFormFieldSignature < 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`
23
+ # @return [String]
24
+ attr_accessor :type
25
+
26
+ # Attribute mapping from ruby-style variable name to JSON key.
27
+ def self.attribute_map
28
+ {
29
+ :'type' => :'type'
30
+ }
31
+ end
32
+
33
+ # Returns all the JSON keys this model knows about, including the ones defined in its parent(s)
34
+ def self.acceptable_attributes
35
+ attribute_map.values.concat(superclass.acceptable_attributes)
36
+ end
37
+
38
+ # Returns attribute map of this model + parent
39
+ def self.merged_attributes
40
+ self.superclass.attribute_map.merge(self.attribute_map)
41
+ end
42
+
43
+ # Attribute type mapping.
44
+ def self.openapi_types
45
+ {
46
+ :'type' => :'String'
47
+ }
48
+ end
49
+
50
+ # Attribute type mapping of this model + parent
51
+ def self.merged_types
52
+ self.superclass.openapi_types.merge(self.openapi_types)
53
+ end
54
+
55
+ # List of attributes with nullable: true
56
+ def self.openapi_nullable
57
+ Set.new([
58
+ ])
59
+ end
60
+
61
+ # Returns list of attributes with nullable: true of this model + parent
62
+ def self.merged_nullable
63
+ self.superclass.openapi_nullable.merge(self.openapi_nullable)
64
+ end
65
+
66
+ # Attempt to instantiate and hydrate a new instance of this class
67
+ # @param [Object] data Data to be converted
68
+ # @return [TemplateResponseDocumentFormFieldSignature]
69
+ def self.init(data)
70
+ return ApiClient.default.convert_to_type(
71
+ data,
72
+ "TemplateResponseDocumentFormFieldSignature"
73
+ ) || TemplateResponseDocumentFormFieldSignature.new
74
+ end
75
+
76
+ # Initializes the object
77
+ # @param [Hash] attributes Model attributes in the form of hash
78
+ def initialize(attributes = {})
79
+ if (!attributes.is_a?(Hash))
80
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Dropbox::Sign::TemplateResponseDocumentFormFieldSignature` initialize method"
81
+ end
82
+
83
+ # check to see if the attribute exists and convert string to symbol for hash key
84
+ attributes = attributes.each_with_object({}) { |(k, v), h|
85
+ if (!self.class.merged_attributes.key?(k.to_sym))
86
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Dropbox::Sign::TemplateResponseDocumentFormFieldSignature`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
87
+ end
88
+ h[k.to_sym] = v
89
+ }
90
+
91
+ # call parent's initialize
92
+ super(attributes)
93
+
94
+ if attributes.key?(:'type')
95
+ self.type = attributes[:'type']
96
+ else
97
+ self.type = 'signature'
98
+ end
99
+ end
100
+
101
+ # Show invalid properties with the reasons. Usually used together with valid?
102
+ # @return Array for valid properties with the reasons
103
+ def list_invalid_properties
104
+ invalid_properties = super
105
+ if @type.nil?
106
+ invalid_properties.push('invalid value for "type", type cannot be nil.')
107
+ end
108
+
109
+ invalid_properties
110
+ end
111
+
112
+ # Check to see if the all the properties in the model are valid
113
+ # @return true if the model is valid
114
+ def valid?
115
+ return false if @type.nil?
116
+ true && super
117
+ end
118
+
119
+ # Checks equality by comparing each attribute.
120
+ # @param [Object] Object to be compared
121
+ def ==(o)
122
+ return true if self.equal?(o)
123
+ self.class == o.class &&
124
+ type == o.type && super(o)
125
+ end
126
+
127
+ # @see the `==` method
128
+ # @param [Object] Object to be compared
129
+ def eql?(o)
130
+ self == o
131
+ end
132
+
133
+ # Calculates hash code according to all attributes.
134
+ # @return [Integer] Hash code
135
+ def hash
136
+ [type].hash
137
+ end
138
+
139
+ # Builds the object from hash
140
+ # @param [Hash] attributes Model attributes in the form of hash
141
+ # @return [Object] Returns the model itself
142
+ def self.build_from_hash(attributes)
143
+ new.build_from_hash(attributes)
144
+ end
145
+
146
+ # Builds the object from hash
147
+ # @param [Hash] attributes Model attributes in the form of hash
148
+ # @return [Object] Returns the model itself
149
+ def build_from_hash(attributes)
150
+ return nil unless attributes.is_a?(Hash)
151
+ super(attributes)
152
+ attribute_map = self.class.merged_attributes
153
+
154
+ self.class.merged_types.each_pair do |key, type|
155
+ if type =~ /\AArray<(.*)>/i
156
+ # check to ensure the input is an array given that the attribute
157
+ # is documented as an array but the input is not
158
+ if attributes[attribute_map[key]].is_a?(Array)
159
+ self.send("#{key}=", attributes[attribute_map[key]].map { |v| _deserialize($1, v) })
160
+ end
161
+ elsif !attributes[attribute_map[key]].nil?
162
+ self.send("#{key}=", _deserialize(type, attributes[attribute_map[key]]))
163
+ end
164
+ end
165
+
166
+ self
167
+ end
168
+
169
+ # Deserializes the data based on type
170
+ # @param string type Data type
171
+ # @param string value Value to be deserialized
172
+ # @return [Object] Deserialized data
173
+ def _deserialize(type, value)
174
+ case type.to_sym
175
+ when :Time
176
+ Time.parse(value)
177
+ when :Date
178
+ Date.parse(value)
179
+ when :String
180
+ value.to_s
181
+ when :Integer
182
+ value.to_i
183
+ when :Float
184
+ value.to_f
185
+ when :Boolean
186
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
187
+ true
188
+ else
189
+ false
190
+ end
191
+ when :File
192
+ value
193
+ when :Object
194
+ # generic object (usually a Hash), return directly
195
+ value
196
+ when /\AArray<(?<inner_type>.+)>\z/
197
+ inner_type = Regexp.last_match[:inner_type]
198
+ value.map { |v| _deserialize(inner_type, v) }
199
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
200
+ k_type = Regexp.last_match[:k_type]
201
+ v_type = Regexp.last_match[:v_type]
202
+ {}.tap do |hash|
203
+ value.each do |k, v|
204
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
205
+ end
206
+ end
207
+ else # model
208
+ # models (e.g. Pet)
209
+ klass = Dropbox::Sign.const_get(type)
210
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
211
+ end
212
+ end
213
+
214
+ # Returns the string representation of the object
215
+ # @return [String] String presentation of the object
216
+ def to_s
217
+ to_hash.to_s
218
+ end
219
+
220
+ # to_body is an alias to to_hash (backward compatibility)
221
+ # @return [Hash] Returns the object in the form of hash
222
+ def to_body
223
+ to_hash
224
+ end
225
+
226
+ # Returns the object in the form of hash
227
+ # @return [Hash] Returns the object in the form of hash
228
+ def to_hash(include_nil = true)
229
+ hash = super
230
+ self.class.merged_attributes.each_pair do |attr, param|
231
+ value = self.send(attr)
232
+ if value.nil?
233
+ next unless include_nil
234
+ is_nullable = self.class.merged_nullable.include?(attr)
235
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
236
+ end
237
+
238
+ hash[param] = _to_hash(value, include_nil)
239
+ end
240
+ hash
241
+ end
242
+
243
+ # Outputs non-array value in the form of hash
244
+ # For object, use to_hash. Otherwise, just return the value
245
+ # @param [Object] value Any valid value
246
+ # @return [Hash] Returns the value in the form of hash
247
+ def _to_hash(value, include_nil = true)
248
+ if value.is_a?(Array)
249
+ value.compact.map { |v| _to_hash(v, include_nil) }
250
+ elsif value.is_a?(Hash)
251
+ {}.tap do |hash|
252
+ value.each { |k, v| hash[k] = _to_hash(v, include_nil) }
253
+ end
254
+ elsif value.respond_to? :to_hash
255
+ value.to_hash(include_nil)
256
+ else
257
+ value
258
+ end
259
+ end
260
+
261
+ end
262
+
263
+ end
@@ -17,62 +17,31 @@ module Dropbox
17
17
  end
18
18
 
19
19
  module Dropbox::Sign
20
- class TemplateResponseDocumentFormField
21
- # A unique id for the form field.
22
- # @return [String]
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, nil]
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, nil]
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, nil]
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
- :'group',
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 [TemplateResponseDocumentFormField]
120
+ # @return [TemplateResponseDocumentFormFieldText]
171
121
  def self.init(data)
172
122
  return ApiClient.default.convert_to_type(
173
123
  data,
174
- "TemplateResponseDocumentFormField"
175
- ) || TemplateResponseDocumentFormField.new
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::TemplateResponseDocumentFormField` initialize method"
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::TemplateResponseDocumentFormField`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
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
- if attributes.key?(:'api_id')
194
- self.api_id = attributes[:'api_id']
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
- end
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 = Array.new
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
- type_validator = EnumAttributeValidator.new('String', ["checkbox", "checkbox-merge", "date_signed", "dropdown", "hyperlink", "initials", "signature", "radio", "text", "text-merge"])
261
- return false unless type_validator.valid?(@type)
262
- true
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] type Object to be assigned
267
- def type=(type)
268
- validator = EnumAttributeValidator.new('String', ["checkbox", "checkbox-merge", "date_signed", "dropdown", "hyperlink", "initials", "signature", "radio", "text", "text-merge"])
269
- unless validator.valid?(type)
270
- fail ArgumentError, "invalid value for \"type\", must be one of #{validator.allowable_values}."
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
- @type = type
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
- [api_id, name, type, signer, x, y, width, height, required, group, avg_text_length, is_multiline, original_font_size, font_family].hash
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?