class Lithic::Resources::Events::Subscriptions

def create(params)

Returns:
  • (Lithic::Models::EventSubscription) -

Options Hash: (**params)
  • :request_options (Lithic::RequestOptions, Hash{Symbol=>Object}, nil) --
  • :event_types (Array) -- Indicates types of events that will be sent to this subscription. If left blank,
  • :disabled (Boolean) -- Whether the event subscription is active (false) or inactive (true).
  • :description (String) -- Event subscription description.
  • :url (String) -- URL to which event webhooks will be sent. URL must be a valid HTTPS address.

Parameters:
  • params (Lithic::Models::Events::SubscriptionCreateParams, Hash{Symbol=>Object}) -- .
def create(params)
  parsed, options = Lithic::Models::Events::SubscriptionCreateParams.dump_request(params)
  @client.request(
    method: :post,
    path: "v1/event_subscriptions",
    body: parsed,
    model: Lithic::Models::EventSubscription,
    options: options
  )
end

def delete(event_subscription_token, params = {})

Returns:
  • (nil) -

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

Parameters:
  • params (Lithic::Models::Events::SubscriptionDeleteParams, Hash{Symbol=>Object}) -- .
  • event_subscription_token (String) --
def delete(event_subscription_token, params = {})
  @client.request(
    method: :delete,
    path: ["v1/event_subscriptions/%1$s", event_subscription_token],
    model: NilClass,
    options: params[:request_options]
  )
end

def initialize(client:)

Parameters:
  • client (Lithic::Client) --
def initialize(client:)
  @client = client
end

def list(params = {})

Returns:
  • (Lithic::CursorPage) -

Options Hash: (**params)
  • :request_options (Lithic::RequestOptions, Hash{Symbol=>Object}, nil) --
  • :starting_after (String) -- A cursor representing an item's token after which a page of results should
  • :page_size (Integer) -- Page size (for pagination).
  • :ending_before (String) -- A cursor representing an item's token before which a page of results should end.

Parameters:
  • params (Lithic::Models::Events::SubscriptionListParams, Hash{Symbol=>Object}) -- .
def list(params = {})
  parsed, options = Lithic::Models::Events::SubscriptionListParams.dump_request(params)
  @client.request(
    method: :get,
    path: "v1/event_subscriptions",
    query: parsed,
    page: Lithic::CursorPage,
    model: Lithic::Models::EventSubscription,
    options: options
  )
end

def list_attempts(event_subscription_token, params = {})

Returns:
  • (Lithic::CursorPage) -

Options Hash: (**params)
  • :request_options (Lithic::RequestOptions, Hash{Symbol=>Object}, nil) --
  • :status (Symbol, Lithic::Models::Events::SubscriptionListAttemptsParams::Status) --
  • :starting_after (String) -- A cursor representing an item's token after which a page of results should
  • :page_size (Integer) -- Page size (for pagination).
  • :ending_before (String) -- A cursor representing an item's token before which a page of results should end.
  • :end_ (Time) -- Date string in RFC 3339 format. Only entries created before the specified time
  • :begin_ (Time) -- Date string in RFC 3339 format. Only entries created after the specified time

Parameters:
  • params (Lithic::Models::Events::SubscriptionListAttemptsParams, Hash{Symbol=>Object}) -- .
  • event_subscription_token (String) --
def list_attempts(event_subscription_token, params = {})
  parsed, options = Lithic::Models::Events::SubscriptionListAttemptsParams.dump_request(params)
  @client.request(
    method: :get,
    path: ["v1/event_subscriptions/%1$s/attempts", event_subscription_token],
    query: parsed,
    page: Lithic::CursorPage,
    model: Lithic::Models::MessageAttempt,
    options: options
  )
end

def recover(event_subscription_token, params = {})

Returns:
  • (nil) -

Options Hash: (**params)
  • :request_options (Lithic::RequestOptions, Hash{Symbol=>Object}, nil) --
  • :end_ (Time) -- Date string in RFC 3339 format. Only entries created before the specified time
  • :begin_ (Time) -- Date string in RFC 3339 format. Only entries created after the specified time

Parameters:
  • params (Lithic::Models::Events::SubscriptionRecoverParams, Hash{Symbol=>Object}) -- .
  • event_subscription_token (String) --
def recover(event_subscription_token, params = {})
  parsed, options = Lithic::Models::Events::SubscriptionRecoverParams.dump_request(params)
  @client.request(
    method: :post,
    path: ["v1/event_subscriptions/%1$s/recover", event_subscription_token],
    query: parsed,
    model: NilClass,
    options: options
  )
