require "uri" module PureCloud class ResponseManagementApi attr_accessor :api_client def initialize(api_client = ApiClient.default) @api_client = api_client end # Gets a list of existing response libraries. # # @param [Hash] opts the optional parameters # @option opts [Integer] :page_number Page number # @option opts [Integer] :page_size Page size # @return [LibraryEntityListing] def get_libraries(opts = {}) data, status_code, headers = get_libraries_with_http_info(opts) return data end # Gets a list of existing response libraries. # # @param [Hash] opts the optional parameters # @option opts [Integer] :page_number Page number # @option opts [Integer] :page_size Page size # @return [Array<(LibraryEntityListing, Fixnum, Hash)>] LibraryEntityListing data, response status code and response headers def get_libraries_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: ResponseManagementApi#get_libraries ..." end # resource path path = "/api/v1/responsemanagement/libraries".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, path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'LibraryEntityListing') if @api_client.config.debugging @api_client.config.logger.debug "API called: ResponseManagementApi#get_libraries\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Create a response library. # # @param [Hash] opts the optional parameters # @option opts [Library] :body Library # @return [Library] def post_libraries(opts = {}) data, status_code, headers = post_libraries_with_http_info(opts) return data end # Create a response library. # # @param [Hash] opts the optional parameters # @option opts [Library] :body Library # @return [Array<(Library, Fixnum, Hash)>] Library data, response status code and response headers def post_libraries_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: ResponseManagementApi#post_libraries ..." end # resource path path = "/api/v1/responsemanagement/libraries".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(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 => 'Library') if @api_client.config.debugging @api_client.config.logger.debug "API called: ResponseManagementApi#post_libraries\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get details about an existing response library. # # @param library_id Library ID # @param [Hash] opts the optional parameters # @return [Library] def get_libraries_library_id(library_id, opts = {}) data, status_code, headers = get_libraries_library_id_with_http_info(library_id, opts) return data end # Get details about an existing response library. # # @param library_id Library ID # @param [Hash] opts the optional parameters # @return [Array<(Library, Fixnum, Hash)>] Library data, response status code and response headers def get_libraries_library_id_with_http_info(library_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: ResponseManagementApi#get_libraries_library_id ..." end # verify the required parameter 'library_id' is set fail "Missing the required parameter 'library_id' when calling get_libraries_library_id" if library_id.nil? # resource path path = "/api/v1/responsemanagement/libraries/{libraryId}".sub('{format}','json').sub('{' + 'libraryId' + '}', library_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 => 'Library') if @api_client.config.debugging @api_client.config.logger.debug "API called: ResponseManagementApi#get_libraries_library_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Update an existing response library. # Fields that can be updated: name. The most recent version is required for updates. # @param library_id Library ID # @param [Hash] opts the optional parameters # @option opts [Library] :body Library # @return [Library] def put_libraries_library_id(library_id, opts = {}) data, status_code, headers = put_libraries_library_id_with_http_info(library_id, opts) return data end # Update an existing response library. # Fields that can be updated: name. The most recent version is required for updates. # @param library_id Library ID # @param [Hash] opts the optional parameters # @option opts [Library] :body Library # @return [Array<(Library, Fixnum, Hash)>] Library data, response status code and response headers def put_libraries_library_id_with_http_info(library_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: ResponseManagementApi#put_libraries_library_id ..." end # verify the required parameter 'library_id' is set fail "Missing the required parameter 'library_id' when calling put_libraries_library_id" if library_id.nil? # resource path path = "/api/v1/responsemanagement/libraries/{libraryId}".sub('{format}','json').sub('{' + 'libraryId' + '}', library_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(opts[:'body']) auth_names = ['PureCloud Auth'] data, status_code, headers = @api_client.call_api(:PUT, path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'Library') if @api_client.config.debugging @api_client.config.logger.debug "API called: ResponseManagementApi#put_libraries_library_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Delete an existing response library. # This will remove any responses associated with the library. # @param library_id Library ID # @param [Hash] opts the optional parameters # @return [nil] def delete_libraries_library_id(library_id, opts = {}) delete_libraries_library_id_with_http_info(library_id, opts) return nil end # Delete an existing response library. # This will remove any responses associated with the library. # @param library_id Library ID # @param [Hash] opts the optional parameters # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers def delete_libraries_library_id_with_http_info(library_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: ResponseManagementApi#delete_libraries_library_id ..." end # verify the required parameter 'library_id' is set fail "Missing the required parameter 'library_id' when calling delete_libraries_library_id" if library_id.nil? # resource path path = "/api/v1/responsemanagement/libraries/{libraryId}".sub('{format}','json').sub('{' + 'libraryId' + '}', library_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, 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: ResponseManagementApi#delete_libraries_library_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Gets a list of existing responses. # # @param library_id Library ID # @param [Hash] opts the optional parameters # @option opts [Integer] :page_number Page number # @option opts [Integer] :page_size Page size # @return [ResponseEntityListing] def get_responses(library_id, opts = {}) data, status_code, headers = get_responses_with_http_info(library_id, opts) return data end # Gets a list of existing responses. # # @param library_id Library ID # @param [Hash] opts the optional parameters # @option opts [Integer] :page_number Page number # @option opts [Integer] :page_size Page size # @return [Array<(ResponseEntityListing, Fixnum, Hash)>] ResponseEntityListing data, response status code and response headers def get_responses_with_http_info(library_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: ResponseManagementApi#get_responses ..." end # verify the required parameter 'library_id' is set fail "Missing the required parameter 'library_id' when calling get_responses" if library_id.nil? # resource path path = "/api/v1/responsemanagement/responses".sub('{format}','json') # query parameters query_params = {} query_params[:'libraryId'] = library_id 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, path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'ResponseEntityListing') if @api_client.config.debugging @api_client.config.logger.debug "API called: ResponseManagementApi#get_responses\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Create a response. # # @param [Hash] opts the optional parameters # @option opts [Response] :body Response # @return [Response] def post_responses(opts = {}) data, status_code, headers = post_responses_with_http_info(opts) return data end # Create a response. # # @param [Hash] opts the optional parameters # @option opts [Response] :body Response # @return [Array<(Response, Fixnum, Hash)>] Response data, response status code and response headers def post_responses_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: ResponseManagementApi#post_responses ..." end # resource path path = "/api/v1/responsemanagement/responses".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(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 => 'Response') if @api_client.config.debugging @api_client.config.logger.debug "API called: ResponseManagementApi#post_responses\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Query responses # # @param [Hash] opts the optional parameters # @option opts [ResponseQueryRequest] :body Response # @return [ResponseQueryResults] def post_responses_query(opts = {}) data, status_code, headers = post_responses_query_with_http_info(opts) return data end # Query responses # # @param [Hash] opts the optional parameters # @option opts [ResponseQueryRequest] :body Response # @return [Array<(ResponseQueryResults, Fixnum, Hash)>] ResponseQueryResults data, response status code and response headers def post_responses_query_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: ResponseManagementApi#post_responses_query ..." end # resource path path = "/api/v1/responsemanagement/responses/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(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 => 'ResponseQueryResults') if @api_client.config.debugging @api_client.config.logger.debug "API called: ResponseManagementApi#post_responses_query\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get details about an existing response. # # @param response_id Response ID # @param [Hash] opts the optional parameters # @return [Response] def get_responses_response_id(response_id, opts = {}) data, status_code, headers = get_responses_response_id_with_http_info(response_id, opts) return data end # Get details about an existing response. # # @param response_id Response ID # @param [Hash] opts the optional parameters # @return [Array<(Response, Fixnum, Hash)>] Response data, response status code and response headers def get_responses_response_id_with_http_info(response_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: ResponseManagementApi#get_responses_response_id ..." end # verify the required parameter 'response_id' is set fail "Missing the required parameter 'response_id' when calling get_responses_response_id" if response_id.nil? # resource path path = "/api/v1/responsemanagement/responses/{responseId}".sub('{format}','json').sub('{' + 'responseId' + '}', response_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 => 'Response') if @api_client.config.debugging @api_client.config.logger.debug "API called: ResponseManagementApi#get_responses_response_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Update an existing response. # Fields that can be updated: name, libraries, and texts. The most recent version is required for updates. # @param response_id Response ID # @param [Hash] opts the optional parameters # @option opts [Response] :body Response # @return [Response] def put_responses_response_id(response_id, opts = {}) data, status_code, headers = put_responses_response_id_with_http_info(response_id, opts) return data end # Update an existing response. # Fields that can be updated: name, libraries, and texts. The most recent version is required for updates. # @param response_id Response ID # @param [Hash] opts the optional parameters # @option opts [Response] :body Response # @return [Array<(Response, Fixnum, Hash)>] Response data, response status code and response headers def put_responses_response_id_with_http_info(response_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: ResponseManagementApi#put_responses_response_id ..." end # verify the required parameter 'response_id' is set fail "Missing the required parameter 'response_id' when calling put_responses_response_id" if response_id.nil? # resource path path = "/api/v1/responsemanagement/responses/{responseId}".sub('{format}','json').sub('{' + 'responseId' + '}', response_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(opts[:'body']) auth_names = ['PureCloud Auth'] data, status_code, headers = @api_client.call_api(:PUT, path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'Response') if @api_client.config.debugging @api_client.config.logger.debug "API called: ResponseManagementApi#put_responses_response_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Delete an existing response. # This will remove the response from any libraries associated with it. # @param response_id Response ID # @param [Hash] opts the optional parameters # @return [nil] def delete_responses_response_id(response_id, opts = {}) delete_responses_response_id_with_http_info(response_id, opts) return nil end # Delete an existing response. # This will remove the response from any libraries associated with it. # @param response_id Response ID # @param [Hash] opts the optional parameters # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers def delete_responses_response_id_with_http_info(response_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: ResponseManagementApi#delete_responses_response_id ..." end # verify the required parameter 'response_id' is set fail "Missing the required parameter 'response_id' when calling delete_responses_response_id" if response_id.nil? # resource path path = "/api/v1/responsemanagement/responses/{responseId}".sub('{format}','json').sub('{' + 'responseId' + '}', response_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, 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: ResponseManagementApi#delete_responses_response_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end end end