Class: Uploadcare::Client::WebhooksAccessor
- Inherits:
-
Object
- Object
- Uploadcare::Client::WebhooksAccessor
- Defined in:
- lib/uploadcare/client/webhooks_accessor.rb
Overview
High-level webhook operations scoped to a client instance.
Instance Attribute Summary collapse
-
#client ⇒ Object
readonly
Returns the value of attribute client.
Instance Method Summary collapse
- #create(target_url:, request_options: {}, **options) ⇒ Uploadcare::Resources::Webhook
- #delete(target_url:, request_options: {}) ⇒ nil
-
#initialize(client:) ⇒ WebhooksAccessor
constructor
A new instance of WebhooksAccessor.
- #list(request_options: {}) ⇒ Array<Uploadcare::Resources::Webhook>
- #update(id:, request_options: {}, **options) ⇒ Uploadcare::Resources::Webhook
Constructor Details
#initialize(client:) ⇒ WebhooksAccessor
Returns a new instance of WebhooksAccessor.
8 9 10 |
# File 'lib/uploadcare/client/webhooks_accessor.rb', line 8 def initialize(client:) @client = client end |
Instance Attribute Details
#client ⇒ Object (readonly)
Returns the value of attribute client.
5 6 7 |
# File 'lib/uploadcare/client/webhooks_accessor.rb', line 5 def client @client end |
Instance Method Details
#create(target_url:, request_options: {}, **options) ⇒ Uploadcare::Resources::Webhook
22 23 24 25 26 |
# File 'lib/uploadcare/client/webhooks_accessor.rb', line 22 def create(target_url:, request_options: {}, **) Uploadcare::Resources::Webhook.create( target_url: target_url, client: client, request_options: , ** ) end |
#delete(target_url:, request_options: {}) ⇒ nil
39 40 41 |
# File 'lib/uploadcare/client/webhooks_accessor.rb', line 39 def delete(target_url:, request_options: {}) Uploadcare::Resources::Webhook.delete(target_url: target_url, client: client, request_options: ) end |
#list(request_options: {}) ⇒ Array<Uploadcare::Resources::Webhook>
14 15 16 |
# File 'lib/uploadcare/client/webhooks_accessor.rb', line 14 def list(request_options: {}) Uploadcare::Resources::Webhook.list(client: client, request_options: ) end |
#update(id:, request_options: {}, **options) ⇒ Uploadcare::Resources::Webhook
32 33 34 |
# File 'lib/uploadcare/client/webhooks_accessor.rb', line 32 def update(id:, request_options: {}, **) Uploadcare::Resources::Webhook.update(id: id, client: client, request_options: , **) end |