Class: WebhookRulesClient

Inherits:
Object
  • Object
show all
Defined in:
lib/lockstep_sdk/clients/webhook_rules_client.rb

Instance Method Summary collapse

Constructor Details

#initialize(connection) ⇒ WebhookRulesClient

Initialize the WebhookRulesClient class with an API client instance.

Parameters:

  • connection (LockstepApi)

    The API client object for this connection



22
23
24
# File 'lib/lockstep_sdk/clients/webhook_rules_client.rb', line 22

def initialize(connection)
    @connection = connection
end

Instance Method Details

#create_webhook_rules(body:) ⇒ Object

Creates one or more webhook rules from a given model.

Parameters:

  • body (WebhookRuleModel)

    The Webhook Rules to create



61
62
63
64
# File 'lib/lockstep_sdk/clients/webhook_rules_client.rb', line 61

def create_webhook_rules(body:)
    path = "/api/v1/WebhookRules"
    @connection.request(:post, path, body, nil)
end

#delete_webhook_rule(id:) ⇒ Object

Deletes the Webhook Rule referred to by this unique identifier.

Parameters:

  • id (uuid)

    The unique Lockstep Platform ID number of the Webhook Rule to delete.



52
53
54
55
# File 'lib/lockstep_sdk/clients/webhook_rules_client.rb', line 52

def delete_webhook_rule(id:)
    path = "/api/v1/WebhookRules/#{id}"
    @connection.request(:delete, path, nil, nil)
end

#query_webhook_rules(filter:, include_param:, order:, page_size:, page_number:) ⇒ Object

Queries Webhook Rules for this account using the specified filtering, sorting, and pagination rules requested.

More information on querying can be found on the [Searchlight Query Language](developer.lockstep.io/docs/querying-with-searchlight) page on the Lockstep Developer website.

Parameters:



76
77
78
79
80
# File 'lib/lockstep_sdk/clients/webhook_rules_client.rb', line 76

def query_webhook_rules(filter:, include_param:, order:, page_size:, page_number:)
    path = "/api/v1/WebhookRules/query"
    params = {:filter => filter, :include => include_param, :order => order, :pageSize => page_size, :pageNumber => page_number}
    @connection.request(:get, path, nil, params)
end

#retrieve_webhook_rule(id:) ⇒ Object

Retrieves the Webhook Rule specified by this unique identifier.

Parameters:

  • id (uuid)

    The unique Lockstep Platform ID number of this Webhook Rule



31
32
33
34
# File 'lib/lockstep_sdk/clients/webhook_rules_client.rb', line 31

def retrieve_webhook_rule(id:)
    path = "/api/v1/WebhookRules/#{id}"
    @connection.request(:get, path, nil, nil)
end

#update_webhook_rule(id:, body:) ⇒ Object

Updates a webhook rule that matches the specified id with the requested information.

The PATCH method allows you to change specific values on the object while leaving other values alone. As input you should supply a list of field names and new values. If you do not provide the name of a field, that field will remain unchanged. This allows you to ensure that you are only updating the specific fields desired.

Parameters:

  • id (uuid)

    The unique Lockstep Platform ID number of the Webhook Rule to update.

  • body (object)

    A list of changes to apply to this Webhook Rule



43
44
45
46
# File 'lib/lockstep_sdk/clients/webhook_rules_client.rb', line 43

def update_webhook_rule(id:, body:)
    path = "/api/v1/WebhookRules/#{id}"
    @connection.request(:patch, path, body.to_camelback_keys.to_json, nil)
end