class CrelateClient::TasksApi

Attributes

api_client[RW]

Public Class Methods

new(api_client = ApiClient.default) click to toggle source
# File lib/crelate_client/api/tasks_api.rb, line 19
def initialize(api_client = ApiClient.default)
  @api_client = api_client
end

Public Instance Methods

public_api_delete_task(task_id, api_key, opts = {}) click to toggle source

delete a task

@param task_id identifier @param api_key crelate api key @param [Hash] opts the optional parameters @return [Object]

# File lib/crelate_client/api/tasks_api.rb, line 29
def public_api_delete_task(task_id, api_key, opts = {})
  data, _status_code, _headers = public_api_delete_task_with_http_info(task_id, api_key, opts)
  return data
end
public_api_delete_task_with_http_info(task_id, api_key, opts = {}) click to toggle source

delete a task

@param task_id identifier @param api_key crelate api key @param [Hash] opts the optional parameters @return [Array<(Object, Fixnum, Hash)>] Object data, response status code and response headers

# File lib/crelate_client/api/tasks_api.rb, line 40
def public_api_delete_task_with_http_info(task_id, api_key, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: TasksApi.public_api_delete_task ..."
  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 TasksApi.public_api_delete_task"
  end
  # verify the required parameter 'api_key' is set
  if @api_client.config.client_side_validation && api_key.nil?
    fail ArgumentError, "Missing the required parameter 'api_key' when calling TasksApi.public_api_delete_task"
  end
  # resource path
  local_var_path = "/api/pub/v1/tasks/{taskId}".sub('{' + 'taskId' + '}', task_id.to_s)

  # query parameters
  query_params = {}
  query_params[:'api_key'] = api_key

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json', 'text/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = []
  data, status_code, headers = @api_client.call_api(:DELETE, 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: TasksApi#public_api_delete_task\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
public_api_get_task(task_id, api_key, opts = {}) click to toggle source

retrieve a task

@param task_id identifier @param api_key crelate api key @param [Hash] opts the optional parameters @return [PublicApiGetTaskResponse]

# File lib/crelate_client/api/tasks_api.rb, line 89
def public_api_get_task(task_id, api_key, opts = {})
  data, _status_code, _headers = public_api_get_task_with_http_info(task_id, api_key, opts)
  return data
end
public_api_get_task_with_http_info(task_id, api_key, opts = {}) click to toggle source

retrieve a task

@param task_id identifier @param api_key crelate api key @param [Hash] opts the optional parameters @return [Array<(PublicApiGetTaskResponse, Fixnum, Hash)>] PublicApiGetTaskResponse data, response status code and response headers

# File lib/crelate_client/api/tasks_api.rb, line 100
def public_api_get_task_with_http_info(task_id, api_key, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: TasksApi.public_api_get_task ..."
  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 TasksApi.public_api_get_task"
  end
  # verify the required parameter 'api_key' is set
  if @api_client.config.client_side_validation && api_key.nil?
    fail ArgumentError, "Missing the required parameter 'api_key' when calling TasksApi.public_api_get_task"
  end
  # resource path
  local_var_path = "/api/pub/v1/tasks/{taskId}".sub('{' + 'taskId' + '}', task_id.to_s)

  # query parameters
  query_params = {}
  query_params[:'api_key'] = api_key

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json', 'text/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = []
  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 => 'PublicApiGetTaskResponse')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: TasksApi#public_api_get_task\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
public_api_post_task(api_key, request, opts = {}) click to toggle source

create a task

@param api_key crelate api key @param request @param [Hash] opts the optional parameters @return [PublicApiIdResponse]

# File lib/crelate_client/api/tasks_api.rb, line 149
def public_api_post_task(api_key, request, opts = {})
  data, _status_code, _headers = public_api_post_task_with_http_info(api_key, request, opts)
  return data
end
public_api_post_task_with_http_info(api_key, request, opts = {}) click to toggle source

create a task

@param api_key crelate api key @param request @param [Hash] opts the optional parameters @return [Array<(PublicApiIdResponse, Fixnum, Hash)>] PublicApiIdResponse data, response status code and response headers

# File lib/crelate_client/api/tasks_api.rb, line 160
def public_api_post_task_with_http_info(api_key, request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: TasksApi.public_api_post_task ..."
  end
  # verify the required parameter 'api_key' is set
  if @api_client.config.client_side_validation && api_key.nil?
    fail ArgumentError, "Missing the required parameter 'api_key' when calling TasksApi.public_api_post_task"
  end
  # verify the required parameter 'request' is set
  if @api_client.config.client_side_validation && request.nil?
    fail ArgumentError, "Missing the required parameter 'request' when calling TasksApi.public_api_post_task"
  end
  # resource path
  local_var_path = "/api/pub/v1/tasks"

  # query parameters
  query_params = {}
  query_params[:'api_key'] = api_key

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json', 'text/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json', 'text/json', 'application/x-www-form-urlencoded'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(request)
  auth_names = []
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'PublicApiIdResponse')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: TasksApi#public_api_post_task\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
public_api_put_task(task_id, api_key, request, opts = {}) click to toggle source

update a task Replaces all fields. To partially update a task, first retrieve it using the GET method, apply changes and submit to the PUT method. @param task_id @param api_key crelate api key @param request @param [Hash] opts the optional parameters @return [Object]

# File lib/crelate_client/api/tasks_api.rb, line 212
def public_api_put_task(task_id, api_key, request, opts = {})
  data, _status_code, _headers = public_api_put_task_with_http_info(task_id, api_key, request, opts)
  return data
end
public_api_put_task_with_http_info(task_id, api_key, request, opts = {}) click to toggle source

update a task Replaces all fields. To partially update a task, first retrieve it using the GET method, apply changes and submit to the PUT method. @param task_id @param api_key crelate api key @param request @param [Hash] opts the optional parameters @return [Array<(Object, Fixnum, Hash)>] Object data, response status code and response headers

# File lib/crelate_client/api/tasks_api.rb, line 224
def public_api_put_task_with_http_info(task_id, api_key, request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: TasksApi.public_api_put_task ..."
  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 TasksApi.public_api_put_task"
  end
  # verify the required parameter 'api_key' is set
  if @api_client.config.client_side_validation && api_key.nil?
    fail ArgumentError, "Missing the required parameter 'api_key' when calling TasksApi.public_api_put_task"
  end
  # verify the required parameter 'request' is set
  if @api_client.config.client_side_validation && request.nil?
    fail ArgumentError, "Missing the required parameter 'request' when calling TasksApi.public_api_put_task"
  end
  # resource path
  local_var_path = "/api/pub/v1/tasks/{taskId}".sub('{' + 'taskId' + '}', task_id.to_s)

  # query parameters
  query_params = {}
  query_params[:'api_key'] = api_key

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json', 'text/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json', 'text/json', 'application/x-www-form-urlencoded'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(request)
  auth_names = []
  data, status_code, headers = @api_client.call_api(:PUT, 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: TasksApi#public_api_put_task\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end