class PureCloud::LicenseApi

Attributes

api_client[RW]

Public Class Methods

new(api_client = ApiClient.default) click to toggle source
# File lib/purecloudplatformclientv2/api/license_api.rb, line 23
def initialize(api_client = ApiClient.default)
  @api_client = api_client
end

Public Instance Methods

get_license_definition(license_id, opts = {}) click to toggle source

Get PureCloud license definition.

@param license_id ID @param [Hash] opts the optional parameters @return [LicenseDefinition]

# File lib/purecloudplatformclientv2/api/license_api.rb, line 32
def get_license_definition(license_id, opts = {})
  data, _status_code, _headers = get_license_definition_with_http_info(license_id, opts)
  return data
end
get_license_definition_with_http_info(license_id, opts = {}) click to toggle source

Get PureCloud license definition.

@param license_id ID @param [Hash] opts the optional parameters @return [Array<(LicenseDefinition, Fixnum, Hash)>] LicenseDefinition data, response status code and response headers

# File lib/purecloudplatformclientv2/api/license_api.rb, line 42
def get_license_definition_with_http_info(license_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: LicenseApi.get_license_definition ..."
  end
  
  
  # verify the required parameter 'license_id' is set
  fail ArgumentError, "Missing the required parameter 'license_id' when calling LicenseApi.get_license_definition" if license_id.nil?
  
  
  
  
  
  # resource path
  local_var_path = "/api/v2/license/definitions/{licenseId}".sub('{format}','json').sub('{' + 'licenseId' + '}', license_id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}

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

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

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  
  auth_names = ['PureCloud OAuth']
  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 => 'LicenseDefinition')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: LicenseApi#get_license_definition\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
get_license_definitions(opts = {}) click to toggle source

Get all PureCloud license definitions available for the organization.

@param [Hash] opts the optional parameters @return [Array<LicenseDefinition>]

# File lib/purecloudplatformclientv2/api/license_api.rb, line 96
def get_license_definitions(opts = {})
  data, _status_code, _headers = get_license_definitions_with_http_info(opts)
  return data
end
get_license_definitions_with_http_info(opts = {}) click to toggle source

Get all PureCloud license definitions available for the organization.

@param [Hash] opts the optional parameters @return [Array<(Array<LicenseDefinition>, Fixnum, Hash)>] Array<LicenseDefinition> data, response status code and response headers

# File lib/purecloudplatformclientv2/api/license_api.rb, line 105
def get_license_definitions_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: LicenseApi.get_license_definitions ..."
  end
  
  # resource path
  local_var_path = "/api/v2/license/definitions".sub('{format}','json')

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}

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

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

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  
  auth_names = ['PureCloud OAuth']
  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 => 'Array<LicenseDefinition>')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: LicenseApi#get_license_definitions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
get_license_toggle(feature_name, opts = {}) click to toggle source

Get PureCloud license feature toggle value.

@param feature_name featureName @param [Hash] opts the optional parameters @return [LicenseOrgToggle]

# File lib/purecloudplatformclientv2/api/license_api.rb, line 152
def get_license_toggle(feature_name, opts = {})
  data, _status_code, _headers = get_license_toggle_with_http_info(feature_name, opts)
  return data
end
get_license_toggle_with_http_info(feature_name, opts = {}) click to toggle source

Get PureCloud license feature toggle value.

@param feature_name featureName @param [Hash] opts the optional parameters @return [Array<(LicenseOrgToggle, Fixnum, Hash)>] LicenseOrgToggle data, response status code and response headers

# File lib/purecloudplatformclientv2/api/license_api.rb, line 162
def get_license_toggle_with_http_info(feature_name, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: LicenseApi.get_license_toggle ..."
  end
  
  
  # verify the required parameter 'feature_name' is set
  fail ArgumentError, "Missing the required parameter 'feature_name' when calling LicenseApi.get_license_toggle" if feature_name.nil?
  
  
  
  
  
  # resource path
  local_var_path = "/api/v2/license/toggles/{featureName}".sub('{format}','json').sub('{' + 'featureName' + '}', feature_name.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}

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

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

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  
  auth_names = ['PureCloud OAuth']
  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 => 'LicenseOrgToggle')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: LicenseApi#get_license_toggle\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
