Class: Lithic::Resources::Events::Subscriptions
- Inherits:
-
Object
- Object
- Lithic::Resources::Events::Subscriptions
- Defined in:
- lib/lithic/resources/events/subscriptions.rb,
sig/lithic/resources/events/subscriptions.rbs
Instance Method Summary collapse
-
#create(url:, description: nil, disabled: nil, event_types: nil, request_options: {}) ⇒ Lithic::Models::EventSubscription
Some parameter documentations has been truncated, see Models::Events::SubscriptionCreateParams for more details.
-
#delete(event_subscription_token, request_options: {}) ⇒ nil
Delete an event subscription.
-
#initialize(client:) ⇒ Subscriptions
constructor
private
A new instance of Subscriptions.
-
#list(ending_before: nil, page_size: nil, starting_after: nil, request_options: {}) ⇒ Lithic::Internal::CursorPage<Lithic::Models::EventSubscription>
Some parameter documentations has been truncated, see Models::Events::SubscriptionListParams for more details.
-
#list_attempts(event_subscription_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::Events::SubscriptionListAttemptsParams for more details.
-
#recover(event_subscription_token, begin_: nil, end_: nil, request_options: {}) ⇒ nil
Some parameter documentations has been truncated, see Models::Events::SubscriptionRecoverParams for more details.
-
#replay_missing(event_subscription_token, begin_: nil, end_: nil, request_options: {}) ⇒ nil
Some parameter documentations has been truncated, see Models::Events::SubscriptionReplayMissingParams for more details.
-
#retrieve(event_subscription_token, request_options: {}) ⇒ Lithic::Models::EventSubscription
Get an event subscription.
-
#retrieve_secret(event_subscription_token, request_options: {}) ⇒ Lithic::Models::Events::SubscriptionRetrieveSecretResponse
Get the secret for an event subscription.
-
#rotate_secret(event_subscription_token, request_options: {}) ⇒ nil
Rotate the secret for an event subscription.
-
#send_simulated_example(event_subscription_token, event_type: nil, request_options: {}) ⇒ nil
Send an example message for event.
-
#update(event_subscription_token, url:, description: nil, disabled: nil, event_types: nil, request_options: {}) ⇒ Lithic::Models::EventSubscription
Some parameter documentations has been truncated, see Models::Events::SubscriptionUpdateParams for more details.
Constructor Details
#initialize(client:) ⇒ Subscriptions
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 Subscriptions.
309 310 311 |
# File 'lib/lithic/resources/events/subscriptions.rb', line 309 def initialize(client:) @client = client end |
Instance Method Details
#create(url:, description: nil, disabled: nil, event_types: nil, request_options: {}) ⇒ Lithic::Models::EventSubscription
Some parameter documentations has been truncated, see Models::Events::SubscriptionCreateParams for more details.
Create a new event subscription.
27 28 29 30 31 32 33 34 35 36 |
# File 'lib/lithic/resources/events/subscriptions.rb', line 27 def create(params) parsed, = Lithic::Events::SubscriptionCreateParams.dump_request(params) @client.request( method: :post, path: "v1/event_subscriptions", body: parsed, model: Lithic::EventSubscription, options: ) end |
#delete(event_subscription_token, request_options: {}) ⇒ nil
Delete an event subscription.
131 132 133 134 135 136 137 138 |
# File 'lib/lithic/resources/events/subscriptions.rb', line 131 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 |
#list(ending_before: nil, page_size: nil, starting_after: nil, request_options: {}) ⇒ Lithic::Internal::CursorPage<Lithic::Models::EventSubscription>
Some parameter documentations has been truncated, see Models::Events::SubscriptionListParams for more details.
List all the event subscriptions.
108 109 110 111 112 113 114 115 116 117 118 119 |
# File 'lib/lithic/resources/events/subscriptions.rb', line 108 def list(params = {}) parsed, = Lithic::Events::SubscriptionListParams.dump_request(params) query = Lithic::Internal::Util.encode_query_params(parsed) @client.request( method: :get, path: "v1/event_subscriptions", query: query, page: Lithic::Internal::CursorPage, model: Lithic::EventSubscription, options: ) end |
#list_attempts(event_subscription_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::Events::SubscriptionListAttemptsParams for more details.
List all the message attempts for a given event subscription.
166 167 168 169 170 171 172 173 174 175 176 177 |
# File 'lib/lithic/resources/events/subscriptions.rb', line 166 def list_attempts(event_subscription_token, params = {}) parsed, = Lithic::Events::SubscriptionListAttemptsParams.dump_request(params) query = Lithic::Internal::Util.encode_query_params(parsed) @client.request( method: :get, path: ["v1/event_subscriptions/%1$s/attempts", event_subscription_token], query: query.transform_keys(begin_: "begin", end_: "end"), page: Lithic::Internal::CursorPage, model: Lithic::MessageAttempt, options: ) end |
#recover(event_subscription_token, begin_: nil, end_: nil, request_options: {}) ⇒ nil
Some parameter documentations has been truncated, see Models::Events::SubscriptionRecoverParams for more details.
Resend all failed messages since a given time.
197 198 199 200 201 202 203 204 205 206 207 |
# File 'lib/lithic/resources/events/subscriptions.rb', line 197 def recover(event_subscription_token, params = {}) parsed, = Lithic::Events::SubscriptionRecoverParams.dump_request(params) query = Lithic::Internal::Util.encode_query_params(parsed) @client.request( method: :post, path: ["v1/event_subscriptions/%1$s/recover", event_subscription_token], query: query.transform_keys(begin_: "begin", end_: "end"), model: NilClass, options: ) end |
#replay_missing(event_subscription_token, begin_: nil, end_: nil, request_options: {}) ⇒ nil
Some parameter documentations has been truncated, see Models::Events::SubscriptionReplayMissingParams for more details.
Replays messages to the endpoint. Only messages that were created after begin
will be sent. Messages that were previously sent to the endpoint are not resent.
Message will be retried if endpoint responds with a non-2xx status code. See
Retry Schedule for
details.
231 232 233 234 235 236 237 238 239 240 241 |
# File 'lib/lithic/resources/events/subscriptions.rb', line 231 def replay_missing(event_subscription_token, params = {}) parsed, = Lithic::Events::SubscriptionReplayMissingParams.dump_request(params) query = Lithic::Internal::Util.encode_query_params(parsed) @client.request( method: :post, path: ["v1/event_subscriptions/%1$s/replay_missing", event_subscription_token], query: query.transform_keys(begin_: "begin", end_: "end"), model: NilClass, options: ) end |
#retrieve(event_subscription_token, request_options: {}) ⇒ Lithic::Models::EventSubscription
Get an event subscription.
48 49 50 51 52 53 54 55 |
# File 'lib/lithic/resources/events/subscriptions.rb', line 48 def retrieve(event_subscription_token, params = {}) @client.request( method: :get, path: ["v1/event_subscriptions/%1$s", event_subscription_token], model: Lithic::EventSubscription, options: params[:request_options] ) end |
#retrieve_secret(event_subscription_token, request_options: {}) ⇒ Lithic::Models::Events::SubscriptionRetrieveSecretResponse
Get the secret for an event subscription.
253 254 255 256 257 258 259 260 |
# File 'lib/lithic/resources/events/subscriptions.rb', line 253 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 |
#rotate_secret(event_subscription_token, request_options: {}) ⇒ nil
Rotate the secret for an event subscription. The previous secret will be valid for the next 24 hours.
273 274 275 276 277 278 279 280 |
# File 'lib/lithic/resources/events/subscriptions.rb', line 273 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 |
#send_simulated_example(event_subscription_token, event_type: nil, request_options: {}) ⇒ nil
Send an example message for event.
295 296 297 298 299 300 301 302 303 304 |
# File 'lib/lithic/resources/events/subscriptions.rb', line 295 def send_simulated_example(event_subscription_token, params = {}) parsed, = Lithic::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: ) end |
#update(event_subscription_token, url:, description: nil, disabled: nil, event_types: nil, request_options: {}) ⇒ Lithic::Models::EventSubscription
Some parameter documentations has been truncated, see Models::Events::SubscriptionUpdateParams for more details.
Update an event subscription.
79 80 81 82 83 84 85 86 87 88 |
# File 'lib/lithic/resources/events/subscriptions.rb', line 79 def update(event_subscription_token, params) parsed, = Lithic::Events::SubscriptionUpdateParams.dump_request(params) @client.request( method: :patch, path: ["v1/event_subscriptions/%1$s", event_subscription_token], body: parsed, model: Lithic::EventSubscription, options: ) end |