Class: KazeClient::AddTagRequest

Inherits:
Utils::FinalRequest show all
Includes:
Utils::AuthentifiedRequest
Defined in:
lib/kaze_client/request/requests/jobs/add_tag_request.rb

Overview

Note:

This API is under development and does not work well. When you add a tag with it, it does not check if the id is correct or not and it deletes all the other tags. It should be fixed in a next version of Kaze API.

Add tags to a job. Will make a request like this:

 PUT https://kaze.modulotech.fr/api/tags/references/job/123
--- HEADERS ---
{
    "Authorization": "token", "Content-Type": "application/json", "Accept": "application/json"
}
--- BODY ---
{
    "tags": [1, 2, 3]
}

Examples:

rq = KazeClient::AddTagRequest.new(123, [1, 2, 3]).with_token('token')
KazeClient::Client.new('https://kaze.modulotech.fr').execute(rq)

See Also:

Author:

Since:

  • 0.3.2

Constant Summary

Constants inherited from Request

Request::DEFAULT_HEADERS

Instance Attribute Summary

Attributes included from Utils::AuthentifiedRequest

#token

Attributes inherited from Request

#body, #headers, #method, #query, #url

Instance Method Summary collapse

Methods included from Utils::AuthentifiedRequest

#with_token

Methods inherited from Request

#error_for, #parameters

Constructor Details

#initialize(job_id, tag_ids) ⇒ AddTagRequest

Returns a new instance of AddTagRequest.

Since:

  • 0.3.2



34
35
36
37
38
# File 'lib/kaze_client/request/requests/jobs/add_tag_request.rb', line 34

def initialize(job_id, tag_ids)
  super(:put, "/api/tags/references/job/#{job_id}")

  @body = { tags: tag_ids }
end