class PureCloud::ScriptsApi
Attributes
Public Class Methods
# File lib/purecloud/api/scripts_api.rb, line 23 def initialize(api_client = ApiClient.default) @api_client = api_client end
Public Instance Methods
Get the published scripts.
@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) @option opts [String] :expand Expand @option opts [String] :name Name filter @option opts [String] :feature Feature filter @option opts [String] :flow_id Secure flow id filter @return [ScriptEntityListing]
# File lib/purecloud/api/scripts_api.rb, line 37 def get_published(opts = {}) data, status_code, headers = get_published_with_http_info(opts) return data end
Get the published script.
@param script_id Script
ID @param [Hash] opts the optional parameters @return [Script]
# File lib/purecloud/api/scripts_api.rb, line 105 def get_published_script_id(script_id, opts = {}) data, status_code, headers = get_published_script_id_with_http_info(script_id, opts) return data end
Get the list of published pages
@param script_id Script
ID @param [Hash] opts the optional parameters @return [Array<Page>]
# File lib/purecloud/api/scripts_api.rb, line 165 def get_published_script_id_pages(script_id, opts = {}) data, status_code, headers = get_published_script_id_pages_with_http_info(script_id, opts) return data end
Get the published page.
@param script_id Script
ID @param page_id Page
ID @param [Hash] opts the optional parameters @return [Page]
# File lib/purecloud/api/scripts_api.rb, line 226 def get_published_script_id_pages_page_id(script_id, page_id, opts = {}) data, status_code, headers = get_published_script_id_pages_page_id_with_http_info(script_id, page_id, opts) return data end
Get the published page.
@param script_id Script
ID @param page_id Page
ID @param [Hash] opts the optional parameters @return [Array<(Page
, Fixnum, Hash)>] Page
data, response status code and response headers
# File lib/purecloud/api/scripts_api.rb, line 237 def get_published_script_id_pages_page_id_with_http_info(script_id, page_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: ScriptsApi#get_published_script_id_pages_page_id ..." end # verify the required parameter 'script_id' is set fail "Missing the required parameter 'script_id' when calling get_published_script_id_pages_page_id" if script_id.nil? # verify the required parameter 'page_id' is set fail "Missing the required parameter 'page_id' when calling get_published_script_id_pages_page_id" if page_id.nil? # resource path local_var_path = "/api/v2/scripts/published/{scriptId}/pages/{pageId}".sub('{format}','json').sub('{' + 'scriptId' + '}', script_id.to_s).sub('{' + 'pageId' + '}', page_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 => 'Page') if @api_client.config.debugging @api_client.config.logger.debug "API called: ScriptsApi#get_published_script_id_pages_page_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
Get the list of published pages
@param script_id Script
ID @param [Hash] opts the optional parameters @return [Array<(Array<Page>, Fixnum, Hash)>] Array<Page> data, response status code and response headers
# File lib/purecloud/api/scripts_api.rb, line 175 def get_published_script_id_pages_with_http_info(script_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: ScriptsApi#get_published_script_id_pages ..." end # verify the required parameter 'script_id' is set fail "Missing the required parameter 'script_id' when calling get_published_script_id_pages" if script_id.nil? # resource path local_var_path = "/api/v2/scripts/published/{scriptId}/pages".sub('{format}','json').sub('{' + 'scriptId' + '}', script_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 => 'Array<Page>') if @api_client.config.debugging @api_client.config.logger.debug "API called: ScriptsApi#get_published_script_id_pages\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
Get the published variables
@param script_id Script
ID @param [Hash] opts the optional parameters @option opts [String] :input input @option opts [String] :output output @option opts [String] :type type @return [Object]
# File lib/purecloud/api/scripts_api.rb, line 293 def get_published_script_id_variables(script_id, opts = {}) data, status_code, headers = get_published_script_id_variables_with_http_info(script_id, opts) return data end
Get the published variables
@param script_id Script
ID @param [Hash] opts the optional parameters @option opts [String] :input input @option opts [String] :output output @option opts [String] :type type @return [Array<(Object, Fixnum, Hash)>] Object data, response status code and response headers
# File lib/purecloud/api/scripts_api.rb, line 306 def get_published_script_id_variables_with_http_info(script_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: ScriptsApi#get_published_script_id_variables ..." end # verify the required parameter 'script_id' is set fail "Missing the required parameter 'script_id' when calling get_published_script_id_variables" if script_id.nil? # resource path local_var_path = "/api/v2/scripts/published/{scriptId}/variables".sub('{format}','json').sub('{' + 'scriptId' + '}', script_id.to_s) # query parameters query_params = {} query_params[:'input'] = opts[:'input'] if opts[:'input'] query_params[:'output'] = opts[:'output'] if opts[:'output'] query_params[:'type'] = opts[:'type'] if opts[:'type'] # 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 => 'Object') if @api_client.config.debugging @api_client.config.logger.debug "API called: ScriptsApi#get_published_script_id_variables\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
Get the published script.
@param script_id Script
ID @param [Hash] opts the optional parameters @return [Array<(Script
, Fixnum, Hash)>] Script
data, response status code and response headers
# File lib/purecloud/api/scripts_api.rb, line 115 def get_published_script_id_with_http_info(script_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: ScriptsApi#get_published_script_id ..." end # verify the required parameter 'script_id' is set fail "Missing the required parameter 'script_id' when calling get_published_script_id" if script_id.nil? # resource path local_var_path = "/api/v2/scripts/published/{scriptId}".sub('{format}','json').sub('{' + 'scriptId' + '}', script_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 => 'Script') if @api_client.config.debugging @api_client.config.logger.debug "API called: ScriptsApi#get_published_script_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
Get the published 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 filter @option opts [String] :feature Feature filter @option opts [String] :flow_id Secure flow id filter @return [Array<(ScriptEntityListing
, Fixnum, Hash)>] ScriptEntityListing
data, response status code and response headers
# File lib/purecloud/api/scripts_api.rb, line 52 def get_published_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: ScriptsApi#get_published ..." end # resource path local_var_path = "/api/v2/scripts/published".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'] query_params[:'flowId'] = opts[:'flow_id'] if opts[:'flow_id'] # 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 => 'ScriptEntityListing') if @api_client.config.debugging @api_client.config.logger.debug "API called: ScriptsApi#get_published\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
Get a script
@param script_id Script
ID @param [Hash] opts the optional parameters @return [Script]
# File lib/purecloud/api/scripts_api.rb, line 359 def get_script_id(script_id, opts = {}) data, status_code, headers = get_script_id_with_http_info(script_id, opts) return data end
Get the list of pages
@param script_id Script
ID @param [Hash] opts the optional parameters @return [Array<Page>]
# File lib/purecloud/api/scripts_api.rb, line 419 def get_script_id_pages(script_id, opts = {}) data, status_code, headers = get_script_id_pages_with_http_info(script_id, opts) return data end
Get a page
@param script_id Script
ID @param page_id Page
ID @param [Hash] opts the optional parameters @return [Page]
# File lib/purecloud/api/scripts_api.rb, line 480 def get_script_id_pages_page_id(script_id, page_id, opts = {}) data, status_code, headers = get_script_id_pages_page_id_with_http_info(script_id, page_id, opts) return data end
Get a page
@param script_id Script
ID @param page_id Page
ID @param [Hash] opts the optional parameters @return [Array<(Page
, Fixnum, Hash)>] Page
data, response status code and response headers
# File lib/purecloud/api/scripts_api.rb, line 491 def get_script_id_pages_page_id_with_http_info(script_id, page_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: ScriptsApi#get_script_id_pages_page_id ..." end # verify the required parameter 'script_id' is set fail "Missing the required parameter 'script_id' when calling get_script_id_pages_page_id" if script_id.nil? # verify the required parameter 'page_id' is set fail "Missing the required parameter 'page_id' when calling get_script_id_pages_page_id" if page_id.nil? # resource path local_var_path = "/api/v2/scripts/{scriptId}/pages/{pageId}".sub('{format}','json').sub('{' + 'scriptId' + '}', script_id.to_s).sub('{' + 'pageId' + '}', page_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 => 'Page') if @api_client.config.debugging @api_client.config.logger.debug "API called: ScriptsApi#get_script_id_pages_page_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
Get the list of pages
@param script_id Script
ID @param [Hash] opts the optional parameters @return [Array<(Array<Page>, Fixnum, Hash)>] Array<Page> data, response status code and response headers
# File lib/purecloud/api/scripts_api.rb, line 429 def get_script_id_pages_with_http_info(script_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: ScriptsApi#get_script_id_pages ..." end # verify the required parameter 'script_id' is set fail "Missing the required parameter 'script_id' when calling get_script_id_pages" if script_id.nil? # resource path local_var_path = "/api/v2/scripts/{scriptId}/pages".sub('{format}','json').sub('{' + 'scriptId' + '}', script_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 => 'Array<Page>') if @api_client.config.debugging @api_client.config.logger.debug "API called: ScriptsApi#get_script_id_pages\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
Get a script
@param script_id Script
ID @param [Hash] opts the optional parameters @return [Array<(Script
, Fixnum, Hash)>] Script
data, response status code and response headers
# File lib/purecloud/api/scripts_api.rb, line 369 def get_script_id_with_http_info(script_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: ScriptsApi#get_script_id ..." end # verify the required parameter 'script_id' is set fail "Missing the required parameter 'script_id' when calling get_script_id" if script_id.nil? # resource path local_var_path = "/api/v2/scripts/{scriptId}".sub('{format}','json').sub('{' + 'scriptId' + '}', script_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 => 'Script') if @api_client.config.debugging @api_client.config.logger.debug "API called: ScriptsApi#get_script_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 (default to 25) @option opts [Integer] :page_number Page
number (default to 1) @option opts [String] :expand Expand @option opts [String] :name Name filter @option opts [String] :feature Feature filter @option opts [String] :flow_id Secure flow id filter @option opts [String] :sort_by SortBy @option opts [String] :sort_order SortOrder @return [ScriptEntityListing]
# File lib/purecloud/api/scripts_api.rb, line 551 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 filter @option opts [String] :feature Feature filter @option opts [String] :flow_id Secure flow id filter @option opts [String] :sort_by SortBy @option opts [String] :sort_order SortOrder @return [Array<(ScriptEntityListing
, Fixnum, Hash)>] ScriptEntityListing
data, response status code and response headers
# File lib/purecloud/api/scripts_api.rb, line 568 def get_scripts_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: ScriptsApi#get_scripts ..." end if opts[:'sort_by'] && !['modifiedDate', 'createdDate'].include?(opts[:'sort_by']) fail 'invalid value for "sort_by", must be one of modifiedDate, createdDate' end if opts[:'sort_order'] && !['ascending', 'descending'].include?(opts[:'sort_order']) fail 'invalid value for "sort_order", must be one of ascending, descending' end # resource path local_var_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'] query_params[:'flowId'] = opts[:'flow_id'] if opts[:'flow_id'] query_params[:'sortBy'] = opts[:'sort_by'] if opts[:'sort_by'] query_params[:'sortOrder'] = opts[:'sort_order'] if opts[:'sort_order'] # 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 => '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