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
+ # The rule used to validate checkboxes in the form field group. See [checkbox field grouping](/api/reference/constants/#checkbox-field-grouping).
21
+ class TemplateResponseDocumentFieldGroupRule
22
+ # Examples: `require_0-1` `require_1` `require_1-ormore` - Check out the list of [acceptable `requirement` checkbox type values](/api/reference/constants/#checkbox-field-grouping). - Check out the list of [acceptable `requirement` radio type fields](/api/reference/constants/#radio-field-grouping). - Radio groups require **at least** two fields per group.
23
+ # @return [String]
24
+ attr_accessor :requirement
25
+
26
+ # Name of the group
27
+ # @return [String]
28
+ attr_accessor :group_label
29
+
30
+ # Attribute mapping from ruby-style variable name to JSON key.
31
+ def self.attribute_map
32
+ {
33
+ :'requirement' => :'requirement',
34
+ :'group_label' => :'groupLabel'
35
+ }
36
+ end
37
+
38
+ # Returns all the JSON keys this model knows about
39
+ def self.acceptable_attributes
40
+ attribute_map.values
41
+ end
42
+
43
+ # Returns attribute map of this model + parent
44
+ def self.merged_attributes
45
+ self.attribute_map
46
+ end
47
+
48
+ # Attribute type mapping.
49
+ def self.openapi_types
50
+ {
51
+ :'requirement' => :'String',
52
+ :'group_label' => :'String'
53
+ }
54
+ end
55
+
56
+ # Attribute type mapping of this model + parent
57
+ def self.merged_types
58
+ self.openapi_types
59
+ end
60
+
61
+ # List of attributes with nullable: true
62
+ def self.openapi_nullable
63
+ Set.new([
64
+ ])
65
+ end
66
+
67
+ # Returns list of attributes with nullable: true of this model + parent
68
+ def self.merged_nullable
69
+ self.openapi_nullable
70
+ end
71
+
72
+ # Attempt to instantiate and hydrate a new instance of this class
73
+ # @param [Object] data Data to be converted
74
+ # @return [TemplateResponseDocumentFieldGroupRule]
75
+ def self.init(data)
76
+ return ApiClient.default.convert_to_type(
77
+ data,
78
+ "TemplateResponseDocumentFieldGroupRule"
79
+ ) || TemplateResponseDocumentFieldGroupRule.new
80
+ end
81
+
82
+ # Initializes the object
83
+ # @param [Hash] attributes Model attributes in the form of hash
84
+ def initialize(attributes = {})
85
+ if (!attributes.is_a?(Hash))
86
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Dropbox::Sign::TemplateResponseDocumentFieldGroupRule` initialize method"
87
+ end
88
+
89
+ # check to see if the attribute exists and convert string to symbol for hash key
90
+ attributes = attributes.each_with_object({}) { |(k, v), h|
91
+ if (!self.class.merged_attributes.key?(k.to_sym))
92
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Dropbox::Sign::TemplateResponseDocumentFieldGroupRule`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
93
+ end
94
+ h[k.to_sym] = v
95
+ }
96
+
97
+ if attributes.key?(:'requirement')
98
+ self.requirement = attributes[:'requirement']
99
+ end
100
+
101
+ if attributes.key?(:'group_label')
102
+ self.group_label = attributes[:'group_label']
103
+ end
104
+ end
105
+
106
+ # Show invalid properties with the reasons. Usually used together with valid?
107
+ # @return Array for valid properties with the reasons
108
+ def list_invalid_properties
109
+ invalid_properties = Array.new
110
+ invalid_properties
111
+ end
112
+
113
+ # Check to see if the all the properties in the model are valid
114
+ # @return true if the model is valid
115
+ def valid?
116
+ true
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
+ requirement == o.requirement &&
125
+ group_label == o.group_label
126
+ end
127
+
128
+ # @see the `==` method
129
+ # @param [Object] Object to be compared
130
+ def eql?(o)
131
+ self == o
132
+ end
133
+
134
+ # Calculates hash code according to all attributes.
135
+ # @return [Integer] Hash code
136
+ def hash
137
+ [requirement, group_label].hash
138
+ end
139
+
140
+ # Builds the object from hash
141
+ # @param [Hash] attributes Model attributes in the form of hash
142
+ # @return [Object] Returns the model itself
143
+ def self.build_from_hash(attributes)
144
+ new.build_from_hash(attributes)
145
+ end
146
+
147
+ # Builds the object from hash
148
+ # @param [Hash] attributes Model attributes in the form of hash
149
+ # @return [Object] Returns the model itself
150
+ def build_from_hash(attributes)
151
+ return nil unless attributes.is_a?(Hash)
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 = {}
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,16 +17,20 @@ module Dropbox
17
17
  end
