Class: CloudmersiveConvertApiClient::ConvertDataApi

Inherits:
Object
  • Object
show all
Defined in:
lib/cloudmersive-convert-api-client/api/convert_data_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ ConvertDataApi

Returns a new instance of ConvertDataApi.



19
20
21
# File 'lib/cloudmersive-convert-api-client/api/convert_data_api.rb', line 19

def initialize(api_client = ApiClient.default)
  @api_client = api_client
end

Instance Attribute Details

#api_client ⇒ Object

Returns the value of attribute api_client.



17
18
19
# File 'lib/cloudmersive-convert-api-client/api/convert_data_api.rb', line 17

def api_client
  @api_client
end

Instance Method Details

#convert_data_csv_to_json(input_file, opts = {}) ⇒ Object

Convert CSV to JSON conversion Convert a CSV file to a JSON object array

Parameters:

  • input_file —

    Input file to perform the operation on.

  • opts (Hash) (defaults to: {}) —

    the optional parameters

Options Hash (opts):

  • :column_names_from_first_row (BOOLEAN) —

    Optional; If true, the first row will be used as the labels for the columns; if false, columns will be named Column0, Column1, etc. Default is true. Set to false if you are not using column headings, or have an irregular column structure.

Returns:

  • (Object)


28
29
30
31
# File 'lib/cloudmersive-convert-api-client/api/convert_data_api.rb', line 28

def convert_data_csv_to_json(input_file, opts = {})
  data, _status_code, _headers = convert_data_csv_to_json_with_http_info(input_file, opts)
  data
end

#convert_data_csv_to_json_with_http_info(input_file, opts = {}) ⇒ Array<(Object, Fixnum, Hash)>

Convert CSV to JSON conversion Convert a CSV file to a JSON object array

Parameters:

  • input_file —

    Input file to perform the operation on.

  • opts (Hash) (defaults to: {}) —

    the optional parameters

Options Hash (opts):

  • :column_names_from_first_row (BOOLEAN) —

    Optional; If true, the first row will be used as the labels for the columns; if false, columns will be named Column0, Column1, etc. Default is true. Set to false if you are not using column headings, or have an irregular column structure.

Returns:

  • (Array<(Object, Fixnum, Hash)>) —

    Object data, response status code and response headers



39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
# File 'lib/cloudmersive-convert-api-client/api/convert_data_api.rb', line 39

def convert_data_csv_to_json_with_http_info(input_file, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ConvertDataApi.convert_data_csv_to_json ...'
  end
  # verify the required parameter 'input_file' is set
  if @api_client.config.client_side_validation && input_file.nil?
    fail ArgumentError, "Missing the required parameter 'input_file' when calling ConvertDataApi.convert_data_csv_to_json"
  end
  # resource path
  local_var_path = '/convert/csv/to/json'

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['multipart/form-data'])
  header_params[:'columnNamesFromFirstRow'] = opts[:'column_names_from_first_row'] if !opts[:'column_names_from_first_row'].nil?

  # form parameters
  form_params = {}
  form_params['inputFile'] = input_file

  # http body (model)
  post_body = nil
  auth_names = ['Apikey']
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'Object')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ConvertDataApi#convert_data_csv_to_json\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#convert_data_json_to_xml(json_object, opts = {}) ⇒ String

Convert JSON to XML conversion Convert a JSON object into XML

Parameters:

  • json_object —

    Input JSON to convert to XML

  • opts (Hash) (defaults to: {}) —

    the optional parameters

Returns:

  • (String)


85
86
87
88
# File 'lib/cloudmersive-convert-api-client/api/convert_data_api.rb', line 85

def convert_data_json_to_xml(json_object, opts = {})
  data, _status_code, _headers = convert_data_json_to_xml_with_http_info(json_object, opts)
  data
end

#convert_data_json_to_xml_with_http_info(json_object, opts = {}) ⇒ Array<(String, Fixnum, Hash)>

Convert JSON to XML conversion Convert a JSON object into XML

Parameters:

  • json_object —

    Input JSON to convert to XML

  • opts (Hash) (defaults to: {}) —

    the optional parameters

Returns:

  • (Array<(String, Fixnum, Hash)>) —

    String data, response status code and response headers



95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
# File 'lib/cloudmersive-convert-api-client/api/convert_data_api.rb', line 95

def convert_data_json_to_xml_with_http_info(json_object, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ConvertDataApi.convert_data_json_to_xml ...'
  end
  # verify the required parameter 'json_object' is set
  if @api_client.config.client_side_validation && json_object.nil?
    fail ArgumentError, "Missing the required parameter 'json_object' when calling ConvertDataApi.convert_data_json_to_xml"
  end
  # resource path
  local_var_path = '/convert/json/to/xml'

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/xml'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json', 'text/json', 'application/xml', 'text/xml', 'application/x-www-form-urlencoded'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(json_object)
  auth_names = ['Apikey']
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'String')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ConvertDataApi#convert_data_json_to_xml\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#convert_data_xls_to_json(input_file, opts = {}) ⇒ Object

Convert Excel (97-2003) XLS to JSON conversion Convert an Excel (97-2003) XLS file to a JSON object array

Parameters:

  • input_file —

    Input file to perform the operation on.

  • opts (Hash) (defaults to: {}) —

    the optional parameters

Returns:

  • (Object)


139
140
141
142
# File 'lib/cloudmersive-convert-api-client/api/convert_data_api.rb', line 139

def convert_data_xls_to_json(input_file, opts = {})
  data, _status_code, _headers = convert_data_xls_to_json_with_http_info(input_file, opts)
  data
end

