dropbox-sign 1.6.1 → 1.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (71) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +1 -1
  3. data/README.md +15 -5
  4. data/VERSION +1 -1
  5. data/docs/AccountResponseQuotas.md +1 -1
  6. data/docs/FaxApi.md +364 -0
  7. data/docs/FaxGetResponse.md +11 -0
  8. data/docs/FaxListResponse.md +11 -0
  9. data/docs/FaxResponse.md +19 -0
  10. data/docs/FaxResponseTransmission.md +13 -0
  11. data/docs/FaxSendRequest.md +18 -0
  12. data/docs/OAuthTokenRefreshRequest.md +2 -0
  13. data/docs/SignatureRequestApi.md +1 -1
  14. data/docs/SubWhiteLabelingOptions.md +12 -12
  15. data/docs/TemplateApi.md +3 -3
  16. data/docs/TemplateResponse.md +2 -1
  17. data/docs/TemplateResponseDocumentFormFieldBase.md +0 -1
  18. data/docs/TemplateResponseDocumentFormFieldCheckbox.md +1 -0
  19. data/docs/TemplateResponseDocumentFormFieldDateSigned.md +1 -0
  20. data/docs/TemplateResponseDocumentFormFieldDropdown.md +1 -0
  21. data/docs/TemplateResponseDocumentFormFieldHyperlink.md +1 -0
  22. data/docs/TemplateResponseDocumentFormFieldInitials.md +1 -0
  23. data/docs/TemplateResponseDocumentFormFieldRadio.md +1 -0
  24. data/docs/TemplateResponseDocumentFormFieldSignature.md +1 -0
  25. data/docs/TemplateResponseDocumentFormFieldText.md +1 -0
  26. data/examples/FaxDelete.rb +14 -0
  27. data/examples/FaxFiles.rb +17 -0
  28. data/examples/FaxGet.rb +17 -0
  29. data/examples/FaxList.rb +18 -0
  30. data/examples/FaxSend.rb +25 -0
  31. data/lib/dropbox-sign/api/fax_api.rb +495 -0
  32. data/lib/dropbox-sign/api/o_auth_api.rb +28 -0
  33. data/lib/dropbox-sign/api/signature_request_api.rb +2 -2
  34. data/lib/dropbox-sign/api/template_api.rb +2 -2
  35. data/lib/dropbox-sign/models/account_response_quotas.rb +1 -1
  36. data/lib/dropbox-sign/models/api_app_response_o_auth.rb +2 -1
  37. data/lib/dropbox-sign/models/fax_get_response.rb +263 -0
  38. data/lib/dropbox-sign/models/fax_list_response.rb +267 -0
  39. data/lib/dropbox-sign/models/fax_response.rb +399 -0
  40. data/lib/dropbox-sign/models/fax_response_transmission.rb +328 -0
  41. data/lib/dropbox-sign/models/fax_send_request.rb +345 -0
  42. data/lib/dropbox-sign/models/o_auth_token_refresh_request.rb +26 -4
  43. data/lib/dropbox-sign/models/sub_white_labeling_options.rb +12 -12
  44. data/lib/dropbox-sign/models/template_response.rb +22 -13
  45. data/lib/dropbox-sign/models/template_response_document.rb +1 -2
  46. data/lib/dropbox-sign/models/template_response_document_form_field_base.rb +4 -16
  47. data/lib/dropbox-sign/models/template_response_document_form_field_checkbox.rb +16 -4
  48. data/lib/dropbox-sign/models/template_response_document_form_field_date_signed.rb +16 -4
  49. data/lib/dropbox-sign/models/template_response_document_form_field_dropdown.rb +16 -4
  50. data/lib/dropbox-sign/models/template_response_document_form_field_hyperlink.rb +16 -4
  51. data/lib/dropbox-sign/models/template_response_document_form_field_initials.rb +16 -4
  52. data/lib/dropbox-sign/models/template_response_document_form_field_radio.rb +20 -4
  53. data/lib/dropbox-sign/models/template_response_document_form_field_signature.rb +16 -4
  54. data/lib/dropbox-sign/models/template_response_document_form_field_text.rb +17 -5
  55. data/lib/dropbox-sign/version.rb +1 -1
  56. data/lib/dropbox-sign.rb +6 -0
  57. data/openapi-config.yaml +1 -1
  58. data/openapi-sdk.yaml +821 -112
  59. data/run-build +9 -0
  60. data/test_fixtures/ApiAppCreateRequest.json +10 -10
  61. data/test_fixtures/ApiAppGetResponse.json +18 -3
  62. data/test_fixtures/ApiAppListResponse.json +7 -1
  63. data/test_fixtures/ApiAppUpdateRequest.json +11 -11
  64. data/test_fixtures/FaxGetResponse.json +23 -0
  65. data/test_fixtures/FaxListResponse.json +31 -0
  66. data/test_fixtures/FaxSendRequest.json +14 -0
  67. data/test_fixtures/FaxSendResponse.json +16 -0
  68. data/test_fixtures/TeamGetResponse.json +5 -0
  69. data/test_fixtures/TemplateGetResponse.json +25 -478
  70. data/test_fixtures/TemplateListResponse.json +34 -5
  71. metadata +29 -8
