Class: PureCloud::LicensingApi

Inherits:
Object
  • Object
show all
Defined in:
lib/purecloud/api/licensing_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ LicensingApi

Returns a new instance of LicensingApi.



7
8
9
# File 'lib/purecloud/api/licensing_api.rb', line 7

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

Instance Attribute Details

#api_clientObject

Returns the value of attribute api_client.



5
6
7
# File 'lib/purecloud/api/licensing_api.rb', line 5

def api_client
  @api_client
end

Instance Method Details

#get_licenses(opts = {}) ⇒ Array<License>

Get Licenses required for a set of permissions.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :permission (Array<String>)

    Permission

Returns:



16
17
18
19
# File 'lib/purecloud/api/licensing_api.rb', line 16

def get_licenses(opts = {})
  data, status_code, headers = get_licenses_with_http_info(opts)
  return data
end

#get_licenses_with_http_info(opts = {}) ⇒ Array<(Array<License>, Fixnum, Hash)>

Get Licenses required for a set of permissions.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :permission (Array<String>)

    Permission

Returns:

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

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



26
27
28
29
30
31
32
33
34
35
36
37
38
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
# File 'lib/purecloud/api/licensing_api.rb', line 26

def get_licenses_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: LicensingApi#get_licenses ..."
  end
  
  # resource path
  path = "/api/v2/licensing/licenses".sub('{format}','json')

  # query parameters
  query_params = {}
  query_params[:'permission'] = @api_client.build_collection_param(opts[:'permission'], :multi) if opts[:'permission']

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  _header_accept = ['application/json']
  _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result

  # HTTP header 'Content-Type'
  _header_content_type = ['application/json']
  header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type)

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  

  auth_names = ['PureCloud Auth']
  data, status_code, headers = @api_client.call_api(:GET, path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'Array<License>')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: LicensingApi#get_licenses\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_orgassignments(opts = {}) ⇒ OrgLicenseAssignment

Get org license assignments.

Parameters:

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

    the optional parameters

Returns:



74
75
76
77
# File 'lib/purecloud/api/licensing_api.rb', line 74

def get_orgassignments(opts = {})
  data, status_code, headers = get_orgassignments_with_http_info(opts)
  return data
end

#get_orgassignments_id(id, opts = {}) ⇒ OrgLicenseAssignment

Get org license assignment.

Parameters:

  • id

    ID

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

    the optional parameters

Returns:



131
132
133
134
# File 'lib/purecloud/api/licensing_api.rb', line 131

def get_orgassignments_id(id, opts = {})
  data, status_code, headers = get_orgassignments_id_with_http_info(id, opts)
  return data
end

#get_orgassignments_id_with_http_info(id, opts = {}) ⇒ Array<(OrgLicenseAssignment, Fixnum, Hash)>

Get org license assignment.

Parameters:

  • id

    ID

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

    the optional parameters

Returns:

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

    OrgLicenseAssignment data, response status code and response headers



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
# File 'lib/purecloud/api/licensing_api.rb', line 141

def get_orgassignments_id_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: LicensingApi#get_orgassignments_id ..."
  end
  
  # verify the required parameter 'id' is set
  fail "Missing the required parameter 'id' when calling get_orgassignments_id" if id.nil?
  
  # resource path
  path = "/api/v2/licensing/orgassignments/{id}".sub('{format}','json').sub('{' + 'id' + '}', id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  _header_accept = ['application/json']
  _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result

  # HTTP header 'Content-Type'
  _header_content_type = ['application/json']
  header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type)

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  

  auth_names = ['PureCloud Auth']
  data, status_code, headers = @api_client.call_api(:GET, path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'OrgLicenseAssignment')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: LicensingApi#get_orgassignments_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_orgassignments_with_http_info(opts = {}) ⇒ Array<(OrgLicenseAssignment, Fixnum, Hash)>

Get org license assignments.

Parameters:

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

    the optional parameters

Returns:

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

    OrgLicenseAssignment data, response status code and response headers



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
# File 'lib/purecloud/api/licensing_api.rb', line 83

def get_orgassignments_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: LicensingApi#get_orgassignments ..."
  end
  
  # resource path
  path = "/api/v2/licensing/orgassignments".sub('{format}','json')

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  _header_accept = ['application/json']
  _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result

  # HTTP header 'Content-Type'
  _header_content_type = ['application/json']
  header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type)

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  

  auth_names = ['PureCloud Auth']
  data, status_code, headers = @api_client.call_api(:GET, path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'OrgLicenseAssignment')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: LicensingApi#get_orgassignments\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_permissions(opts = {}) ⇒ Array<LicensesByPermission>

Get Licenses required per permission.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :id (Array<String>)

    ID

Returns:



192
193
194
195
# File 'lib/purecloud/api/licensing_api.rb', line 192

def get_permissions(opts = {})
  data, status_code, headers = get_permissions_with_http_info(opts)
  return data
end

#get_permissions_with_http_info(opts = {}) ⇒ Array<(Array<LicensesByPermission>, Fixnum, Hash)>

