Class: Lithic::Resources::Events

Inherits:
Object
  • Object
show all
Defined in:
lib/lithic/resources/events.rb,
lib/lithic/resources/events/subscriptions.rb,
lib/lithic/resources/events/event_subscriptions.rb

Defined Under Namespace

Classes: EventSubscriptions, Subscriptions

Instance Attribute Summary collapse

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:



112
113
114
115
116
# File 'lib/lithic/resources/events.rb', line 112

def initialize(client:)
  @client = client
  @subscriptions = Lithic::Resources::Events::Subscriptions.new(client: client)
  @event_subscriptions = Lithic::Resources::Events::EventSubscriptions.new(client: client)
end

Instance Attribute Details

#event_subscriptionsLithic::Resources::Events::EventSubscriptions (readonly)



10
11
12
# File 'lib/lithic/resources/events.rb', line 10

def event_subscriptions
  @event_subscriptions
end

#subscriptionsLithic::Resources::Events::Subscriptions (readonly)



7
8
9
# File 'lib/lithic/resources/events.rb', line 7

def subscriptions
  @subscriptions
end

Instance Method Details

#list(begin_: nil, end_: nil, ending_before: nil, event_types: nil, page_size: nil, starting_after: nil, with_content: nil, request_options: {}) ⇒ Lithic::Internal::CursorPage<Lithic::Models::Event>

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

List all events.

Parameters:

  • begin_ (Time)

    Date string in RFC 3339 format. Only entries created after the specified time wi

  • end_ (Time)

    Date string in RFC 3339 format. Only entries created before the specified time w

  • ending_before (String)

    A cursor representing an item’s token before which a page of results should end.

  • event_types (Array<Symbol, Lithic::Models::EventListParams::EventType>)

    Event types to filter events by.

  • page_size (Integer)

    Page size (for pagination).

  • starting_after (String)

    A cursor representing an item’s token after which a page of results should begin

  • with_content (Boolean)

    Whether to include the event payload content in the response.

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

Returns:

See Also:



57
58
59
60
61
62
63
64
65
66
67
68
# File 'lib/lithic/resources/events.rb', line 57

def list(params = {})
  parsed, options = Lithic::EventListParams.dump_request(params)
  query = Lithic::Internal::Util.encode_query_params(parsed)
  @client.request(
    method: :get,
    path: "v1/events",
    query: query.transform_keys(begin_: "begin", end_: "end"),
    page: Lithic::Internal::CursorPage,
    model: Lithic::Event,
    options: options
  )
end

#list_attempts(event_token, begin_: nil, end_: nil, ending_before: nil, page_size: nil, starting_after: nil, status: nil, request_options: {}) ⇒ Lithic::Internal::CursorPage<Lithic::Models::MessageAttempt>

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

List all the message attempts for a given event.

Parameters:

  • event_token (String)
  • begin_ (Time)

    Date string in RFC 3339 format. Only entries created after the specified time wi

  • end_ (Time)

    Date string in RFC 3339 format. Only entries created before the specified time w

  • ending_before (String)

    A cursor representing an item’s token before which a page of results should end.

  • page_size (Integer)

    Page size (for pagination).

  • starting_after (String)

    A cursor representing an item’s token after which a page of results should begin

  • status (Symbol, Lithic::Models::EventListAttemptsParams::Status)
  • request_options (Lithic::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



96
97
98
99
100
101
102
103
104
105
106
107
# File 'lib/lithic/resources/events.rb', line 96

def list_attempts(event_token, params = {})
  parsed, options = Lithic::EventListAttemptsParams.dump_request(params)
  query = Lithic::Internal::Util.encode_query_params(parsed)
  @client.request(
    method: :get,
    path: ["v1/events/%1$s/attempts", event_token],
    query: query.transform_keys(begin_: "begin", end_: "end"),
    page: Lithic::Internal::CursorPage,
    model: Lithic::MessageAttempt,
    options: options
  )
end

#retrieve(event_token, request_options: {}) ⇒ Lithic::Models::Event

Get an event.

Parameters:

Returns:

See Also:



22
23
24
25
26
27
28
29
# File 'lib/lithic/resources/events.rb', line 22

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