#convert_data_xls_to_json_with_http_info(input_file, opts = {}) ⇒ Array<(Object, Fixnum, Hash)>

Convert Excel (97-2003) XLS to JSON conversion Convert an Excel (97-2003) XLS file to a JSON object array

Parameters:

  • input_file —

    Input file to perform the operation on.

  • opts (Hash) (defaults to: {}) —

    the optional parameters

Returns:

  • (Array<(Object, Fixnum, Hash)>) —

    Object data, response status code and response headers



149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
# File 'lib/cloudmersive-convert-api-client/api/convert_data_api.rb', line 149

def convert_data_xls_to_json_with_http_info(input_file, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ConvertDataApi.convert_data_xls_to_json ...'
  end
  # verify the required parameter 'input_file' is set
  if @api_client.config.client_side_validation && input_file.nil?
    fail ArgumentError, "Missing the required parameter 'input_file' when calling ConvertDataApi.convert_data_xls_to_json"
  end
  # resource path
  local_var_path = '/convert/xls/to/json'

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['multipart/form-data'])

  # form parameters
  form_params = {}
  form_params['inputFile'] = input_file

  # http body (model)
  post_body = nil
  auth_names = ['Apikey']
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'Object')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ConvertDataApi#convert_data_xls_to_json\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#convert_data_xlsx_to_json(input_file, opts = {}) ⇒ Object

Convert Excel XLSX to JSON conversion Convert an Excel XLSX file to a JSON object array

Parameters:

  • input_file —

    Input file to perform the operation on.

  • opts (Hash) (defaults to: {}) —

    the optional parameters

Returns:

  • (Object)


194
195
196
197
# File 'lib/cloudmersive-convert-api-client/api/convert_data_api.rb', line 194

def convert_data_xlsx_to_json(input_file, opts = {})
  data, _status_code, _headers = convert_data_xlsx_to_json_with_http_info(input_file, opts)
  data
end

#convert_data_xlsx_to_json_with_http_info(input_file, opts = {}) ⇒ Array<(Object, Fixnum, Hash)>

Convert Excel XLSX to JSON conversion Convert an Excel XLSX file to a JSON object array

Parameters:

  • input_file —

    Input file to perform the operation on.

  • opts (Hash) (defaults to: {}) —

    the optional parameters

Returns:

  • (Array<(Object, Fixnum, Hash)>) —

    Object data, response status code and response headers



204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
# File 'lib/cloudmersive-convert-api-client/api/convert_data_api.rb', line 204

def convert_data_xlsx_to_json_with_http_info(input_file, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ConvertDataApi.convert_data_xlsx_to_json ...'
  end
  # verify the required parameter 'input_file' is set
  if @api_client.config.client_side_validation && input_file.nil?
    fail ArgumentError, "Missing the required parameter 'input_file' when calling ConvertDataApi.convert_data_xlsx_to_json"
  end
  # resource path
  local_var_path = '/convert/xlsx/to/json'

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['multipart/form-data'])

  # form parameters
  form_params = {}
  form_params['inputFile'] = input_file

  # http body (model)
  post_body = nil
  auth_names = ['Apikey']
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'Object')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ConvertDataApi#convert_data_xlsx_to_json\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#convert_data_xml_edit_add_attribute_with_x_path(input_file, x_path_expression, xml_attribute_name, xml_attribute_value, opts = {}) ⇒ XmlAddAttributeWithXPathResult

Adds an attribute to all XML nodes matching XPath expression Return the reuslts of editing an XML document by adding an attribute to all of the nodes that match an input XPath expression.

Parameters:

  • input_file —

    Input XML file to perform the operation on.

  • x_path_expression —

    Valid XML XPath query expression

  • xml_attribute_name —

    Name of the XML attribute to add

  • xml_attribute_value —

    Value of the XML attribute to add

  • opts (Hash) (defaults to: {}) —

    the optional parameters

Returns:



252
253
254
255
# File 'lib/cloudmersive-convert-api-client/api/convert_data_api.rb', line 252

def convert_data_xml_edit_add_attribute_with_x_path(input_file, x_path_expression, xml_attribute_name, xml_attribute_value, opts = {})
  data, _status_code, _headers = convert_data_xml_edit_add_attribute_with_x_path_with_http_info(input_file, x_path_expression, xml_attribute_name, xml_attribute_value, opts)
  data
end

#convert_data_xml_edit_add_attribute_with_x_path_with_http_info(input_file, x_path_expression, xml_attribute_name, xml_attribute_value, opts = {}) ⇒ Array<(XmlAddAttributeWithXPathResult, Fixnum, Hash)>

Adds an attribute to all XML nodes matching XPath expression Return the reuslts of editing an XML document by adding an attribute to all of the nodes that match an input XPath expression.

Parameters:

  • input_file —

    Input XML file to perform the operation on.

  • x_path_expression —

    Valid XML XPath query expression

  • xml_attribute_name —

    Name of the XML attribute to add

  • xml_attribute_value —

    Value of the XML attribute to add

  • opts (Hash) (defaults to: {}) —

    the optional parameters

Returns:



265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
# File 'lib/cloudmersive-convert-api-client/api/convert_data_api.rb', line 265

