require "uri" module PureCloud class ScriptsApi attr_accessor :api_client def initialize(api_client = ApiClient.default) @api_client = api_client end # Get the list of evaluation forms # # @param [Hash] opts the optional parameters # @option opts [Integer] :page_size The total page size requested # @option opts [Integer] :page_number The page number requested # @option opts [String] :sort_by variable name requested to sort by # @option opts [Array] :expand variable name requested by expand list # @option opts [String] :expand2 Expand # @option opts [String] :name Name # @return [EvaluationFormEntityListing] def get_forms(opts = {}) data, status_code, headers = get_forms_with_http_info(opts) return data end # Get the list of evaluation forms # # @param [Hash] opts the optional parameters # @option opts [Integer] :page_size The total page size requested # @option opts [Integer] :page_number The page number requested # @option opts [String] :sort_by variable name requested to sort by # @option opts [Array] :expand variable name requested by expand list # @option opts [String] :expand2 Expand # @option opts [String] :name Name # @return [Array<(EvaluationFormEntityListing, Fixnum, Hash)>] EvaluationFormEntityListing data, response status code and response headers def get_forms_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: ScriptsApi#get_forms ..." end # resource path path = "/api/v2/quality/forms".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'] query_params[:'sortBy'] = opts[:'sort_by'] if opts[:'sort_by'] query_params[:'expand'] = @api_client.build_collection_param(opts[:'expand'], :multi) if opts[:'expand'] query_params[:'expand'] = opts[:'expand2'] if opts[:'expand2'] query_params[:'name'] = opts[:'name'] if opts[:'name'] # 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 => 'EvaluationFormEntityListing') if @api_client.config.debugging @api_client.config.logger.debug "API called: ScriptsApi#get_forms\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Create an evaluation form. # # @param [Hash] opts the optional parameters # @option opts [EvaluationForm] :body # @return [EvaluationForm] def post_forms(opts = {}) data, status_code, headers = post_forms_with_http_info(opts) return data end # Create an evaluation form. # # @param [Hash] opts the optional parameters # @option opts [EvaluationForm] :body # @return [Array<(EvaluationForm, Fixnum, Hash)>] EvaluationForm data, response status code and response headers def post_forms_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: ScriptsApi#post_forms ..." end # resource path path = "/api/v2/quality/forms".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 => 'EvaluationForm') if @api_client.config.debugging @api_client.config.logger.debug "API called: ScriptsApi#post_forms\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get an evaluation form # # @param form_id Form ID # @param [Hash] opts the optional parameters # @return [EvaluationForm] def get_forms_form_id(form_id, opts = {}) data, status_code, headers = get_forms_form_id_with_http_info(form_id, opts) return data end # Get an evaluation form # # @param form_id Form ID # @param [Hash] opts the optional parameters # @return [Array<(EvaluationForm, Fixnum, Hash)>] EvaluationForm data, response status code and response headers def get_forms_form_id_with_http_info(form_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: ScriptsApi#get_forms_form_id ..." end # verify the required parameter 'form_id' is set fail "Missing the required parameter 'form_id' when calling get_forms_form_id" if form_id.nil? # resource path path = "/api/v2/quality/forms/{formId}".sub('{format}','json').sub('{' + 'formId' + '}', form_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 => 'EvaluationForm') if @api_client.config.debugging @api_client.config.logger.debug "API called: ScriptsApi#get_forms_form_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Update an evaluation form. # # @param form_id Form ID # @param [Hash] opts the optional parameters # @option opts [EvaluationForm] :body # @return [EvaluationForm] def put_forms_form_id(form_id, opts = {}) data, status_code, headers = put_forms_form_id_with_http_info(form_id, opts) return data end # Update an evaluation form. # # @param form_id Form ID # @param [Hash] opts the optional parameters # @option opts [EvaluationForm] :body # @return [Array<(EvaluationForm, Fixnum, Hash)>] EvaluationForm data, response status code and response headers def put_forms_form_id_with_http_info(form_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: ScriptsApi#put_forms_form_id ..." end # verify the required parameter 'form_id' is set fail "Missing the required parameter 'form_id' when calling put_forms_form_id" if form_id.nil? # resource path path = "/api/v2/quality/forms/{formId}".sub('{format}','json').sub('{' + 'formId' + '}', form_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 => 'EvaluationForm') if @api_client.config.debugging @api_client.config.logger.debug "API called: ScriptsApi#put_forms_form_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Delete an evaluation form. # # @param form_id Form ID # @param [Hash] opts the optional parameters # @return [String] def delete_forms_form_id(form_id, opts = {}) data, status_code, headers = delete_forms_form_id_with_http_info(form_id, opts) return data end # Delete an evaluation form. # # @param form_id Form ID # @param [Hash] opts the optional parameters # @return [Array<(String, Fixnum, Hash)>] String data, response status code and response headers def delete_forms_form_id_with_http_info(form_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: ScriptsApi#delete_forms_form_id ..." end # verify the required parameter 'form_id' is set fail "Missing the required parameter 'form_id' when calling delete_forms_form_id" if form_id.nil? # resource path path = "/api/v2/quality/forms/{formId}".sub('{format}','json').sub('{' + 'formId' + '}', form_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, :return_type => 'String') if @api_client.config.debugging @api_client.config.logger.debug "API called: ScriptsApi#delete_forms_form_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Gets all the revisions for a specific evaluation. # # @param form_id Form ID # @param [Hash] opts the optional parameters # @option opts [Integer] :page_size Page size # @option opts [Integer] :page_number Page number # @return [EvaluationFormEntityListing] def get_forms_form_id_versions(form_id, opts = {}) data, status_code, headers = get_forms_form_id_versions_with_http_info(form_id, opts) return data end # Gets all the revisions for a specific evaluation. # # @param form_id Form ID # @param [Hash] opts the optional parameters # @option opts [Integer] :page_size Page size # @option opts [Integer] :page_number Page number # @return [Array<(EvaluationFormEntityListing, Fixnum, Hash)>] EvaluationFormEntityListing data, response status code and response headers def get_forms_form_id_versions_with_http_info(form_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: ScriptsApi#get_forms_form_id_versions ..." end # verify the required parameter 'form_id' is set fail "Missing the required parameter 'form_id' when calling get_forms_form_id_versions" if form_id.nil? # resource path path = "/api/v2/quality/forms/{formId}/versions".sub('{format}','json').sub('{' + 'formId' + '}', form_id.to_s) # 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) _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 => 'EvaluationFormEntityListing') if @api_client.config.debugging @api_client.config.logger.debug "API called: ScriptsApi#get_forms_form_id_versions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get the published evaluation forms. # # @param [Hash] opts the optional parameters # @option opts [Integer] :page_size Page size # @option opts [Integer] :page_number Page number # @option opts [String] :name Name # @return [EvaluationFormEntityListing] def get_publishedforms(opts = {}) data, status_code, headers = get_publishedforms_with_http_info(opts) return data end # Get the published evaluation forms. # # @param [Hash] opts the optional parameters # @option opts [Integer] :page_size Page size # @option opts [Integer] :page_number Page number # @option opts [String] :name Name # @return [Array<(EvaluationFormEntityListing, Fixnum, Hash)>] EvaluationFormEntityListing data, response status code and response headers def get_publishedforms_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: ScriptsApi#get_publishedforms ..." end # resource path path = "/api/v2/quality/publishedforms".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'] query_params[:'name'] = opts[:'name'] if opts[:'name'] # 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 => 'EvaluationFormEntityListing') if @api_client.config.debugging @api_client.config.logger.debug "API called: ScriptsApi#get_publishedforms\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Publish an evaluation form. # # @param [Hash] opts the optional parameters # @option opts [EvaluationForm] :body # @return [EvaluationForm] def post_publishedforms(opts = {}) data, status_code, headers = post_publishedforms_with_http_info(opts) return data end # Publish an evaluation form. # # @param [Hash] opts the optional parameters # @option opts [EvaluationForm] :body # @return [Array<(EvaluationForm, Fixnum, Hash)>] EvaluationForm data, response status code and response headers def post_publishedforms_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: ScriptsApi#post_publishedforms ..." end # resource path path = "/api/v2/quality/publishedforms".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 => 'EvaluationForm') if @api_client.config.debugging @api_client.config.logger.debug "API called: ScriptsApi#post_publishedforms\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get the published evaluation forms. # # @param form_id Form ID # @param [Hash] opts the optional parameters # @return [EvaluationForm] def get_publishedforms_form_id(form_id, opts = {}) data, status_code, headers = get_publishedforms_form_id_with_http_info(form_id, opts) return data end # Get the published evaluation forms. # # @param form_id Form ID # @param [Hash] opts the optional parameters # @return [Array<(EvaluationForm, Fixnum, Hash)>] EvaluationForm data, response status code and response headers def get_publishedforms_form_id_with_http_info(form_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: ScriptsApi#get_publishedforms_form_id ..." end # verify the required parameter 'form_id' is set fail "Missing the required parameter 'form_id' when calling get_publishedforms_form_id" if form_id.nil? # resource path path = "/api/v2/quality/publishedforms/{formId}".sub('{format}','json').sub('{' + 'formId' + '}', form_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 => 'EvaluationForm') if @api_client.config.debugging @api_client.config.logger.debug "API called: ScriptsApi#get_publishedforms_form_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get the list of scripts # # @param [Hash] opts the optional parameters # @option opts [Integer] :page_size Page size # @option opts [Integer] :page_number Page number # @option opts [String] :expand Expand # @option opts [String] :name Name # @option opts [String] :feature Feature # @return [ScriptEntityListing] def get_scripts(opts = {}) data, status_code, headers = get_scripts_with_http_info(opts) return data end # Get the list of scripts # # @param [Hash] opts the optional parameters # @option opts [Integer] :page_size Page size # @option opts [Integer] :page_number Page number # @option opts [String] :expand Expand # @option opts [String] :name Name # @option opts [String] :feature Feature # @return [Array<(ScriptEntityListing, Fixnum, Hash)>] ScriptEntityListing data, response status code and response headers def get_scripts_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: ScriptsApi#get_scripts ..." end # resource path path = "/api/v2/scripts".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'] query_params[:'expand'] = opts[:'expand'] if opts[:'expand'] query_params[:'name'] = opts[:'name'] if opts[:'name'] query_params[:'feature'] = opts[:'feature'] if opts[:'feature'] # 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 => 'ScriptEntityListing') if @api_client.config.debugging @api_client.config.logger.debug "API called: ScriptsApi#get_scripts\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Create a script. # # @param [Hash] opts the optional parameters # @option opts [Body1] :body # @return [Script] def post_scripts(opts = {}) data, status_code, headers = post_scripts_with_http_info(opts) return data end # Create a script. # # @param [Hash] opts the optional parameters # @option opts [Body1] :body # @return [Array<(Script, Fixnum, Hash)>] Script data, response status code and response headers def post_scripts_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: ScriptsApi#post_scripts ..." end # resource path path = "/api/v2/scripts".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 => 'Script') if @api_client.config.debugging @api_client.config.logger.debug "API called: ScriptsApi#post_scripts\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end end end