Class: Nodeum::TaskMetadataApi

Inherits:
Object
  • Object
show all
Defined in:
lib/nodeum_sdk/api/task_metadata_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ TaskMetadataApi

Returns a new instance of TaskMetadataApi.



19
20
21
# File 'lib/nodeum_sdk/api/task_metadata_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/nodeum_sdk/api/task_metadata_api.rb', line 17

def api_client
  @api_client
end

Instance Method Details

#create_task_metadatum(task_id, task_metadatum_body, opts = {}) ⇒ TaskMetadatum

Creates a new task metadatum. **API Key Scope**: task_metadata / create

Parameters:

  • task_id (String)

    Numeric ID or name of task. Task names are not unique, it's recommanded to use numeric ID.

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

    the optional parameters

Returns:



28
29
30
31
# File 'lib/nodeum_sdk/api/task_metadata_api.rb', line 28

def create_task_metadatum(task_id, task_metadatum_body, opts = {})
  data, _status_code, _headers = create_task_metadatum_with_http_info(task_id, task_metadatum_body, opts)
  data
end

#create_task_metadatum_with_http_info(task_id, task_metadatum_body, opts = {}) ⇒ Array<(TaskMetadatum, Integer, Hash)>

Creates a new task metadatum. **API Key Scope**: task_metadata / create

Parameters:

  • task_id (String)

    Numeric ID or name of task. Task names are not unique, it&#39;s recommanded to use numeric ID.

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

    the optional parameters

Returns:

  • (Array<(TaskMetadatum, Integer, Hash)>)

    TaskMetadatum data, response status code and response headers



39
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
78
79
80
81
82
83
84
85
86
87
88
89
90
# File 'lib/nodeum_sdk/api/task_metadata_api.rb', line 39

def create_task_metadatum_with_http_info(task_id, task_metadatum_body, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TaskMetadataApi.create_task_metadatum ...'
  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 TaskMetadataApi.create_task_metadatum"
  end
  # verify the required parameter 'task_metadatum_body' is set
  if @api_client.config.client_side_validation && task_metadatum_body.nil?
    fail ArgumentError, "Missing the required parameter 'task_metadatum_body' when calling TaskMetadataApi.create_task_metadatum"
  end
  # resource path
  local_var_path = '/tasks/{task_id}/task_metadata'.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_metadatum_body) 

  # return_type
  return_type = opts[:return_type] || 'TaskMetadatum' 

  # 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: TaskMetadataApi#create_task_metadatum\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#destroy_task_metadatum(task_id, task_metadatum_id, opts = {}) ⇒ nil

Destroys a specific task metadatum. **API Key Scope**: task_metadata / destroy

Parameters:

  • task_id (String)

    Numeric ID or name of task. Task names are not unique, it&#39;s recommanded to use numeric ID.

  • task_metadatum_id (Integer)

    Numeric ID of task metadatum.

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

    the optional parameters

Returns:

  • (nil)


98
99
100
101
# File 'lib/nodeum_sdk/api/task_metadata_api.rb', line 98

def destroy_task_metadatum(task_id, task_metadatum_id, opts = {})
  destroy_task_metadatum_with_http_info(task_id, task_metadatum_id, opts)
  nil
end

#destroy_task_metadatum_with_http_info(task_id, task_metadatum_id, opts = {}) ⇒ Array<(nil, Integer, Hash)>

Destroys a specific task metadatum. **API Key Scope**: task_metadata / destroy

Parameters:

  • task_id (String)

    Numeric ID or name of task. Task names are not unique, it&#39;s recommanded to use numeric ID.

  • task_metadatum_id (Integer)

    Numeric ID of task metadatum.

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

    the optional parameters

Returns:

  • (Array<(nil, Integer, Hash)>)

    nil, response status code and response headers



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
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
# File 'lib/nodeum_sdk/api/task_metadata_api.rb', line 109

