cloudmersive-convert-api-client 2.1.9 → 2.2.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (32) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +19 -7
  3. data/docs/DocumentEditingEditSession.md +9 -0
  4. data/docs/DocumentTransformEditSession.md +9 -0
  5. data/docs/DocxTableSingleTableFill.md +10 -0
  6. data/docs/DocxTableTableFillMultiRequest.md +10 -0
  7. data/docs/DocxTableTableFillRequest.md +12 -0
  8. data/docs/DocxTableTableFillTableCell.md +9 -0
  9. data/docs/DocxTableTableFillTableRow.md +8 -0
  10. data/docs/EditDocumentApi.md +58 -3
  11. data/docs/TransformDocumentApi.md +237 -6
  12. data/lib/cloudmersive-convert-api-client/api/edit_document_api.rb +56 -2
  13. data/lib/cloudmersive-convert-api-client/api/transform_document_api.rb +235 -4
  14. data/lib/cloudmersive-convert-api-client/models/document_editing_edit_session.rb +196 -0
  15. data/lib/cloudmersive-convert-api-client/models/document_transform_edit_session.rb +196 -0
  16. data/lib/cloudmersive-convert-api-client/models/docx_table_single_table_fill.rb +208 -0
  17. data/lib/cloudmersive-convert-api-client/models/docx_table_table_fill_multi_request.rb +223 -0
  18. data/lib/cloudmersive-convert-api-client/models/docx_table_table_fill_request.rb +243 -0
  19. data/lib/cloudmersive-convert-api-client/models/docx_table_table_fill_table_cell.rb +196 -0
  20. data/lib/cloudmersive-convert-api-client/models/docx_table_table_fill_table_row.rb +188 -0
  21. data/lib/cloudmersive-convert-api-client/version.rb +1 -1
  22. data/lib/cloudmersive-convert-api-client.rb +7 -0
  23. data/spec/api/edit_document_api_spec.rb +13 -1
  24. data/spec/api/transform_document_api_spec.rb +54 -2
  25. data/spec/models/document_editing_edit_session_spec.rb +47 -0
  26. data/spec/models/document_transform_edit_session_spec.rb +47 -0
  27. data/spec/models/docx_table_single_table_fill_spec.rb +53 -0
  28. data/spec/models/docx_table_table_fill_multi_request_spec.rb +53 -0
  29. data/spec/models/docx_table_table_fill_request_spec.rb +65 -0
  30. data/spec/models/docx_table_table_fill_table_cell_spec.rb +47 -0
  31. data/spec/models/docx_table_table_fill_table_row_spec.rb +41 -0
  32. metadata +23 -2
@@ -1700,7 +1700,7 @@ module CloudmersiveConvertApiClient
1700
1700
  end
1701
1701
  return data, status_code, headers
1702
1702
  end
1703
- # Replace multiple strings in Word DOCX document
1703
+ # Replace multiple strings in Word DOCX document, return result
1704
1704
  # Replace all instances of multiple strings in an Office Word Document (docx)
1705
1705
  # @param req_config Document string replacement configuration input
1706
1706
  # @param [Hash] opts the optional parameters
@@ -1710,7 +1710,7 @@ module CloudmersiveConvertApiClient
1710
1710
  data
1711
1711
  end
1712
1712
 
1713
- # Replace multiple strings in Word DOCX document
1713
+ # Replace multiple strings in Word DOCX document, return result
1714
1714
  # Replace all instances of multiple strings in an Office Word Document (docx)
1715
1715
  # @param req_config Document string replacement configuration input
1716
1716
  # @param [Hash] opts the optional parameters
@@ -1754,6 +1754,60 @@ module CloudmersiveConvertApiClient
1754
1754
  end
1755
1755
  return data, status_code, headers
1756
1756
  end
