Sha256: 6e65e1adec443f2dc6a6623c903b39f1514ae6d08d34e32dbc6eb88f36a0610b

Contents?: true

Size: 1.09 KB

Versions: 5

Compression:

Stored size: 1.09 KB

Contents

module Calendlyr
  class WebhookResource < Resource
    def list(organization:, scope:, **params)
      response = get_request("webhook_subscriptions", params: params.merge(organization: organization, scope: scope).compact)
      Collection.from_response(response, type: Webhooks::Subscription, client: client)
    end

    def create(url:, events:, organization:, scope:, **params)
      body = params.merge(url: url, events: events, organization: organization, scope: scope)
      Webhooks::Subscription.new post_request("webhook_subscriptions", body: body).dig("resource").merge(client: client)
    end

    def retrieve(webhook_uuid:)
      Webhooks::Subscription.new get_request("webhook_subscriptions/#{webhook_uuid}").dig("resource").merge(client: client)
    end

    def delete(webhook_uuid:)
      delete_request("webhook_subscriptions/#{webhook_uuid}")
    end

    def sample_webhook_data(event:, organization:, scope:, **params)
      Object.new get_request("sample_webhook_data", params: params.merge(event: event, organization: organization, scope: scope)).merge(client: client)
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
calendlyr-0.7.4 lib/calendlyr/resources/webhook.rb
calendlyr-0.7.3 lib/calendlyr/resources/webhook.rb
calendlyr-0.7.2 lib/calendlyr/resources/webhook.rb
calendlyr-0.7.1 lib/calendlyr/resources/webhook.rb
calendlyr-0.7.0 lib/calendlyr/resources/webhook.rb