Class: GroupDocsConversionCloud::InfoApi

Inherits:
Object
  • Object
show all
Defined in:
lib/groupdocs_conversion_cloud/api/info_api.rb

Overview

GroupDocs.Conversion Cloud API

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(config) ⇒ InfoApi

Initializes new instance of InfoApi

Parameters:



43
44
45
46
47
# File 'lib/groupdocs_conversion_cloud/api/info_api.rb', line 43

def initialize(config)
  @config = config
  @api_client = ApiClient.new(config)
  @access_token = nil
end

Instance Attribute Details

#configObject

Returns the value of attribute config.



34
35
36
# File 'lib/groupdocs_conversion_cloud/api/info_api.rb', line 34

def config
  @config
end

Class Method Details

.from_config(config) ⇒ InfoApi

Initializes new instance of InfoApi

Parameters:

Returns:

  • (InfoApi)

    New instance of InfoApi



63
64
65
# File 'lib/groupdocs_conversion_cloud/api/info_api.rb', line 63

def self.from_config(config)
  return new(config)
end

.from_keys(app_sid, app_key) ⇒ InfoApi

Initializes new instance of InfoApi

Parameters:

  • Application (app_sid)

    identifier (App SID)

  • Application (app_key)

    private key (App Key)

Returns:

  • (InfoApi)

    New instance of InfoApi



54
55
56
57
# File 'lib/groupdocs_conversion_cloud/api/info_api.rb', line 54

def self.from_keys(app_sid, app_key)
  config = Configuration.new(app_sid, app_key)
  return new(config)
end

Instance Method Details

#get_document_metadata(request) ⇒ DocumentMetadata

Returns metadata for provided document

Parameters:

  • request

    get_document_metadata_request

Returns:



71
72
73
74
# File 'lib/groupdocs_conversion_cloud/api/info_api.rb', line 71

def (request)
  data, _status_code, _headers = (request)
  data
end

#get_document_metadata_with_http_info(request) ⇒ Array<(DocumentMetadata, Fixnum, Hash)>

Returns metadata for provided document

DocumentMetadata data, response status code and response headers

Parameters:

  • request

    get_document_metadata_request

Returns:

Raises:

  • (ArgumentError)


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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
# File 'lib/groupdocs_conversion_cloud/api/info_api.rb', line 81

def (request)
  raise ArgumentError, 'Incorrect request type' unless request.is_a? GetDocumentMetadataRequest

  @api_client.config.logger.debug 'Calling API: InfoApi.get_document_metadata ...' if @api_client.config.debugging
  # resource path
  local_var_path = '/conversion/info'

  # query parameters
  query_params = {}
  if local_var_path.include? ('{' + downcase_first_letter('FilePath') + '}')
    local_var_path = local_var_path.sub('{' + downcase_first_letter('FilePath') + '}', request.file_path.to_s)
  else
    query_params[downcase_first_letter('FilePath')] = request.file_path unless request.file_path.nil?
  end
  if local_var_path.include? ('{' + downcase_first_letter('StorageName') + '}')
    local_var_path = local_var_path.sub('{' + downcase_first_letter('StorageName') + '}', request.storage_name.to_s)
  else
    query_params[downcase_first_letter('StorageName')] = request.storage_name unless request.storage_name.nil?
  end

  # 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
  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,
                                                    access_token: get_access_token,
                                                    return_type: 'DocumentMetadata')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called:
    InfoApi#get_document_metadata\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  [data, status_code, headers]
end

#get_supported_conversion_types(request) ⇒ Array<SupportedFormat>

Returns all supported conversion types

Parameters:

  • request

    get_supported_conversion_types_request

Returns:



131
132
133
134
# File 'lib/groupdocs_conversion_cloud/api/info_api.rb', line 131

def get_supported_conversion_types(request)
  data, _status_code, _headers = get_supported_conversion_types_with_http_info(request)
  data
end

#get_supported_conversion_types_with_http_info(request) ⇒ Array<(Array<SupportedFormat>, Fixnum, Hash)>

Returns all supported conversion types

Array<SupportedFormat> data, response status code and response headers

Parameters:

  • request

    get_supported_conversion_types_request

Returns:

Raises:

  • (ArgumentError)


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
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
# File 'lib/groupdocs_conversion_cloud/api/info_api.rb', line 141

def get_supported_conversion_types_with_http_info(request)
  raise ArgumentError, 'Incorrect request type' unless request.is_a? GetSupportedConversionTypesRequest

  @api_client.config.logger.debug 'Calling API: InfoApi.get_supported_conversion_types ...' if @api_client.config.debugging
  # resource path
  local_var_path = '/conversion/formats'

  # query parameters
  query_params = {}
  if local_var_path.include? ('{' + downcase_first_letter('FilePath') + '}')
    local_var_path = local_var_path.sub('{' + downcase_first_letter('FilePath') + '}', request.file_path.to_s)
  else
    query_params[downcase_first_letter('FilePath')] = request.file_path unless request.file_path.nil?
  end
  if local_var_path.include? ('{' + downcase_first_letter('StorageName') + '}')
    local_var_path = local_var_path.sub('{' + downcase_first_letter('StorageName') + '}', request.storage_name.to_s)
  else
    query_params[downcase_first_letter('StorageName')] = request.storage_name unless request.storage_name.nil?
  end
  if local_var_path.include? ('{' + downcase_first_letter('format') + '}')
    local_var_path = local_var_path.sub('{' + downcase_first_letter('format') + '}', request.format.to_s)
  else
    query_params[downcase_first_letter('format')] = request.format unless request.format.nil?
  end

  # 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
  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,
                                                    access_token: get_access_token,
                                                    return_type: 'Array<SupportedFormat>')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called:
    InfoApi#get_supported_conversion_types\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  [data, status_code, headers]
end