Class: Io::Flow::V0::Clients::WebhookSettings

Inherits:
Object
  • Object
show all
Defined in:
lib/flow_commerce/flow_api_v0_client.rb

Instance Method Summary collapse

Constructor Details

#initialize(client) ⇒ WebhookSettings

Returns a new instance of WebhookSettings.



5331
5332
5333
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 5331

def initialize(client)
  @client = HttpClient::Preconditions.assert_class('client', client, ::Io::Flow::V0::Client)
end

Instance Method Details

#get_channel_and_webhook_and_settings_by_channel(channel) ⇒ Object

Returns the webhook settings for a channel



5336
5337
5338
5339
5340
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 5336

def get_channel_and_webhook_and_settings_by_channel(channel)
  HttpClient::Preconditions.assert_class('channel', channel, String)
  r = @client.request("/channel/#{CGI.escape(channel)}/webhook/settings").get
  ::Io::Flow::V0::Models::WebhookSettings.new(r)
end

#get_webhook_and_settings_by_organization(organization) ⇒ Object

Returns the webhook settings for an organization



5351
5352
5353
5354
5355
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 5351

def get_webhook_and_settings_by_organization(organization)
  HttpClient::Preconditions.assert_class('organization', organization, String)
  r = @client.request("/#{CGI.escape(organization)}/webhook/settings").get
  ::Io::Flow::V0::Models::WebhookSettings.new(r)
end

#put_channel_and_webhook_and_settings_by_channel(channel, webhook_settings) ⇒ Object

Updates the webhook settings for a channel



5343
5344
5345
5346
5347
5348
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 5343

def put_channel_and_webhook_and_settings_by_channel(channel, webhook_settings)
  HttpClient::Preconditions.assert_class('channel', channel, String)
  (x = webhook_settings; x.is_a?(::Io::Flow::V0::Models::WebhookSettings) ? x : ::Io::Flow::V0::Models::WebhookSettings.new(x))
  r = @client.request("/channel/#{CGI.escape(channel)}/webhook/settings").with_json(webhook_settings.to_json).put
  ::Io::Flow::V0::Models::WebhookSettings.new(r)
end

#put_webhook_and_settings_by_organization(organization, webhook_settings) ⇒ Object

Updates the webhook settings for an organization



5358
5359
5360
5361
5362
5363
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 5358

def put_webhook_and_settings_by_organization(organization, webhook_settings)
  HttpClient::Preconditions.assert_class('organization', organization, String)
  (x = webhook_settings; x.is_a?(::Io::Flow::V0::Models::WebhookSettings) ? x : ::Io::Flow::V0::Models::WebhookSettings.new(x))
  r = @client.request("/#{CGI.escape(organization)}/webhook/settings").with_json(webhook_settings.to_json).put
  ::Io::Flow::V0::Models::WebhookSettings.new(r)
end