Class: Amocrm::Resources::Tags
- Inherits:
-
Object
- Object
- Amocrm::Resources::Tags
- Defined in:
- lib/amocrm/resources/tags.rb
Instance Method Summary collapse
-
#create(entity_type, body:, request_options: {}) ⇒ Amocrm::Models::TagCreateResponse::TagCreateResponse, Amocrm::Models::TagCreateResponse::Problem
Create tags.
-
#initialize(client:) ⇒ Tags
constructor
private
A new instance of Tags.
-
#list(entity_type, filter: nil, limit: nil, page: nil, query: nil, request_options: {}) ⇒ Amocrm::Models::TagListResponse::TagListResponse, Amocrm::Models::TagListResponse::Problem
Get tags list.
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.
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, = 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: ) 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.
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, = 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: ) end |