def convert_data_xml_edit_add_attribute_with_x_path_with_http_info(input_file, x_path_expression, xml_attribute_name, xml_attribute_value, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ConvertDataApi.convert_data_xml_edit_add_attribute_with_x_path ...'
  end
  # verify the required parameter 'input_file' is set
  if @api_client.config.client_side_validation && input_file.nil?
    fail ArgumentError, "Missing the required parameter 'input_file' when calling ConvertDataApi.convert_data_xml_edit_add_attribute_with_x_path"
  end
  # verify the required parameter 'x_path_expression' is set
  if @api_client.config.client_side_validation && x_path_expression.nil?
    fail ArgumentError, "Missing the required parameter 'x_path_expression' when calling ConvertDataApi.convert_data_xml_edit_add_attribute_with_x_path"
  end
  # verify the required parameter 'xml_attribute_name' is set
  if @api_client.config.client_side_validation && xml_attribute_name.nil?
    fail ArgumentError, "Missing the required parameter 'xml_attribute_name' when calling ConvertDataApi.convert_data_xml_edit_add_attribute_with_x_path"
  end
  # verify the required parameter 'xml_attribute_value' is set
  if @api_client.config.client_side_validation && xml_attribute_value.nil?
    fail ArgumentError, "Missing the required parameter 'xml_attribute_value' when calling ConvertDataApi.convert_data_xml_edit_add_attribute_with_x_path"
  end
  # resource path
  local_var_path = '/convert/xml/edit/xpath/add-attribute'

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json', 'text/json', 'application/xml', 'text/xml'])
  header_params[:'XPathExpression'] = x_path_expression
  header_params[:'XmlAttributeName'] = xml_attribute_name
  header_params[:'XmlAttributeValue'] = xml_attribute_value

  # form parameters
  form_params = {}
  form_params['inputFile'] = input_file

  # http body (model)
  post_body = nil
  auth_names = ['Apikey']
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'XmlAddAttributeWithXPathResult')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ConvertDataApi#convert_data_xml_edit_add_attribute_with_x_path\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#convert_data_xml_edit_add_child_with_x_path(input_file, x_path_expression, xml_node_to_add, opts = {}) ⇒ XmlAddChildWithXPathResult

Adds an XML node as a child to XML nodes matching XPath expression Return the reuslts of editing an XML document by adding an XML node as a child to all of the nodes that match an input XPath expression.

Parameters:

  • input_file —

    Input XML file to perform the operation on.

  • x_path_expression —

    Valid XML XPath query expression

  • xml_node_to_add —

    XML Node to add as a child

  • opts (Hash) (defaults to: {}) —

    the optional parameters

Returns:



325
326
327
328
# File 'lib/cloudmersive-convert-api-client/api/convert_data_api.rb', line 325

def convert_data_xml_edit_add_child_with_x_path(input_file, x_path_expression, xml_node_to_add, opts = {})
  data, _status_code, _headers = convert_data_xml_edit_add_child_with_x_path_with_http_info(input_file, x_path_expression, xml_node_to_add, opts)
  data
end

#convert_data_xml_edit_add_child_with_x_path_with_http_info(input_file, x_path_expression, xml_node_to_add, opts = {}) ⇒ Array<(XmlAddChildWithXPathResult, Fixnum, Hash)>

Adds an XML node as a child to XML nodes matching XPath expression Return the reuslts of editing an XML document by adding an XML node as a child to all of the nodes that match an input XPath expression.

Parameters:

  • input_file —

    Input XML file to perform the operation on.

  • x_path_expression —

    Valid XML XPath query expression

  • xml_node_to_add —

    XML Node to add as a child

  • opts (Hash) (defaults to: {}) —

    the optional parameters

Returns:

  • (Array<(XmlAddChildWithXPathResult, Fixnum, Hash)>) —

    XmlAddChildWithXPathResult data, response status code and response headers



337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
# File 'lib/cloudmersive-convert-api-client/api/convert_data_api.rb', line 337

def convert_data_xml_edit_add_child_with_x_path_with_http_info(input_file, x_path_expression, xml_node_to_add, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ConvertDataApi.convert_data_xml_edit_add_child_with_x_path ...'
  end
  # verify the required parameter 'input_file' is set
  if @api_client.config.client_side_validation && input_file.nil?
    fail ArgumentError, "Missing the required parameter 'input_file' when calling ConvertDataApi.convert_data_xml_edit_add_child_with_x_path"
  end
  # verify the required parameter 'x_path_expression' is set
  if @api_client.config.client_side_validation && x_path_expression.nil?
    fail ArgumentError, "Missing the required parameter 'x_path_expression' when calling ConvertDataApi.convert_data_xml_edit_add_child_with_x_path"
  end
  # verify the required parameter 'xml_node_to_add' is set
  if @api_client.config.client_side_validation && xml_node_to_add.nil?
    fail ArgumentError, "Missing the required parameter 'xml_node_to_add' when calling ConvertDataApi.convert_data_xml_edit_add_child_with_x_path"
  end
  # resource path
  local_var_path = '/convert/xml/edit/xpath/add-child'

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json', 'text/json', 'application/xml', 'text/xml'])
  header_params[:'XPathExpression'] = x_path_expression
  header_params[:'XmlNodeToAdd'] = xml_node_to_add

  # form parameters
  form_params = {}
  form_params['inputFile'] = input_file

  # http body (model)
  post_body = nil
  auth_names = ['Apikey']
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'XmlAddChildWithXPathResult')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ConvertDataApi#convert_data_xml_edit_add_child_with_x_path\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#convert_data_xml_edit_remove_all_child_nodes_with_x_path(input_file, x_path_expression, opts = {}) ⇒ XmlRemoveAllChildrenWithXPathResult

Removes, deletes all children of nodes matching XPath expression, but does not remove the nodes Return the reuslts of editing an XML document by removing all child nodes of the nodes that match an input XPath expression.

Parameters:

  • input_file —

    Input XML file to perform the operation on.

  • x_path_expression —

    Valid XML XPath query expression

  • opts (Hash) (defaults to: {}) —

    the optional parameters