1757
+ # Replace multiple strings in Word DOCX document, return edit session
1758
+ # Replace all instances of multiple strings in an Office Word Document (docx). Returns an edit session URL so that you can chain together multiple edit operations without having to send the entire document contents back and forth multiple times. Call the Finish Editing API to retrieve the final document once editing is complete.
1759
+ # @param req_config Document string replacement configuration input
1760
+ # @param [Hash] opts the optional parameters
1761
+ # @return [DocumentEditingEditSession]
1762
+ def edit_document_docx_replace_multi_edit_session(req_config, opts = {})
1763
+ data, _status_code, _headers = edit_document_docx_replace_multi_edit_session_with_http_info(req_config, opts)
1764
+ data
1765
+ end
1766
+
1767
+ # Replace multiple strings in Word DOCX document, return edit session
1768
+ # Replace all instances of multiple strings in an Office Word Document (docx). Returns an edit session URL so that you can chain together multiple edit operations without having to send the entire document contents back and forth multiple times. Call the Finish Editing API to retrieve the final document once editing is complete.
1769
+ # @param req_config Document string replacement configuration input
1770
+ # @param [Hash] opts the optional parameters
1771
+ # @return [Array<(DocumentEditingEditSession, Fixnum, Hash)>] DocumentEditingEditSession data, response status code and response headers
1772
+ def edit_document_docx_replace_multi_edit_session_with_http_info(req_config, opts = {})
1773
+ if @api_client.config.debugging
1774
+ @api_client.config.logger.debug 'Calling API: EditDocumentApi.edit_document_docx_replace_multi_edit_session ...'
1775
+ end
1776
+ # verify the required parameter 'req_config' is set
1777
+ if @api_client.config.client_side_validation && req_config.nil?
1778
+ fail ArgumentError, "Missing the required parameter 'req_config' when calling EditDocumentApi.edit_document_docx_replace_multi_edit_session"
1779
+ end
1780
+ # resource path
1781
+ local_var_path = '/convert/edit/docx/replace-all/multi/edit-session'
1782
+
1783
+ # query parameters
1784
+ query_params = {}
1785
+
1786
+ # header parameters
1787
+ header_params = {}
1788
+ # HTTP header 'Accept' (if needed)
1789
+ header_params['Accept'] = @api_client.select_header_accept(['application/json', 'text/json', 'application/xml', 'text/xml'])
1790
+ # HTTP header 'Content-Type'
1791
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json', 'text/json', 'application/xml', 'text/xml', 'application/x-www-form-urlencoded'])
1792
+
1793
+ # form parameters
1794
+ form_params = {}
1795
+
1796
+ # http body (model)
1797
+ post_body = @api_client.object_to_http_body(req_config)
1798
+ auth_names = ['Apikey']
1799
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path,
1800
+ :header_params => header_params,
1801
+ :query_params => query_params,
1802
+ :form_params => form_params,
1803
+ :body => post_body,
1804
+ :auth_names => auth_names,
1805
+ :return_type => 'DocumentEditingEditSession')
1806
+ if @api_client.config.debugging
1807
+ @api_client.config.logger.debug "API called: EditDocumentApi#edit_document_docx_replace_multi_edit_session\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1808
+ end
1809
+ return data, status_code, headers
1810
+ end
1757
1811
  # Replace matching paragraphs in a Word DOCX document
1758
1812
  # Returns the edited Word Document (DOCX) format file with the matching paragraphs replaced as requested. Replace a paragraph with another object such as an image. Useful for performing templating operations.
1759
1813
  # @param req_config Document input request
@@ -19,7 +19,7 @@ module CloudmersiveConvertApiClient
19
19
  def initialize(api_client = ApiClient.default)
20
20
  @api_client = api_client
21
21
  end
22
- # Replace string in Word DOCX document
22
+ # Replace string in Word DOCX document, return result
23
23
  # Replace all instances of a string in an Office Word Document (docx)
24
24
  # @param match_string String to search for and match against, to be replaced
25
25
  # @param replace_string String to replace the matched values with
@@ -33,7 +33,7 @@ module CloudmersiveConvertApiClient
33
33
  data
34
34
  end
35
35
 
36
- # Replace string in Word DOCX document
36
+ # Replace string in Word DOCX document, return result
37
37
  # Replace all instances of a string in an Office Word Document (docx)