@@ -241,7 +241,7 @@ module Dropbox::Sign
241
241
  end
242
242
 
243
243
  # Cancel Incomplete Signature Request
244
- # Cancels an incomplete signature request. This action is **not reversible**. The request will be canceled and signers will no longer be able to sign. If they try to access the signature request they will receive a HTTP 410 status code indicating that the resource has been deleted. Cancelation is asynchronous and a successful call to this endpoint will return an empty 200 OK response if the signature request is eligible to be canceled and has been successfully queued. This 200 OK response does not indicate a successful cancelation of the signature request itself. The cancelation is confirmed via the `signature_request_canceled` event. It is recommended that a [callback handler](/api/reference/tag/Callbacks-and-Events) be implemented to listen for the `signature_request_canceled` event. This callback will be sent only when the cancelation has completed successfully. If a callback handler has been configured and the event has not been received within 60 minutes of making the call, check the status of the request in the [API Dashboard](https://app.hellosign.com/apidashboard) and retry the cancelation if necessary. To be eligible for cancelation, a signature request must have been sent successfully, must not yet have been signed by all signers, and you must either be the sender or own the API app under which it was sent. A partially signed signature request can be canceled. **NOTE:** To remove your access to a completed signature request, use the endpoint: `POST /signature_request/remove/[:signature_request_id]`.
244
+ # Cancels an incomplete signature request. This action is **not reversible**. The request will be canceled and signers will no longer be able to sign. If they try to access the signature request they will receive a HTTP 410 status code indicating that the resource has been deleted. Cancelation is asynchronous and a successful call to this endpoint will return an empty 200 OK response if the signature request is eligible to be canceled and has been successfully queued. This 200 OK response does not indicate a successful cancelation of the signature request itself. The cancelation is confirmed via the `signature_request_canceled` event. It is recommended that a [callback handler](/api/reference/tag/Callbacks-and-Events) be implemented to listen for the `signature_request_canceled` event. This callback will be sent only when the cancelation has completed successfully. If a callback handler has been configured and the event has not been received within 60 minutes of making the call, check the status of the request in the [API Dashboard](https://app.hellosign.com/apidashboard) and retry the cancelation if necessary. To be eligible for cancelation, a signature request must have been sent successfully, must not yet have been signed by all signers, and you must either be the sender or own the API app under which it was sent. A partially signed signature request can be canceled. **NOTE:** To remove your access to a completed signature request, use the endpoint: `POST /signature_request/remove/[:signature_request_id]`.
245
245
  # @param signature_request_id [String] The id of the incomplete SignatureRequest to cancel.
246
246
  # @param [Hash] opts the optional parameters
247
247
  # @return [nil]
@@ -251,7 +251,7 @@ module Dropbox::Sign
251
251
  end
252
252
 
253
253
  # Cancel Incomplete Signature Request