Returns:



391
392
393
394
# File 'lib/cloudmersive-convert-api-client/api/convert_data_api.rb', line 391

def convert_data_xml_edit_remove_all_child_nodes_with_x_path(input_file, x_path_expression, opts = {})
  data, _status_code, _headers = convert_data_xml_edit_remove_all_child_nodes_with_x_path_with_http_info(input_file, x_path_expression, opts)
  data
end

#convert_data_xml_edit_remove_all_child_nodes_with_x_path_with_http_info(input_file, x_path_expression, opts = {}) ⇒ Array<(XmlRemoveAllChildrenWithXPathResult, Fixnum, Hash)>

Removes, deletes all children of nodes matching XPath expression, but does not remove the nodes Return the reuslts of editing an XML document by removing all child nodes of the nodes that match an input XPath expression.

Parameters:

  • input_file —

    Input XML file to perform the operation on.

  • x_path_expression —

    Valid XML XPath query expression

  • opts (Hash) (defaults to: {}) —

    the optional parameters

Returns:



402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
# File 'lib/cloudmersive-convert-api-client/api/convert_data_api.rb', line 402

def convert_data_xml_edit_remove_all_child_nodes_with_x_path_with_http_info(input_file, x_path_expression, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ConvertDataApi.convert_data_xml_edit_remove_all_child_nodes_with_x_path ...'
  end
  # verify the required parameter 'input_file' is set
  if @api_client.config.client_side_validation && input_file.nil?
    fail ArgumentError, "Missing the required parameter 'input_file' when calling ConvertDataApi.convert_data_xml_edit_remove_all_child_nodes_with_x_path"
  end
  # verify the required parameter 'x_path_expression' is set
  if @api_client.config.client_side_validation && x_path_expression.nil?
    fail ArgumentError, "Missing the required parameter 'x_path_expression' when calling ConvertDataApi.convert_data_xml_edit_remove_all_child_nodes_with_x_path"
  end
  # resource path
  local_var_path = '/convert/xml/edit/xpath/remove-all-children'

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json', 'text/json', 'application/xml', 'text/xml'])
  header_params[:'XPathExpression'] = x_path_expression

  # form parameters
  form_params = {}
  form_params['inputFile'] = input_file

  # http body (model)
  post_body = nil
  auth_names = ['Apikey']
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'XmlRemoveAllChildrenWithXPathResult')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ConvertDataApi#convert_data_xml_edit_remove_all_child_nodes_with_x_path\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#convert_data_xml_edit_replace_with_x_path(input_file, x_path_expression, xml_node_replacement, opts = {}) ⇒ XmlReplaceWithXPathResult

Replaces XML nodes matching XPath expression with new node Return the reuslts of editing an XML document by replacing all of the nodes that match an input XPath expression with a new XML node expression.

Parameters:

  • input_file —

    Input XML file to perform the operation on.

  • x_path_expression —

    Valid XML XPath query expression

  • xml_node_replacement —

    XML Node replacement content

  • opts (Hash) (defaults to: {}) —

    the optional parameters

Returns:



452
453
454
455
# File 'lib/cloudmersive-convert-api-client/api/convert_data_api.rb', line 452

def convert_data_xml_edit_replace_with_x_path(input_file, x_path_expression, xml_node_replacement, opts = {})
  data, _status_code, _headers = convert_data_xml_edit_replace_with_x_path_with_http_info(input_file, x_path_expression, xml_node_replacement, opts)
  data
end

#convert_data_xml_edit_replace_with_x_path_with_http_info(input_file, x_path_expression, xml_node_replacement, opts = {}) ⇒ Array<(XmlReplaceWithXPathResult, Fixnum, Hash)>

Replaces XML nodes matching XPath expression with new node Return the reuslts of editing an XML document by replacing all of the nodes that match an input XPath expression with a new XML node expression.

Parameters:

  • input_file —

    Input XML file to perform the operation on.

  • x_path_expression —

    Valid XML XPath query expression

  • xml_node_replacement —

    XML Node replacement content

  • opts (Hash) (defaults to: {}) —

    the optional parameters

Returns:

  • (Array<(XmlReplaceWithXPathResult, Fixnum, Hash)>) —

    XmlReplaceWithXPathResult data, response status code and response headers



464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
# File 'lib/cloudmersive-convert-api-client/api/convert_data_api.rb', line 464

def convert_data_xml_edit_replace_with_x_path_with_http_info(input_file, x_path_expression, xml_node_replacement, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ConvertDataApi.convert_data_xml_edit_replace_with_x_path ...'
  end
  # verify the required parameter 'input_file' is set
  if @api_client.config.client_side_validation && input_file.nil?
    fail ArgumentError, "Missing the required parameter 'input_file' when calling ConvertDataApi.convert_data_xml_edit_replace_with_x_path"
  end
  # verify the required parameter 'x_path_expression' is set
  if @api_client.config.client_side_validation && x_path_expression.nil?
    fail ArgumentError, "Missing the required parameter 'x_path_expression' when calling ConvertDataApi.convert_data_xml_edit_replace_with_x_path"
  end
  # verify the required parameter 'xml_node_replacement' is set
  if @api_client.config.client_side_validation && xml_node_replacement.nil?
    fail ArgumentError, "Missing the required parameter 'xml_node_replacement' when calling ConvertDataApi.convert_data_xml_edit_replace_with_x_path"
  end
  # resource path
  local_var_path = '/convert/xml/edit/xpath/replace'

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json', 'text/json', 'application/xml', 'text/xml'])
  header_params[:'XPathExpression'] = x_path_expression
  header_params[:'XmlNodeReplacement'] = xml_node_replacement

  # form parameters
  form_params = {}
  form_params['inputFile'] = input_file

  # http body (model)
  post_body = nil
  auth_names = ['Apikey']
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'XmlReplaceWithXPathResult')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ConvertDataApi#convert_data_xml_edit_replace_with_x_path\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#convert_data_xml_edit_set_value_with_x_path(input_file, x_path_expression, xml_value, opts = {}) ⇒ XmlSetValueWithXPathResult

