Class: AsposeDiagramCloud::DiagramApi

Inherits:
Object
  • Object
show all
Defined in:
lib/AsposeDiagramCloud/api/diagram_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(grant_type, app_sid, app_key, api_client = ApiClient.default) ⇒ DiagramApi

Returns a new instance of DiagramApi.



19
20
21
22
23
24
25
26
# File 'lib/AsposeDiagramCloud/api/diagram_api.rb', line 19

def initialize(grant_type,app_sid,app_key,api_client = ApiClient.default)
  @api_client = api_client
  @api_client.config.api_key['api_key'] = app_key
  @api_client.config.api_key['app_sid'] = app_sid
  @api_client.config.api_key['grant_type'] = grant_type
  request_token

end

Instance Attribute Details

#api_clientObject

Returns the value of attribute api_client.



17
18
19
# File 'lib/AsposeDiagramCloud/api/diagram_api.rb', line 17

def api_client
  @api_client
end

Instance Method Details

#convert_document(name, file, opts = {}) ⇒ File

Converts document from the request’s content to the specified format.

Parameters:

  • name

    Download document name.

  • file

    File to upload

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

    the optional parameters

Options Hash (opts):

  • :source_filename (String)

    Source document name.

Returns:

  • (File)


48
49
50
51
# File 'lib/AsposeDiagramCloud/api/diagram_api.rb', line 48

def convert_document(name, file, opts = {})
  data, _status_code, _headers = convert_document_with_http_info(name, file, opts)
  return data
end

#convert_document_with_http_info(name, file, opts = {}) ⇒ Array<(File, Fixnum, Hash)>

Converts document from the request&#39;s content to the specified format.

Parameters:

  • name

    Download document name.

  • file

    File to upload

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

    the optional parameters

Options Hash (opts):

  • :source_filename (String)

    Source document name.

Returns:

  • (Array<(File, Fixnum, Hash)>)

    File data, response status code and response headers



60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
# File 'lib/AsposeDiagramCloud/api/diagram_api.rb', line 60

