Class: Increase::Resources::EventSubscriptions

Inherits:
Object
  • Object
show all
Defined in:
lib/increase/resources/event_subscriptions.rb

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ EventSubscriptions

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 EventSubscriptions.

Parameters:



114
115
116
# File 'lib/increase/resources/event_subscriptions.rb', line 114

def initialize(client:)
  @client = client
end

Instance Method Details

#create(url: , oauth_connection_id: nil, selected_event_category: nil, shared_secret: nil, request_options: {}) ⇒ Increase::Models::EventSubscription

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

Create an Event Subscription

Parameters:

  • url (String)

    The URL you’d like us to send webhooks to.

  • oauth_connection_id (String)

    If specified, this subscription will only receive webhooks for Events associated

  • selected_event_category (Symbol, Increase::Models::EventSubscriptionCreateParams::SelectedEventCategory)

    If specified, this subscription will only receive webhooks for Events with the s

  • shared_secret (String)

    The key that will be used to sign webhooks. If no value is passed, a random stri

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

Returns:

See Also:



26
27
28
29
30
31
32
33
34
35
# File 'lib/increase/resources/event_subscriptions.rb', line 26

def create(params)
  parsed, options = Increase::EventSubscriptionCreateParams.dump_request(params)
  @client.request(
    method: :post,
    path: "event_subscriptions",
    body: parsed,
    model: Increase::EventSubscription,
    options: options
  )
end

#list(cursor: nil, idempotency_key: nil, limit: nil, request_options: {}) ⇒ Increase::Internal::Page<Increase::Models::EventSubscription>

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

List Event Subscriptions

Parameters:

  • cursor (String)

    Return the page of entries after this one.

  • idempotency_key (String)

    Filter records to the one with the specified ‘idempotency_key` you chose for tha

  • limit (Integer)

    Limit the size of the list that is returned. The default (and maximum) is 100 ob

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

Returns:

See Also:



99
100
101
102
103
104
105
106
107
108
109
# File 'lib/increase/resources/event_subscriptions.rb', line 99

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

#retrieve(event_subscription_id, request_options: {}) ⇒ Increase::Models::EventSubscription

Retrieve an Event Subscription

Parameters:

  • event_subscription_id (String)

    The identifier of the Event Subscription.

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

Returns:

See Also:



48
49
50
51
52
53
54
55
# File 'lib/increase/resources/event_subscriptions.rb', line 48

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

#update(event_subscription_id, status: nil, request_options: {}) ⇒ Increase::Models::EventSubscription

Update an Event Subscription

Parameters:

Returns:

See Also:



70
71
72
73
74
75
76
77
78
79
# File 'lib/increase/resources/event_subscriptions.rb', line 70

def update(event_subscription_id, params = {})
  parsed, options = Increase::EventSubscriptionUpdateParams.dump_request(params)
  @client.request(
    method: :patch,
    path: ["event_subscriptions/%1$s", event_subscription_id],
    body: parsed,
    model: Increase::EventSubscription,
    options: options
  )
end