Sets the value contents of XML nodes matching XPath expression Return the reuslts of editing an XML document by setting the contents of all of the nodes that match an input XPath expression. Supports elements and attributes.

Parameters:

  • input_file —

    Input XML file to perform the operation on.

  • x_path_expression —

    Valid XML XPath query expression

  • xml_value —

    XML Value to set into the matching XML nodes

  • opts (Hash) (defaults to: {}) —

    the optional parameters

Returns:



519
520
521
522
# File 'lib/cloudmersive-convert-api-client/api/convert_data_api.rb', line 519

def convert_data_xml_edit_set_value_with_x_path(input_file, x_path_expression, xml_value, opts = {})
  data, _status_code, _headers = convert_data_xml_edit_set_value_with_x_path_with_http_info(input_file, x_path_expression, xml_value, opts)
  data
end

#convert_data_xml_edit_set_value_with_x_path_with_http_info(input_file, x_path_expression, xml_value, opts = {}) ⇒ Array<(XmlSetValueWithXPathResult, Fixnum, Hash)>

Sets the value contents of XML nodes matching XPath expression Return the reuslts of editing an XML document by setting the contents of all of the nodes that match an input XPath expression. Supports elements and attributes.

Parameters:

  • input_file —

    Input XML file to perform the operation on.

  • x_path_expression —

    Valid XML XPath query expression

  • xml_value —

    XML Value to set into the matching XML nodes

  • opts (Hash) (defaults to: {}) —

    the optional parameters

Returns:

  • (Array<(XmlSetValueWithXPathResult, Fixnum, Hash)>) —

    XmlSetValueWithXPathResult data, response status code and response headers



531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
# File 'lib/cloudmersive-convert-api-client/api/convert_data_api.rb', line 531

def convert_data_xml_edit_set_value_with_x_path_with_http_info(input_file, x_path_expression, xml_value, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ConvertDataApi.convert_data_xml_edit_set_value_with_x_path ...'
  end
  # verify the required parameter 'input_file' is set
  if @api_client.config.client_side_validation && input_file.nil?
    fail ArgumentError, "Missing the required parameter 'input_file' when calling ConvertDataApi.convert_data_xml_edit_set_value_with_x_path"
  end
  # verify the required parameter 'x_path_expression' is set
  if @api_client.config.client_side_validation && x_path_expression.nil?
    fail ArgumentError, "Missing the required parameter 'x_path_expression' when calling ConvertDataApi.convert_data_xml_edit_set_value_with_x_path"
  end
  # verify the required parameter 'xml_value' is set
  if @api_client.config.client_side_validation && xml_value.nil?
    fail ArgumentError, "Missing the required parameter 'xml_value' when calling ConvertDataApi.convert_data_xml_edit_set_value_with_x_path"
  end
  # resource path
  local_var_path = '/convert/xml/edit/xpath/set-value'

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json', 'text/json', 'application/xml', 'text/xml'])
  header_params[:'XPathExpression'] = x_path_expression
  header_params[:'XmlValue'] = xml_value

  # form parameters
  form_params = {}
  form_params['inputFile'] = input_file

  # http body (model)
  post_body = nil
  auth_names = ['Apikey']
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'XmlSetValueWithXPathResult')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ConvertDataApi#convert_data_xml_edit_set_value_with_x_path\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#convert_data_xml_filter_with_x_path(x_path_expression, input_file, opts = {}) ⇒ XmlFilterWithXPathResult

Filter, select XML nodes using XPath expression, get results Return the reuslts of filtering, selecting an XML document with an XPath expression

Parameters:

  • x_path_expression —

    Valid XML XPath query expression

  • input_file —

    Input file to perform the operation on.

  • opts (Hash) (defaults to: {}) —

    the optional parameters

Returns:



585
586
587
588
# File 'lib/cloudmersive-convert-api-client/api/convert_data_api.rb', line 585

def convert_data_xml_filter_with_x_path(x_path_expression, input_file, opts = {})
  data, _status_code, _headers = convert_data_xml_filter_with_x_path_with_http_info(x_path_expression, input_file, opts)
  data
end

#convert_data_xml_filter_with_x_path_with_http_info(x_path_expression, input_file, opts = {}) ⇒ Array<(XmlFilterWithXPathResult, Fixnum, Hash)>

Filter, select XML nodes using XPath expression, get results Return the reuslts of filtering, selecting an XML document with an XPath expression

Parameters:

  • x_path_expression —

    Valid XML XPath query expression

  • input_file —

    Input file to perform the operation on.

  • opts (Hash) (defaults to: {}) —

    the optional parameters

Returns:

  • (Array<(XmlFilterWithXPathResult, Fixnum, Hash)>) —

    XmlFilterWithXPathResult data, response status code and response headers



596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
# File 'lib/cloudmersive-convert-api-client/api/convert_data_api.rb', line 596

