Class: Increase::Resources::Events

Inherits:
Object
  • Object
show all
Defined in:
lib/increase/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:



63
64
65
# File 'lib/increase/resources/events.rb', line 63

def initialize(client:)
  @client = client
end

Instance Method Details

#list(associated_object_id: nil, category: nil, created_at: nil, cursor: nil, limit: nil, request_options: {}) ⇒ Increase::Internal::Page<Increase::Models::Event>

Some parameter documentations has been truncated, see Models::EventListParams for more details.

List Events

Parameters:

Returns:

See Also:



48
49
50
51
52
53
54
55
56
57
58
# File 'lib/increase/resources/events.rb', line 48

def list(params = {})
  parsed, options = Increase::EventListParams.dump_request(params)
  @client.request(
    method: :get,
    path: "events",
    query: parsed,
    page: Increase::Internal::Page,
    model: Increase::Event,
    options: options
  )
end

#retrieve(event_id, request_options: {}) ⇒ Increase::Models::Event

Retrieve an Event

Parameters:

  • event_id (String)

    The identifier of the Event.

  • request_options (Increase::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



17
18
19
20
21
22
23
24
# File 'lib/increase/resources/events.rb', line 17

def retrieve(event_id, params = {})
  @client.request(
    method: :get,
    path: ["events/%1$s", event_id],
    model: Increase::Event,
    options: params[:request_options]
  )
end