Class: Amocrm::Resources::Events
- Inherits:
-
Object
- Object
- Amocrm::Resources::Events
- Defined in:
- lib/amocrm/resources/events.rb
Instance Method Summary collapse
-
#get_by_id(id, with: nil, request_options: {}) ⇒ Amocrm::Models::EventGetByIDResponse::Event, Amocrm::Models::EventGetByIDResponse::Problem
Get event by id.
-
#initialize(client:) ⇒ Events
constructor
private
A new instance of Events.
-
#list(filter: nil, limit: nil, page: nil, with: nil, request_options: {}) ⇒ Amocrm::Models::EventListResponse::EventListResponse, Amocrm::Models::EventListResponse::Problem
Get events list.
-
#list_types(language_code: nil, request_options: {}) ⇒ Amocrm::Models::EventListTypesResponse::EventTypesResponse, Amocrm::Models::EventListTypesResponse::Problem
Get event types.
Constructor Details
#initialize(client:) ⇒ Events
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 Events.
79 80 81 |
# File 'lib/amocrm/resources/events.rb', line 79 def initialize(client:) @client = client end |
Instance Method Details
#get_by_id(id, with: nil, request_options: {}) ⇒ Amocrm::Models::EventGetByIDResponse::Event, Amocrm::Models::EventGetByIDResponse::Problem
Get event by id.
42 43 44 45 46 47 48 49 50 51 52 |
# File 'lib/amocrm/resources/events.rb', line 42 def get_by_id(id, params = {}) parsed, = Amocrm::EventGetByIDParams.dump_request(params) query = Amocrm::Internal::Util.encode_query_params(parsed) @client.request( method: :get, path: ["api/v4/events/%1$s", id], query: query, model: Amocrm::Models::EventGetByIDResponse, options: ) end |
#list(filter: nil, limit: nil, page: nil, with: nil, request_options: {}) ⇒ Amocrm::Models::EventListResponse::EventListResponse, Amocrm::Models::EventListResponse::Problem
Get events list.
19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/amocrm/resources/events.rb', line 19 def list(params = {}) parsed, = Amocrm::EventListParams.dump_request(params) query = Amocrm::Internal::Util.encode_query_params(parsed) @client.request( method: :get, path: "api/v4/events", query: query, model: Amocrm::Models::EventListResponse, options: ) end |
#list_types(language_code: nil, request_options: {}) ⇒ Amocrm::Models::EventListTypesResponse::EventTypesResponse, Amocrm::Models::EventListTypesResponse::Problem
Get event types.
64 65 66 67 68 69 70 71 72 73 74 |
# File 'lib/amocrm/resources/events.rb', line 64 def list_types(params = {}) parsed, = Amocrm::EventListTypesParams.dump_request(params) query = Amocrm::Internal::Util.encode_query_params(parsed) @client.request( method: :get, path: "api/v4/events/types", query: query, model: Amocrm::Models::EventListTypesResponse, options: ) end |