def convert_data_xml_filter_with_x_path_with_http_info(x_path_expression, input_file, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ConvertDataApi.convert_data_xml_filter_with_x_path ...'
  end
  # verify the required parameter 'x_path_expression' is set
  if @api_client.config.client_side_validation && x_path_expression.nil?
    fail ArgumentError, "Missing the required parameter 'x_path_expression' when calling ConvertDataApi.convert_data_xml_filter_with_x_path"
  end
  # verify the required parameter 'input_file' is set
  if @api_client.config.client_side_validation && input_file.nil?
    fail ArgumentError, "Missing the required parameter 'input_file' when calling ConvertDataApi.convert_data_xml_filter_with_x_path"
  end
  # resource path
  local_var_path = '/convert/xml/select/xpath'

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json', 'text/json', 'application/xml', 'text/xml'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['multipart/form-data'])
  header_params[:'XPathExpression'] = x_path_expression

  # form parameters
  form_params = {}
  form_params['inputFile'] = input_file

  # http body (model)
  post_body = nil
  auth_names = ['Apikey']
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'XmlFilterWithXPathResult')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ConvertDataApi#convert_data_xml_filter_with_x_path\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#convert_data_xml_query_with_x_query(input_file, x_query, opts = {}) ⇒ XmlQueryWithXQueryResult

Query an XML file using XQuery query, get results Return the reuslts of querying a single XML document with an XQuery expression. Supports XQuery 3.1 and earlier. This API is optimized for a single XML document as input. Provided XML document is automatically loaded as the default context; to access elements in the document, simply refer to them without a document reference, such as bookstore/book

Parameters:

  • input_file —

    Input XML file to perform the operation on.

  • x_query —

    Valid XML XQuery 3.1 or earlier query expression; multi-line expressions are supported

  • opts (Hash) (defaults to: {}) —

    the optional parameters

Returns:



647
648
649
650
# File 'lib/cloudmersive-convert-api-client/api/convert_data_api.rb', line 647

def convert_data_xml_query_with_x_query(input_file, x_query, opts = {})
  data, _status_code, _headers = convert_data_xml_query_with_x_query_with_http_info(input_file, x_query, opts)
  data
end

#convert_data_xml_query_with_x_query_multi(input_file1, x_query, opts = {}) ⇒ XmlQueryWithXQueryMultiResult

Query multiple XML files using XQuery query, get results Return the reuslts of querying an XML document with an XQuery expression. Supports XQuery 3.1 and earlier. This API is optimized for multiple XML documents as input. You can refer to the contents of a given document by name, for example doc("books.xml") or doc("restaurants.xml") if you included two input files named books.xml and restaurants.xml. If input files contain no file name, they will default to file names input1.xml, input2.xml and so on.

Parameters:

  • input_file1 —

    First input XML file to perform the operation on.

  • x_query —

    Valid XML XQuery 3.1 or earlier query expression; multi-line expressions are supported

  • opts (Hash) (defaults to: {}) —

    the optional parameters

Options Hash (opts):

  • :input_file2 (File) —

    Second input XML file to perform the operation on.

  • :input_file3 (File) —

    Third input XML file to perform the operation on.

  • :input_file4 (File) —

    Fourth input XML file to perform the operation on.

  • :input_file5 (File) —

    Fifth input XML file to perform the operation on.

  • :input_file6 (File) —

    Sixth input XML file to perform the operation on.

  • :input_file7 (File) —

    Seventh input XML file to perform the operation on.

  • :input_file8 (File) —

    Eighth input XML file to perform the operation on.

  • :input_file9 (File) —

    Ninth input XML file to perform the operation on.

  • :input_file10 (File) —

    Tenth input XML file to perform the operation on.

Returns:



716
717
718
719
# File 'lib/cloudmersive-convert-api-client/api/convert_data_api.rb', line 716

def convert_data_xml_query_with_x_query_multi(input_file1, x_query, opts = {})
  data, _status_code, _headers = convert_data_xml_query_with_x_query_multi_with_http_info(input_file1, x_query, opts)
  data
end

#convert_data_xml_query_with_x_query_multi_with_http_info(input_file1, x_query, opts = {}) ⇒ Array<(XmlQueryWithXQueryMultiResult, Fixnum, Hash)>

Query multiple XML files using XQuery query, get results Return the reuslts of querying an XML document with an XQuery expression. Supports XQuery 3.1 and earlier. This API is optimized for multiple XML documents as input. You can refer to the contents of a given document by name, for example doc(&quot;books.xml&quot;) or doc(&quot;restaurants.xml&quot;) if you included two input files named books.xml and restaurants.xml. If input files contain no file name, they will default to file names input1.xml, input2.xml and so on.

Parameters:

  • input_file1 —

    First input XML file to perform the operation on.

  • x_query —

    Valid XML XQuery 3.1 or earlier query expression; multi-line expressions are supported

  • opts (Hash) (defaults to: {}) —

    the optional parameters

Options Hash (opts):

  • :input_file2 (File) —

    Second input XML file to perform the operation on.

  • :input_file3 (File) —

    Third input XML file to perform the operation on.

  • :input_file4 (File) —

    Fourth input XML file to perform the operation on.

  • :input_file5 (File) —

    Fifth input XML file to perform the operation on.

  • :input_file6 (File) —

    Sixth input XML file to perform the operation on.

  • :input_file7 (File) —

    Seventh input XML file to perform the operation on.

  • :input_file8 (File) —

    Eighth input XML file to perform the operation on.

  • :input_file9 (File) —

    Ninth input XML file to perform the operation on.

  • :input_file10 (File) —

    Tenth input XML file to perform the operation on.

Returns:



736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
# File 'lib/cloudmersive-convert-api-client/api/convert_data_api.rb', line 736