get_license_user(user_id, opts = {}) click to toggle source

Get licenses for specified user.

@param user_id ID @param [Hash] opts the optional parameters @return [LicenseUser]

# File lib/purecloudplatformclientv2/api/license_api.rb, line 217
def get_license_user(user_id, opts = {})
  data, _status_code, _headers = get_license_user_with_http_info(user_id, opts)
  return data
end
get_license_user_with_http_info(user_id, opts = {}) click to toggle source

Get licenses for specified user.

@param user_id ID @param [Hash] opts the optional parameters @return [Array<(LicenseUser, Fixnum, Hash)>] LicenseUser data, response status code and response headers

# File lib/purecloudplatformclientv2/api/license_api.rb, line 227
def get_license_user_with_http_info(user_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: LicenseApi.get_license_user ..."
  end
  
  
  # verify the required parameter 'user_id' is set
  fail ArgumentError, "Missing the required parameter 'user_id' when calling LicenseApi.get_license_user" if user_id.nil?
  
  
  
  
  
  # resource path
  local_var_path = "/api/v2/license/users/{userId}".sub('{format}','json').sub('{' + 'userId' + '}', user_id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}

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

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

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  
  auth_names = ['PureCloud OAuth']
  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 => 'LicenseUser')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: LicenseApi#get_license_user\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
get_license_users(opts = {}) click to toggle source

Get a page of users and their licenses Retrieve a page of users in an organization along with the licenses they possess. @param [Hash] opts the optional parameters @option opts [Integer] :page_size Page size (default to 25) @option opts [Integer] :page_number Page number (default to 1) @return [UserLicensesEntityListing]

# File lib/purecloudplatformclientv2/api/license_api.rb, line 283
def get_license_users(opts = {})
  data, _status_code, _headers = get_license_users_with_http_info(opts)
  return data
end
get_license_users_with_http_info(opts = {}) click to toggle source

Get a page of users and their licenses Retrieve a page of users in an organization along with the licenses they possess. @param [Hash] opts the optional parameters @option opts [Integer] :page_size Page size @option opts [Integer] :page_number Page number @return [Array<(UserLicensesEntityListing, Fixnum, Hash)>] UserLicensesEntityListing data, response status code and response headers

# File lib/purecloudplatformclientv2/api/license_api.rb, line 294
def get_license_users_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: LicenseApi.get_license_users ..."
  end
  
  
  
  
  
  
  
  
  
  
  
  
  
  # resource path
  local_var_path = "/api/v2/license/users".sub('{format}','json')

  # query parameters
  query_params = {}
  query_params[:'pageSize'] = opts[:'page_size'] if opts[:'page_size']
  query_params[:'pageNumber'] = opts[:'page_number'] if opts[:'page_number']

  # header parameters
  header_params = {}

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

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

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  
  auth_names = ['PureCloud OAuth']
  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 => 'UserLicensesEntityListing')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: LicenseApi#get_license_users\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
post_license_infer(opts = {}) click to toggle source

Get a list of licenses inferred based on a list of roleIds

@param [Hash] opts the optional parameters @option opts [Array<String>] :body The roleIds to use while inferring licenses @return [Array<String>]

# File lib/purecloudplatformclientv2/api/license_api.rb, line 355
def post_license_infer(opts = {})
  data, _status_code, _headers = post_license_infer_with_http_info(opts)
  return data
end
post_license_infer_with_http_info(opts = {}) click to toggle source

Get a list of licenses inferred based on a list of roleIds

@param [Hash] opts the optional parameters @option opts [Array<String>] :body The roleIds to use while inferring licenses @return [Array<(Array<String>, Fixnum, Hash)>] Array<String> data, response status code and response headers

# File lib/purecloudplatformclientv2/api/license_api.rb, line 365
def post_license_infer_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: LicenseApi.post_license_infer ..."
  end
  
  
  
  
  
  
  
  # resource path
  local_var_path = "/api/v2/license/infer".sub('{format}','json')

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}

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

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

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(opts[:'body'])
  
  auth_names = ['PureCloud OAuth']
  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 => 'Array<String>')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: LicenseApi#post_license_infer\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
