Class: Zavudev::Resources::Senders::Agent::Tools::Webhook
- Inherits:
-
Object
- Object
- Zavudev::Resources::Senders::Agent::Tools::Webhook
- Defined in:
- lib/zavudev/resources/senders/agent/tools/webhook.rb,
sig/zavudev/resources/senders/agent/tools/webhook.rbs
Instance Method Summary collapse
-
#initialize(client:) ⇒ Webhook
constructor
private
A new instance of Webhook.
-
#rotate_secret(tool_id, sender_id:, request_options: {}) ⇒ Zavudev::Models::WebhookSecretResponse
Generate a new signing secret for this tool.
Constructor Details
#initialize(client:) ⇒ Webhook
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of Webhook.
39 40 41 |
# File 'lib/zavudev/resources/senders/agent/tools/webhook.rb', line 39 def initialize(client:) @client = client end |
Instance Method Details
#rotate_secret(tool_id, sender_id:, request_options: {}) ⇒ Zavudev::Models::WebhookSecretResponse
Generate a new signing secret for this tool. The previous one stops working on the next call, with no overlap, so update your endpoint first. The tool keeps its id, so flows that reference it by name are unaffected.
22 23 24 25 26 27 28 29 30 31 32 33 34 |
# File 'lib/zavudev/resources/senders/agent/tools/webhook.rb', line 22 def rotate_secret(tool_id, params) parsed, = Zavudev::Senders::Agent::Tools::WebhookRotateSecretParams.dump_request(params) sender_id = parsed.delete(:sender_id) do raise ArgumentError.new("missing required path argument #{_1}") end @client.request( method: :post, path: ["v1/senders/%1$s/agent/tools/%2$s/webhook/secret", sender_id, tool_id], model: Zavudev::WebhookSecretResponse, options: ) end |