18
18
 
19
19
  module Dropbox::Sign
20
- class TemplateResponseNamedFormField
21
- # The name of the Named Form Field.
20
+ # An array of Form Field objects containing the name and type of each named field.
21
+ class TemplateResponseDocumentFormFieldBase
22
22
  # @return [String]
23
- attr_accessor :name
23
+ attr_accessor :type
24
24
 
25
- # The type of this Named Form Field. Only `text` and `checkbox` are currently supported.
25
+ # A unique id for the form field.
26
26
  # @return [String]
27
- attr_accessor :type
27
+ attr_accessor :api_id
28
28
 
29
- # The signer of the Named Form Field.
29
+ # The name of the form field.
30
+ # @return [String]
31
+ attr_accessor :name
32
+
33
+ # The signer of the Form Field.
30
34
  # @return [String]
31
35
  attr_accessor :signer
32
36
 
@@ -50,46 +54,28 @@ module Dropbox::Sign
50
54
  # @return [Boolean]
51
55
  attr_accessor :required
52
56
 
53
- # The unique ID for this field.
54
- # @return [String]
55
- attr_accessor :api_id
56
-
57
- # The name of the group this field is in. If this field is not a group, this defaults to `null`.
57
+ # The name of the group this field is in. If this field is not a group, this defaults to `null` except for Radio fields.
58
58
  # @return [String, nil]
59
59
  attr_accessor :group
60
60
 
61
- # @return [TemplateResponseFieldAvgTextLength]
62
- attr_accessor :avg_text_length
63
-
64
- # Whether this form field is multiline text.
65
- # @return [Boolean, nil]
66
- attr_accessor :is_multiline
67
-
68
- # Original font size used in this form field's text.
69
- # @return [Integer, nil]
70
- attr_accessor :original_font_size
71
-
72
- # Font family used in this form field's text.
73
- # @return [String, nil]
74
- attr_accessor :font_family
61
+ # Final font size used by this form field.
62
+ # @return [Integer]
63
+ attr_accessor :font_size
75
64
 
76
65
  # Attribute mapping from ruby-style variable name to JSON key.
77
66
  def self.attribute_map
78
67
  {
79
- :'name' => :'name',
80
68
  :'type' => :'type',
69
+ :'api_id' => :'api_id',
70
+ :'name' => :'name',
81
71
  :'signer' => :'signer',
82
72
  :'x' => :'x',
83
73
  :'y' => :'y',
84
74
  :'width' => :'width',
85
75
  :'height' => :'height',
86
76
  :'required' => :'required',
87
- :'api_id' => :'api_id',
88
77
  :'group' => :'group',
89
- :'avg_text_length' => :'avg_text_length',
90
- :'is_multiline' => :'isMultiline',
91
- :'original_font_size' => :'originalFontSize',
92
- :'font_family' => :'fontFamily'
78
+ :'font_size' => :'fontSize'
93
79
  }
94
80
  end
95
81
 
@@ -106,20 +92,17 @@ module Dropbox::Sign
106
92
  # Attribute type mapping.
107
93
  def self.openapi_types