def destroy_task_metadatum_with_http_info(task_id, task_metadatum_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TaskMetadataApi.destroy_task_metadatum ...'
  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 TaskMetadataApi.destroy_task_metadatum"
  end
  # verify the required parameter 'task_metadatum_id' is set
  if @api_client.config.client_side_validation && task_metadatum_id.nil?
    fail ArgumentError, "Missing the required parameter 'task_metadatum_id' when calling TaskMetadataApi.destroy_task_metadatum"
  end
  # resource path
  local_var_path = '/tasks/{task_id}/task_metadata/{task_metadatum_id}'.sub('{' + 'task_id' + '}', CGI.escape(task_id.to_s)).sub('{' + 'task_metadatum_id' + '}', CGI.escape(task_metadatum_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: TaskMetadataApi#destroy_task_metadatum\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#index_task_metadata(task_id, opts = {}) ⇒ TaskMetadatumCollection

Lists all task metadata. **API Key Scope**: task_metadata / index

Parameters:

  • task_id (String)

    Numeric ID or name of task. Task names are not unique, it&#39;s recommanded to use numeric ID.

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

    the optional parameters

Options Hash (opts):

  • :limit (Integer)

    The number of items to display for pagination.

  • :offset (Integer)

    The number of items to skip for pagination.

  • :sort_by (Array<String>)

    Sort results by attribute. Can sort on multiple attributes, separated by &#x60;|&#x60;. Order direction can be suffixing the attribute by either &#x60;:asc&#x60; (default) or &#x60;:desc&#x60;.

  • :id (String)

    Filter on id

  • :key (String)

    Filter on key

  • :value (String)

    Filter on value

Returns:



169
170
171
172
# File 'lib/nodeum_sdk/api/task_metadata_api.rb', line 169

def (task_id, opts = {})
  data, _status_code, _headers = (task_id, opts)
  data
end

#index_task_metadata_with_http_info(task_id, opts = {}) ⇒ Array<(TaskMetadatumCollection, Integer, Hash)>

Lists all task metadata. **API Key Scope**: task_metadata / index

Parameters:

  • task_id (String)

    Numeric ID or name of task. Task names are not unique, it&#39;s recommanded to use numeric ID.

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

    the optional parameters

Options Hash (opts):

  • :limit (Integer)

    The number of items to display for pagination.

  • :offset (Integer)

    The number of items to skip for pagination.

  • :sort_by (Array<String>)

    Sort results by attribute. Can sort on multiple attributes, separated by &#x60;|&#x60;. Order direction can be suffixing the attribute by either &#x60;:asc&#x60; (default) or &#x60;:desc&#x60;.

  • :id (String)

    Filter on id

  • :key (String)

    Filter on key

  • :value (String)

    Filter on value

Returns:

  • (Array<(TaskMetadatumCollection, Integer, Hash)>)

    TaskMetadatumCollection data, response status code and response headers



185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
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
# File 'lib/nodeum_sdk/api/task_metadata_api.rb', line 185

def (task_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TaskMetadataApi.index_task_metadata ...'
  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 TaskMetadataApi.index_task_metadata"
  end
  # resource path
  local_var_path = '/tasks/{task_id}/task_metadata'.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[:'key'] = opts[:'key'] if !opts[:'key'].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] || 'TaskMetadatumCollection' 

  # 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: TaskMetadataApi#index_task_metadata\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#show_task_metadatum(task_id, task_metadatum_id, opts = {}) ⇒ TaskMetadatum

Displays a specific task metadatum. **API Key Scope**: task_metadata / show

Parameters:

  • task_id (String)

    Numeric ID or name of task. Task names are not unique, it&#39;s recommanded to use numeric ID.

  • task_metadatum_id (Integer)

    Numeric ID of task metadatum.

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

    the optional parameters

Returns:



244
245
246
247
# File 'lib/nodeum_sdk/api/task_metadata_api.rb', line 244

def show_task_metadatum(task_id, task_metadatum_id, opts = {})
  data, _status_code, _headers = show_task_metadatum_with_http_info(task_id, task_metadatum_id, opts)
  data
end

#show_task_metadatum_with_http_info(task_id, task_metadatum_id, opts = {}) ⇒ Array<(TaskMetadatum, Integer, Hash)>

Displays a specific task metadatum. **API Key Scope**: task_metadata / show

Parameters:

  • task_id (String)

    Numeric ID or name of task. Task names are not unique, it&#39;s recommanded to use numeric ID.

  • task_metadatum_id (Integer)

    Numeric ID of task metadatum.

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

    the optional parameters

Returns:

  • (Array<(TaskMetadatum, Integer, Hash)>)

    TaskMetadatum data, response status code and response headers



255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
# File 'lib/nodeum_sdk/api/task_metadata_api.rb', line 255

def show_task_metadatum_with_http_info(task_id, task_metadatum_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TaskMetadataApi.show_task_metadatum ...'
  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 TaskMetadataApi.show_task_metadatum"
  end
  # verify the required parameter 'task_metadatum_id' is set
  if @api_client.config.client_side_validation && task_metadatum_id.nil?
    fail ArgumentError, "Missing the required parameter 'task_metadatum_id' when calling TaskMetadataApi.show_task_metadatum"
  end
  # resource path
  local_var_path = '/tasks/{task_id}/task_metadata/{task_metadatum_id}'.sub('{' + 'task_id' + '}', CGI.escape(task_id.to_s)).sub('{' + 'task_metadatum_id' + '}', CGI.escape(task_metadatum_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] || 'TaskMetadatum' 

  # 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: TaskMetadataApi#show_task_metadatum\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#update_task_metadatum(task_id, task_metadatum_id, task_metadatum_body, opts = {}) ⇒ TaskMetadatum

Updates a specific task metadatum. **API Key Scope**: task_metadata / update

Parameters:

  • task_id (String)

    Numeric ID or name of task. Task names are not unique, it&#39;s recommanded to use numeric ID.

  • task_metadatum_id (Integer)

    Numeric ID of task metadatum.

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

    the optional parameters

Returns:



313
314
315
316
# File 'lib/nodeum_sdk/api/task_metadata_api.rb', line 313

def update_task_metadatum(task_id, task_metadatum_id, task_metadatum_body, opts = {})
  data, _status_code, _headers = update_task_metadatum_with_http_info(task_id, task_metadatum_id, task_metadatum_body, opts)
  data
end

#update_task_metadatum_with_http_info(task_id, task_metadatum_id, task_metadatum_body, opts = {}) ⇒ Array<(TaskMetadatum, Integer, Hash)>

Updates a specific task metadatum. **API Key Scope**: task_metadata / update

Parameters:

  • task_id (String)

    Numeric ID or name of task. Task names are not unique, it&#39;s recommanded to use numeric ID.

  • task_metadatum_id (Integer)

    Numeric ID of task metadatum.

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

    the optional parameters

Returns:

  • (Array<(TaskMetadatum, Integer, Hash)>)

    TaskMetadatum data, response status code and response headers



325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
# File 'lib/nodeum_sdk/api/task_metadata_api.rb', line 325

def update_task_metadatum_with_http_info(task_id, task_metadatum_id, task_metadatum_body, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TaskMetadataApi.update_task_metadatum ...'
  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 TaskMetadataApi.update_task_metadatum"
  end
  # verify the required parameter 'task_metadatum_id' is set
  if @api_client.config.client_side_validation && task_metadatum_id.nil?
    fail ArgumentError, "Missing the required parameter 'task_metadatum_id' when calling TaskMetadataApi.update_task_metadatum"
  end
  # verify the required parameter 'task_metadatum_body' is set
  if @api_client.config.client_side_validation && task_metadatum_body.nil?
    fail ArgumentError, "Missing the required parameter 'task_metadatum_body' when calling TaskMetadataApi.update_task_metadatum"
  end
  # resource path
  local_var_path = '/tasks/{task_id}/task_metadata/{task_metadatum_id}'.sub('{' + 'task_id' + '}', CGI.escape(task_id.to_s)).sub('{' + 'task_metadatum_id' + '}', CGI.escape(task_metadatum_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_metadatum_body) 

  # return_type
  return_type = opts[:return_type] || 'TaskMetadatum' 

  # 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: TaskMetadataApi#update_task_metadatum\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end