lib/purecloud/api/attributes_api.rb in purecloud-0.35.1 vs lib/purecloud/api/attributes_api.rb in purecloud-0.36.1

- old
+ new

@@ -1,44 +1,59 @@ +=begin +PureCloud API + +PureCloud API + +OpenAPI spec version: v1 +Contact: chuck.pulfer@inin.com +Generated by: https://github.com/swagger-api/swagger-codegen.git + +License: ININ +http://www.inin.com + +Terms of Service: http://www.inin.com + +=end + require "uri" module PureCloud class AttributesApi attr_accessor :api_client def initialize(api_client = ApiClient.default) @api_client = api_client end - # Gets a list of existing attributes. - # + # Delete an existing Attribute. + # This will remove attribute. + # @param attribute_id Attribute ID # @param [Hash] opts the optional parameters - # @option opts [Integer] :page_number Page number - # @option opts [Integer] :page_size Page size - # @return [AttributeEntityListing] - def get_attributes(opts = {}) - data, status_code, headers = get_attributes_with_http_info(opts) - return data + # @return [nil] + def delete_attribute_id(attribute_id, opts = {}) + delete_attribute_id_with_http_info(attribute_id, opts) + return nil end - # Gets a list of existing attributes. - # + # Delete an existing Attribute. + # This will remove attribute. + # @param attribute_id Attribute ID # @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 - def get_attributes_with_http_info(opts = {}) + # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers + def delete_attribute_id_with_http_info(attribute_id, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug "Calling API: AttributesApi#get_attributes ..." + @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 - path = "/api/v2/attributes".sub('{format}','json') + local_var_path = "/api/v2/attributes/{attributeId}".sub('{format}','json').sub('{' + 'attributeId' + '}', attribute_id.to_s) # 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) @@ -53,47 +68,48 @@ form_params = {} # http body (model) post_body = nil - auth_names = ['PureCloud Auth'] - data, status_code, headers = @api_client.call_api(:GET, path, + 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, - :return_type => 'AttributeEntityListing') + :auth_names => auth_names) if @api_client.config.debugging - @api_client.config.logger.debug "API called: AttributesApi#get_attributes\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @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 - # Create an attribute. + # Get details about an existing attribute. # + # @param attribute_id Attribute ID # @param [Hash] opts the optional parameters - # @option opts [Attribute] :body Attribute # @return [Attribute] - def post_attributes(opts = {}) - data, status_code, headers = post_attributes_with_http_info(opts) + def get_attribute_id(attribute_id, opts = {}) + data, status_code, headers = get_attribute_id_with_http_info(attribute_id, opts) return data end - # Create an attribute. + # Get details about an existing attribute. # + # @param attribute_id Attribute ID # @param [Hash] opts the optional parameters - # @option opts [Attribute] :body Attribute # @return [Array<(Attribute, Fixnum, Hash)>] Attribute data, response status code and response headers - def post_attributes_with_http_info(opts = {}) + def get_attribute_id_with_http_info(attribute_id, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug "Calling API: AttributesApi#post_attributes ..." + @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 - path = "/api/v2/attributes".sub('{format}','json') + local_var_path = "/api/v2/attributes/{attributeId}".sub('{format}','json').sub('{' + 'attributeId' + '}', attribute_id.to_s) # query parameters query_params = {} # header parameters @@ -109,52 +125,55 @@ # form parameters form_params = {} # http body (model) - post_body = @api_client.object_to_http_body(opts[:'body']) + post_body = nil - auth_names = ['PureCloud Auth'] - data, status_code, headers = @api_client.call_api(:POST, path, + 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#post_attributes\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @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 - # Query attributes + # Gets a list of existing attributes. # # @param [Hash] opts the optional parameters - # @option opts [AttributeQueryRequest] :body query + # @option opts [Integer] :page_number Page number (default to 1) + # @option opts [Integer] :page_size Page size (default to 25) # @return [AttributeEntityListing] - def post_query(opts = {}) - data, status_code, headers = post_query_with_http_info(opts) + def get_attributes(opts = {}) + data, status_code, headers = get_attributes_with_http_info(opts) return data end - # Query attributes + # Gets a list of existing attributes. # # @param [Hash] opts the optional parameters - # @option opts [AttributeQueryRequest] :body query + # @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 - def post_query_with_http_info(opts = {}) + def get_attributes_with_http_info(opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug "Calling API: AttributesApi#post_query ..." + @api_client.config.logger.debug "Calling API: AttributesApi#get_attributes ..." end # resource path - path = "/api/v2/attributes/query".sub('{format}','json') + 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) @@ -167,52 +186,48 @@ # form parameters form_params = {} # http body (model) - post_body = @api_client.object_to_http_body(opts[:'body']) + post_body = nil - auth_names = ['PureCloud Auth'] - data, status_code, headers = @api_client.call_api(:POST, path, + 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#post_query\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @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 - # Get details about an existing attribute. + # Create an attribute. # - # @param attribute_id Attribute ID # @param [Hash] opts the optional parameters + # @option opts [Attribute] :body Attribute # @return [Attribute] - def get_attribute_id(attribute_id, opts = {}) - data, status_code, headers = get_attribute_id_with_http_info(attribute_id, opts) + def post_attributes(opts = {}) + data, status_code, headers = post_attributes_with_http_info(opts) return data end - # Get details about an existing attribute. + # Create an attribute. # - # @param attribute_id Attribute ID # @param [Hash] opts the optional parameters + # @option opts [Attribute] :body Attribute # @return [Array<(Attribute, Fixnum, Hash)>] Attribute data, response status code and response headers - def get_attribute_id_with_http_info(attribute_id, opts = {}) + def post_attributes_with_http_info(opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug "Calling API: AttributesApi#get_attribute_id ..." + @api_client.config.logger.debug "Calling API: AttributesApi#post_attributes ..." 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 - path = "/api/v2/attributes/{attributeId}".sub('{format}','json').sub('{' + 'attributeId' + '}', attribute_id.to_s) + local_var_path = "/api/v2/attributes".sub('{format}','json') # query parameters query_params = {} # header parameters @@ -228,54 +243,48 @@ # form parameters form_params = {} # http body (model) - post_body = nil + post_body = @api_client.object_to_http_body(opts[:'body']) - auth_names = ['PureCloud Auth'] - data, status_code, headers = @api_client.call_api(:GET, path, + 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#get_attribute_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @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 - # Update an existing attribute. - # Fields that can be updated: name, description. The most recent version is required for updates. - # @param attribute_id Attribute ID + # Query attributes + # # @param [Hash] opts the optional parameters - # @option opts [Attribute] :body Attribute - # @return [Attribute] - def put_attribute_id(attribute_id, opts = {}) - data, status_code, headers = put_attribute_id_with_http_info(attribute_id, opts) + # @option opts [AttributeQueryRequest] :body query + # @return [AttributeEntityListing] + def post_query(opts = {}) + data, status_code, headers = post_query_with_http_info(opts) return data end - # Update an existing attribute. - # Fields that can be updated: name, description. The most recent version is required for updates. - # @param attribute_id Attribute ID + # Query attributes + # # @param [Hash] opts the optional parameters - # @option opts [Attribute] :body Attribute - # @return [Array<(Attribute, Fixnum, Hash)>] Attribute data, response status code and response headers - def put_attribute_id_with_http_info(attribute_id, opts = {}) + # @option opts [AttributeQueryRequest] :body query + # @return [Array<(AttributeEntityListing, Fixnum, Hash)>] AttributeEntityListing data, response status code and response headers + def post_query_with_http_info(opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug "Calling API: AttributesApi#put_attribute_id ..." + @api_client.config.logger.debug "Calling API: AttributesApi#post_query ..." 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? - # resource path - path = "/api/v2/attributes/{attributeId}".sub('{format}','json').sub('{' + 'attributeId' + '}', attribute_id.to_s) + local_var_path = "/api/v2/attributes/query".sub('{format}','json') # query parameters query_params = {} # header parameters @@ -293,50 +302,51 @@ 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(:PUT, path, + 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') + :return_type => 'AttributeEntityListing') 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}" + @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 - # Delete an existing Attribute. - # This will remove attribute. + # 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 [Hash] opts the optional parameters - # @return [nil] - def delete_attribute_id(attribute_id, opts = {}) - delete_attribute_id_with_http_info(attribute_id, opts) - return nil + # @option opts [Attribute] :body Attribute + # @return [Attribute] + def put_attribute_id(attribute_id, opts = {}) + data, status_code, headers = put_attribute_id_with_http_info(attribute_id, opts) + return data end - # Delete an existing Attribute. - # This will remove attribute. + # 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 [Hash] opts the optional parameters - # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers - def delete_attribute_id_with_http_info(attribute_id, opts = {}) + # @option opts [Attribute] :body Attribute + # @return [Array<(Attribute, Fixnum, Hash)>] Attribute data, response status code and response headers + def put_attribute_id_with_http_info(attribute_id, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug "Calling API: AttributesApi#delete_attribute_id ..." + @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 delete_attribute_id" if attribute_id.nil? + fail "Missing the required parameter 'attribute_id' when calling put_attribute_id" if attribute_id.nil? # resource path - path = "/api/v2/attributes/{attributeId}".sub('{format}','json').sub('{' + 'attributeId' + '}', attribute_id.to_s) + local_var_path = "/api/v2/attributes/{attributeId}".sub('{format}','json').sub('{' + 'attributeId' + '}', attribute_id.to_s) # query parameters query_params = {} # header parameters @@ -352,26 +362,22 @@ # form parameters form_params = {} # http body (model) - post_body = nil + post_body = @api_client.object_to_http_body(opts[:'body']) - auth_names = ['PureCloud Auth'] - data, status_code, headers = @api_client.call_api(:DELETE, path, + 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) + :auth_names => auth_names, + :return_type => 'Attribute') 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}" + @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 end end - - - -