254
- # Cancels an incomplete signature request. This action is **not reversible**. The request will be canceled and signers will no longer be able to sign. If they try to access the signature request they will receive a HTTP 410 status code indicating that the resource has been deleted. Cancelation is asynchronous and a successful call to this endpoint will return an empty 200 OK response if the signature request is eligible to be canceled and has been successfully queued. This 200 OK response does not indicate a successful cancelation of the signature request itself. The cancelation is confirmed via the `signature_request_canceled` event. It is recommended that a [callback handler](/api/reference/tag/Callbacks-and-Events) be implemented to listen for the `signature_request_canceled` event. This callback will be sent only when the cancelation has completed successfully. If a callback handler has been configured and the event has not been received within 60 minutes of making the call, check the status of the request in the [API Dashboard](https://app.hellosign.com/apidashboard) and retry the cancelation if necessary. To be eligible for cancelation, a signature request must have been sent successfully, must not yet have been signed by all signers, and you must either be the sender or own the API app under which it was sent. A partially signed signature request can be canceled. **NOTE:** To remove your access to a completed signature request, use the endpoint: `POST /signature_request/remove/[:signature_request_id]`.
254
+ # Cancels an incomplete signature request. This action is **not reversible**. The request will be canceled and signers will no longer be able to sign. If they try to access the signature request they will receive a HTTP 410 status code indicating that the resource has been deleted. Cancelation is asynchronous and a successful call to this endpoint will return an empty 200 OK response if the signature request is eligible to be canceled and has been successfully queued. This 200 OK response does not indicate a successful cancelation of the signature request itself. The cancelation is confirmed via the `signature_request_canceled` event. It is recommended that a [callback handler](/api/reference/tag/Callbacks-and-Events) be implemented to listen for the `signature_request_canceled` event. This callback will be sent only when the cancelation has completed successfully. If a callback handler has been configured and the event has not been received within 60 minutes of making the call, check the status of the request in the [API Dashboard](https://app.hellosign.com/apidashboard) and retry the cancelation if necessary. To be eligible for cancelation, a signature request must have been sent successfully, must not yet have been signed by all signers, and you must either be the sender or own the API app under which it was sent. A partially signed signature request can be canceled. **NOTE:** To remove your access to a completed signature request, use the endpoint: `POST /signature_request/remove/[:signature_request_id]`.
255
255
  # @param signature_request_id [String] The id of the incomplete SignatureRequest to cancel.
256
256
  # @param [Hash] opts the optional parameters
257
257
  # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
@@ -137,7 +137,7 @@ module Dropbox::Sign
137
137
  return data, status_code, headers
138
138
  end
139
139
 
140
- # Create Template
140
+ # Create Template
141
141
  # Creates a template that can then be used.
142
142
  # @param template_create_request [TemplateCreateRequest]
143
143
  # @param [Hash] opts the optional parameters
@@ -147,7 +147,7 @@ module Dropbox::Sign
147
147
  data
148
148
  end
149
149
 
150
- # Create Template
150
+ # Create Template
151
151
  # Creates a template that can then be used.
152
152
  # @param template_create_request [TemplateCreateRequest]
153
153
  # @param [Hash] opts the optional parameters
@@ -35,7 +35,7 @@ module Dropbox::Sign
35
35
  # @return [Integer, nil]
36
36
  attr_accessor :templates_left
37
37
 
38
- # SMS verifications remaining.
38
+ # SMS verifications remaining.
39
39
  # @return [Integer, nil]
40
40
  attr_accessor :sms_verifications_left
41
41
 
@@ -24,7 +24,7 @@ module Dropbox::Sign
24
24
  attr_accessor :callback_url
25
25
 
26
26
  # The app's OAuth secret, or null if the app does not belong to user.
27
- # @return [String]
27
+ # @return [String, nil]
28
28
  attr_accessor :secret
29
29
 
30
30
  # Array of OAuth scopes used by the app.
@@ -63,6 +63,7 @@ module Dropbox::Sign
63
63
  # List of attributes with nullable: true
64
64
  def self.openapi_nullable
65
65
  Set.new([
66
+ :'secret',
66
67
  ])
67
68
  end
68
69
 
