Class: SignwellSDK::Resources::V1::Hooks

Inherits:
Object
  • Object
show all
Defined in:
lib/signwell_sdk/resources/v1/hooks.rb

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ Hooks

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 Hooks.

Parameters:



72
73
74
# File 'lib/signwell_sdk/resources/v1/hooks.rb', line 72

def initialize(client:)
  @client = client
end

Instance Method Details

#create(callback_url:, api_application_id: nil, request_options: {}) ⇒ nil

Register a callback URL that we will post document events to.

Parameters:

  • callback_url (String)

    URL that we will post document events to.

  • api_application_id (String)

    Unique identifier for the API Application.

  • request_options (SignwellSDK::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

  • (nil)

See Also:



20
21
22
23
24
25
26
27
28
29
# File 'lib/signwell_sdk/resources/v1/hooks.rb', line 20

def create(params)
  parsed, options = SignwellSDK::V1::HookCreateParams.dump_request(params)
  @client.request(
    method: :post,
    path: "api/v1/hooks",
    body: parsed,
    model: NilClass,
    options: options
  )
end

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

Deletes a registered callback URL that we are posting document events to.

Parameters:

Returns:

  • (nil)

See Also:



60
61
62
63
64
65
66
67
# File 'lib/signwell_sdk/resources/v1/hooks.rb', line 60

def delete(id, params = {})
  @client.request(
    method: :delete,
    path: ["api/v1/hooks/%1$s", id],
    model: NilClass,
    options: params[:request_options]
  )
end

#list(request_options: {}) ⇒ nil

List all the webhooks in the account.

Parameters:

Returns:

  • (nil)

See Also:



40
41
42
43
44
45
46
47
# File 'lib/signwell_sdk/resources/v1/hooks.rb', line 40

def list(params = {})
  @client.request(
    method: :get,
    path: "api/v1/hooks",
    model: NilClass,
    options: params[:request_options]
  )
end