108
94
  {
109
- :'name' => :'String',
110
95
  :'type' => :'String',
96
+ :'api_id' => :'String',
97
+ :'name' => :'String',
111
98
  :'signer' => :'String',
112
99
  :'x' => :'Integer',
113
100
  :'y' => :'Integer',
114
101
  :'width' => :'Integer',
115
102
  :'height' => :'Integer',
116
103
  :'required' => :'Boolean',
117
- :'api_id' => :'String',
118
104
  :'group' => :'String',
119
- :'avg_text_length' => :'TemplateResponseFieldAvgTextLength',
120
- :'is_multiline' => :'Boolean',
121
- :'original_font_size' => :'Integer',
122
- :'font_family' => :'String'
105
+ :'font_size' => :'Integer'
123
106
  }
124
107
  end
125
108
 
@@ -132,9 +115,6 @@ module Dropbox::Sign
132
115
  def self.openapi_nullable
133
116
  Set.new([
134
117
  :'group',
135
- :'is_multiline',
136
- :'original_font_size',
137
- :'font_family'
138
118
  ])
139
119
  end
140
120
 
@@ -143,39 +123,69 @@ module Dropbox::Sign
143
123
  self.openapi_nullable
144
124
  end
145
125
 
146
- # Attempt to instantiate and hydrate a new instance of this class
147
- # @param [Object] data Data to be converted
148
- # @return [TemplateResponseNamedFormField]
149
- def self.init(data)
150
- return ApiClient.default.convert_to_type(
151
- data,
152
- "TemplateResponseNamedFormField"
153
- ) || TemplateResponseNamedFormField.new
126
+ # discriminator's property name in OpenAPI v3
127
+ def self.openapi_discriminator_name
128
+ :'type'
129
+ end
130
+
131
+ def self.discriminator_class_name(value)
132
+ return nil unless value.is_a?(String)
133
+
134
+ if value == 'checkbox'
135
+ return "Dropbox::Sign::TemplateResponseDocumentFormFieldCheckbox"
136
+ end
137
+ if value == 'date_signed'
138
+ return "Dropbox::Sign::TemplateResponseDocumentFormFieldDateSigned"
139
+ end
140
+ if value == 'dropdown'
141
+ return "Dropbox::Sign::TemplateResponseDocumentFormFieldDropdown"
142
+ end
143
+ if value == 'hyperlink'
144
+ return "Dropbox::Sign::TemplateResponseDocumentFormFieldHyperlink"
145
+ end
146
+ if value == 'initials'
147
+ return "Dropbox::Sign::TemplateResponseDocumentFormFieldInitials"
148
+ end
149
+ if value == 'radio'
150
+ return "Dropbox::Sign::TemplateResponseDocumentFormFieldRadio"
151
+ end
152
+ if value == 'signature'
153
+ return "Dropbox::Sign::TemplateResponseDocumentFormFieldSignature"
154
+ end
155
+ if value == 'text'
156
+ return "Dropbox::Sign::TemplateResponseDocumentFormFieldText"
157
+ end
158
+
159
+ return nil
154
160
  end
155
161
 
156
162
  # Initializes the object
157
163
  # @param [Hash] attributes Model attributes in the form of hash
158
164
  def initialize(attributes = {})
159
165
  if (!attributes.is_a?(Hash))