def convert_document_with_http_info(name, file, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: DiagramApi.convert_document ..."
  end
  # verify the required parameter 'name' is set
  if @api_client.config.client_side_validation && name.nil?
    fail ArgumentError, "Missing the required parameter 'name' when calling DiagramApi.convert_document"
  end
  # verify the required parameter 'file' is set
  if @api_client.config.client_side_validation && file.nil?
    fail ArgumentError, "Missing the required parameter 'file' when calling DiagramApi.convert_document"
  end
  # resource path
  local_var_path = "/diagram/{name}/convert".sub('{' + 'name' + '}', name.to_s)

  # query parameters
  query_params = {}
  query_params[:'sourceFilename'] = opts[:'source_filename'] if !opts[:'source_filename'].nil?

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

  # form parameters
  form_params = {}
  #form_params["File"] = file

  # http body (model)
  post_body = file
  auth_names = ['JWT']
  data, status_code, headers = @api_client.call_api(:PUT, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'File')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: DiagramApi#convert_document\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#create_new(name, opts = {}) ⇒ CreateNewResponse

Create Empty file into the specified format.

Parameters:

  • name

    The document name.

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

    the optional parameters

Options Hash (opts):

  • :folder (String)

    The document folder.

  • :is_overwrite (BOOLEAN)

    If true overwrite the same name file.The default value is false (default to false)

Returns:



114
115
116
117
# File 'lib/AsposeDiagramCloud/api/diagram_api.rb', line 114

def create_new(name, opts = {})
  data, _status_code, _headers = create_new_with_http_info(name, opts)
  return data
end

#create_new_with_http_info(name, opts = {}) ⇒ Array<(CreateNewResponse, Fixnum, Hash)>

Create Empty file into the specified format.

Parameters:

  • name

    The document name.

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

    the optional parameters

Options Hash (opts):

  • :folder (String)

    The document folder.

  • :is_overwrite (BOOLEAN)

    If true overwrite the same name file.The default value is false

Returns:

  • (Array<(CreateNewResponse, Fixnum, Hash)>)

    CreateNewResponse data, response status code and response headers



126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
# File 'lib/AsposeDiagramCloud/api/diagram_api.rb', line 126

def create_new_with_http_info(name, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: DiagramApi.create_new ..."
  end
  # verify the required parameter 'name' is set
  if @api_client.config.client_side_validation && name.nil?
    fail ArgumentError, "Missing the required parameter 'name' when calling DiagramApi.create_new"
  end
  # resource path
  local_var_path = "/diagram/{name}".sub('{' + 'name' + '}', name.to_s)

  # query parameters
  query_params = {}
  query_params[:'folder'] = opts[:'folder'] if !opts[:'folder'].nil?
  query_params[:'IsOverwrite'] = opts[:'is_overwrite'] if !opts[:'is_overwrite'].nil?

  # 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(['application/json'])

  # form parameters
  form_params = {}

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

#delete_page(name, page_name, opts = {}) ⇒ ModifyResponse

Parameters:

  • name

    Document name.

  • page_name

    The page name for delete.

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

    the optional parameters

Options Hash (opts):

  • :folder (String)

    Document folder.

Returns:



517
518
519
520
# File 'lib/AsposeDiagramCloud/api/diagram_api.rb', line 517

def delete_page(name, page_name, opts = {})
  data, _status_code, _headers = delete_page_with_http_info(name, page_name, opts)
  return data
end

#delete_page_with_http_info(name, page_name, opts = {}) ⇒ Array<(ModifyResponse, Fixnum, Hash)>

Remove Page

Parameters:

  • name

    Document name.

  • page_name

    The page name for delete.

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

    the optional parameters

Options Hash (opts):

  • :folder (String)

    Document folder.

Returns:

  • (Array<(ModifyResponse, Fixnum, Hash)>)

    ModifyResponse data, response status code and response headers



529
530
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
# File 'lib/AsposeDiagramCloud/api/diagram_api.rb', line 529

def delete_page_with_http_info(name, page_name, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: PageApi.delete_page ..."
  end
  # verify the required parameter 'name' is set
  if @api_client.config.client_side_validation && name.nil?
    fail ArgumentError, "Missing the required parameter 'name' when calling PageApi.delete_page"
  end
  # verify the required parameter 'page_name' is set
  if @api_client.config.client_side_validation && page_name.nil?
    fail ArgumentError, "Missing the required parameter 'page_name' when calling PageApi.delete_page"
  end
  # resource path
  local_var_path = "/diagram/{name}/pages/{pageName}".sub('{' + 'name' + '}', name.to_s).sub('{' + 'pageName' + '}', page_name.to_s)

  # query parameters
  query_params = {}
  query_params[:'folder'] = opts[:'folder'] if !opts[:'folder'].nil?

  # 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(['application/json'])

  # form parameters
  form_params = {}

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

#download_file_with_format(name, format, opts = {}) ⇒ File

Exports the document into the specified format.

Parameters:

  • name

    The document name.

  • format

    The destination format.

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

    the optional parameters

Options Hash (opts):

  • :folder (String)

    Original document folder.

Returns:

  • (File)


175
176
177
178
# File 'lib/AsposeDiagramCloud/api/diagram_api.rb', line 175

def download_file_with_format(name, format, opts = {})
  data, _status_code, _headers = download_file_with_format_with_http_info(name, format, opts)
  return data
end

#download_file_with_format_with_http_info(name, format, opts = {}) ⇒ Array<(File, Fixnum, Hash)>

Exports the document into the specified format.

Parameters:

  • name

    The document name.

  • format

    The destination format.

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

    the optional parameters

Options Hash (opts):

  • :folder (String)

    Original document folder.

Returns:

  • (Array<(File, Fixnum, Hash)>)

    File data, response status code and response headers



187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
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
# File 'lib/AsposeDiagramCloud/api/diagram_api.rb', line 187

def download_file_with_format_with_http_info(name, format, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: DiagramApi.download_file_with_format ..."
  end
  # verify the required parameter 'name' is set
  if @api_client.config.client_side_validation && name.nil?
    fail ArgumentError, "Missing the required parameter 'name' when calling DiagramApi.download_file_with_format"
  end
  # verify the required parameter 'format' is set
  if @api_client.config.client_side_validation && format.nil?
    fail ArgumentError, "Missing the required parameter 'format' when calling DiagramApi.download_file_with_format"
  end
  # resource path
  local_var_path = "/diagram/{name}".sub('{' + 'name' + '}', name.to_s)

  # query parameters
  query_params = {}
  query_params[:'format'] = format
  query_params[:'folder'] = opts[:'folder'] if !opts[:'folder'].nil?

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

  # form parameters
  form_params = {}

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

#get_pages(name, opts = {}) ⇒ ApiResponseOfListOfPageData

Read pages info.

Parameters:

  • name

    Document name.

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

    the optional parameters

Options Hash (opts):

  • :folder (String)

    Document folder.

Returns:



580
581
582
583
# File 'lib/AsposeDiagramCloud/api/diagram_api.rb', line 580

def get_pages(name, opts = {})
  data, _status_code, _headers = get_pages_with_http_info(name, opts)
  return data
end

#get_pages_with_http_info(name, opts = {}) ⇒ Array<(ApiResponseOfListOfPageData, Fixnum, Hash)>

Read pages info.

Parameters:

  • name

    Document name.

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

    the optional parameters

Options Hash (opts):

  • :folder (String)

    Document folder.

Returns:



591
592
593
594
595
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
# File 'lib/AsposeDiagramCloud/api/diagram_api.rb', line 591

def get_pages_with_http_info(name, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: PageApi.get_pages ..."
  end
  # verify the required parameter 'name' is set
  if @api_client.config.client_side_validation && name.nil?
    fail ArgumentError, "Missing the required parameter 'name' when calling PageApi.get_pages"
  end
  # resource path
  local_var_path = "/diagram/{name}/pages".sub('{' + 'name' + '}', name.to_s)

  # query parameters
  query_params = {}
  query_params[:'folder'] = opts[:'folder'] if !opts[:'folder'].nil?

  # 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(['application/json'])

  # form parameters
  form_params = {}

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

#post_page_setup(name, page_name, page_setting, opts = {}) ⇒ ModifyResponse

page setup

Parameters:

  • name

    Document name.

  • page_name

    The page name for setting.

  • page_setting

    Page setting info.

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

    the optional parameters

Options Hash (opts):

  • :folder (String)

    Document folder.

Returns:



640
641
642
643
# File 'lib/AsposeDiagramCloud/api/diagram_api.rb', line 640

def post_page_setup(name, page_name, page_setting, opts = {})
  data, _status_code, _headers = post_page_setup_with_http_info(name, page_name, page_setting, opts)
  return data
end

#post_page_setup_with_http_info(name, page_name, page_setting, opts = {}) ⇒ Array<(ModifyResponse, Fixnum, Hash)>

page setup

Parameters:

  • name

    Document name.

  • page_name

    The page name for setting.

  • page_setting

    Page setting info.

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

    the optional parameters

Options Hash (opts):

  • :folder (String)

    Document folder.

Returns:

  • (Array<(ModifyResponse, Fixnum, Hash)>)

    ModifyResponse data, response status code and response headers



653
654
655
656
657
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
701
# File 'lib/AsposeDiagramCloud/api/diagram_api.rb', line 653

def post_page_setup_with_http_info(name, page_name, page_setting, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: PageApi.post_page_setup ..."
  end
  # verify the required parameter 'name' is set
  if @api_client.config.client_side_validation && name.nil?
    fail ArgumentError, "Missing the required parameter 'name' when calling PageApi.post_page_setup"
  end
  # verify the required parameter 'page_name' is set
  if @api_client.config.client_side_validation && page_name.nil?
    fail ArgumentError, "Missing the required parameter 'page_name' when calling PageApi.post_page_setup"
  end
  # verify the required parameter 'page_setting' is set
  if @api_client.config.client_side_validation && page_setting.nil?
    fail ArgumentError, "Missing the required parameter 'page_setting' when calling PageApi.post_page_setup"
  end
  # resource path
  local_var_path = "/diagram/{name}/pages/PageSetup".sub('{' + 'name' + '}', name.to_s)

  # query parameters
  query_params = {}
  query_params[:'pageName'] = page_name
  query_params[:'folder'] = opts[:'folder'] if !opts[:'folder'].nil?

  # 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(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(page_setting)
  auth_names = ['JWT']
  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 => 'ModifyResponse')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: PageApi#post_page_setup\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#put_draw_ellipse(name, page_name, ellipse_data, opts = {}) ⇒ ModifyResponse

Parameters:

  • name

    Document name.

  • page_name

    Page name.

  • ellipse_data

    drawing ellipse data.

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

    the optional parameters

Options Hash (opts):

  • :folder (String)

    Document folder.

Returns:



308
309
310
311
# File 'lib/AsposeDiagramCloud/api/diagram_api.rb', line 308

def put_draw_ellipse(name, page_name, ellipse_data, opts = {})
  data, _status_code, _headers = put_draw_ellipse_with_http_info(name, page_name, ellipse_data, opts)
  return data
end

#put_draw_ellipse_with_http_info(name, page_name, ellipse_data, opts = {}) ⇒ Array<(ModifyResponse, Fixnum, Hash)>

draw ellipse on the page.

Parameters:

  • name

    Document name.

  • page_name

    Page name.

  • ellipse_data

    drawing ellipse data.

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

    the optional parameters

Options Hash (opts):

  • :folder (String)

    Document folder.

Returns:

  • (Array<(ModifyResponse, Fixnum, Hash)>)

    ModifyResponse data, response status code and response headers



321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
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
# File 'lib/AsposeDiagramCloud/api/diagram_api.rb', line 321

def put_draw_ellipse_with_http_info(name, page_name, ellipse_data, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: DrawApi.put_draw_ellipse ..."
  end
  # verify the required parameter 'name' is set
  if @api_client.config.client_side_validation && name.nil?
    fail ArgumentError, "Missing the required parameter 'name' when calling DrawApi.put_draw_ellipse"
  end
  # verify the required parameter 'page_name' is set
  if @api_client.config.client_side_validation && page_name.nil?
    fail ArgumentError, "Missing the required parameter 'page_name' when calling DrawApi.put_draw_ellipse"
  end
  # verify the required parameter 'ellipse_data' is set
  if @api_client.config.client_side_validation && ellipse_data.nil?
    fail ArgumentError, "Missing the required parameter 'ellipse_data' when calling DrawApi.put_draw_ellipse"
  end
  # resource path
  local_var_path = "/diagram/{name}/pages/{pageName}/drawEllipse".sub('{' + 'name' + '}', name.to_s).sub('{' + 'pageName' + '}', page_name.to_s)

  # query parameters
  query_params = {}
  query_params[:'folder'] = opts[:'folder'] if !opts[:'folder'].nil?

  # 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(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(ellipse_data)
  auth_names = ['JWT']
  data, status_code, headers = @api_client.call_api(:PUT, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'ModifyResponse')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: DrawApi#put_draw_ellipse\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#put_draw_line(name, page_name, line_data, opts = {}) ⇒ ModifyResponse

draw line on the page.

Parameters:

  • name

    Document name.

  • page_name

    Page name.

  • line_data

    drawing line data.

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

    the optional parameters

Options Hash (opts):

  • :folder (String)

    Document folder.

Returns:



378
379
380
381
# File 'lib/AsposeDiagramCloud/api/diagram_api.rb', line 378

def put_draw_line(name, page_name, line_data, opts = {})
  data, _status_code, _headers = put_draw_line_with_http_info(name, page_name, line_data, opts)
  return data
end

#put_draw_line_with_http_info(name, page_name, line_data, opts = {}) ⇒ Array<(ModifyResponse, Fixnum, Hash)>

draw line on the page.

Parameters:

  • name

    Document name.

  • page_name

    Page name.

  • line_data

    drawing line data.

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

    the optional parameters

Options Hash (opts):

  • :folder (String)

    Document folder.

Returns:

  • (Array<(ModifyResponse, Fixnum, Hash)>)

    ModifyResponse data, response status code and response headers



391
392
393
394
395
396
397
398
399
400
401
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
# File 'lib/AsposeDiagramCloud/api/diagram_api.rb', line 391

def put_draw_line_with_http_info(name, page_name, line_data, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: DrawApi.put_draw_line ..."
  end
  # verify the required parameter 'name' is set
  if @api_client.config.client_side_validation && name.nil?
    fail ArgumentError, "Missing the required parameter 'name' when calling DrawApi.put_draw_line"
  end
  # verify the required parameter 'page_name' is set
  if @api_client.config.client_side_validation && page_name.nil?
    fail ArgumentError, "Missing the required parameter 'page_name' when calling DrawApi.put_draw_line"
  end
  # verify the required parameter 'line_data' is set
  if @api_client.config.client_side_validation && line_data.nil?
    fail ArgumentError, "Missing the required parameter 'line_data' when calling DrawApi.put_draw_line"
  end
  # resource path
  local_var_path = "/diagram/{name}/pages/{pageName}/drawLine".sub('{' + 'name' + '}', name.to_s).sub('{' + 'pageName' + '}', page_name.to_s)

  # query parameters
  query_params = {}
  query_params[:'folder'] = opts[:'folder'] if !opts[:'folder'].nil?

  # 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(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(line_data)
  auth_names = ['JWT']
  data, status_code, headers = @api_client.call_api(:PUT, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'ModifyResponse')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: DrawApi#put_draw_line\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#put_draw_polyline(name, page_name, polyline_data, opts = {}) ⇒ ModifyResponse

draw polyline on the page.

Parameters:

  • name

    Document name.

  • page_name

    Page name.

  • polyline_data

    drawing polyline data.

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

    the optional parameters

Options Hash (opts):

  • :folder (String)

    Document folder.

Returns:



448
449
450
451
# File 'lib/AsposeDiagramCloud/api/diagram_api.rb', line 448

def put_draw_polyline(name, page_name, polyline_data, opts = {})
  data, _status_code, _headers = put_draw_polyline_with_http_info(name, page_name, polyline_data, opts)
  return data
end

#put_draw_polyline_with_http_info(name, page_name, polyline_data, opts = {}) ⇒ Array<(ModifyResponse, Fixnum, Hash)>

draw polyline on the page.

Parameters:

  • name

    Document name.

  • page_name

    Page name.

  • polyline_data

    drawing polyline data.

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

    the optional parameters

Options Hash (opts):

  • :folder (String)

    Document folder.

Returns:

  • (Array<(ModifyResponse, Fixnum, Hash)>)

    ModifyResponse data, response status code and response headers



461
462
463
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
# File 'lib/AsposeDiagramCloud/api/diagram_api.rb', line 461

def put_draw_polyline_with_http_info(name, page_name, polyline_data, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: DrawApi.put_draw_polyline ..."
  end
  # verify the required parameter 'name' is set
  if @api_client.config.client_side_validation && name.nil?
    fail ArgumentError, "Missing the required parameter 'name' when calling DrawApi.put_draw_polyline"
  end
  # verify the required parameter 'page_name' is set
  if @api_client.config.client_side_validation && page_name.nil?
    fail ArgumentError, "Missing the required parameter 'page_name' when calling DrawApi.put_draw_polyline"
  end
  # verify the required parameter 'polyline_data' is set
  if @api_client.config.client_side_validation && polyline_data.nil?
    fail ArgumentError, "Missing the required parameter 'polyline_data' when calling DrawApi.put_draw_polyline"
  end
  # resource path
  local_var_path = "/diagram/{name}/pages/{pageName}/drawPolyline".sub('{' + 'name' + '}', name.to_s).sub('{' + 'pageName' + '}', page_name.to_s)

  # query parameters
  query_params = {}
  query_params[:'folder'] = opts[:'folder'] if !opts[:'folder'].nil?

  # 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(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(polyline_data)
  auth_names = ['JWT']
  data, status_code, headers = @api_client.call_api(:PUT, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'ModifyResponse')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: DrawApi#put_draw_polyline\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#put_new_page(name, page_name, opts = {}) ⇒ ModifyResponse

Add new empty page

Parameters:

  • name

    Document name.

  • page_name

    New page name.

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

    the optional parameters

Options Hash (opts):

  • :folder (String)

    Document folder.

Returns:



710
711
712
713
# File 'lib/AsposeDiagramCloud/api/diagram_api.rb', line 710

def put_new_page(name, page_name, opts = {})
  data, _status_code, _headers = put_new_page_with_http_info(name, page_name, opts)
  return data
end

#put_new_page_with_http_info(name, page_name, opts = {}) ⇒ Array<(ModifyResponse, Fixnum, Hash)>

Add new empty page

Parameters:

  • name

    Document name.

  • page_name

    New page name.

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

    the optional parameters

Options Hash (opts):

  • :folder (String)

    Document folder.

Returns:

  • (Array<(ModifyResponse, Fixnum, Hash)>)

    ModifyResponse data, response status code and response headers



722
723
724
725
726
727
728
729
730
731
732
733
734
735
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
# File 'lib/AsposeDiagramCloud/api/diagram_api.rb', line 722

def put_new_page_with_http_info(name, page_name, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: PageApi.put_new_page ..."
  end
  # verify the required parameter 'name' is set
  if @api_client.config.client_side_validation && name.nil?
    fail ArgumentError, "Missing the required parameter 'name' when calling PageApi.put_new_page"
  end
  # verify the required parameter 'page_name' is set
  if @api_client.config.client_side_validation && page_name.nil?
    fail ArgumentError, "Missing the required parameter 'page_name' when calling PageApi.put_new_page"
  end
  # resource path
  local_var_path = "/diagram/{name}/pages/addNew".sub('{' + 'name' + '}', name.to_s)

  # query parameters
  query_params = {}
  query_params[:'pageName'] = page_name
  query_params[:'folder'] = opts[:'folder'] if !opts[:'folder'].nil?

  # 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(['application/json'])

  # form parameters
  form_params = {}

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

#request_tokenObject

Gets a request token from server



31
32
33
34
35
36
37
38
39
40
# File 'lib/AsposeDiagramCloud/api/diagram_api.rb', line 31

def request_token
  authconfig=Configuration.new
  authconfig.base_path=""
  authClient=ApiClient.new(authconfig)
  authApi=AsposeDiagramCloud::OAuthApi.new(authClient)
  config=@api_client.config
  data, _status_code, _headers=authApi.o_auth_post(config.api_key['grant_type'],config.api_key['app_sid'],config.api_key['api_key'])
  #print(data.access_token)
  @api_client.default_headers["Authorization"] ="Bearer " + data.access_token
end

#save_as(name, save_options_request, opts = {}) ⇒ SaveAsResponse

Converts document to destination format with detailed settings and saves result to storage.

Parameters:

  • name

    Original document name.

  • save_options_request

    Save options.

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

    the optional parameters

Options Hash (opts):

  • :folder (String)

    Original document folder.

  • :is_overwrite (BOOLEAN)

    If true overwrite the same name file.The default value is false (default to false)

Returns:



241
242
243
244
# File 'lib/AsposeDiagramCloud/api/diagram_api.rb', line 241

def save_as(name, save_options_request, opts = {})
  data, _status_code, _headers = save_as_with_http_info(name, save_options_request, opts)
  return data
end

#save_as_with_http_info(name, save_options_request, opts = {}) ⇒ Array<(SaveAsResponse, Fixnum, Hash)>

Converts document to destination format with detailed settings and saves result to storage.

Parameters:

  • name

    Original document name.

  • save_options_request

    Save options.

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

    the optional parameters

Options Hash (opts):

  • :folder (String)

    Original document folder.

  • :is_overwrite (BOOLEAN)

    If true overwrite the same name file.The default value is false

Returns:

  • (Array<(SaveAsResponse, Fixnum, Hash)>)

    SaveAsResponse data, response status code and response headers



254
255
256
257
258
259
260
261
262
263
264
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
# File 'lib/AsposeDiagramCloud/api/diagram_api.rb', line 254

def save_as_with_http_info(name, save_options_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: DiagramApi.save_as ..."
  end
  # verify the required parameter 'name' is set
  if @api_client.config.client_side_validation && name.nil?
    fail ArgumentError, "Missing the required parameter 'name' when calling DiagramApi.save_as"
  end
  # verify the required parameter 'save_options_request' is set
  if @api_client.config.client_side_validation && save_options_request.nil?
    fail ArgumentError, "Missing the required parameter 'save_options_request' when calling DiagramApi.save_as"
  end
  # resource path
  local_var_path = "/diagram/{name}/saveAs".sub('{' + 'name' + '}', name.to_s)

  # query parameters
  query_params = {}
  query_params[:'folder'] = opts[:'folder'] if !opts[:'folder'].nil?
  query_params[:'IsOverwrite'] = opts[:'is_overwrite'] if !opts[:'is_overwrite'].nil?

  # 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(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(save_options_request)
  auth_names = ['JWT']
  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 => 'SaveAsResponse')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: DiagramApi#save_as\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end