def convert_data_xml_query_with_x_query_multi_with_http_info(input_file1, x_query, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ConvertDataApi.convert_data_xml_query_with_x_query_multi ...'
  end
  # verify the required parameter 'input_file1' is set
  if @api_client.config.client_side_validation && input_file1.nil?
    fail ArgumentError, "Missing the required parameter 'input_file1' when calling ConvertDataApi.convert_data_xml_query_with_x_query_multi"
  end
  # verify the required parameter 'x_query' is set
  if @api_client.config.client_side_validation && x_query.nil?
    fail ArgumentError, "Missing the required parameter 'x_query' when calling ConvertDataApi.convert_data_xml_query_with_x_query_multi"
  end
  # resource path
  local_var_path = '/convert/xml/query/xquery/multi'

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json', 'text/json', 'application/xml', 'text/xml'])
  header_params[:'XQuery'] = x_query

  # form parameters
  form_params = {}
  form_params['inputFile1'] = input_file1
  form_params['inputFile2'] = opts[:'input_file2'] if !opts[:'input_file2'].nil?
  form_params['inputFile3'] = opts[:'input_file3'] if !opts[:'input_file3'].nil?
  form_params['inputFile4'] = opts[:'input_file4'] if !opts[:'input_file4'].nil?
  form_params['inputFile5'] = opts[:'input_file5'] if !opts[:'input_file5'].nil?
  form_params['inputFile6'] = opts[:'input_file6'] if !opts[:'input_file6'].nil?
  form_params['inputFile7'] = opts[:'input_file7'] if !opts[:'input_file7'].nil?
  form_params['inputFile8'] = opts[:'input_file8'] if !opts[:'input_file8'].nil?
  form_params['inputFile9'] = opts[:'input_file9'] if !opts[:'input_file9'].nil?
  form_params['inputFile10'] = opts[:'input_file10'] if !opts[:'input_file10'].nil?

  # http body (model)
  post_body = nil
  auth_names = ['Apikey']
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'XmlQueryWithXQueryMultiResult')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ConvertDataApi#convert_data_xml_query_with_x_query_multi\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#convert_data_xml_query_with_x_query_with_http_info(input_file, x_query, opts = {}) ⇒ Array<(XmlQueryWithXQueryResult, Fixnum, Hash)>

Query an XML file using XQuery query, get results Return the reuslts of querying a single XML document with an XQuery expression. Supports XQuery 3.1 and earlier. This API is optimized for a single XML document as input. Provided XML document is automatically loaded as the default context; to access elements in the document, simply refer to them without a document reference, such as bookstore/book

Parameters:

  • input_file —

    Input XML file to perform the operation on.

  • x_query —

    Valid XML XQuery 3.1 or earlier query expression; multi-line expressions are supported

  • opts (Hash) (defaults to: {}) —

    the optional parameters

Returns:

  • (Array<(XmlQueryWithXQueryResult, Fixnum, Hash)>) —

    XmlQueryWithXQueryResult data, response status code and response headers



658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
# File 'lib/cloudmersive-convert-api-client/api/convert_data_api.rb', line 658

def convert_data_xml_query_with_x_query_with_http_info(input_file, x_query, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ConvertDataApi.convert_data_xml_query_with_x_query ...'
  end
  # verify the required parameter 'input_file' is set
  if @api_client.config.client_side_validation && input_file.nil?
    fail ArgumentError, "Missing the required parameter 'input_file' when calling ConvertDataApi.convert_data_xml_query_with_x_query"
  end
  # verify the required parameter 'x_query' is set
  if @api_client.config.client_side_validation && x_query.nil?
    fail ArgumentError, "Missing the required parameter 'x_query' when calling ConvertDataApi.convert_data_xml_query_with_x_query"
  end
  # resource path
  local_var_path = '/convert/xml/query/xquery'

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json', 'text/json', 'application/xml', 'text/xml'])
  header_params[:'XQuery'] = x_query

  # form parameters
  form_params = {}
  form_params['inputFile'] = input_file

  # http body (model)
  post_body = nil
  auth_names = ['Apikey']
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'XmlQueryWithXQueryResult')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ConvertDataApi#convert_data_xml_query_with_x_query\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#convert_data_xml_remove_with_x_path(x_path_expression, input_file, opts = {}) ⇒ XmlRemoveWithXPathResult

Remove, delete XML nodes and items matching XPath expression Return the reuslts of editing an XML document by removing all of the nodes that match an input XPath expression

Parameters:

  • x_path_expression —

    Valid XML XPath query expression

  • input_file —

    Input file to perform the operation on.

  • opts (Hash) (defaults to: {}) —

    the optional parameters

Returns:



794
795
796
797
# File 'lib/cloudmersive-convert-api-client/api/convert_data_api.rb', line 794

def convert_data_xml_remove_with_x_path(x_path_expression, input_file, opts = {})
  data, _status_code, _headers = convert_data_xml_remove_with_x_path_with_http_info(x_path_expression, input_file, opts)
  data
end

#convert_data_xml_remove_with_x_path_with_http_info(x_path_expression, input_file, opts = {}) ⇒ Array<(XmlRemoveWithXPathResult, Fixnum, Hash)>

Remove, delete XML nodes and items matching XPath expression Return the reuslts of editing an XML document by removing all of the nodes that match an input XPath expression

Parameters:

  • x_path_expression —

    Valid XML XPath query expression

  • input_file —

    Input file to perform the operation on.

  • opts (Hash) (defaults to: {}) —

    the optional parameters

Returns:

  • (Array<(XmlRemoveWithXPathResult, Fixnum, Hash)>) —

    XmlRemoveWithXPathResult data, response status code and response headers



