Class: GroupDocsConversionCloud::LicenseApi

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

Overview

GroupDocs.Conversion Cloud API

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(config) ⇒ LicenseApi

Initializes new instance of LicenseApi

Parameters:



43
44
45
46
47
# File 'lib/groupdocs_conversion_cloud/api/license_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/license_api.rb', line 34

def config
  @config
end

Class Method Details

.from_config(config) ⇒ LicenseApi

Initializes new instance of LicenseApi

Parameters:

Returns:



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

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

.from_keys(app_sid, app_key) ⇒ LicenseApi

Initializes new instance of LicenseApi

Parameters:

  • Application (app_sid)

    identifier (App SID)

  • Application (app_key)

    private key (App Key)

Returns:



54
55
56
57
# File 'lib/groupdocs_conversion_cloud/api/license_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_consumption_creditConsumptionResult

Get license consumption

Returns:



70
71
72
73
# File 'lib/groupdocs_conversion_cloud/api/license_api.rb', line 70

def get_consumption_credit()
  data, _status_code, _headers = get_consumption_credit_with_http_info()
  data
end

#get_consumption_credit_with_http_infoArray<(ConsumptionResult, Fixnum, Hash)>

ConsumptionResult data, response status code and response headers

Returns:



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
106
107
108
109
110
111
112
113
114
# File 'lib/groupdocs_conversion_cloud/api/license_api.rb', line 80

def get_consumption_credit_with_http_info()
  

  @api_client.config.logger.debug 'Calling API: LicenseApi.get_consumption_credit ...' if @api_client.config.debugging
  # resource path
  local_var_path = '/conversion/consumption'

  # 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(['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: 'ConsumptionResult')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called:
    LicenseApi#get_consumption_credit\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  [data, status_code, headers]
end

#get_license_infoLicenseInfo

Get license information

Returns:



119
120
121
122
# File 'lib/groupdocs_conversion_cloud/api/license_api.rb', line 119

def get_license_info()
  data, _status_code, _headers = get_license_info_with_http_info()
  data
end

#get_license_info_with_http_infoArray<(LicenseInfo, Fixnum, Hash)>

LicenseInfo data, response status code and response headers

Returns:



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
# File 'lib/groupdocs_conversion_cloud/api/license_api.rb', line 129

def get_license_info_with_http_info()
  

  @api_client.config.logger.debug 'Calling API: LicenseApi.get_license_info ...' if @api_client.config.debugging
  # resource path
  local_var_path = '/conversion/license'

  # 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(['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: 'LicenseInfo')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called:
    LicenseApi#get_license_info\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  [data, status_code, headers]
end