lib/purecloud/api/scripts_api.rb in purecloud-0.63.1 vs lib/purecloud/api/scripts_api.rb in purecloud-0.64.1
- old
+ new
@@ -22,97 +22,10 @@
def initialize(api_client = ApiClient.default)
@api_client = api_client
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]
- def get(opts = {})
- data, status_code, headers = get_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
- def get_with_http_info(opts = {})
- if @api_client.config.debugging
- @api_client.config.logger.debug "Calling API: ScriptsApi#get ..."
- 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\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 (default to 25)
# @option opts [Integer] :page_number Page number (default to 1)
@@ -608,9 +521,96 @@
: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 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]
+ 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
+ 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
end
end