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
@@ -7,4 +7,5 @@ This class extends `TemplateResponseDocumentFormFieldBase`
7
7
  | Name | Type | Description | Notes |
8
8
  | ---- | ---- | ----------- | ----- |
9
9
  | `type`<sup>*_required_</sup> | ```String``` | The type of this form field. See [field types](/api/reference/constants/#field-types).<br><br>* Text Field uses `TemplateResponseDocumentFormFieldText`<br>* Dropdown Field uses `TemplateResponseDocumentFormFieldDropdown`<br>* Hyperlink Field uses `TemplateResponseDocumentFormFieldHyperlink`<br>* Checkbox Field uses `TemplateResponseDocumentFormFieldCheckbox`<br>* Radio Field uses `TemplateResponseDocumentFormFieldRadio`<br>* Signature Field uses `TemplateResponseDocumentFormFieldSignature`<br>* Date Signed Field uses `TemplateResponseDocumentFormFieldDateSigned`<br>* Initials Field uses `TemplateResponseDocumentFormFieldInitials` | [default to 'dropdown'] |
10
+ | `group` | ```String``` | The name of the group this field is in. If this field is not a group, this defaults to `null` except for Radio fields. | |
10
11
 
@@ -11,4 +11,5 @@ This class extends `TemplateResponseDocumentFormFieldBase`
11
11
  | `is_multiline` | ```Boolean``` | Whether this form field is multiline text. | |
12
12
  | `original_font_size` | ```Integer``` | Original font size used in this form field&#39;s text. | |
13
13
  | `font_family` | ```String``` | Font family used in this form field&#39;s text. | |
14
+ | `group` | ```String``` | The name of the group this field is in. If this field is not a group, this defaults to `null` except for Radio fields. | |
14
15
 
@@ -7,4 +7,5 @@ This class extends `TemplateResponseDocumentFormFieldBase`
7
7
  | Name | Type | Description | Notes |
8
8
  | ---- | ---- | ----------- | ----- |
9
9
  | `type`<sup>*_required_</sup> | ```String``` | The type of this form field. See [field types](/api/reference/constants/#field-types).<br><br>* Text Field uses `TemplateResponseDocumentFormFieldText`<br>* Dropdown Field uses `TemplateResponseDocumentFormFieldDropdown`<br>* Hyperlink Field uses `TemplateResponseDocumentFormFieldHyperlink`<br>* Checkbox Field uses `TemplateResponseDocumentFormFieldCheckbox`<br>* Radio Field uses `TemplateResponseDocumentFormFieldRadio`<br>* Signature Field uses `TemplateResponseDocumentFormFieldSignature`<br>* Date Signed Field uses `TemplateResponseDocumentFormFieldDateSigned`<br>* Initials Field uses `TemplateResponseDocumentFormFieldInitials` | [default to 'initials'] |
10
+ | `group` | ```String``` | The name of the group this field is in. If this field is not a group, this defaults to `null` except for Radio fields. | |
10
11
 
@@ -7,4 +7,5 @@ This class extends `TemplateResponseDocumentFormFieldBase`
7
7
  | Name | Type | Description | Notes |
8
8
  | ---- | ---- | ----------- | ----- |
9
9
  | `type`<sup>*_required_</sup> | ```String``` | The type of this form field. See [field types](/api/reference/constants/#field-types).<br><br>* Text Field uses `TemplateResponseDocumentFormFieldText`<br>* Dropdown Field uses `TemplateResponseDocumentFormFieldDropdown`<br>* Hyperlink Field uses `TemplateResponseDocumentFormFieldHyperlink`<br>* Checkbox Field uses `TemplateResponseDocumentFormFieldCheckbox`<br>* Radio Field uses `TemplateResponseDocumentFormFieldRadio`<br>* Signature Field uses `TemplateResponseDocumentFormFieldSignature`<br>* Date Signed Field uses `TemplateResponseDocumentFormFieldDateSigned`<br>* Initials Field uses `TemplateResponseDocumentFormFieldInitials` | [default to 'radio'] |
10
+ | `group`<sup>*_required_</sup> | ```String``` | The name of the group this field is in. If this field is not a group, this defaults to `null` except for Radio fields. | |
10
11
 
@@ -7,4 +7,5 @@ This class extends `TemplateResponseDocumentFormFieldBase`
7
7
  | Name | Type | Description | Notes |
8
8
  | ---- | ---- | ----------- | ----- |
9
9
  | `type`<sup>*_required_</sup> | ```String``` | The type of this form field. See [field types](/api/reference/constants/#field-types).<br><br>* Text Field uses `TemplateResponseDocumentFormFieldText`<br>* Dropdown Field uses `TemplateResponseDocumentFormFieldDropdown`<br>* Hyperlink Field uses `TemplateResponseDocumentFormFieldHyperlink`<br>* Checkbox Field uses `TemplateResponseDocumentFormFieldCheckbox`<br>* Radio Field uses `TemplateResponseDocumentFormFieldRadio`<br>* Signature Field uses `TemplateResponseDocumentFormFieldSignature`<br>* Date Signed Field uses `TemplateResponseDocumentFormFieldDateSigned`<br>* Initials Field uses `TemplateResponseDocumentFormFieldInitials` | [default to 'signature'] |
10
+ | `group` | ```String``` | The name of the group this field is in. If this field is not a group, this defaults to `null` except for Radio fields. | |
10
11
 
@@ -12,4 +12,5 @@ This class extends `TemplateResponseDocumentFormFieldBase`
12
12
  | `original_font_size` | ```Integer``` | Original font size used in this form field&#39;s text. | |
13
13
  | `font_family` | ```String``` | Font family used in this form field&#39;s text. | |
14
14
  | `validation_type` | ```String``` | 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. | |
15
+ | `group` | ```String``` | The name of the group this field is in. If this field is not a group, this defaults to `null` except for Radio fields. | |
15
16
 
@@ -0,0 +1,14 @@
1
+ require "dropbox-sign"
2
+
3
+ Dropbox::Sign.configure do |config|
4
+ # Configure HTTP basic authorization: api_key
5
+ config.username = "YOUR_API_KEY"
6
+ end
7
+
8
+ fax_api = Dropbox::Sign::FaxApi.new
9
+
10
+ begin
11
+ fax_api.fax_delete("fa5c8a0b0f492d768749333ad6fcc214c111e967")
12
+ rescue Dropbox::Sign::ApiError => e
13
+ puts "Exception when calling Dropbox Sign API: #{e}"
14
+ end
@@ -0,0 +1,17 @@
1
+ require "dropbox-sign"
2
+
3
+ Dropbox::Sign.configure do |config|
4
+ # Configure HTTP basic authorization: api_key
5
+ config.username = "YOUR_API_KEY"
6
+ end
7
+
8
+ fax_api = Dropbox::Sign::FaxApi.new
9
+
10
+ faxId = "fa5c8a0b0f492d768749333ad6fcc214c111e967"
11
+
12
+ begin
13
+ file_bin = fax_api.fax_files(data)
14
+ FileUtils.cp(file_bin.path, "path/to/file.pdf")
15
+ rescue Dropbox::Sign::ApiError => e
16
+ puts "Exception when calling Dropbox Sign API: #{e}"
17
+ end
@@ -0,0 +1,17 @@
1
+ require "dropbox-sign"
2
+
3
+ Dropbox::Sign.configure do |config|
4
+ # Configure HTTP basic authorization: api_key
5
+ config.username = "YOUR_API_KEY"
6
+ end
7
+
8
+ fax_api = Dropbox::Sign::FaxApi.new
9
+
10
+ fax_id = "fa5c8a0b0f492d768749333ad6fcc214c111e967"
11
+
12
+ begin
13
+ result = fax_api.fax_get(fax_id)
14
+ p result
15
+ rescue Dropbox::Sign::ApiError => e
16
+ puts "Exception when calling Dropbox Sign API: #{e}"
17
+ end
@@ -0,0 +1,18 @@
1
+ require "dropbox-sign"
2
+
3
+ Dropbox::Sign.configure do |config|
4
+ # Configure HTTP basic authorization: api_key
5
+ config.username = "YOUR_API_KEY"
6
+ end
7
+
8
+ fax_api = Dropbox::Sign::FaxApi.new
9
+
10
+ page = 1
11
+ page_size = 2
12
+
13
+ begin
14
+ result = fax_api.fax_list({ page: page, page_size: page_size })
15
+ p result
16
+ rescue Dropbox::Sign::ApiError => e
17
+ puts "Exception when calling Dropbox Sign API: #{e}"
18
+ end
@@ -0,0 +1,25 @@
1
+ require "dropbox-sign"
2
+
3
+ Dropbox::Sign.configure do |config|
4
+ # Configure HTTP basic authorization: api_key
5
+ config.username = "YOUR_API_KEY"
6
+ end
7
+
8
+ fax_api = Dropbox::Sign::FaxApi.new
9
+
10
+ data = Dropbox::Sign::FaxSendRequest.new
11
+ data.files = [File.new("example_signature_request.pdf", "r")]
12
+ data.test_mode = true
13
+ data.recipient = "16690000001"
14
+ data.sender = "16690000000"
15
+ data.cover_page_to = "Jill Fax"
16
+ data.cover_page_message = "I'm sending you a fax!"
17
+ data.cover_page_from = "Faxer Faxerson"
18
+ data.title = "This is what the fax is about!"
19
+
20
+ begin
21
+ result = fax_api.fax_send(data)
22
+ p result
23
+ rescue Dropbox::Sign::ApiError => e
24
+ puts "Exception when calling Dropbox Sign API: #{e}"
25
+ end
@@ -0,0 +1,495 @@
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 'cgi'
14
+
15
+ module Dropbox
16
+ end
17
+
18
+ module Dropbox::Sign
19
+ class FaxApi
20
+ attr_accessor :api_client
21
+
22
+ def initialize(api_client = ApiClient.default)
23
+ @api_client = api_client
24
+ end
25
+ # Delete Fax
26
+ # Deletes the specified Fax from the system.
27
+ # @param fax_id [String] Fax ID
28
+ # @param [Hash] opts the optional parameters
29
+ # @return [nil]
30
+ def fax_delete(fax_id, opts = {})
31
+ fax_delete_with_http_info(fax_id, opts)
32
+ nil
33
+ end
34
+
35
+ # Delete Fax
36
+ # Deletes the specified Fax from the system.
37
+ # @param fax_id [String] Fax ID
38
+ # @param [Hash] opts the optional parameters
39
+ # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
40
+ def fax_delete_with_http_info(fax_id, opts = {})
41
+ if @api_client.config.debugging
42
+ @api_client.config.logger.debug 'Calling API: FaxApi.fax_delete ...'
43
+ end
44
+ # verify the required parameter 'fax_id' is set
45
+ if @api_client.config.client_side_validation && fax_id.nil?
46
+ fail ArgumentError, "Missing the required parameter 'fax_id' when calling FaxApi.fax_delete"
47
+ end
48
+ # resource path
49
+ local_var_path = '/fax/{fax_id}'.sub('{' + 'fax_id' + '}', CGI.escape(fax_id.to_s))
50
+
51
+ # query parameters
52
+ query_params = opts[:query_params] || {}
53
+
54
+ # header parameters
55
+ header_params = opts[:header_params] || {}
56
+ # HTTP header 'Accept' (if needed)
57
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
58
+
59
+ post_body = {}
60
+ form_params = opts[:form_params] || {}
61
+
62
+ # http body (model)
63
+ post_body = opts[:debug_body]
64
+
65
+ # return_type
66
+ return_type = opts[:debug_return_type]
67
+
68
+ # auth_names
69
+ auth_names = opts[:debug_auth_names] || ['api_key']
70
+
71
+ new_options = opts.merge(
72
+ :operation => :"FaxApi.fax_delete",
73
+ :header_params => header_params,
74
+ :query_params => query_params,
75
+ :form_params => form_params,
76
+ :body => post_body,
77
+ :auth_names => auth_names,
78
+ :return_type => return_type
79
+ )
80
+
81
+ begin
82
+ data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
83
+ rescue Dropbox::Sign::ApiError => e
84
+ end
85
+
86
+ if @api_client.config.debugging
87
+ @api_client.config.logger.debug "API called: FaxApi#fax_delete\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
88
+ end
89
+ return data, status_code, headers
90
+ end
91
+
92
+ # List Fax Files
93
+ # Returns list of fax files
94
+ # @param fax_id [String] Fax ID
95
+ # @param [Hash] opts the optional parameters
96
+ # @return [File]
97
+ def fax_files(fax_id, opts = {})
98
+ data, _status_code, _headers = fax_files_with_http_info(fax_id, opts)
99
+ data
100
+ end
101
+
102
+ # List Fax Files
103
+ # Returns list of fax files
104
+ # @param fax_id [String] Fax ID
105
+ # @param [Hash] opts the optional parameters
106
+ # @return [Array<(File, Integer, Hash)>] File data, response status code and response headers
107
+ def fax_files_with_http_info(fax_id, opts = {})
108
+ if @api_client.config.debugging
109
+ @api_client.config.logger.debug 'Calling API: FaxApi.fax_files ...'
110
+ end
111
+ # verify the required parameter 'fax_id' is set
112
+ if @api_client.config.client_side_validation && fax_id.nil?
113
+ fail ArgumentError, "Missing the required parameter 'fax_id' when calling FaxApi.fax_files"
114
+ end
115
+ # resource path
116
+ local_var_path = '/fax/files/{fax_id}'.sub('{' + 'fax_id' + '}', CGI.escape(fax_id.to_s))
117
+
118
+ # query parameters
119
+ query_params = opts[:query_params] || {}
120
+
121
+ # header parameters
122
+ header_params = opts[:header_params] || {}
123
+ # HTTP header 'Accept' (if needed)
124
+ header_params['Accept'] = @api_client.select_header_accept(['application/pdf', 'application/json']) unless header_params['Accept']
125
+
126
+ post_body = {}
127
+ form_params = opts[:form_params] || {}
128
+
129
+ # http body (model)
130
+ post_body = opts[:debug_body]
131
+
132
+ # return_type
133
+ return_type = opts[:debug_return_type] || 'File'
134
+
135
+ # auth_names
136
+ auth_names = opts[:debug_auth_names] || ['api_key']
137
+
138
+ new_options = opts.merge(
139
+ :operation => :"FaxApi.fax_files",
140
+ :header_params => header_params,
141
+ :query_params => query_params,
142
+ :form_params => form_params,
143
+ :body => post_body,
144
+ :auth_names => auth_names,
145
+ :return_type => return_type
146
+ )
147
+
148
+ begin
149
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
150
+ rescue Dropbox::Sign::ApiError => e
151
+ if e.code === 200
152
+ body = @api_client.convert_to_type(
153
+ JSON.parse("[#{e.response_body}]", :symbolize_names => true)[0],
154
+ "Dropbox::Sign::File"
155
+ )
156
+
157
+ fail ApiError.new(:code => e.code,
158
+ :response_headers => e.response_headers,
159
+ :response_body => body),
160
+ e.message
161
+ end
162
+
163
+ range_code = "4XX".split('').first
164
+ range_code_left = "#{range_code}00".to_i
165
+ range_code_right = "#{range_code}99".to_i
166
+ if e.code >= range_code_left && e.code <= range_code_right
167
+ body = @api_client.convert_to_type(
168
+ JSON.parse("[#{e.response_body}]", :symbolize_names => true)[0],
169
+ "Dropbox::Sign::ErrorResponse"
170
+ )
171
+
172
+ fail ApiError.new(:code => e.code,
173
+ :response_headers => e.response_headers,
174
+ :response_body => body),
175
+ e.message
176
+ end
177
+
178
+ end
179
+
180
+ if @api_client.config.debugging
181
+ @api_client.config.logger.debug "API called: FaxApi#fax_files\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
182
+ end
183
+ return data, status_code, headers
184
+ end
185
+
186
+ # Get Fax
187
+ # Returns information about fax
188
+ # @param fax_id [String] Fax ID
189
+ # @param [Hash] opts the optional parameters
190
+ # @return [FaxGetResponse]
191
+ def fax_get(fax_id, opts = {})
192
+ data, _status_code, _headers = fax_get_with_http_info(fax_id, opts)
193
+ data
194
+ end
195
+
196
+ # Get Fax
197
+ # Returns information about fax
198
+ # @param fax_id [String] Fax ID
199
+ # @param [Hash] opts the optional parameters
200
+ # @return [Array<(FaxGetResponse, Integer, Hash)>] FaxGetResponse data, response status code and response headers
201
+ def fax_get_with_http_info(fax_id, opts = {})
202
+ if @api_client.config.debugging
203
+ @api_client.config.logger.debug 'Calling API: FaxApi.fax_get ...'
204
+ end
205
+ # verify the required parameter 'fax_id' is set
206
+ if @api_client.config.client_side_validation && fax_id.nil?
207
+ fail ArgumentError, "Missing the required parameter 'fax_id' when calling FaxApi.fax_get"
208
+ end
209
+ # resource path
210
+ local_var_path = '/fax/{fax_id}'.sub('{' + 'fax_id' + '}', CGI.escape(fax_id.to_s))
211
+
212
+ # query parameters
213
+ query_params = opts[:query_params] || {}
214
+
215
+ # header parameters
216
+ header_params = opts[:header_params] || {}
217
+ # HTTP header 'Accept' (if needed)
218
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
219
+
220
+ post_body = {}
221
+ form_params = opts[:form_params] || {}
222
+
223
+ # http body (model)
224
+ post_body = opts[:debug_body]
225
+
226
+ # return_type
227
+ return_type = opts[:debug_return_type] || 'FaxGetResponse'
228
+
229
+ # auth_names
230
+ auth_names = opts[:debug_auth_names] || ['api_key']
231
+
232
+ new_options = opts.merge(
233
+ :operation => :"FaxApi.fax_get",
234
+ :header_params => header_params,
235
+ :query_params => query_params,
236
+ :form_params => form_params,
237
+ :body => post_body,
238
+ :auth_names => auth_names,
239
+ :return_type => return_type
240
+ )
241
+
242
+ begin
243
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
244
+ rescue Dropbox::Sign::ApiError => e
245
+ if e.code === 200
246
+ body = @api_client.convert_to_type(
247
+ JSON.parse("[#{e.response_body}]", :symbolize_names => true)[0],
248
+ "Dropbox::Sign::FaxGetResponse"
249
+ )
250
+
251
+ fail ApiError.new(:code => e.code,
252
+ :response_headers => e.response_headers,
253
+ :response_body => body),
254
+ e.message
255
+ end
256
+
257
+ range_code = "4XX".split('').first
258
+ range_code_left = "#{range_code}00".to_i
259
+ range_code_right = "#{range_code}99".to_i
260
+ if e.code >= range_code_left && e.code <= range_code_right
261
+ body = @api_client.convert_to_type(
262
+ JSON.parse("[#{e.response_body}]", :symbolize_names => true)[0],
263
+ "Dropbox::Sign::ErrorResponse"
264
+ )
265
+
266
+ fail ApiError.new(:code => e.code,
267
+ :response_headers => e.response_headers,
268
+ :response_body => body),
269
+ e.message
270
+ end
271
+
272
+ end
273
+
274
+ if @api_client.config.debugging
275
+ @api_client.config.logger.debug "API called: FaxApi#fax_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
276
+ end
277
+ return data, status_code, headers
278
+ end
279
+
280
+ # Lists Faxes
281
+ # Returns properties of multiple faxes
282
+ # @param [Hash] opts the optional parameters
283
+ # @option opts [Integer] :page Page (default to 1)
284
+ # @option opts [Integer] :page_size Page size (default to 20)
285
+ # @return [FaxListResponse]
286
+ def fax_list(opts = {})
287
+ data, _status_code, _headers = fax_list_with_http_info(opts)
288
+ data
289
+ end
290
+
291
+ # Lists Faxes
292
+ # Returns properties of multiple faxes
293
+ # @param [Hash] opts the optional parameters
294
+ # @option opts [Integer] :page Page (default to 1)
295
+ # @option opts [Integer] :page_size Page size (default to 20)
296
+ # @return [Array<(FaxListResponse, Integer, Hash)>] FaxListResponse data, response status code and response headers
297
+ def fax_list_with_http_info(opts = {})
298
+ if @api_client.config.debugging
299
+ @api_client.config.logger.debug 'Calling API: FaxApi.fax_list ...'
300
+ end
301
+ if @api_client.config.client_side_validation && !opts[:'page'].nil? && opts[:'page'] < 1
302
+ fail ArgumentError, 'invalid value for "opts[:"page"]" when calling FaxApi.fax_list, must be greater than or equal to 1.'
303
+ end
304
+
305
+ if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 100
306
+ fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling FaxApi.fax_list, must be smaller than or equal to 100.'
307
+ end
308
+
309
+ if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 1
310
+ fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling FaxApi.fax_list, must be greater than or equal to 1.'
311
+ end
312
+
313
+ # resource path
314
+ local_var_path = '/fax/list'
315
+
316
+ # query parameters
317
+ query_params = opts[:query_params] || {}
318
+ query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
319
+ query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil?
320
+
321
+ # header parameters
322
+ header_params = opts[:header_params] || {}
323
+ # HTTP header 'Accept' (if needed)
324
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
325
+
326
+ post_body = {}
327
+ form_params = opts[:form_params] || {}
328
+
329
+ # http body (model)
330
+ post_body = opts[:debug_body]
331
+
332
+ # return_type
333
+ return_type = opts[:debug_return_type] || 'FaxListResponse'
334
+
335
+ # auth_names
336
+ auth_names = opts[:debug_auth_names] || ['api_key']
337
+
338
+ new_options = opts.merge(
339
+ :operation => :"FaxApi.fax_list",
340
+ :header_params => header_params,
341
+ :query_params => query_params,
342
+ :form_params => form_params,
343
+ :body => post_body,
344
+ :auth_names => auth_names,
345
+ :return_type => return_type
346
+ )
347
+
348
+ begin
349
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
350
+ rescue Dropbox::Sign::ApiError => e
351
+ if e.code === 200
352
+ body = @api_client.convert_to_type(
353
+ JSON.parse("[#{e.response_body}]", :symbolize_names => true)[0],
354
+ "Dropbox::Sign::FaxListResponse"
355
+ )
356
+
357
+ fail ApiError.new(:code => e.code,
358
+ :response_headers => e.response_headers,
359
+ :response_body => body),
360
+ e.message
361
+ end
362
+
363
+ range_code = "4XX".split('').first
364
+ range_code_left = "#{range_code}00".to_i
365
+ range_code_right = "#{range_code}99".to_i
366
+ if e.code >= range_code_left && e.code <= range_code_right
367
+ body = @api_client.convert_to_type(
368
+ JSON.parse("[#{e.response_body}]", :symbolize_names => true)[0],
369
+ "Dropbox::Sign::ErrorResponse"
370
+ )
371
+
372
+ fail ApiError.new(:code => e.code,
373
+ :response_headers => e.response_headers,
374
+ :response_body => body),
375
+ e.message
376
+ end
377
+
378
+ end
379
+
380
+ if @api_client.config.debugging
381
+ @api_client.config.logger.debug "API called: FaxApi#fax_list\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
382
+ end
383
+ return data, status_code, headers
384
+ end
385
+
386
+ # Send Fax
387
+ # Action to prepare and send a fax
388
+ # @param fax_send_request [FaxSendRequest]
389
+ # @param [Hash] opts the optional parameters
390
+ # @return [FaxGetResponse]
391
+ def fax_send(fax_send_request, opts = {})
392
+ data, _status_code, _headers = fax_send_with_http_info(fax_send_request, opts)
393
+ data
394
+ end
395
+
396
+ # Send Fax
397
+ # Action to prepare and send a fax
398
+ # @param fax_send_request [FaxSendRequest]
399
+ # @param [Hash] opts the optional parameters
400
+ # @return [Array<(FaxGetResponse, Integer, Hash)>] FaxGetResponse data, response status code and response headers
401
+ def fax_send_with_http_info(fax_send_request, opts = {})
402
+ if @api_client.config.debugging
403
+ @api_client.config.logger.debug 'Calling API: FaxApi.fax_send ...'
404
+ end
405
+ # verify the required parameter 'fax_send_request' is set
406
+ if @api_client.config.client_side_validation && fax_send_request.nil?
407
+ fail ArgumentError, "Missing the required parameter 'fax_send_request' when calling FaxApi.fax_send"
408
+ end
409
+ # resource path
410
+ local_var_path = '/fax/send'
411
+
412
+ # query parameters
413
+ query_params = opts[:query_params] || {}
414
+
415
+ # header parameters
416
+ header_params = opts[:header_params] || {}
417
+ # HTTP header 'Accept' (if needed)
418
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
419
+ # HTTP header 'Content-Type'
420
+ content_type = @api_client.select_header_content_type(['application/json', 'multipart/form-data'])
421
+ if !content_type.nil?
422
+ header_params['Content-Type'] = content_type
423
+ end
424
+
425
+ post_body = {}
426
+ form_params = opts[:form_params] || {}
427
+ result = @api_client.generate_form_data(
428
+ fax_send_request,
429
+ Dropbox::Sign::FaxSendRequest.openapi_types
430
+ )
431
+
432
+ # form parameters
433
+ if result[:has_file]
434
+ form_params = opts[:form_params] || result[:params]
435
+ header_params['Content-Type'] = 'multipart/form-data'
436
+ else
437
+ # http body (model)
438
+ post_body = opts[:debug_body] || result[:params]
439
+ end
440
+
441
+ # return_type
442
+ return_type = opts[:debug_return_type] || 'FaxGetResponse'
443
+
444
+ # auth_names
445
+ auth_names = opts[:debug_auth_names] || ['api_key']
446
+
447
+ new_options = opts.merge(
448
+ :operation => :"FaxApi.fax_send",
449
+ :header_params => header_params,
450
+ :query_params => query_params,
451
+ :form_params => form_params,
452
+ :body => post_body,
453
+ :auth_names => auth_names,
454
+ :return_type => return_type
455
+ )
456
+
457
+ begin
458
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
459
+ rescue Dropbox::Sign::ApiError => e
460
+ if e.code === 200
461
+ body = @api_client.convert_to_type(
462
+ JSON.parse("[#{e.response_body}]", :symbolize_names => true)[0],
463
+ "Dropbox::Sign::FaxGetResponse"
464
+ )
465
+
466
+ fail ApiError.new(:code => e.code,
467
+ :response_headers => e.response_headers,
468
+ :response_body => body),
469
+ e.message
470
+ end
471
+
472
+ range_code = "4XX".split('').first
473
+ range_code_left = "#{range_code}00".to_i
474
+ range_code_right = "#{range_code}99".to_i
475
+ if e.code >= range_code_left && e.code <= range_code_right
476
+ body = @api_client.convert_to_type(
477
+ JSON.parse("[#{e.response_body}]", :symbolize_names => true)[0],
478
+ "Dropbox::Sign::ErrorResponse"
479
+ )
480
+
481
+ fail ApiError.new(:code => e.code,
482
+ :response_headers => e.response_headers,
483
+ :response_body => body),
484
+ e.message
485
+ end
486
+
487
+ end
488
+
489
+ if @api_client.config.debugging
490
+ @api_client.config.logger.debug "API called: FaxApi#fax_send\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
491
+ end
492
+ return data, status_code, headers
493
+ end
494
+ end
495
+ end
@@ -108,6 +108,20 @@ module Dropbox::Sign
108
108
  e.message
109
109
  end
110
110
 
111
+ range_code = "4XX".split('').first
112
+ range_code_left = "#{range_code}00".to_i
113
+ range_code_right = "#{range_code}99".to_i
114
+ if e.code >= range_code_left && e.code <= range_code_right
115
+ body = @api_client.convert_to_type(
116
+ JSON.parse("[#{e.response_body}]", :symbolize_names => true)[0],
117
+ "Dropbox::Sign::ErrorResponse"
118
+ )
119
+
120
+ fail ApiError.new(:code => e.code,
121
+ :response_headers => e.response_headers,
122
+ :response_body => body),
123
+ e.message
124
+ end
111
125
 
112
126
  end
113
127
 
@@ -203,6 +217,20 @@ module Dropbox::Sign
203
217
  e.message
204
218
  end
205
219
 
220
+ range_code = "4XX".split('').first
221
+ range_code_left = "#{range_code}00".to_i
222
+ range_code_right = "#{range_code}99".to_i
223
+ if e.code >= range_code_left && e.code <= range_code_right
224
+ body = @api_client.convert_to_type(
225
+ JSON.parse("[#{e.response_body}]", :symbolize_names => true)[0],
226
+ "Dropbox::Sign::ErrorResponse"
227
+ )
228
+
229
+ fail ApiError.new(:code => e.code,
230
+ :response_headers => e.response_headers,
231
+ :response_body => body),
232
+ e.message
233
+ end
206
234
 
207
235
  end
208
236