38
38
  # @param match_string String to search for and match against, to be replaced
39
39
  # @param replace_string String to replace the matched values with
@@ -88,7 +88,238 @@ module CloudmersiveConvertApiClient
88
88
  end
89
89
  return data, status_code, headers
90
90
  end
91
- # Replace string in PowerPoint PPTX presentation
91
+ # Replace string in Word DOCX document, return edit session
92
+ # Replace all instances of a string in an Office Word Document (docx). Returns an edit session URL so that you can chain together multiple edit operations without having to send the entire document contents back and forth multiple times. Call the Finish Editing API to retrieve the final document once editing is complete.
93
+ # @param match_string String to search for and match against, to be replaced
94
+ # @param replace_string String to replace the matched values with
95
+ # @param [Hash] opts the optional parameters
96
+ # @option opts [File] :input_file Optional: Input file to perform the operation on.
97
+ # @option opts [String] :input_file_url Optional: URL of a file to operate on as input. This can be a public URL, or you can also use the begin-editing API (part of EditDocumentApi) to upload a document and pass in the secure URL result from that operation as the URL here (this URL is not public).
98
+ # @option opts [BOOLEAN] :match_case Optional: True if the case should be matched, false for case insensitive match. Default is false.
99
+ # @return [DocumentTransformEditSession]
100
+ def transform_document_docx_replace_edit_session(match_string, replace_string, opts = {})
101
+ data, _status_code, _headers = transform_document_docx_replace_edit_session_with_http_info(match_string, replace_string, opts)
102
+ data
103
+ end
104
+
105
+ # Replace string in Word DOCX document, return edit session
106
+ # Replace all instances of a string in an Office Word Document (docx). Returns an edit session URL so that you can chain together multiple edit operations without having to send the entire document contents back and forth multiple times. Call the Finish Editing API to retrieve the final document once editing is complete.
107
+ # @param match_string String to search for and match against, to be replaced
108
+ # @param replace_string String to replace the matched values with
109
+ # @param [Hash] opts the optional parameters
110
+ # @option opts [File] :input_file Optional: Input file to perform the operation on.
111
+ # @option opts [String] :input_file_url Optional: URL of a file to operate on as input. This can be a public URL, or you can also use the begin-editing API (part of EditDocumentApi) to upload a document and pass in the secure URL result from that operation as the URL here (this URL is not public).
112
+ # @option opts [BOOLEAN] :match_case Optional: True if the case should be matched, false for case insensitive match. Default is false.
113
+ # @return [Array<(DocumentTransformEditSession, Fixnum, Hash)>] DocumentTransformEditSession data, response status code and response headers
114
+ def transform_document_docx_replace_edit_session_with_http_info(match_string, replace_string, opts = {})
115
+ if @api_client.config.debugging
116
+ @api_client.config.logger.debug 'Calling API: TransformDocumentApi.transform_document_docx_replace_edit_session ...'
117
+ end
118
+ # verify the required parameter 'match_string' is set
119
+ if @api_client.config.client_side_validation && match_string.nil?
120
+ fail ArgumentError, "Missing the required parameter 'match_string' when calling TransformDocumentApi.transform_document_docx_replace_edit_session"
121
+ end
122
+ # verify the required parameter 'replace_string' is set
123
+ if @api_client.config.client_side_validation && replace_string.nil?
124
+ fail ArgumentError, "Missing the required parameter 'replace_string' when calling TransformDocumentApi.transform_document_docx_replace_edit_session"
125
+ end
126
+ # resource path
127
+ local_var_path = '/convert/transform/docx/replace-all/edit-session'
128
+
129
+ # query parameters
130
+ query_params = {}
131
+
132
+ # header parameters
133
+ header_params = {}
134
+ # HTTP header 'Accept' (if needed)
135
+ header_params['Accept'] = @api_client.select_header_accept(['application/json', 'text/json', 'application/xml', 'text/xml'])
136
+ header_params[:'matchString'] = match_string
137
+ header_params[:'replaceString'] = replace_string
138
+ header_params[:'inputFileUrl'] = opts[:'input_file_url'] if !opts[:'input_file_url'].nil?
139
+ header_params[:'matchCase'] = opts[:'match_case'] if !opts[:'match_case'].nil?
140
+
141
+ # form parameters
142
+ form_params = {}
143
+ form_params['inputFile'] = opts[:'input_file'] if !opts[:'input_file'].nil?
144
+
145
+ # http body (model)
146
+ post_body = nil
147
+ auth_names = ['Apikey']
148
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path,
149
+ :header_params => header_params,
150
+ :query_params => query_params,
151
+ :form_params => form_params,
152
+ :body => post_body,
153
+ :auth_names => auth_names,
154
+ :return_type => 'DocumentTransformEditSession')
155
+ if @api_client.config.debugging
156
+ @api_client.config.logger.debug "API called: TransformDocumentApi#transform_document_docx_replace_edit_session\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
157
+ end
158
+ return data, status_code, headers
159
+ end
160
+ # Fill in data in a table in a Word DOCX document, return result
161
+ # Replace placeholder rows ina table in an Office Word Document (docx) using one or more templates
162
+ # @param request
163
+ # @param [Hash] opts the optional parameters
164
+ # @return [String]
165
+ def transform_document_docx_table_fill_in(request, opts = {})
166
+ data, _status_code, _headers = transform_document_docx_table_fill_in_with_http_info(request, opts)
167
+ data
168
+ end
169
+
170
+ # Fill in data in a table in a Word DOCX document, return result
171
+ # Replace placeholder rows ina table in an Office Word Document (docx) using one or more templates
172
+ # @param request
173
+ # @param [Hash] opts the optional parameters
174
+ # @return [Array<(String, Fixnum, Hash)>] String data, response status code and response headers
175
+ def transform_document_docx_table_fill_in_with_http_info(request, opts = {})
176
+ if @api_client.config.debugging
177
+ @api_client.config.logger.debug 'Calling API: TransformDocumentApi.transform_document_docx_table_fill_in ...'
178
+ end
179
+ # verify the required parameter 'request' is set
180
+ if @api_client.config.client_side_validation && request.nil?
181
+ fail ArgumentError, "Missing the required parameter 'request' when calling TransformDocumentApi.transform_document_docx_table_fill_in"
182
+ end
183
+ # resource path
184
+ local_var_path = '/convert/transform/docx/table/fill/data'
185
+
186
+ # query parameters
187
+ query_params = {}
188
+
189
+ # header parameters
190
+ header_params = {}
191
+ # HTTP header 'Accept' (if needed)
192
+ header_params['Accept'] = @api_client.select_header_accept(['application/octet-stream'])
193
+ # HTTP header 'Content-Type'
194
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json', 'text/json', 'application/xml', 'text/xml', 'application/x-www-form-urlencoded'])
195
+
196
+ # form parameters
197
+ form_params = {}
198
+
199
+ # http body (model)
200
+ post_body = @api_client.object_to_http_body(request)
201
+ auth_names = ['Apikey']
202
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path,
203
+ :header_params => header_params,
204
+ :query_params => query_params,
205
+ :form_params => form_params,
206
+ :body => post_body,
207
+ :auth_names => auth_names,
208
+ :return_type => 'String')
209
+ if @api_client.config.debugging
210
+ @api_client.config.logger.debug "API called: TransformDocumentApi#transform_document_docx_table_fill_in\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
211
+ end
212
+ return data, status_code, headers
213
+ end
214
+ # Fill in data in a table in a Word DOCX document, return edit session
215
+ # Replace placeholder rows ina table in an Office Word Document (docx) using one or more templates. Returns an edit session URL so that you can chain together multiple edit operations without having to send the entire document contents back and forth multiple times. Call the Finish Editing API to retrieve the final document once editing is complete.
216
+ # @param request
217
+ # @param [Hash] opts the optional parameters
218
+ # @return [DocumentTransformEditSession]
219
+ def transform_document_docx_table_fill_in_edit_session(request, opts = {})
220
+ data, _status_code, _headers = transform_document_docx_table_fill_in_edit_session_with_http_info(request, opts)
221
+ data
222
+ end
223
+
224
+ # Fill in data in a table in a Word DOCX document, return edit session
225
+ # Replace placeholder rows ina table in an Office Word Document (docx) using one or more templates. Returns an edit session URL so that you can chain together multiple edit operations without having to send the entire document contents back and forth multiple times. Call the Finish Editing API to retrieve the final document once editing is complete.
226
+ # @param request
227
+ # @param [Hash] opts the optional parameters
228
+ # @return [Array<(DocumentTransformEditSession, Fixnum, Hash)>] DocumentTransformEditSession data, response status code and response headers
229
+ def transform_document_docx_table_fill_in_edit_session_with_http_info(request, opts = {})
230
+ if @api_client.config.debugging
231
+ @api_client.config.logger.debug 'Calling API: TransformDocumentApi.transform_document_docx_table_fill_in_edit_session ...'
232
+ end
233
+ # verify the required parameter 'request' is set
234
+ if @api_client.config.client_side_validation && request.nil?
235
+ fail ArgumentError, "Missing the required parameter 'request' when calling TransformDocumentApi.transform_document_docx_table_fill_in_edit_session"
236
+ end
237
+ # resource path
238
+ local_var_path = '/convert/transform/docx/table/fill/data/edit-session'
239
+
240
+ # query parameters
241
+ query_params = {}
242
+
243
+ # header parameters
244
+ header_params = {}
245
+ # HTTP header 'Accept' (if needed)
246
+ header_params['Accept'] = @api_client.select_header_accept(['application/json', 'text/json', 'application/xml', 'text/xml'])
247
+ # HTTP header 'Content-Type'
248
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json', 'text/json', 'application/xml', 'text/xml', 'application/x-www-form-urlencoded'])
249
+
250
+ # form parameters
251
+ form_params = {}
252
+
253
+ # http body (model)
254
+ post_body = @api_client.object_to_http_body(request)
255
+ auth_names = ['Apikey']
256
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path,
257
+ :header_params => header_params,
258
+ :query_params => query_params,
259
+ :form_params => form_params,
260
+ :body => post_body,
261
+ :auth_names => auth_names,
262
+ :return_type => 'DocumentTransformEditSession')
263
+ if @api_client.config.debugging
264
+ @api_client.config.logger.debug "API called: TransformDocumentApi#transform_document_docx_table_fill_in_edit_session\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
265
+ end
266
+ return data, status_code, headers
267
+ end
268
+ # Fill in data in multiple tables in a Word DOCX document, return result
269
+ # Replace placeholder rows in multiple tables in an Office Word Document (docx) using one or more templates
270
+ # @param request
271
+ # @param [Hash] opts the optional parameters
272
+ # @return [Object]
273
+ def transform_document_docx_table_fill_in_multi(request, opts = {})
274
+ data, _status_code, _headers = transform_document_docx_table_fill_in_multi_with_http_info(request, opts)
275
+ data
276
+ end
277
+
278
+ # Fill in data in multiple tables in a Word DOCX document, return result
279
+ # Replace placeholder rows in multiple tables in an Office Word Document (docx) using one or more templates
280
+ # @param request
281
+ # @param [Hash] opts the optional parameters
282
+ # @return [Array<(Object, Fixnum, Hash)>] Object data, response status code and response headers
283
+ def transform_document_docx_table_fill_in_multi_with_http_info(request, opts = {})
284
+ if @api_client.config.debugging
285
+ @api_client.config.logger.debug 'Calling API: TransformDocumentApi.transform_document_docx_table_fill_in_multi ...'
286
+ end
287
+ # verify the required parameter 'request' is set
288
+ if @api_client.config.client_side_validation && request.nil?
289
+ fail ArgumentError, "Missing the required parameter 'request' when calling TransformDocumentApi.transform_document_docx_table_fill_in_multi"
290
+ end
291
+ # resource path
292
+ local_var_path = '/convert/transform/docx/table/fill/data/multi'
293
+
294
+ # query parameters
295
+ query_params = {}
296
+
297
+ # header parameters
298
+ header_params = {}
299
+ # HTTP header 'Accept' (if needed)
300
+ header_params['Accept'] = @api_client.select_header_accept(['application/octet-stream'])
301
+ # HTTP header 'Content-Type'
302
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json', 'text/json', 'application/xml', 'text/xml', 'application/x-www-form-urlencoded'])
303
+
304
+ # form parameters
305
+ form_params = {}
306
+
307
+ # http body (model)
308
+ post_body = @api_client.object_to_http_body(request)
309
+ auth_names = ['Apikey']
310
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path,
311
+ :header_params => header_params,
312
+ :query_params => query_params,
313
+ :form_params => form_params,
314
+ :body => post_body,
315
+ :auth_names => auth_names,
316
+ :return_type => 'Object')
317
+ if @api_client.config.debugging
318
+ @api_client.config.logger.debug "API called: TransformDocumentApi#transform_document_docx_table_fill_in_multi\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
319
+ end
320
+ return data, status_code, headers
321
+ end
322
+ # Replace string in PowerPoint PPTX presentation, return result
92
323
  # Replace all instances of a string in an Office PowerPoint Document (pptx)