805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
# File 'lib/cloudmersive-convert-api-client/api/convert_data_api.rb', line 805

def convert_data_xml_remove_with_x_path_with_http_info(x_path_expression, input_file, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ConvertDataApi.convert_data_xml_remove_with_x_path ...'
  end
  # verify the required parameter 'x_path_expression' is set
  if @api_client.config.client_side_validation && x_path_expression.nil?
    fail ArgumentError, "Missing the required parameter 'x_path_expression' when calling ConvertDataApi.convert_data_xml_remove_with_x_path"
  end
  # verify the required parameter 'input_file' is set
  if @api_client.config.client_side_validation && input_file.nil?
    fail ArgumentError, "Missing the required parameter 'input_file' when calling ConvertDataApi.convert_data_xml_remove_with_x_path"
  end
  # resource path
  local_var_path = '/convert/xml/edit/xpath/remove'

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json', 'text/json', 'application/xml', 'text/xml'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['multipart/form-data'])
  header_params[:'XPathExpression'] = x_path_expression

  # form parameters
  form_params = {}
  form_params['inputFile'] = input_file

  # http body (model)
  post_body = nil
  auth_names = ['Apikey']
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'XmlRemoveWithXPathResult')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ConvertDataApi#convert_data_xml_remove_with_x_path\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#convert_data_xml_to_json(input_file, opts = {}) ⇒ Object

Convert XML to JSON conversion Convert an XML string or file into JSON

Parameters:

  • input_file —

    Input file to perform the operation on.

  • opts (Hash) (defaults to: {}) —

    the optional parameters

Returns:

  • (Object)


855
856
857
858
# File 'lib/cloudmersive-convert-api-client/api/convert_data_api.rb', line 855

def convert_data_xml_to_json(input_file, opts = {})
  data, _status_code, _headers = convert_data_xml_to_json_with_http_info(input_file, opts)
  data
end

#convert_data_xml_to_json_with_http_info(input_file, opts = {}) ⇒ Array<(Object, Fixnum, Hash)>

Convert XML to JSON conversion Convert an XML string or file into JSON

Parameters:

  • input_file —

    Input file to perform the operation on.

  • opts (Hash) (defaults to: {}) —

    the optional parameters

Returns:

  • (Array<(Object, Fixnum, Hash)>) —

    Object data, response status code and response headers



865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
# File 'lib/cloudmersive-convert-api-client/api/convert_data_api.rb', line 865

def convert_data_xml_to_json_with_http_info(input_file, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ConvertDataApi.convert_data_xml_to_json ...'
  end
  # verify the required parameter 'input_file' is set
  if @api_client.config.client_side_validation && input_file.nil?
    fail ArgumentError, "Missing the required parameter 'input_file' when calling ConvertDataApi.convert_data_xml_to_json"
  end
  # resource path
  local_var_path = '/convert/xml/to/json'

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['multipart/form-data'])

  # form parameters
  form_params = {}
  form_params['inputFile'] = input_file

  # http body (model)
  post_body = nil
  auth_names = ['Apikey']
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'Object')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ConvertDataApi#convert_data_xml_to_json\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#convert_data_xml_transform_with_xslt_to_xml(input_file, transform_file, opts = {}) ⇒ String

Transform XML document file with XSLT into a new XML document Convert an XML string or file into JSON

Parameters:

  • input_file —

    Input XML file to perform the operation on.

  • transform_file —

    Input XSLT file to use to transform the input XML file.

  • opts (Hash) (defaults to: {}) —

    the optional parameters

Returns:

  • (String)


911
912
913
914
# File 'lib/cloudmersive-convert-api-client/api/convert_data_api.rb', line 911

def convert_data_xml_transform_with_xslt_to_xml(input_file, transform_file, opts = {})
  data, _status_code, _headers = convert_data_xml_transform_with_xslt_to_xml_with_http_info(input_file, transform_file, opts)
  data
end

#convert_data_xml_transform_with_xslt_to_xml_with_http_info(input_file, transform_file, opts = {}) ⇒ Array<(String, Fixnum, Hash)>

Transform XML document file with XSLT into a new XML document Convert an XML string or file into JSON

Parameters:

  • input_file —

    Input XML file to perform the operation on.

  • transform_file —

    Input XSLT file to use to transform the input XML file.

  • opts (Hash) (defaults to: {}) —

    the optional parameters

Returns:

  • (Array<(String, Fixnum, Hash)>) —

    String data, response status code and response headers



922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
# File 'lib/cloudmersive-convert-api-client/api/convert_data_api.rb', line 922

def convert_data_xml_transform_with_xslt_to_xml_with_http_info(input_file, transform_file, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ConvertDataApi.convert_data_xml_transform_with_xslt_to_xml ...'
  end
  # verify the required parameter 'input_file' is set
  if @api_client.config.client_side_validation && input_file.nil?
    fail ArgumentError, "Missing the required parameter 'input_file' when calling ConvertDataApi.convert_data_xml_transform_with_xslt_to_xml"
  end
  # verify the required parameter 'transform_file' is set
  if @api_client.config.client_side_validation && transform_file.nil?
    fail ArgumentError, "Missing the required parameter 'transform_file' when calling ConvertDataApi.convert_data_xml_transform_with_xslt_to_xml"
  end
  # resource path
  local_var_path = '/convert/xml/transform/xslt/to/xml'

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/xml'])

  # form parameters
  form_params = {}
  form_params['inputFile'] = input_file
  form_params['transformFile'] = transform_file

  # http body (model)
  post_body = nil
  auth_names = ['Apikey']
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'String')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ConvertDataApi#convert_data_xml_transform_with_xslt_to_xml\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end