Class: Io::Flow::V0::Clients::WebhookSettings
- Inherits:
-
Object
- Object
- Io::Flow::V0::Clients::WebhookSettings
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Instance Method Summary collapse
-
#get(organization) ⇒ Object
Returns the webhook settings for an organization.
-
#initialize(client) ⇒ WebhookSettings
constructor
A new instance of WebhookSettings.
-
#put(organization, webhook_settings) ⇒ Object
Updates the webhook settings for an organization.
Constructor Details
#initialize(client) ⇒ WebhookSettings
Returns a new instance of WebhookSettings.
4818 4819 4820 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 4818 def initialize(client) @client = HttpClient::Preconditions.assert_class('client', client, ::Io::Flow::V0::Client) end |
Instance Method Details
#get(organization) ⇒ Object
Returns the webhook settings for an organization
4823 4824 4825 4826 4827 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 4823 def get(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(organization, webhook_settings) ⇒ Object
Updates the webhook settings for an organization
4830 4831 4832 4833 4834 4835 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 4830 def put(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 |