Method: NgrokAPI::Services::EventSourcesClient#create

Defined in:
lib/ngrokapi/services/event_sources_client.rb

#create(subscription_id: "", type: "", filter: "", fields: []) ⇒ NgrokAPI::Models::EventSource

Add an additional type for which this event subscription will trigger

https://ngrok.com/docs/api#api-event-sources-create

Parameters:

  • subscription_id (string) (defaults to: "")

    The unique identifier for the Event Subscription that this Event Source is attached to.

  • type (string) (defaults to: "")

    Type of event for which an event subscription will trigger

Returns:



27
28
29
30
31
32
33
34
35
36
# File 'lib/ngrokapi/services/event_sources_client.rb', line 27

def create(subscription_id: "", type: "", filter: "", fields: [])
  path = '/event_subscriptions/%{subscription_id}/sources'
  replacements = {
    subscription_id: subscription_id,
  }
  data = {}
  data[:type] = type if type
  result = @client.post(path % replacements, data: data)
  NgrokAPI::Models::EventSource.new(client: self, attrs: result)
end