160
- fail ArgumentError, "The input argument (attributes) must be a hash in `Dropbox::Sign::TemplateResponseNamedFormField` initialize method"
166
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Dropbox::Sign::TemplateResponseDocumentFormFieldBase` initialize method"
161
167
  end
162
168
 
163
169
  # check to see if the attribute exists and convert string to symbol for hash key
164
170
  attributes = attributes.each_with_object({}) { |(k, v), h|
165
171
  if (!self.class.merged_attributes.key?(k.to_sym))
166
- fail ArgumentError, "`#{k}` is not a valid attribute in `Dropbox::Sign::TemplateResponseNamedFormField`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
172
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Dropbox::Sign::TemplateResponseDocumentFormFieldBase`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
167
173
  end
168
174
  h[k.to_sym] = v
169
175
  }
170
176
 
171
- if attributes.key?(:'name')
172
- self.name = attributes[:'name']
173
- end
174
-
175
177
  if attributes.key?(:'type')
176
178
  self.type = attributes[:'type']
177
179
  end
178
180
 
181
+ if attributes.key?(:'api_id')
182
+ self.api_id = attributes[:'api_id']
183
+ end
184
+
185
+ if attributes.key?(:'name')
186
+ self.name = attributes[:'name']
187
+ end
188
+
179
189
  if attributes.key?(:'signer')
180
190
  self.signer = attributes[:'signer']
181
191
  end
@@ -200,28 +210,12 @@ module Dropbox::Sign
200
210
  self.required = attributes[:'required']
201
211
  end
202
212
 
203
- if attributes.key?(:'api_id')
204
- self.api_id = attributes[:'api_id']
205
- end
206
-
207
213
  if attributes.key?(:'group')
208
214
  self.group = attributes[:'group']
209
215
  end
210
216
 
211
- if attributes.key?(:'avg_text_length')
212
- self.avg_text_length = attributes[:'avg_text_length']
213
- end
214
-
215
- if attributes.key?(:'is_multiline')
216
- self.is_multiline = attributes[:'is_multiline']
217
- end
218
-
219
- if attributes.key?(:'original_font_size')
220
- self.original_font_size = attributes[:'original_font_size']
221
- end
222
-
223
- if attributes.key?(:'font_family')
224
- self.font_family = attributes[:'font_family']
217
+ if attributes.key?(:'font_size')
218
+ self.font_size = attributes[:'font_size']
225
219
  end
226
220
  end
227
221
 
@@ -229,12 +223,17 @@ module Dropbox::Sign
229
223
  # @return Array for valid properties with the reasons
230
224
  def list_invalid_properties
231
225
  invalid_properties = Array.new
226
+ if @type.nil?
227
+ invalid_properties.push('invalid value for "type", type cannot be nil.')
228
+ end
229
+
232
230
  invalid_properties
233
231
  end
234
232
 
235
233
  # Check to see if the all the properties in the model are valid
236
234
  # @return true if the model is valid
237
235
  def valid?
236
+ return false if @type.nil?
238
237
  true
239
238
  end
240
239
 
@@ -243,20 +242,17 @@ module Dropbox::Sign
243
242
  def ==(o)
244
243
  return true if self.equal?(o)
245
244
  self.class == o.class &&
246
- name == o.name &&
247
245
  type == o.type &&
246
+ api_id == o.api_id &&
247
+ name == o.name &&
248
248
  signer == o.signer &&
249
249
  x == o.x &&
250
250
  y == o.y &&
251
251
  width == o.width &&
252
252
  height == o.height &&
253
253
  required == o.required &&
254
- api_id == o.api_id &&
255
254
  group == o.group &&
256
- avg_text_length == o.avg_text_length &&
257
- is_multiline == o.is_multiline &&
258
- original_font_size == o.original_font_size &&
259
- font_family == o.font_family
255
+ font_size == o.font_size
260
256
  end
261
257
 
262
258
  # @see the `==` method
@@ -268,13 +264,20 @@ module Dropbox::Sign
268
264
  # Calculates hash code according to all attributes.
269
265
  # @return [Integer] Hash code
270
266
  def hash
271
- [name, type, signer, x, y, width, height, required, api_id, group, avg_text_length, is_multiline, original_font_size, font_family].hash
267
+ [type, api_id, name, signer, x, y, width, height, required, group, font_size].hash
272
268
  end
273
269
 
274
270
  # Builds the object from hash
275
271
  # @param [Hash] attributes Model attributes in the form of hash
276
272
  # @return [Object] Returns the model itself
277
273
  def self.build_from_hash(attributes)
274
+ if !attributes[self.openapi_discriminator_name].nil?
275
+ klass = self.discriminator_class_name(attributes[self.openapi_discriminator_name])
276
+ if klass != new.class.to_s
277
+ obj = Object.const_get(klass).new.build_from_hash(attributes)
278
+ return obj
279
+ end
280
+ end
278
281
  new.build_from_hash(attributes)
279
282
  end
280
283