class AsposeDiagramCloud::DiagramApi

Attributes

api_client[RW]

Public Class Methods

new(grant_type,app_sid,app_key,api_client = ApiClient.default) click to toggle source
# 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

Public Instance Methods

convert_document(name, file, opts = {}) click to toggle source

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

@param name Download document name. @param file File to upload @param [Hash] opts the optional parameters @option opts [String] :source_filename Source document name. @return [File]

# 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 = {}) click to toggle source

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

@param name Download document name. @param file File to upload @param [Hash] opts the optional parameters @option opts [String] :source_filename Source document name. @return [Array<(File, Fixnum, Hash)>] File data, response status code and response headers

# 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 = {}) click to toggle source

Create Empty file into the specified format.

@param name The document name. @param [Hash] opts the optional parameters @option opts [String] :folder The document folder. @option opts [BOOLEAN] :is_overwrite If true overwrite the same name file.The default value is false (default to false) @return [CreateNewResponse]

# 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 = {}) click to toggle source

Create Empty file into the specified format.

@param name The document name. @param [Hash] opts the optional parameters @option opts [String] :folder The document folder. @option opts [BOOLEAN] :is_overwrite If true overwrite the same name file.The default value is false @return [Array<(CreateNewResponse, Fixnum, Hash)>] CreateNewResponse data, response status code and response headers

# 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 = {}) click to toggle source

Remove Page

@param name Document name. @param page_name The page name for delete. @param [Hash] opts the optional parameters @option opts [String] :folder Document folder. @return [ModifyResponse]

# 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 = {}) click to toggle source

Remove Page

@param name Document name. @param page_name The page name for delete. @param [Hash] opts the optional parameters @option opts [String] :folder Document folder. @return [Array<(ModifyResponse, Fixnum, Hash)>] ModifyResponse data, response status code and response headers

# 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 = {}) click to toggle source

Exports the document into the specified format.

@param name The document name. @param format The destination format. @param [Hash] opts the optional parameters @option opts [String] :folder Original document folder. @return [File]

# 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 = {}) click to toggle source

Exports the document into the specified format.

@param name The document name. @param format The destination format. @param [Hash] opts the optional parameters @option opts [String] :folder Original document folder. @return [Array<(File, Fixnum, Hash)>] File data, response status code and response headers

# 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 = {}) click to toggle source

Read pages info.

@param name Document name. @param [Hash] opts the optional parameters @option opts [String] :folder Document folder. @return [ApiResponseOfListOfPageData]

# 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 = {}) click to toggle source

Read pages info.

@param name Document name. @param [Hash] opts the optional parameters @option opts [String] :folder Document folder. @return [Array<(ApiResponseOfListOfPageData, Fixnum, Hash)>] ApiResponseOfListOfPageData data, response status code and response headers

# 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 = {}) click to toggle source

page setup

@param name Document name. @param page_name The page name for setting. @param page_setting Page setting info. @param [Hash] opts the optional parameters @option opts [String] :folder Document folder. @return [ModifyResponse]

# 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 = {}) click to toggle source

page setup

@param name Document name. @param page_name The page name for setting. @param page_setting Page setting info. @param [Hash] opts the optional parameters @option opts [String] :folder Document folder. @return [Array<(ModifyResponse, Fixnum, Hash)>] ModifyResponse data, response status code and response headers

# 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 = {}) click to toggle source

draw ellipse on the page.

@param name Document name. @param page_name Page name. @param ellipse_data drawing ellipse data. @param [Hash] opts the optional parameters @option opts [String] :folder Document folder. @return [ModifyResponse]

# 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 = {}) click to toggle source

draw ellipse on the page.

@param name Document name. @param page_name Page name. @param ellipse_data drawing ellipse data. @param [Hash] opts the optional parameters @option opts [String] :folder Document folder. @return [Array<(ModifyResponse, Fixnum, Hash)>] ModifyResponse data, response status code and response headers

# 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 = {}) click to toggle source

draw line on the page.

@param name Document name. @param page_name Page name. @param line_data drawing line data. @param [Hash] opts the optional parameters @option opts [String] :folder Document folder. @return [ModifyResponse]

# 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 = {}) click to toggle source

draw line on the page.

@param name Document name. @param page_name Page name. @param line_data drawing line data. @param [Hash] opts the optional parameters @option opts [String] :folder Document folder. @return [Array<(ModifyResponse, Fixnum, Hash)>] ModifyResponse data, response status code and response headers

# 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 = {}) click to toggle source

draw polyline on the page.

@param name Document name. @param page_name Page name. @param polyline_data drawing polyline data. @param [Hash] opts the optional parameters @option opts [String] :folder Document folder. @return [ModifyResponse]

# 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 = {}) click to toggle source

draw polyline on the page.

@param name Document name. @param page_name Page name. @param polyline_data drawing polyline data. @param [Hash] opts the optional parameters @option opts [String] :folder Document folder. @return [Array<(ModifyResponse, Fixnum, Hash)>] ModifyResponse data, response status code and response headers

# 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 = {}) click to toggle source

Add new empty page

@param name Document name. @param page_name New page name. @param [Hash] opts the optional parameters @option opts [String] :folder Document folder. @return [ModifyResponse]

# 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 = {}) click to toggle source

Add new empty page

@param name Document name. @param page_name New page name. @param [Hash] opts the optional parameters @option opts [String] :folder Document folder. @return [Array<(ModifyResponse, Fixnum, Hash)>] ModifyResponse data, response status code and response headers

# 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_token() click to toggle source

Gets a request token from server

# 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 = {}) click to toggle source

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

@param name Original document name. @param save_options_request Save options. @param [Hash] opts the optional parameters @option opts [String] :folder Original document folder. @option opts [BOOLEAN] :is_overwrite If true overwrite the same name file.The default value is false (default to false) @return [SaveAsResponse]

# 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 = {}) click to toggle source

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

@param name Original document name. @param save_options_request Save options. @param [Hash] opts the optional parameters @option opts [String] :folder Original document folder. @option opts [BOOLEAN] :is_overwrite If true overwrite the same name file.The default value is false @return [Array<(SaveAsResponse, Fixnum, Hash)>] SaveAsResponse data, response status code and response headers

# 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