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 Throws an exception if API error.
47 48 49 50 51 52 53 54 55 56 |
# File 'lib/ngrokapi/services/event_sources_client.rb', line 47 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, danger: true) NgrokAPI::Models::EventSource.new(client: self, attrs: result) end |