class Nodeum::TaskOptionsApi
Attributes
Public Class Methods
# File lib/nodeum_sdk/api/task_options_api.rb, line 19 def initialize(api_client = ApiClient.default) @api_client = api_client end
Public Instance Methods
Creates a new task option. **API Key Scope**: task_options / create @param task_id [String] Numeric ID or name of task. Task
names are not unique, it's recommanded to use numeric ID. @param task_option_body [TaskOption] @param [Hash] opts the optional parameters @return [TaskOption]
# File lib/nodeum_sdk/api/task_options_api.rb, line 28 def create_task_option(task_id, task_option_body, opts = {}) data, _status_code, _headers = create_task_option_with_http_info(task_id, task_option_body, opts) data end
Creates a new task option. **API Key Scope**: task_options / create @param task_id [String] Numeric ID or name of task. Task
names are not unique, it's recommanded to use numeric ID. @param task_option_body [TaskOption] @param [Hash] opts the optional parameters @return [Array<(TaskOption
, Integer, Hash)>] TaskOption
data, response status code and response headers
# File lib/nodeum_sdk/api/task_options_api.rb, line 39 def create_task_option_with_http_info(task_id, task_option_body, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: TaskOptionsApi.create_task_option ...' end # verify the required parameter 'task_id' is set if @api_client.config.client_side_validation && task_id.nil? fail ArgumentError, "Missing the required parameter 'task_id' when calling TaskOptionsApi.create_task_option" end # verify the required parameter 'task_option_body' is set if @api_client.config.client_side_validation && task_option_body.nil? fail ArgumentError, "Missing the required parameter 'task_option_body' when calling TaskOptionsApi.create_task_option" end # resource path local_var_path = '/tasks/{task_id}/task_options'.sub('{' + 'task_id' + '}', CGI.escape(task_id.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:body] || @api_client.object_to_http_body(task_option_body) # return_type return_type = opts[:return_type] || 'TaskOption' # auth_names auth_names = opts[:auth_names] || ['BasicAuth', 'BearerAuth'] new_options = opts.merge( :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: TaskOptionsApi#create_task_option\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
Destroys a specific task option. **API Key Scope**: task_options / destroy @param task_id [String] Numeric ID or name of task. Task
names are not unique, it's recommanded to use numeric ID. @param task_option_id [Integer] Numeric ID of task option. @param [Hash] opts the optional parameters @return [nil]
# File lib/nodeum_sdk/api/task_options_api.rb, line 98 def destroy_task_option(task_id, task_option_id, opts = {}) destroy_task_option_with_http_info(task_id, task_option_id, opts) nil end
Destroys a specific task option. **API Key Scope**: task_options / destroy @param task_id [String] Numeric ID or name of task. Task
names are not unique, it's recommanded to use numeric ID. @param task_option_id [Integer] Numeric ID of task option. @param [Hash] opts the optional parameters @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
# File lib/nodeum_sdk/api/task_options_api.rb, line 109 def destroy_task_option_with_http_info(task_id, task_option_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: TaskOptionsApi.destroy_task_option ...' end # verify the required parameter 'task_id' is set if @api_client.config.client_side_validation && task_id.nil? fail ArgumentError, "Missing the required parameter 'task_id' when calling TaskOptionsApi.destroy_task_option" end # verify the required parameter 'task_option_id' is set if @api_client.config.client_side_validation && task_option_id.nil? fail ArgumentError, "Missing the required parameter 'task_option_id' when calling TaskOptionsApi.destroy_task_option" end # resource path local_var_path = '/tasks/{task_id}/task_options/{task_option_id}'.sub('{' + 'task_id' + '}', CGI.escape(task_id.to_s)).sub('{' + 'task_option_id' + '}', CGI.escape(task_option_id.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:body] # return_type return_type = opts[:return_type] # auth_names auth_names = opts[:auth_names] || ['BasicAuth', 'BearerAuth'] new_options = opts.merge( :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: TaskOptionsApi#destroy_task_option\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
Lists all task options. **API Key Scope**: task_options / index @param task_id [String] Numeric ID or name of task. Task
names are not unique, it's recommanded to use numeric ID. @param [Hash] opts the optional parameters @option opts [Integer] :limit The number of items to display for pagination. @option opts [Integer] :offset The number of items to skip for pagination. @option opts [Array<String>] :sort_by Sort results by attribute. Can sort on multiple attributes, separated by `|`. Order direction can be suffixing the attribute by either `:asc` (default) or `:desc`. @option opts [String] :id Filter on id @option opts [String] :type Filter on type @option opts [String] :value Filter on value @return [TaskOptionCollection]
# File lib/nodeum_sdk/api/task_options_api.rb, line 169 def index_task_options(task_id, opts = {}) data, _status_code, _headers = index_task_options_with_http_info(task_id, opts) data end
Lists all task options. **API Key Scope**: task_options / index @param task_id [String] Numeric ID or name of task. Task
names are not unique, it's recommanded to use numeric ID. @param [Hash] opts the optional parameters @option opts [Integer] :limit The number of items to display for pagination. @option opts [Integer] :offset The number of items to skip for pagination. @option opts [Array<String>] :sort_by Sort results by attribute. Can sort on multiple attributes, separated by `|`. Order direction can be suffixing the attribute by either `:asc` (default) or `:desc`. @option opts [String] :id Filter on id @option opts [String] :type Filter on type @option opts [String] :value Filter on value @return [Array<(TaskOptionCollection
, Integer, Hash)>] TaskOptionCollection
data, response status code and response headers
# File lib/nodeum_sdk/api/task_options_api.rb, line 185 def index_task_options_with_http_info(task_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: TaskOptionsApi.index_task_options ...' end # verify the required parameter 'task_id' is set if @api_client.config.client_side_validation && task_id.nil? fail ArgumentError, "Missing the required parameter 'task_id' when calling TaskOptionsApi.index_task_options" end # resource path local_var_path = '/tasks/{task_id}/task_options'.sub('{' + 'task_id' + '}', CGI.escape(task_id.to_s)) # query parameters query_params = opts[:query_params] || {} query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil? query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil? query_params[:'sort_by'] = @api_client.build_collection_param(opts[:'sort_by'], :pipe) if !opts[:'sort_by'].nil? query_params[:'id'] = opts[:'id'] if !opts[:'id'].nil? query_params[:'type'] = opts[:'type'] if !opts[:'type'].nil? query_params[:'value'] = opts[:'value'] if !opts[:'value'].nil? # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:body] # return_type return_type = opts[:return_type] || 'TaskOptionCollection' # auth_names auth_names = opts[:auth_names] || ['BasicAuth', 'BearerAuth'] new_options = opts.merge( :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: TaskOptionsApi#index_task_options\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
Displays a specific task option. **API Key Scope**: task_options / show @param task_id [String] Numeric ID or name of task. Task
names are not unique, it's recommanded to use numeric ID. @param task_option_id [Integer] Numeric ID of task option. @param [Hash] opts the optional parameters @return [TaskOption]
# File lib/nodeum_sdk/api/task_options_api.rb, line 244 def show_task_option(task_id, task_option_id, opts = {}) data, _status_code, _headers = show_task_option_with_http_info(task_id, task_option_id, opts) data end
Displays a specific task option. **API Key Scope**: task_options / show @param task_id [String] Numeric ID or name of task. Task
names are not unique, it's recommanded to use numeric ID. @param task_option_id [Integer] Numeric ID of task option. @param [Hash] opts the optional parameters @return [Array<(TaskOption
, Integer, Hash)>] TaskOption
data, response status code and response headers
# File lib/nodeum_sdk/api/task_options_api.rb, line 255 def show_task_option_with_http_info(task_id, task_option_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: TaskOptionsApi.show_task_option ...' end # verify the required parameter 'task_id' is set if @api_client.config.client_side_validation && task_id.nil? fail ArgumentError, "Missing the required parameter 'task_id' when calling TaskOptionsApi.show_task_option" end # verify the required parameter 'task_option_id' is set if @api_client.config.client_side_validation && task_option_id.nil? fail ArgumentError, "Missing the required parameter 'task_option_id' when calling TaskOptionsApi.show_task_option" end # resource path local_var_path = '/tasks/{task_id}/task_options/{task_option_id}'.sub('{' + 'task_id' + '}', CGI.escape(task_id.to_s)).sub('{' + 'task_option_id' + '}', CGI.escape(task_option_id.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:body] # return_type return_type = opts[:return_type] || 'TaskOption' # auth_names auth_names = opts[:auth_names] || ['BasicAuth', 'BearerAuth'] new_options = opts.merge( :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: TaskOptionsApi#show_task_option\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
Updates a specific task option. **API Key Scope**: task_options / update @param task_id [String] Numeric ID or name of task. Task
names are not unique, it's recommanded to use numeric ID. @param task_option_id [Integer] Numeric ID of task option. @param task_option_body [TaskOption] @param [Hash] opts the optional parameters @return [TaskOption]
# File lib/nodeum_sdk/api/task_options_api.rb, line 313 def update_task_option(task_id, task_option_id, task_option_body, opts = {}) data, _status_code, _headers = update_task_option_with_http_info(task_id, task_option_id, task_option_body, opts) data end
Updates a specific task option. **API Key Scope**: task_options / update @param task_id [String] Numeric ID or name of task. Task
names are not unique, it's recommanded to use numeric ID. @param task_option_id [Integer] Numeric ID of task option. @param task_option_body [TaskOption] @param [Hash] opts the optional parameters @return [Array<(TaskOption
, Integer, Hash)>] TaskOption
data, response status code and response headers
# File lib/nodeum_sdk/api/task_options_api.rb, line 325 def update_task_option_with_http_info(task_id, task_option_id, task_option_body, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: TaskOptionsApi.update_task_option ...' end # verify the required parameter 'task_id' is set if @api_client.config.client_side_validation && task_id.nil? fail ArgumentError, "Missing the required parameter 'task_id' when calling TaskOptionsApi.update_task_option" end # verify the required parameter 'task_option_id' is set if @api_client.config.client_side_validation && task_option_id.nil? fail ArgumentError, "Missing the required parameter 'task_option_id' when calling TaskOptionsApi.update_task_option" end # verify the required parameter 'task_option_body' is set if @api_client.config.client_side_validation && task_option_body.nil? fail ArgumentError, "Missing the required parameter 'task_option_body' when calling TaskOptionsApi.update_task_option" end # resource path local_var_path = '/tasks/{task_id}/task_options/{task_option_id}'.sub('{' + 'task_id' + '}', CGI.escape(task_id.to_s)).sub('{' + 'task_option_id' + '}', CGI.escape(task_option_id.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:body] || @api_client.object_to_http_body(task_option_body) # return_type return_type = opts[:return_type] || 'TaskOption' # auth_names auth_names = opts[:auth_names] || ['BasicAuth', 'BearerAuth'] new_options = opts.merge( :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: TaskOptionsApi#update_task_option\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end