class PureCloud::AttributesApi

Attributes

api_client[RW]

Public Class Methods

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

Public Instance Methods

delete_attribute_id(attribute_id, opts = {}) click to toggle source

Delete an existing Attribute. This will remove attribute. @param attribute_id Attribute ID @param [Hash] opts the optional parameters @return [nil]

# File lib/purecloud/api/attributes_api.rb, line 32
def delete_attribute_id(attribute_id, opts = {})
  delete_attribute_id_with_http_info(attribute_id, opts)
  return nil
end
delete_attribute_id_with_http_info(attribute_id, opts = {}) click to toggle source

Delete an existing Attribute. This will remove attribute. @param attribute_id Attribute ID @param [Hash] opts the optional parameters @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers

# File lib/purecloud/api/attributes_api.rb, line 42
def delete_attribute_id_with_http_info(attribute_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: AttributesApi#delete_attribute_id ..."
  end
  
  # verify the required parameter 'attribute_id' is set
  fail "Missing the required parameter 'attribute_id' when calling delete_attribute_id" if attribute_id.nil?
  
  # resource path
  local_var_path = "/api/v2/attributes/{attributeId}".sub('{format}','json').sub('{' + 'attributeId' + '}', attribute_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(:DELETE, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AttributesApi#delete_attribute_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
get_attribute_id(attribute_id, opts = {}) click to toggle source

Get details about an existing attribute.

@param attribute_id Attribute ID @param [Hash] opts the optional parameters @return [Attribute]

# File lib/purecloud/api/attributes_api.rb, line 91
def get_attribute_id(attribute_id, opts = {})
  data, status_code, headers = get_attribute_id_with_http_info(attribute_id, opts)
  return data
end
get_attribute_id_with_http_info(attribute_id, opts = {}) click to toggle source

Get details about an existing attribute.

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

# File lib/purecloud/api/attributes_api.rb, line 101
def get_attribute_id_with_http_info(attribute_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: AttributesApi#get_attribute_id ..."
  end
  
  # verify the required parameter 'attribute_id' is set
  fail "Missing the required parameter 'attribute_id' when calling get_attribute_id" if attribute_id.nil?
  
  # resource path
  local_var_path = "/api/v2/attributes/{attributeId}".sub('{format}','json').sub('{' + 'attributeId' + '}', attribute_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, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'Attribute')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AttributesApi#get_attribute_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
get_attributes(opts = {}) click to toggle source

Gets a list of existing attributes.

@param [Hash] opts the optional parameters @option opts [Integer] :page_number Page number (default to 1) @option opts [Integer] :page_size Page size (default to 25) @return [AttributeEntityListing]

# File lib/purecloud/api/attributes_api.rb, line 152
def get_attributes(opts = {})
  data, status_code, headers = get_attributes_with_http_info(opts)
  return data
end
get_attributes_with_http_info(opts = {}) click to toggle source

Gets a list of existing attributes.

@param [Hash] opts the optional parameters @option opts [Integer] :page_number Page number @option opts [Integer] :page_size Page size @return [Array<(AttributeEntityListing, Fixnum, Hash)>] AttributeEntityListing data, response status code and response headers

# File lib/purecloud/api/attributes_api.rb, line 163
def get_attributes_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: AttributesApi#get_attributes ..."
  end
  
  # resource path
  local_var_path = "/api/v2/attributes".sub('{format}','json')

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

  # 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, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'AttributeEntityListing')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AttributesApi#get_attributes\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
post_attributes(body, opts = {}) click to toggle source

Create an attribute.

@param body Attribute @param [Hash] opts the optional parameters @return [Attribute]

# File lib/purecloud/api/attributes_api.rb, line 212
def post_attributes(body, opts = {})
  data, status_code, headers = post_attributes_with_http_info(body, opts)
  return data
end
post_attributes_with_http_info(body, opts = {}) click to toggle source

Create an attribute.

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

# File lib/purecloud/api/attributes_api.rb, line 222
def post_attributes_with_http_info(body, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: AttributesApi#post_attributes ..."
  end
  
  # verify the required parameter 'body' is set
  fail "Missing the required parameter 'body' when calling post_attributes" if body.nil?
  
  # resource path
  local_var_path = "/api/v2/attributes".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 = @api_client.object_to_http_body(body)
  
  auth_names = ['PureCloud Auth']
  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 => 'Attribute')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AttributesApi#post_attributes\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
post_query(body, opts = {}) click to toggle source

Query attributes

@param body query @param [Hash] opts the optional parameters @return [AttributeEntityListing]

# File lib/purecloud/api/attributes_api.rb, line 272
def post_query(body, opts = {})
  data, status_code, headers = post_query_with_http_info(body, opts)
  return data
end
post_query_with_http_info(body, opts = {}) click to toggle source

Query attributes

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

# File lib/purecloud/api/attributes_api.rb, line 282
def post_query_with_http_info(body, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: AttributesApi#post_query ..."
  end
  
  # verify the required parameter 'body' is set
  fail "Missing the required parameter 'body' when calling post_query" if body.nil?
  
  # resource path
  local_var_path = "/api/v2/attributes/query".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 = @api_client.object_to_http_body(body)
  
  auth_names = ['PureCloud Auth']
  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 => 'AttributeEntityListing')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AttributesApi#post_query\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
put_attribute_id(attribute_id, body, opts = {}) click to toggle source

Update an existing attribute. Fields that can be updated: name, description. The most recent version is required for updates. @param attribute_id Attribute ID @param body Attribute @param [Hash] opts the optional parameters @return [Attribute]

# File lib/purecloud/api/attributes_api.rb, line 333
def put_attribute_id(attribute_id, body, opts = {})
  data, status_code, headers = put_attribute_id_with_http_info(attribute_id, body, opts)
  return data
end
put_attribute_id_with_http_info(attribute_id, body, opts = {}) click to toggle source

Update an existing attribute. Fields that can be updated: name, description. The most recent version is required for updates. @param attribute_id Attribute ID @param body Attribute @param [Hash] opts the optional parameters @return [Array<(Attribute, Fixnum, Hash)>] Attribute data, response status code and response headers

# File lib/purecloud/api/attributes_api.rb, line 344
def put_attribute_id_with_http_info(attribute_id, body, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: AttributesApi#put_attribute_id ..."
  end
  
  # verify the required parameter 'attribute_id' is set
  fail "Missing the required parameter 'attribute_id' when calling put_attribute_id" if attribute_id.nil?
  
  # verify the required parameter 'body' is set
  fail "Missing the required parameter 'body' when calling put_attribute_id" if body.nil?
  
  # resource path
  local_var_path = "/api/v2/attributes/{attributeId}".sub('{format}','json').sub('{' + 'attributeId' + '}', attribute_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 = @api_client.object_to_http_body(body)
  
  auth_names = ['PureCloud Auth']
  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 => 'Attribute')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AttributesApi#put_attribute_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end