Class: Amocrm::Resources::Events

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

Instance Method Summary collapse

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.

Parameters:



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.

Parameters:

Returns:

See Also:



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, options = 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: options
  )
end

#list(filter: nil, limit: nil, page: nil, with: nil, request_options: {}) ⇒ Amocrm::Models::EventListResponse::EventListResponse, Amocrm::Models::EventListResponse::Problem

Get events list.

Parameters:

  • filter (Object)
  • limit (Integer)
  • page (Integer)
  • with (String)
  • request_options (Amocrm::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



19
20
21
22
23
24
25
26
27
28
29
# File 'lib/amocrm/resources/events.rb', line 19

def list(params = {})
  parsed, options = 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: options
  )
end

#list_types(language_code: nil, request_options: {}) ⇒ Amocrm::Models::EventListTypesResponse::EventTypesResponse, Amocrm::Models::EventListTypesResponse::Problem

Get event types.

Parameters:

Returns:

See Also:



64
65
66
67
68
69
70
71
72
73
74
# File 'lib/amocrm/resources/events.rb', line 64

def list_types(params = {})
  parsed, options = 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: options
  )
end