Class: Uploadcare::Client::WebhooksAccessor

Inherits:
Object
  • Object
show all
Defined in:
lib/uploadcare/client/webhooks_accessor.rb

Overview

High-level webhook operations scoped to a client instance.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ WebhooksAccessor

Returns a new instance of WebhooksAccessor.

Parameters:



8
9
10
# File 'lib/uploadcare/client/webhooks_accessor.rb', line 8

def initialize(client:)
  @client = client
end

Instance Attribute Details

#clientObject (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

Parameters:

  • target_url (String)
  • request_options (Hash) (defaults to: {})
  • options (Hash)

Returns:



22
23
24
25
26
# File 'lib/uploadcare/client/webhooks_accessor.rb', line 22

def create(target_url:, request_options: {}, **options)
  Uploadcare::Resources::Webhook.create(
    target_url: target_url, client: client, request_options: request_options, **options
  )
end

#delete(target_url:, request_options: {}) ⇒ nil

Parameters:

  • target_url (String)
  • request_options (Hash) (defaults to: {})

Returns:

  • (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: request_options)
end

#list(request_options: {}) ⇒ Array<Uploadcare::Resources::Webhook>

Parameters:

  • request_options (Hash) (defaults to: {})

Returns:



14
15
16
# File 'lib/uploadcare/client/webhooks_accessor.rb', line 14

def list(request_options: {})
  Uploadcare::Resources::Webhook.list(client: client, request_options: request_options)
end

#update(id:, request_options: {}, **options) ⇒ Uploadcare::Resources::Webhook

Parameters:

  • id (String)
  • request_options (Hash) (defaults to: {})
  • options (Hash)

Returns:



32
33
34
# File 'lib/uploadcare/client/webhooks_accessor.rb', line 32

def update(id:, request_options: {}, **options)
  Uploadcare::Resources::Webhook.update(id: id, client: client, request_options: request_options, **options)
end