93
324
  # @param match_string String to search for and match against, to be replaced
94
325
  # @param replace_string String to replace the matched values with
@@ -102,7 +333,7 @@ module CloudmersiveConvertApiClient
102
333
  data
103
334
  end
104
335
 
105
- # Replace string in PowerPoint PPTX presentation
336
+ # Replace string in PowerPoint PPTX presentation, return result
106
337
  # Replace all instances of a string in an Office PowerPoint Document (pptx)
107
338
  # @param match_string String to search for and match against, to be replaced
108
339
  # @param replace_string String to replace the matched values with
@@ -0,0 +1,196 @@
1
+ =begin
2
+ #convertapi
3
+
4
+ #Convert API lets you effortlessly convert file formats and types.
5
+
6
+ OpenAPI spec version: v1
7
+
8
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
9
+ Swagger Codegen version: 2.4.14
10
+
11
+ =end
12
+
13
+ require 'date'
14
+
15
+ module CloudmersiveConvertApiClient
16
+ # Active document editing session result. To retrieve the document, use the Finish Editing API.
17
+ class DocumentEditingEditSession
18
+ # True if the operation was successful, false otherwise
19
+ attr_accessor :successful
20
+
21
+ # Document editing session URL; in-memory temporary cache link with TTL (Time-to-Live expiration) of 30 minutes. To retrieve the document, use the Finish Editing API.
22
+ attr_accessor :edit_session_url
23
+
24
+ # Attribute mapping from ruby-style variable name to JSON key.
25
+ def self.attribute_map
26
+ {
27
+ :'successful' => :'Successful',
28
+ :'edit_session_url' => :'EditSessionURL'
29
+ }
30
+ end
31
+
32
+ # Attribute type mapping.
33
+ def self.swagger_types
34
+ {
35
+ :'successful' => :'BOOLEAN',
36
+ :'edit_session_url' => :'String'
37
+ }
38
+ end
39
+
40
+ # Initializes the object
41
+ # @param [Hash] attributes Model attributes in the form of hash
42
+ def initialize(attributes = {})
43
+ return unless attributes.is_a?(Hash)
44
+
45
+ # convert string to symbol for hash key
46
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
47
+
48
+ if attributes.has_key?(:'Successful')
49
+ self.successful = attributes[:'Successful']
50
+ end
51
+
52
+ if attributes.has_key?(:'EditSessionURL')
53
+ self.edit_session_url = attributes[:'EditSessionURL']
54
+ end
55
+ end
56
+
57
+ # Show invalid properties with the reasons. Usually used together with valid?
58
+ # @return Array for valid properties with the reasons
59
+ def list_invalid_properties
60
+ invalid_properties = Array.new
61
+ invalid_properties
62
+ end
63
+
64
+ # Check to see if the all the properties in the model are valid
65
+ # @return true if the model is valid
66
+ def valid?
67
+ true
68
+ end
69
+
70
+ # Checks equality by comparing each attribute.
71
+ # @param [Object] Object to be compared
72
+ def ==(o)
73
+ return true if self.equal?(o)
74
+ self.class == o.class &&
75
+ successful == o.successful &&
76
+ edit_session_url == o.edit_session_url
77
+ end
78
+
79
+ # @see the `==` method
80
+ # @param [Object] Object to be compared
81
+ def eql?(o)
82
+ self == o
83
+ end
84
+
85
+ # Calculates hash code according to all attributes.
86
+ # @return [Fixnum] Hash code
87
+ def hash
88
+ [successful, edit_session_url].hash
89
+ end
90
+
91
+ # Builds the object from hash
92
+ # @param [Hash] attributes Model attributes in the form of hash
93
+ # @return [Object] Returns the model itself
94
+ def build_from_hash(attributes)
95
+ return nil unless attributes.is_a?(Hash)
96
+ self.class.swagger_types.each_pair do |key, type|
97
+ if type =~ /\AArray<(.*)>/i
98
+ # check to ensure the input is an array given that the attribute
99
+ # is documented as an array but the input is not
100
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
101
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
102
+ end
103
+ elsif !attributes[self.class.attribute_map[key]].nil?
104
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
105
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
106
+ end
107
+
108
+ self
109
+ end
110
+
111
+ # Deserializes the data based on type
112
+ # @param string type Data type
113
+ # @param string value Value to be deserialized
114
+ # @return [Object] Deserialized data
115
+ def _deserialize(type, value)
116
+ case type.to_sym
117
+ when :DateTime
118
+ DateTime.parse(value)
119
+ when :Date
120
+ Date.parse(value)
121
+ when :String
122
+ value.to_s
123
+ when :Integer
124
+ value.to_i
125
+ when :Float
126
+ value.to_f
127
+ when :BOOLEAN
128
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
129
+ true
130
+ else
131
+ false
132
+ end
133
+ when :Object
134
+ # generic object (usually a Hash), return directly
135
+ value
136
+ when /\AArray<(?<inner_type>.+)>\z/
137
+ inner_type = Regexp.last_match[:inner_type]
138
+ value.map { |v| _deserialize(inner_type, v) }
139
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
140
+ k_type = Regexp.last_match[:k_type]
141
+ v_type = Regexp.last_match[:v_type]
142
+ {}.tap do |hash|
143
+ value.each do |k, v|
144
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
145
+ end
146
+ end
147
+ else # model
148
+ temp_model = CloudmersiveConvertApiClient.const_get(type).new
149
+ temp_model.build_from_hash(value)
150
+ end
151
+ end
152
+
153
+ # Returns the string representation of the object
154
+ # @return [String] String presentation of the object
155
+ def to_s
156
+ to_hash.to_s
157
+ end
158
+
159
+ # to_body is an alias to to_hash (backward compatibility)
160
+ # @return [Hash] Returns the object in the form of hash
161
+ def to_body
162
+ to_hash
163
+ end
164
+
165
+ # Returns the object in the form of hash
166
+ # @return [Hash] Returns the object in the form of hash
167
+ def to_hash
168
+ hash = {}
169
+ self.class.attribute_map.each_pair do |attr, param|
170
+ value = self.send(attr)
171
+ next if value.nil?
172
+ hash[param] = _to_hash(value)
173
+ end
174
+ hash
175
+ end
176
+
177
+ # Outputs non-array value in the form of hash
178
+ # For object, use to_hash. Otherwise, just return the value
179
+ # @param [Object] value Any valid value
180
+ # @return [Hash] Returns the value in the form of hash
181
+ def _to_hash(value)
182
+ if value.is_a?(Array)
183
+ value.compact.map { |v| _to_hash(v) }
184
+ elsif value.is_a?(Hash)
185
+ {}.tap do |hash|
186
+ value.each { |k, v| hash[k] = _to_hash(v) }
187
+ end
188
+ elsif value.respond_to? :to_hash
189
+ value.to_hash
190
+ else
191
+ value
192
+ end
193
+ end
194
+
195
+ end
196
+ end