Class: SwaggerClient::TasksApi

Inherits:
Object
  • Object
show all
Defined in:
lib/swagger_client/api/tasks_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ TasksApi

Returns a new instance of TasksApi.



19
20
21
# File 'lib/swagger_client/api/tasks_api.rb', line 19

def initialize(api_client = ApiClient.default)
  @api_client = api_client
end

Instance Attribute Details

#api_clientObject

Returns the value of attribute api_client.



17
18
19
# File 'lib/swagger_client/api/tasks_api.rb', line 17

def api_client
  @api_client
end

Instance Method Details

#public_api_delete_task(task_id, api_key, opts = {}) ⇒ Object

delete a task

Parameters:

  • task_id

    identifier

  • api_key

    crelate api key

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Object)


29
30
31
32
# File 'lib/swagger_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 = {}) ⇒ Array<(Object, Fixnum, Hash)>

delete a task

Parameters:

  • task_id

    identifier

  • api_key

    crelate api key

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(Object, Fixnum, Hash)>)

    Object data, response status code and response headers



40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
# File 'lib/swagger_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
  fail ArgumentError, "Missing the required parameter 'task_id' when calling TasksApi.public_api_delete_task" if task_id.nil?
  # verify the required parameter 'api_key' is set
  fail ArgumentError, "Missing the required parameter 'api_key' when calling TasksApi.public_api_delete_task" if api_key.nil?
  # 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 = {}) ⇒ PublicApiGetTaskResponse

retrieve a task

Parameters:

  • task_id

    identifier

  • api_key

    crelate api key

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



85
86
87
88
# File 'lib/swagger_client/api/tasks_api.rb', line 85

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 = {}) ⇒ Array<(PublicApiGetTaskResponse, Fixnum, Hash)>

retrieve a task

Parameters:

  • task_id

    identifier

  • api_key

    crelate api key

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(PublicApiGetTaskResponse, Fixnum, Hash)>)

    PublicApiGetTaskResponse data, response status code and response headers



96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
# File 'lib/swagger_client/api/tasks_api.rb', line 96

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
  fail ArgumentError, "Missing the required parameter 'task_id' when calling TasksApi.public_api_get_task" if task_id.nil?
  # verify the required parameter 'api_key' is set
  fail ArgumentError, "Missing the required parameter 'api_key' when calling TasksApi.public_api_get_task" if api_key.nil?
  # 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 = {}) ⇒ PublicApiIdResponse

create a task

Parameters:

  • api_key

    crelate api key

  • request
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



141
142
143
144
# File 'lib/swagger_client/api/tasks_api.rb', line 141

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 = {}) ⇒ Array<(PublicApiIdResponse, Fixnum, Hash)>

create a task

Parameters:

  • api_key

    crelate api key

  • request
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(PublicApiIdResponse, Fixnum, Hash)>)

    PublicApiIdResponse data, response status code and response headers



152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
# File 'lib/swagger_client/api/tasks_api.rb', line 152

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
  fail ArgumentError, "Missing the required parameter 'api_key' when calling TasksApi.public_api_post_task" if api_key.nil?
  # verify the required parameter 'request' is set
  fail ArgumentError, "Missing the required parameter 'request' when calling TasksApi.public_api_post_task" if request.nil?
  # 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 = {}) ⇒ Object

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.

Parameters:

  • task_id
  • api_key

    crelate api key

  • request
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Object)


200
201
202
203
# File 'lib/swagger_client/api/tasks_api.rb', line 200

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 = {}) ⇒ Array<(Object, Fixnum, Hash)>

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.

Parameters:

  • task_id
  • api_key

    crelate api key

  • request
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(Object, Fixnum, Hash)>)

    Object data, response status code and response headers



212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
# File 'lib/swagger_client/api/tasks_api.rb', line 212

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
  fail ArgumentError, "Missing the required parameter 'task_id' when calling TasksApi.public_api_put_task" if task_id.nil?
  # verify the required parameter 'api_key' is set
  fail ArgumentError, "Missing the required parameter 'api_key' when calling TasksApi.public_api_put_task" if api_key.nil?
  # verify the required parameter 'request' is set
  fail ArgumentError, "Missing the required parameter 'request' when calling TasksApi.public_api_put_task" if request.nil?
  # 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