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
@@ -0,0 +1,399 @@
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 FaxResponse
21
+ # Fax ID
22
+ # @return [String]
23
+ attr_accessor :fax_id
24
+
25
+ # Fax Title
26
+ # @return [String]
27
+ attr_accessor :title
28
+
29
+ # Fax Original Title
30
+ # @return [String]
31
+ attr_accessor :original_title
32
+
33
+ # Fax Subject
34
+ # @return [String]
35
+ attr_accessor :subject
36
+
37
+ # Fax Message
38
+ # @return [String]
39
+ attr_accessor :message
40
+
41
+ # Fax Metadata
42
+ # @return [Hash<String, Object>]
43
+ attr_accessor :metadata
44
+
45
+ # Fax Created At Timestamp
46
+ # @return [Integer]
47
+ attr_accessor :created_at
48
+
49
+ # Fax Sender Email
50
+ # @return [String]
51
+ attr_accessor :sender
52
+
53
+ # Fax Transmissions List
54
+ # @return [Array<FaxResponseTransmission>]
55
+ attr_accessor :transmissions
56
+
57
+ # Fax Files URL
58
+ # @return [String]
59
+ attr_accessor :files_url
60
+
61
+ # Attribute mapping from ruby-style variable name to JSON key.
62
+ def self.attribute_map
63
+ {
64
+ :'fax_id' => :'fax_id',
65
+ :'title' => :'title',
66
+ :'original_title' => :'original_title',
67
+ :'subject' => :'subject',
68
+ :'message' => :'message',
69
+ :'metadata' => :'metadata',
70
+ :'created_at' => :'created_at',
71
+ :'sender' => :'sender',
72
+ :'transmissions' => :'transmissions',
73
+ :'files_url' => :'files_url'
74
+ }
75
+ end
76
+
77
+ # Returns all the JSON keys this model knows about
78
+ def self.acceptable_attributes
79
+ attribute_map.values
80
+ end
81
+
82
+ # Attribute type mapping.
83
+ def self.openapi_types
84
+ {
85
+ :'fax_id' => :'String',
86
+ :'title' => :'String',
87
+ :'original_title' => :'String',
88
+ :'subject' => :'String',
89
+ :'message' => :'String',
90
+ :'metadata' => :'Hash<String, Object>',
91
+ :'created_at' => :'Integer',
92
+ :'sender' => :'String',
93
+ :'transmissions' => :'Array<FaxResponseTransmission>',
94
+ :'files_url' => :'String'
95
+ }
96
+ end
97
+
98
+ # List of attributes with nullable: true
99
+ def self.openapi_nullable
100
+ Set.new([
101
+ ])
102
+ end
103
+
104
+ # Returns attribute map of this model + parent
105
+ def self.merged_attributes
106
+ self.attribute_map
107
+ end
108
+
109
+ # Attribute type mapping of this model + parent
110
+ def self.merged_types
111
+ self.openapi_types
112
+ end
113
+
114
+ # Returns list of attributes with nullable: true of this model + parent
115
+ def self.merged_nullable
116
+ self.openapi_nullable
117
+ end
118
+
119
+ # Attempt to instantiate and hydrate a new instance of this class
120
+ # @param [Object] data Data to be converted
121
+ # @return [FaxResponse]
122
+ def self.init(data)
123
+ ApiClient.default.convert_to_type(
124
+ data,
125
+ "FaxResponse"
126
+ ) || FaxResponse.new
127
+ end
128
+
129
+ # Initializes the object
130
+ # @param [Hash] attributes Model attributes in the form of hash
131
+ def initialize(attributes = {})
132
+ if (!attributes.is_a?(Hash))
133
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Dropbox::Sign::FaxResponse` initialize method"
134
+ end
135
+
136
+ # check to see if the attribute exists and convert string to symbol for hash key
137
+ attributes = attributes.each_with_object({}) { |(k, v), h|
138
+ if (!self.class.merged_attributes.key?(k.to_sym))
139
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Dropbox::Sign::FaxResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
140
+ end
141
+ h[k.to_sym] = v
142
+ }
143
+
144
+ if attributes.key?(:'fax_id')
145
+ self.fax_id = attributes[:'fax_id']
146
+ end
147
+
148
+ if attributes.key?(:'title')
149
+ self.title = attributes[:'title']
150
+ end
151
+
152
+ if attributes.key?(:'original_title')
153
+ self.original_title = attributes[:'original_title']
154
+ end
155
+
156
+ if attributes.key?(:'subject')
157
+ self.subject = attributes[:'subject']
158
+ end
159
+
160
+ if attributes.key?(:'message')
161
+ self.message = attributes[:'message']
162
+ end
163
+
164
+ if attributes.key?(:'metadata')
165
+ if (value = attributes[:'metadata']).is_a?(Hash)
166
+ self.metadata = value
167
+ end
168
+ end
169
+
170
+ if attributes.key?(:'created_at')
171
+ self.created_at = attributes[:'created_at']
172
+ end
173
+
174
+ if attributes.key?(:'sender')
175
+ self.sender = attributes[:'sender']
176
+ end
177
+
178
+ if attributes.key?(:'transmissions')
179
+ if (value = attributes[:'transmissions']).is_a?(Array)
180
+ self.transmissions = value
181
+ end
182
+ end
183
+
184
+ if attributes.key?(:'files_url')
185
+ self.files_url = attributes[:'files_url']
186
+ end
187
+ end
188
+
189
+ # Show invalid properties with the reasons. Usually used together with valid?
190
+ # @return Array for valid properties with the reasons
191
+ def list_invalid_properties
192
+ invalid_properties = Array.new
193
+ if @fax_id.nil?
194
+ invalid_properties.push('invalid value for "fax_id", fax_id cannot be nil.')
195
+ end
196
+
197
+ if @title.nil?
198
+ invalid_properties.push('invalid value for "title", title cannot be nil.')
199
+ end
200
+
201
+ if @original_title.nil?
202
+ invalid_properties.push('invalid value for "original_title", original_title cannot be nil.')
203
+ end
204
+
205
+ if @subject.nil?
206
+ invalid_properties.push('invalid value for "subject", subject cannot be nil.')
207
+ end
208
+
209
+ if @message.nil?
210
+ invalid_properties.push('invalid value for "message", message cannot be nil.')
211
+ end
212
+
213
+ if @metadata.nil?
214
+ invalid_properties.push('invalid value for "metadata", metadata cannot be nil.')
215
+ end
216
+
217
+ if @created_at.nil?
218
+ invalid_properties.push('invalid value for "created_at", created_at cannot be nil.')
219
+ end
220
+
221
+ if @sender.nil?
222
+ invalid_properties.push('invalid value for "sender", sender cannot be nil.')
223
+ end
224
+
225
+ if @transmissions.nil?
226
+ invalid_properties.push('invalid value for "transmissions", transmissions cannot be nil.')
227
+ end
228
+
229
+ if @files_url.nil?
230
+ invalid_properties.push('invalid value for "files_url", files_url cannot be nil.')
231
+ end
232
+
233
+ invalid_properties
234
+ end
235
+
236
+ # Check to see if the all the properties in the model are valid
237
+ # @return true if the model is valid
238
+ def valid?
239
+ return false if @fax_id.nil?
240
+ return false if @title.nil?
241
+ return false if @original_title.nil?
242
+ return false if @subject.nil?
243
+ return false if @message.nil?
244
+ return false if @metadata.nil?
245
+ return false if @created_at.nil?
246
+ return false if @sender.nil?
247
+ return false if @transmissions.nil?
248
+ return false if @files_url.nil?
249
+ true
250
+ end
251
+
252
+ # Checks equality by comparing each attribute.
253
+ # @param [Object] Object to be compared
254
+ def ==(o)
255
+ return true if self.equal?(o)
256
+ self.class == o.class &&
257
+ fax_id == o.fax_id &&
258
+ title == o.title &&
259
+ original_title == o.original_title &&
260
+ subject == o.subject &&
261
+ message == o.message &&
262
+ metadata == o.metadata &&
263
+ created_at == o.created_at &&
264
+ sender == o.sender &&
265
+ transmissions == o.transmissions &&
266
+ files_url == o.files_url
267
+ end
268
+
269
+ # @see the `==` method
270
+ # @param [Object] Object to be compared
271
+ def eql?(o)
272
+ self == o
273
+ end
274
+
275
+ # Calculates hash code according to all attributes.
276
+ # @return [Integer] Hash code
277
+ def hash
278
+ [fax_id, title, original_title, subject, message, metadata, created_at, sender, transmissions, files_url].hash
279
+ end
280
+
281
+ # Builds the object from hash
282
+ # @param [Hash] attributes Model attributes in the form of hash
283
+ # @return [Object] Returns the model itself
284
+ def self.build_from_hash(attributes)
285
+ new.build_from_hash(attributes)
286
+ end
287
+
288
+ # Builds the object from hash
289
+ # @param [Hash] attributes Model attributes in the form of hash
290
+ # @return [Object] Returns the model itself
291
+ def build_from_hash(attributes)
292
+ return nil unless attributes.is_a?(Hash)
293
+ attribute_map = self.class.merged_attributes
294
+
295
+ self.class.merged_types.each_pair do |key, type|
296
+ if type =~ /\AArray<(.*)>/i
297
+ # check to ensure the input is an array given that the attribute
298
+ # is documented as an array but the input is not
299
+ if attributes[attribute_map[key]].is_a?(Array)
300
+ self.send("#{key}=", attributes[attribute_map[key]].map { |v| _deserialize($1, v) })
301
+ end
302
+ elsif !attributes[attribute_map[key]].nil?
303
+ self.send("#{key}=", _deserialize(type, attributes[attribute_map[key]]))
304
+ end
305
+ end
306
+
307
+ self
308
+ end
309
+
310
+ # Deserializes the data based on type
311
+ # @param string type Data type
312
+ # @param string value Value to be deserialized
313
+ # @return [Object] Deserialized data
314
+ def _deserialize(type, value)
315
+ case type.to_sym
316
+ when :Time
317
+ Time.parse(value)
318
+ when :Date
319
+ Date.parse(value)
320
+ when :String
321
+ value.to_s
322
+ when :Integer
323
+ value.to_i
324
+ when :Float
325
+ value.to_f
326
+ when :Boolean
327
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
328
+ true
329
+ else
330
+ false
331
+ end
332
+ when :Object
333
+ # generic object (usually a Hash), return directly
334
+ value
335
+ when /\AArray<(?<inner_type>.+)>\z/
336
+ inner_type = Regexp.last_match[:inner_type]
337
+ value.map { |v| _deserialize(inner_type, v) }
338
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
339
+ k_type = Regexp.last_match[:k_type]
340
+ v_type = Regexp.last_match[:v_type]
341
+ {}.tap do |hash|
342
+ value.each do |k, v|
343
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
344
+ end
345
+ end
346
+ else # model
347
+ klass = Dropbox::Sign.const_get(type)
348
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
349
+ end
350
+ end
351
+
352
+ # Returns the string representation of the object
353
+ # @return [String] String presentation of the object
354
+ def to_s
355
+ to_hash.to_s
356
+ end
357
+
358
+ # to_body is an alias to to_hash (backward compatibility)
359
+ # @return [Hash] Returns the object in the form of hash
360
+ def to_body
361
+ to_hash
362
+ end
363
+
364
+ # Returns the object in the form of hash
365
+ # @return [Hash] Returns the object in the form of hash
366
+ def to_hash(include_nil = true)
367
+ hash = {}
368
+ self.class.merged_attributes.each_pair do |attr, param|
369
+ value = self.send(attr)
370
+ if value.nil?
371
+ next unless include_nil
372
+ is_nullable = self.class.merged_nullable.include?(attr)
373
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
374
+ end
375
+
376
+ hash[param] = _to_hash(value, include_nil)
377
+ end
378
+ hash
379
+ end
380
+
381
+ # Outputs non-array value in the form of hash
382
+ # For object, use to_hash. Otherwise, just return the value
383
+ # @param [Object] value Any valid value
384
+ # @return [Hash] Returns the value in the form of hash
385
+ def _to_hash(value, include_nil = true)
386
+ if value.is_a?(Array)
387
+ value.compact.map { |v| _to_hash(v, include_nil) }
388
+ elsif value.is_a?(Hash)
389
+ {}.tap do |hash|
390
+ value.each { |k, v| hash[k] = _to_hash(v, include_nil) }
391
+ end
392
+ elsif value.respond_to? :to_hash
393
+ value.to_hash(include_nil)
394
+ else
395
+ value
396
+ end
397
+ end
398
+ end
399
+ end