Class: Amocrm::Resources::Tags

Inherits:
Object
  • Object
show all
Defined in:
lib/amocrm/resources/tags.rb

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ Tags

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of Tags.

Parameters:



57
58
59
# File 'lib/amocrm/resources/tags.rb', line 57

def initialize(client:)
  @client = client
end

Instance Method Details

#create(entity_type, body:, request_options: {}) ⇒ Amocrm::Models::TagCreateResponse::TagCreateResponse, Amocrm::Models::TagCreateResponse::Problem

Create tags.



17
18
19
20
21
22
23
24
25
26
# File 'lib/amocrm/resources/tags.rb', line 17

def create(entity_type, params)
  parsed, options = Amocrm::TagCreateParams.dump_request(params)
  @client.request(
    method: :post,
    path: ["api/v4/%1$s/tags", entity_type],
    body: parsed[:body],
    model: Amocrm::Models::TagCreateResponse,
    options: options
  )
end

#list(entity_type, filter: nil, limit: nil, page: nil, query: nil, request_options: {}) ⇒ Amocrm::Models::TagListResponse::TagListResponse, Amocrm::Models::TagListResponse::Problem

Get tags list.

Parameters:

Returns:

See Also:



42
43
44
45
46
47
48
49
50
51
52
# File 'lib/amocrm/resources/tags.rb', line 42

def list(entity_type, params = {})
  parsed, options = Amocrm::TagListParams.dump_request(params)
  query = Amocrm::Internal::Util.encode_query_params(parsed)
  @client.request(
    method: :get,
    path: ["api/v4/%1$s/tags", entity_type],
    query: query,
    model: Amocrm::Models::TagListResponse,
    options: options
  )
end