post_license_organization(opts = {}) click to toggle source

Update the organization's license assignments in a batch.

@param [Hash] opts the optional parameters @option opts [LicenseBatchAssignmentRequest] :body The license assignments to update. @return [Array<LicenseUpdateStatus>]

# File lib/purecloudplatformclientv2/api/license_api.rb, line 418
def post_license_organization(opts = {})
  data, _status_code, _headers = post_license_organization_with_http_info(opts)
  return data
end
post_license_organization_with_http_info(opts = {}) click to toggle source

Update the organization&#39;s license assignments in a batch.

@param [Hash] opts the optional parameters @option opts [LicenseBatchAssignmentRequest] :body The license assignments to update. @return [Array<(Array<LicenseUpdateStatus>, Fixnum, Hash)>] Array<LicenseUpdateStatus> data, response status code and response headers

# File lib/purecloudplatformclientv2/api/license_api.rb, line 428
def post_license_organization_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: LicenseApi.post_license_organization ..."
  end
  
  
  
  
  
  
  
  # resource path
  local_var_path = "/api/v2/license/organization".sub('{format}','json')

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}

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

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

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(opts[:'body'])
  
  auth_names = ['PureCloud OAuth']
  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 => 'Array<LicenseUpdateStatus>')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: LicenseApi#post_license_organization\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
post_license_toggle(feature_name, opts = {}) click to toggle source

Switch PureCloud license feature toggle value.

@param feature_name featureName @param [Hash] opts the optional parameters @return [LicenseOrgToggle]

# File lib/purecloudplatformclientv2/api/license_api.rb, line 481
def post_license_toggle(feature_name, opts = {})
  data, _status_code, _headers = post_license_toggle_with_http_info(feature_name, opts)
  return data
end
post_license_toggle_with_http_info(feature_name, opts = {}) click to toggle source

Switch PureCloud license feature toggle value.

@param feature_name featureName @param [Hash] opts the optional parameters @return [Array<(LicenseOrgToggle, Fixnum, Hash)>] LicenseOrgToggle data, response status code and response headers

# File lib/purecloudplatformclientv2/api/license_api.rb, line 491
def post_license_toggle_with_http_info(feature_name, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: LicenseApi.post_license_toggle ..."
  end
  
  
  # verify the required parameter 'feature_name' is set
  fail ArgumentError, "Missing the required parameter 'feature_name' when calling LicenseApi.post_license_toggle" if feature_name.nil?
  
  
  
  
  
  # resource path
  local_var_path = "/api/v2/license/toggles/{featureName}".sub('{format}','json').sub('{' + 'featureName' + '}', feature_name.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}

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

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

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  
  auth_names = ['PureCloud OAuth']
  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 => 'LicenseOrgToggle')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: LicenseApi#post_license_toggle\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
post_license_users(opts = {}) click to toggle source

Fetch user licenses in a batch.

@param [Hash] opts the optional parameters @option opts [Array<String>] :body The user IDs to fetch. @return [Hash<String, Object>]

# File lib/purecloudplatformclientv2/api/license_api.rb, line 546
def post_license_users(opts = {})
  data, _status_code, _headers = post_license_users_with_http_info(opts)
  return data
end
post_license_users_with_http_info(opts = {}) click to toggle source

Fetch user licenses in a batch.

@param [Hash] opts the optional parameters @option opts [Array<String>] :body The user IDs to fetch. @return [Array<(Hash<String, Object>, Fixnum, Hash)>] Hash<String, Object> data, response status code and response headers

# File lib/purecloudplatformclientv2/api/license_api.rb, line 556
def post_license_users_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: LicenseApi.post_license_users ..."
  end
  
  
  
  
  
  
  
  # resource path
  local_var_path = "/api/v2/license/users".sub('{format}','json')

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}

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

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

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(opts[:'body'])
  
  auth_names = ['PureCloud OAuth']
  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 => 'Hash<String, Object>')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: LicenseApi#post_license_users\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end