@@ -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
+ Generator version: 7.8.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module Dropbox
17
+ end
18
+
19
+ module Dropbox::Sign
20
+ class FaxGetResponse
21
+ # @return [FaxResponse]
22
+ attr_accessor :fax
23
+
24
+ # A list of warnings.
25
+ # @return [Array<WarningResponse>]
26
+ attr_accessor :warnings
27
+
28
+ # Attribute mapping from ruby-style variable name to JSON key.
29
+ def self.attribute_map
30
+ {
31
+ :'fax' => :'fax',
32
+ :'warnings' => :'warnings'
33
+ }
34
+ end
35
+
36
+ # Returns all the JSON keys this model knows about
37
+ def self.acceptable_attributes
38
+ attribute_map.values
39
+ end
40
+
41
+ # Attribute type mapping.
42
+ def self.openapi_types
43
+ {
44
+ :'fax' => :'FaxResponse',
45
+ :'warnings' => :'Array<WarningResponse>'
46
+ }
47
+ end
48
+
49
+ # List of attributes with nullable: true
50
+ def self.openapi_nullable
51
+ Set.new([
52
+ ])
53
+ end
54
+
55
+ # Returns attribute map of this model + parent
56
+ def self.merged_attributes
57
+ self.attribute_map
58
+ end
59
+
60
+ # Attribute type mapping of this model + parent
61
+ def self.merged_types
62
+ self.openapi_types
63
+ end
64
+
65
+ # Returns list of attributes with nullable: true of this model + parent
66
+ def self.merged_nullable
67
+ self.openapi_nullable
68
+ end
69
+
70
+ # Attempt to instantiate and hydrate a new instance of this class
71
+ # @param [Object] data Data to be converted
72
+ # @return [FaxGetResponse]
73
+ def self.init(data)
74
+ ApiClient.default.convert_to_type(
75
+ data,
76
+ "FaxGetResponse"
77
+ ) || FaxGetResponse.new
78
+ end
79
+
80
+ # Initializes the object
81
+ # @param [Hash] attributes Model attributes in the form of hash
82
+ def initialize(attributes = {})
83
+ if (!attributes.is_a?(Hash))
84
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Dropbox::Sign::FaxGetResponse` initialize method"
85
+ end
86
+
87
+ # check to see if the attribute exists and convert string to symbol for hash key
88
+ attributes = attributes.each_with_object({}) { |(k, v), h|
89
+ if (!self.class.merged_attributes.key?(k.to_sym))
90
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Dropbox::Sign::FaxGetResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
91
+ end
92
+ h[k.to_sym] = v
93
+ }
94
+
95
+ if attributes.key?(:'fax')
96
+ self.fax = attributes[:'fax']
97
+ end
98
+
99
+ if attributes.key?(:'warnings')
100
+ if (value = attributes[:'warnings']).is_a?(Array)
101
+ self.warnings = value
102
+ end
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
+ if @fax.nil?
111
+ invalid_properties.push('invalid value for "fax", fax cannot be nil.')
112
+ end
113
+
114
+ invalid_properties
115
+ end
116
+
117
+ # Check to see if the all the properties in the model are valid
118
+ # @return true if the model is valid
119
+ def valid?
120
+ return false if @fax.nil?
121
+ true
122
+ end
123
+
124
+ # Checks equality by comparing each attribute.
125
+ # @param [Object] Object to be compared
126
+ def ==(o)
127
+ return true if self.equal?(o)
128
+ self.class == o.class &&
129
+ fax == o.fax &&
130
+ warnings == o.warnings
131
+ end
132
+
133
+ # @see the `==` method
134
+ # @param [Object] Object to be compared
135
+ def eql?(o)
136
+ self == o
137
+ end
138
+
139
+ # Calculates hash code according to all attributes.
140
+ # @return [Integer] Hash code
141
+ def hash
142
+ [fax, warnings].hash
143
+ end
144
+
145
+ # Builds the object from hash
146
+ # @param [Hash] attributes Model attributes in the form of hash
147
+ # @return [Object] Returns the model itself
148
+ def self.build_from_hash(attributes)
149
+ new.build_from_hash(attributes)
150
+ end
151
+
152
+ # Builds the object from hash
153
+ # @param [Hash] attributes Model attributes in the form of hash
154
+ # @return [Object] Returns the model itself
155
+ def build_from_hash(attributes)
156
+ return nil unless attributes.is_a?(Hash)
157
+ attribute_map = self.class.merged_attributes
158
+
159
+ self.class.merged_types.each_pair do |key, type|
160
+ if type =~ /\AArray<(.*)>/i
161
+ # check to ensure the input is an array given that the attribute
162
+ # is documented as an array but the input is not
163
+ if attributes[attribute_map[key]].is_a?(Array)
164
+ self.send("#{key}=", attributes[attribute_map[key]].map { |v| _deserialize($1, v) })
165
+ end
166
+ elsif !attributes[attribute_map[key]].nil?
167
+ self.send("#{key}=", _deserialize(type, attributes[attribute_map[key]]))
168
+ end
169
+ end
170
+
171
+ self
172
+ end
173
+
174
+ # Deserializes the data based on type
175
+ # @param string type Data type
176
+ # @param string value Value to be deserialized
177
+ # @return [Object] Deserialized data
178
+ def _deserialize(type, value)
179
+ case type.to_sym
180
+ when :Time
181
+ Time.parse(value)
182
+ when :Date
183
+ Date.parse(value)
184
+ when :String
185
+ value.to_s
186
+ when :Integer
187
+ value.to_i
188
+ when :Float
189
+ value.to_f
190
+ when :Boolean
191
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
192
+ true
193
+ else
194
+ false
195
+ end
196
+ when :Object
197
+ # generic object (usually a Hash), return directly
198
+ value
199
+ when /\AArray<(?<inner_type>.+)>\z/
200
+ inner_type = Regexp.last_match[:inner_type]
201
+ value.map { |v| _deserialize(inner_type, v) }
202
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
203
+ k_type = Regexp.last_match[:k_type]
204
+ v_type = Regexp.last_match[:v_type]
205
+ {}.tap do |hash|
206
+ value.each do |k, v|
207
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
208
+ end
209
+ end
210
+ else # model
211
+ klass = Dropbox::Sign.const_get(type)
212
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
213
+ end
214
+ end
215
+
216
+ # Returns the string representation of the object
217
+ # @return [String] String presentation of the object
218
+ def to_s
219
+ to_hash.to_s
220
+ end
221
+
222
+ # to_body is an alias to to_hash (backward compatibility)
223
+ # @return [Hash] Returns the object in the form of hash
224
+ def to_body
225
+ to_hash
226
+ end
227
+
228
+ # Returns the object in the form of hash
229
+ # @return [Hash] Returns the object in the form of hash
230
+ def to_hash(include_nil = true)
231
+ hash = {}
232
+ self.class.merged_attributes.each_pair do |attr, param|
233
+ value = self.send(attr)
234
+ if value.nil?
235
+ next unless include_nil
236
+ is_nullable = self.class.merged_nullable.include?(attr)
237
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
238
+ end
239
+
240
+ hash[param] = _to_hash(value, include_nil)
241
+ end
242
+ hash
243
+ end
244
+
245
+ # Outputs non-array value in the form of hash
246
+ # For object, use to_hash. Otherwise, just return the value
247
+ # @param [Object] value Any valid value
248
+ # @return [Hash] Returns the value in the form of hash
249
+ def _to_hash(value, include_nil = true)
250
+ if value.is_a?(Array)
251
+ value.compact.map { |v| _to_hash(v, include_nil) }
252
+ elsif value.is_a?(Hash)
253
+ {}.tap do |hash|
254
+ value.each { |k, v| hash[k] = _to_hash(v, include_nil) }
255
+ end
256
+ elsif value.respond_to? :to_hash
257
+ value.to_hash(include_nil)
258
+ else
259
+ value
260
+ end
261
+ end
262
+ end
263
+ end
@@ -0,0 +1,267 @@
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
+ Generator version: 7.8.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module Dropbox
17
+ end
18
+
19
+ module Dropbox::Sign
20
+ class FaxListResponse
21
+ # @return [Array<FaxResponse>]
22
+ attr_accessor :faxes
23
+
24
+ # @return [ListInfoResponse]
25
+ attr_accessor :list_info
26
+
27
+ # Attribute mapping from ruby-style variable name to JSON key.
28
+ def self.attribute_map
29
+ {
30
+ :'faxes' => :'faxes',
31
+ :'list_info' => :'list_info'
32
+ }
33
+ end
34
+
35
+ # Returns all the JSON keys this model knows about
36
+ def self.acceptable_attributes
37
+ attribute_map.values
38
+ end
39
+
40
+ # Attribute type mapping.
41
+ def self.openapi_types
42
+ {
43
+ :'faxes' => :'Array<FaxResponse>',
44
+ :'list_info' => :'ListInfoResponse'
45
+ }
46
+ end
47
+
48
+ # List of attributes with nullable: true
49
+ def self.openapi_nullable
50
+ Set.new([
51
+ ])
52
+ end
53
+
54
+ # Returns attribute map of this model + parent
55
+ def self.merged_attributes
56
+ self.attribute_map
57
+ end
58
+
59
+ # Attribute type mapping of this model + parent
60
+ def self.merged_types
61
+ self.openapi_types
62
+ end
63
+
64
+ # Returns list of attributes with nullable: true of this model + parent
65
+ def self.merged_nullable
66
+ self.openapi_nullable
67
+ end
68
+
69
+ # Attempt to instantiate and hydrate a new instance of this class
70
+ # @param [Object] data Data to be converted
71
+ # @return [FaxListResponse]
72
+ def self.init(data)
73
+ ApiClient.default.convert_to_type(
74
+ data,
75
+ "FaxListResponse"
76
+ ) || FaxListResponse.new
77
+ end
78
+
79
+ # Initializes the object
80
+ # @param [Hash] attributes Model attributes in the form of hash
81
+ def initialize(attributes = {})
82
+ if (!attributes.is_a?(Hash))
83
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Dropbox::Sign::FaxListResponse` initialize method"
84
+ end
85
+
86
+ # check to see if the attribute exists and convert string to symbol for hash key
87
+ attributes = attributes.each_with_object({}) { |(k, v), h|
88
+ if (!self.class.merged_attributes.key?(k.to_sym))
89
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Dropbox::Sign::FaxListResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
90
+ end
91
+ h[k.to_sym] = v
92
+ }
93
+
94
+ if attributes.key?(:'faxes')
95
+ if (value = attributes[:'faxes']).is_a?(Array)
96
+ self.faxes = value
97
+ end
98
+ end
99
+
100
+ if attributes.key?(:'list_info')
101
+ self.list_info = attributes[:'list_info']
102
+ end
103
+ end
104
+
105
+ # Show invalid properties with the reasons. Usually used together with valid?
106
+ # @return Array for valid properties with the reasons
107
+ def list_invalid_properties
108
+ invalid_properties = Array.new
109
+ if @faxes.nil?
110
+ invalid_properties.push('invalid value for "faxes", faxes cannot be nil.')
111
+ end
112
+
113
+ if @list_info.nil?
114
+ invalid_properties.push('invalid value for "list_info", list_info cannot be nil.')
115
+ end
116
+
117
+ invalid_properties
118
+ end
119
+
120
+ # Check to see if the all the properties in the model are valid
121
+ # @return true if the model is valid
122
+ def valid?
123
+ return false if @faxes.nil?
124
+ return false if @list_info.nil?
125
+ true
126
+ end
127
+
128
+ # Checks equality by comparing each attribute.
129
+ # @param [Object] Object to be compared
130
+ def ==(o)
131
+ return true if self.equal?(o)
132
+ self.class == o.class &&
133
+ faxes == o.faxes &&
134
+ list_info == o.list_info
135
+ end
136
+
137
+ # @see the `==` method
138
+ # @param [Object] Object to be compared
139
+ def eql?(o)
140
+ self == o
141
+ end
142
+
143
+ # Calculates hash code according to all attributes.
144
+ # @return [Integer] Hash code
145
+ def hash
146
+ [faxes, list_info].hash
147
+ end
148
+
149
+ # Builds the object from hash
150
+ # @param [Hash] attributes Model attributes in the form of hash
151
+ # @return [Object] Returns the model itself
152
+ def self.build_from_hash(attributes)
153
+ new.build_from_hash(attributes)
154
+ end
155
+
156
+ # Builds the object from hash
157
+ # @param [Hash] attributes Model attributes in the form of hash
158
+ # @return [Object] Returns the model itself
159
+ def build_from_hash(attributes)
160
+ return nil unless attributes.is_a?(Hash)
161
+ attribute_map = self.class.merged_attributes
162
+
163
+ self.class.merged_types.each_pair do |key, type|
164
+ if type =~ /\AArray<(.*)>/i
165
+ # check to ensure the input is an array given that the attribute
166
+ # is documented as an array but the input is not
167
+ if attributes[attribute_map[key]].is_a?(Array)
168
+ self.send("#{key}=", attributes[attribute_map[key]].map { |v| _deserialize($1, v) })
169
+ end
170
+ elsif !attributes[attribute_map[key]].nil?
171
+ self.send("#{key}=", _deserialize(type, attributes[attribute_map[key]]))
172
+ end
173
+ end
174
+
175
+ self
176
+ end
177
+
178
+ # Deserializes the data based on type
179
+ # @param string type Data type
180
+ # @param string value Value to be deserialized
181
+ # @return [Object] Deserialized data
182
+ def _deserialize(type, value)
183
+ case type.to_sym
184
+ when :Time
185
+ Time.parse(value)
186
+ when :Date
187
+ Date.parse(value)
188
+ when :String
189
+ value.to_s
190
+ when :Integer
191
+ value.to_i
192
+ when :Float
193
+ value.to_f
194
+ when :Boolean
195
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
196
+ true
197
+ else
198
+ false
199
+ end
200
+ when :Object
201
+ # generic object (usually a Hash), return directly
202
+ value
203
+ when /\AArray<(?<inner_type>.+)>\z/
204
+ inner_type = Regexp.last_match[:inner_type]
205
+ value.map { |v| _deserialize(inner_type, v) }
206
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
207
+ k_type = Regexp.last_match[:k_type]
208
+ v_type = Regexp.last_match[:v_type]
209
+ {}.tap do |hash|
210
+ value.each do |k, v|
211
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
212
+ end
213
+ end
214
+ else # model
215
+ klass = Dropbox::Sign.const_get(type)
216
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
217
+ end
218
+ end
219
+
220
+ # Returns the string representation of the object
221
+ # @return [String] String presentation of the object
222
+ def to_s
223
+ to_hash.to_s
224
+ end
225
+
226
+ # to_body is an alias to to_hash (backward compatibility)
227
+ # @return [Hash] Returns the object in the form of hash
228
+ def to_body
229
+ to_hash
230
+ end
231
+
232
+ # Returns the object in the form of hash
233
+ # @return [Hash] Returns the object in the form of hash
234
+ def to_hash(include_nil = true)
235
+ hash = {}
236
+ self.class.merged_attributes.each_pair do |attr, param|
237
+ value = self.send(attr)
238
+ if value.nil?
239
+ next unless include_nil
240
+ is_nullable = self.class.merged_nullable.include?(attr)
241
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
242
+ end
243
+
244
+ hash[param] = _to_hash(value, include_nil)
245
+ end
246
+ hash
247
+ end
248
+
249
+ # Outputs non-array value in the form of hash
250
+ # For object, use to_hash. Otherwise, just return the value
251
+ # @param [Object] value Any valid value
252
+ # @return [Hash] Returns the value in the form of hash
253
+ def _to_hash(value, include_nil = true)
254
+ if value.is_a?(Array)
255
+ value.compact.map { |v| _to_hash(v, include_nil) }
256
+ elsif value.is_a?(Hash)
257
+ {}.tap do |hash|
258
+ value.each { |k, v| hash[k] = _to_hash(v, include_nil) }
259
+ end
260
+ elsif value.respond_to? :to_hash
261
+ value.to_hash(include_nil)
262
+ else
263
+ value
264
+ end
265
+ end
266
+ end
267
+ end