end

def replay_missing(event_subscription_token, params = {})

Returns:
  • (nil) -

Options Hash: (**params)
  • :request_options (Lithic::RequestOptions, Hash{Symbol=>Object}, nil) --
  • :end_ (Time) -- Date string in RFC 3339 format. Only entries created before the specified time
  • :begin_ (Time) -- Date string in RFC 3339 format. Only entries created after the specified time

Parameters:
  • params (Lithic::Models::Events::SubscriptionReplayMissingParams, Hash{Symbol=>Object}) -- .
  • event_subscription_token (String) --
def replay_missing(event_subscription_token, params = {})
  parsed, options = Lithic::Models::Events::SubscriptionReplayMissingParams.dump_request(params)
  @client.request(
    method: :post,
    path: ["v1/event_subscriptions/%1$s/replay_missing", event_subscription_token],
    query: parsed,
    model: NilClass,
    options: options
  )
end

def retrieve(event_subscription_token, params = {})

Returns:
  • (Lithic::Models::EventSubscription) -

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

Parameters:
  • params (Lithic::Models::Events::SubscriptionRetrieveParams, Hash{Symbol=>Object}) -- .
  • event_subscription_token (String) --
def retrieve(event_subscription_token, params = {})
  @client.request(
    method: :get,
    path: ["v1/event_subscriptions/%1$s", event_subscription_token],
    model: Lithic::Models::EventSubscription,
    options: params[:request_options]
  )
end

def retrieve_secret(event_subscription_token, params = {})

Returns:
  • (Lithic::Models::Events::SubscriptionRetrieveSecretResponse) -

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

Parameters:
  • params (Lithic::Models::Events::SubscriptionRetrieveSecretParams, Hash{Symbol=>Object}) -- .
  • event_subscription_token (String) --
def retrieve_secret(event_subscription_token, params = {})
  @client.request(
    method: :get,
    path: ["v1/event_subscriptions/%1$s/secret", event_subscription_token],
    model: Lithic::Models::Events::SubscriptionRetrieveSecretResponse,
    options: params[:request_options]
  )
end

def rotate_secret(event_subscription_token, params = {})

Returns:
  • (nil) -

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

Parameters:
  • params (Lithic::Models::Events::SubscriptionRotateSecretParams, Hash{Symbol=>Object}) -- .
  • event_subscription_token (String) --
def rotate_secret(event_subscription_token, params = {})
  @client.request(
    method: :post,
    path: ["v1/event_subscriptions/%1$s/secret/rotate", event_subscription_token],
    model: NilClass,
    options: params[:request_options]
  )
end

def send_simulated_example(event_subscription_token, params = {})

Returns:
  • (nil) -

Options Hash: (**params)
  • :request_options (Lithic::RequestOptions, Hash{Symbol=>Object}, nil) --
  • :event_type (Symbol, Lithic::Models::Events::SubscriptionSendSimulatedExampleParams::EventType) -- Event type to send example message for.

Parameters:
  • params (Lithic::Models::Events::SubscriptionSendSimulatedExampleParams, Hash{Symbol=>Object}) -- .
  • event_subscription_token (String) --
def send_simulated_example(event_subscription_token, params = {})
  parsed, options = Lithic::Models::Events::SubscriptionSendSimulatedExampleParams.dump_request(params)
  @client.request(
    method: :post,
    path: ["v1/simulate/event_subscriptions/%1$s/send_example", event_subscription_token],
    body: parsed,
    model: NilClass,
    options: options
  )
end

def update(event_subscription_token, params)

Returns:
  • (Lithic::Models::EventSubscription) -

Options Hash: (**params)
  • :request_options (Lithic::RequestOptions, Hash{Symbol=>Object}, nil) --
  • :event_types (Array) -- Indicates types of events that will be sent to this subscription. If left blank,
  • :disabled (Boolean) -- Whether the event subscription is active (false) or inactive (true).
  • :description (String) -- Event subscription description.
  • :url (String) -- URL to which event webhooks will be sent. URL must be a valid HTTPS address.

Parameters:
  • params (Lithic::Models::Events::SubscriptionUpdateParams, Hash{Symbol=>Object}) -- .
  • event_subscription_token (String) --
def update(event_subscription_token, params)
  parsed, options = Lithic::Models::Events::SubscriptionUpdateParams.dump_request(params)
  @client.request(
    method: :patch,
    path: ["v1/event_subscriptions/%1$s", event_subscription_token],
    body: parsed,
    model: Lithic::Models::EventSubscription,
    options: options
  )
end