class NgrokAPI::Services::EventSourcesClient

ngrok.com/docs/api#api-event-sources

Constants

PATH

The API path for the requests

Attributes

client[R]

Public Class Methods

new(client:) click to toggle source
# File lib/ngrokapi/services/event_sources_client.rb, line 13
def initialize(client:)
  @client = client
end

Public Instance Methods

create(subscription_id: "", type: "", filter: "", fields: []) click to toggle source

Add an additional type for which this event subscription will trigger

@param [string] subscription_id The unique identifier for the Event Subscription that this Event Source is attached to. @param [string] type Type of event for which an event subscription will trigger @return [NgrokAPI::Models::EventSource] result from the API request

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

# File lib/ngrokapi/services/event_sources_client.rb, line 25
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
create!(subscription_id: "", type: "", filter: "", fields: []) click to toggle source

Add an additional type for which this event subscription will trigger Throws an exception if API error.

@param [string] subscription_id The unique identifier for the Event Subscription that this Event Source is attached to. @param [string] type Type of event for which an event subscription will trigger @return [NgrokAPI::Models::EventSource] result from the API request

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

# File lib/ngrokapi/services/event_sources_client.rb, line 45
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
delete(subscription_id: "", type: "") click to toggle source

Remove a type for which this event subscription will trigger

@param [string] subscription_id The unique identifier for the Event Subscription that this Event Source is attached to. @param [string] type Type of event for which an event subscription will trigger @return [NgrokAPI::Models::Empty] result from the API request

ngrok.com/docs/api#api-event-sources-delete

# File lib/ngrokapi/services/event_sources_client.rb, line 64
def delete(subscription_id: "", type: "")
  path = '/event_subscriptions/%{subscription_id}/sources/%{type}'
  replacements = {
    subscription_id: subscription_id,
    type: type,
  }
  @client.delete(path % replacements)
end
delete!(subscription_id: "", type: "") click to toggle source

Remove a type for which this event subscription will trigger Throws an exception if API error.

@param [string] subscription_id The unique identifier for the Event Subscription that this Event Source is attached to. @param [string] type Type of event for which an event subscription will trigger @return [NgrokAPI::Models::Empty] result from the API request

ngrok.com/docs/api#api-event-sources-delete

# File lib/ngrokapi/services/event_sources_client.rb, line 82
def delete!(subscription_id: "", type: "")
  path = '/event_subscriptions/%{subscription_id}/sources/%{type}'
  replacements = {
    subscription_id: subscription_id,
    type: type,
  }
  @client.delete(path % replacements, danger: true)
end
get(subscription_id: "", type: "") click to toggle source

Get the details for a given type that triggers for the given event subscription

@param [string] subscription_id The unique identifier for the Event Subscription that this Event Source is attached to. @param [string] type Type of event for which an event subscription will trigger @return [NgrokAPI::Models::EventSource] result from the API request

ngrok.com/docs/api#api-event-sources-get

# File lib/ngrokapi/services/event_sources_client.rb, line 99
def get(subscription_id: "", type: "")
  path = '/event_subscriptions/%{subscription_id}/sources/%{type}'
  replacements = {
    subscription_id: subscription_id,
    type: type,
  }
  data = {}
  result = @client.get(path % replacements, data: data)
  NgrokAPI::Models::EventSource.new(client: self, attrs: result)
end
get!(subscription_id: "", type: "") click to toggle source

Get the details for a given type that triggers for the given event subscription Throws an exception if API error.

@param [string] subscription_id The unique identifier for the Event Subscription that this Event Source is attached to. @param [string] type Type of event for which an event subscription will trigger @return [NgrokAPI::Models::EventSource] result from the API request

ngrok.com/docs/api#api-event-sources-get

# File lib/ngrokapi/services/event_sources_client.rb, line 119
def get!(subscription_id: "", type: "")
  path = '/event_subscriptions/%{subscription_id}/sources/%{type}'
  replacements = {
    subscription_id: subscription_id,
    type: type,
  }
  data = {}
  result = @client.get(path % replacements, data: data, danger: true)
  NgrokAPI::Models::EventSource.new(client: self, attrs: result)
end
list(subscription_id: "") click to toggle source

List the types for which this event subscription will trigger

@param [string] subscription_id The unique identifier for the Event Subscription that this Event Source is attached to. @return [NgrokAPI::Models::EventSourceList] result from the API request

ngrok.com/docs/api#api-event-sources-list

# File lib/ngrokapi/services/event_sources_client.rb, line 137
def list(subscription_id: "")
  path = '/event_subscriptions/%{subscription_id}/sources'
  replacements = {
    subscription_id: subscription_id,
  }
  data = {}
  result = @client.get(path % replacements, data: data)
  NgrokAPI::Models::EventSourceList.new(client: self, attrs: result)
end
list!(subscription_id: "") click to toggle source

List the types for which this event subscription will trigger Throws an exception if API error.

@param [string] subscription_id The unique identifier for the Event Subscription that this Event Source is attached to. @return [NgrokAPI::Models::EventSourceList] result from the API request

ngrok.com/docs/api#api-event-sources-list

# File lib/ngrokapi/services/event_sources_client.rb, line 155
def list!(subscription_id: "")
  path = '/event_subscriptions/%{subscription_id}/sources'
  replacements = {
    subscription_id: subscription_id,
  }
  data = {}
  result = @client.get(path % replacements, data: data, danger: true)
  NgrokAPI::Models::EventSourceList.new(client: self, attrs: result)
end
update(subscription_id: "", type: "", filter: nil, fields: nil) click to toggle source

Update the type for which this event subscription will trigger

@param [string] subscription_id The unique identifier for the Event Subscription that this Event Source is attached to. @param [string] type Type of event for which an event subscription will trigger @return [NgrokAPI::Models::EventSource] result from the API request

ngrok.com/docs/api#api-event-sources-update

# File lib/ngrokapi/services/event_sources_client.rb, line 173
def update(subscription_id: "", type: "", filter: nil, fields: nil)
  path = '/event_subscriptions/%{subscription_id}/sources/%{type}'
  replacements = {
    subscription_id: subscription_id,
    type: type,
  }
  data = {}
  result = @client.patch(path % replacements, data: data)
  NgrokAPI::Models::EventSource.new(client: self, attrs: result)
end
update!(subscription_id: "", type: "", filter: nil, fields: nil) click to toggle source

Update the type for which this event subscription will trigger Throws an exception if API error.

@param [string] subscription_id The unique identifier for the Event Subscription that this Event Source is attached to. @param [string] type Type of event for which an event subscription will trigger @return [NgrokAPI::Models::EventSource] result from the API request

ngrok.com/docs/api#api-event-sources-update

# File lib/ngrokapi/services/event_sources_client.rb, line 193
def update!(subscription_id: "", type: "", filter: nil, fields: nil)
  path = '/event_subscriptions/%{subscription_id}/sources/%{type}'
  replacements = {
    subscription_id: subscription_id,
    type: type,
  }
  data = {}
  result = @client.patch(path % replacements, data: data, danger: true)
  NgrokAPI::Models::EventSource.new(client: self, attrs: result)
end