Get Licenses required per permission.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :id (Array<String>)

    ID

Returns:

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

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



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
232
233
234
235
236
237
238
239
240
241
242
243
244
# File 'lib/purecloud/api/licensing_api.rb', line 202

def get_permissions_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: LicensingApi#get_permissions ..."
  end
  
  # resource path
  path = "/api/v2/licensing/permissions".sub('{format}','json')

  # query parameters
  query_params = {}
  query_params[:'id'] = @api_client.build_collection_param(opts[:'id'], :multi) if opts[:'id']

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  _header_accept = ['application/json']
  _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result

  # HTTP header 'Content-Type'
  _header_content_type = ['application/json']
  header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type)

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  

  auth_names = ['PureCloud Auth']
  data, status_code, headers = @api_client.call_api(:GET, path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'Array<LicensesByPermission>')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: LicensingApi#get_permissions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_userassignments(opts = {}) ⇒ UserLicenseAssignment

Get user license assignments.

Parameters:

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

    the optional parameters

Returns:



311
312
313
314
# File 'lib/purecloud/api/licensing_api.rb', line 311

def get_userassignments(opts = {})
  data, status_code, headers = get_userassignments_with_http_info(opts)
  return data
end

#get_userassignments_id(id, opts = {}) ⇒ UserLicenseAssignment

Get user license assignment.

Parameters:

  • id

    ID

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

    the optional parameters

Returns:



368
369
370
371
# File 'lib/purecloud/api/licensing_api.rb', line 368

def get_userassignments_id(id, opts = {})
  data, status_code, headers = get_userassignments_id_with_http_info(id, opts)
  return data
end

#get_userassignments_id_with_http_info(id, opts = {}) ⇒ Array<(UserLicenseAssignment, Fixnum, Hash)>

Get user license assignment.

Parameters:

  • id

    ID

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

    the optional parameters

Returns:

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

    UserLicenseAssignment data, response status code and response headers



378
379
380
381
382
383
384
385
386
387
388
389
390
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
# File 'lib/purecloud/api/licensing_api.rb', line 378

def get_userassignments_id_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: LicensingApi#get_userassignments_id ..."
  end
  
  # verify the required parameter 'id' is set
  fail "Missing the required parameter 'id' when calling get_userassignments_id" if id.nil?
  
  # resource path
  path = "/api/v2/licensing/userassignments/{id}".sub('{format}','json').sub('{' + 'id' + '}', id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  _header_accept = ['application/json']
  _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result

  # HTTP header 'Content-Type'
  _header_content_type = ['application/json']
  header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type)

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  

  auth_names = ['PureCloud Auth']
  data, status_code, headers = @api_client.call_api(:GET, path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'UserLicenseAssignment')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: LicensingApi#get_userassignments_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_userassignments_with_http_info(opts = {}) ⇒ Array<(UserLicenseAssignment, Fixnum, Hash)>

Get user license assignments.

Parameters:

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

    the optional parameters

Returns:

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

    UserLicenseAssignment data, response status code and response headers



320
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
# File 'lib/purecloud/api/licensing_api.rb', line 320

def get_userassignments_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: LicensingApi#get_userassignments ..."
  end
  
  # resource path
  path = "/api/v2/licensing/userassignments".sub('{format}','json')

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  _header_accept = ['application/json']
  _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result

  # HTTP header 'Content-Type'
  _header_content_type = ['application/json']
  header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type)

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  

  auth_names = ['PureCloud Auth']
  data, status_code, headers = @api_client.call_api(:GET, path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'UserLicenseAssignment')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: LicensingApi#get_userassignments\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#post_permissions(opts = {}) ⇒ Array<LicensesByPermission>

Get Licenses required per permission.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :id (Array<String>)

    ID

  • :body (Permissions)

    The permissions details

Returns:



252
253
254
255
# File 'lib/purecloud/api/licensing_api.rb', line 252

def post_permissions(opts = {})
  data, status_code, headers = post_permissions_with_http_info(opts)
  return data
end

#post_permissions_with_http_info(opts = {}) ⇒ Array<(Array<LicensesByPermission>, Fixnum, Hash)>

Get Licenses required per permission.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :id (Array<String>)

    ID

  • :body (Permissions)

    The permissions details

Returns:

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

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



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
299
300
301
302
303
304
305
# File 'lib/purecloud/api/licensing_api.rb', line 263

def post_permissions_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: LicensingApi#post_permissions ..."
  end
  
  # resource path
  path = "/api/v2/licensing/permissions".sub('{format}','json')

  # query parameters
  query_params = {}
  query_params[:'id'] = @api_client.build_collection_param(opts[:'id'], :multi) if opts[:'id']

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  _header_accept = ['application/json']
  _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result

  # HTTP header 'Content-Type'
  _header_content_type = ['application/json']
  header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type)

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(opts[:'body'])
  

  auth_names = ['PureCloud Auth']
  data, status_code, headers = @api_client.call_api(:POST, path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'Array<LicensesByPermission>')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: LicensingApi#post_permissions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end