Class: LockstepSdk::WebhookRuleModel
- Inherits:
-
Object
- Object
- LockstepSdk::WebhookRuleModel
- Defined in:
- lib/lockstep_sdk/models/webhook_rule_model.rb
Overview
A Webhook Rule is a subscription to receive notifications automatically for
Currently supported objects:
* `SyncRequest` - Receive a notification when a new sync request has completed for the group key.
Instance Attribute Summary collapse
-
#created ⇒ Date-time
The date this webhook rule was created.
-
#created_user_id ⇒ Uuid
The ID of the user who created this webhook rule.
-
#event_type ⇒ String
A Webhook rule is setup to be fired based on
TableKeyandEventType. -
#expiration_date ⇒ Date-time
The expiration date for the given webhook subscription.
-
#filter ⇒ String
The filter for this webhook rule (if necessary) .
-
#group_key ⇒ Uuid
The GroupKey uniquely identifies a single Lockstep Platform account.
-
#modified ⇒ Date-time
The date this webhook rule was last modified.
-
#modified_user_id ⇒ Uuid
The ID of the user who last modified this webhook rule.
-
#request_content_type ⇒ String
The format of the content to be returned in the webhook notifications.
-
#table_key ⇒ String
A Webhook rule is setup to be fired based on
TableKeyandEventType. -
#webhook_id ⇒ Uuid
The unique Webhook ID that will be used to fire the webhook for this rule.
-
#webhook_rule_id ⇒ Uuid
The unique ID of this record, automatically assigned by Lockstep when this record is added to the Lockstep platform.
Instance Method Summary collapse
-
#as_json(options = {}) ⇒ object
This object as a JSON key-value structure.
-
#initialize(params = {}) ⇒ WebhookRuleModel
constructor
Initialize the WebhookRuleModel using the provided prototype.
-
#to_json(*options) ⇒ String
This object converted to a JSON string.
Constructor Details
#initialize(params = {}) ⇒ WebhookRuleModel
Initialize the WebhookRuleModel using the provided prototype
28 29 30 31 32 33 34 35 36 37 38 39 40 41 |
# File 'lib/lockstep_sdk/models/webhook_rule_model.rb', line 28 def initialize(params = {}) @webhook_rule_id = params.dig(:webhook_rule_id) @webhook_id = params.dig(:webhook_id) @group_key = params.dig(:group_key) @table_key = params.dig(:table_key) @event_type = params.dig(:event_type) @expiration_date = params.dig(:expiration_date) @filter = params.dig(:filter) @request_content_type = params.dig(:request_content_type) @created = params.dig(:created) @created_user_id = params.dig(:created_user_id) @modified = params.dig(:modified) @modified_user_id = params.dig(:modified_user_id) end |
Instance Attribute Details
#created ⇒ Date-time
Returns The date this webhook rule was created.
77 78 79 |
# File 'lib/lockstep_sdk/models/webhook_rule_model.rb', line 77 def created @created end |
#created_user_id ⇒ Uuid
Returns The ID of the user who created this webhook rule.
81 82 83 |
# File 'lib/lockstep_sdk/models/webhook_rule_model.rb', line 81 def created_user_id @created_user_id end |
#event_type ⇒ String
Returns A Webhook rule is setup to be fired based on TableKey and EventType. For example, a Webhook setup for when an Invoice is Created would have a TableKey value of Invoice and an EventType value of I (Insert). The EventType value is one of the following: - I (Insert) - D (Delete) - U (Update) For more information, see [linking metadata to an object](developer.lockstep.io/docs/custom-fields#linking-metadata-to-an-object).
61 62 63 |
# File 'lib/lockstep_sdk/models/webhook_rule_model.rb', line 61 def event_type @event_type end |
#expiration_date ⇒ Date-time
Returns The expiration date for the given webhook subscription. Once the expiration date passes, notifications will no longer be sent to the callback url.
65 66 67 |
# File 'lib/lockstep_sdk/models/webhook_rule_model.rb', line 65 def expiration_date @expiration_date end |
#filter ⇒ String
Returns The filter for this webhook rule (if necessary) . See [Searchlight Query Language](developer.lockstep.io/docs/querying-with-searchlight).
69 70 71 |
# File 'lib/lockstep_sdk/models/webhook_rule_model.rb', line 69 def filter @filter end |
#group_key ⇒ Uuid
Returns The GroupKey uniquely identifies a single Lockstep Platform account. All records for this account will share the same GroupKey value. GroupKey values cannot be changed once created. For more information, see [Accounts and GroupKeys](developer.lockstep.io/docs/accounts-and-groupkeys).
53 54 55 |
# File 'lib/lockstep_sdk/models/webhook_rule_model.rb', line 53 def group_key @group_key end |
#modified ⇒ Date-time
Returns The date this webhook rule was last modified.
85 86 87 |
# File 'lib/lockstep_sdk/models/webhook_rule_model.rb', line 85 def modified @modified end |
#modified_user_id ⇒ Uuid
Returns The ID of the user who last modified this webhook rule.
89 90 91 |
# File 'lib/lockstep_sdk/models/webhook_rule_model.rb', line 89 def modified_user_id @modified_user_id end |
#request_content_type ⇒ String
Returns The format of the content to be returned in the webhook notifications. Current options are ‘Full’ or ‘Id’.
73 74 75 |
# File 'lib/lockstep_sdk/models/webhook_rule_model.rb', line 73 def request_content_type @request_content_type end |
#table_key ⇒ String
Returns A Webhook rule is setup to be fired based on TableKey and EventType. For example, a Webhook setup for when an Invoice is Created would have a TableKey value of Invoice and an EventType value of I (Insert). The TableKey value contains the name of the table within the Lockstep Platform to which this metadata is connected. For more information, see [linking metadata to an object](developer.lockstep.io/docs/custom-fields#linking-metadata-to-an-object).
57 58 59 |
# File 'lib/lockstep_sdk/models/webhook_rule_model.rb', line 57 def table_key @table_key end |
#webhook_id ⇒ Uuid
Returns The unique Webhook ID that will be used to fire the webhook for this rule.
49 50 51 |
# File 'lib/lockstep_sdk/models/webhook_rule_model.rb', line 49 def webhook_id @webhook_id end |
#webhook_rule_id ⇒ Uuid
Returns The unique ID of this record, automatically assigned by Lockstep when this record is added to the Lockstep platform.
45 46 47 |
# File 'lib/lockstep_sdk/models/webhook_rule_model.rb', line 45 def webhook_rule_id @webhook_rule_id end |
Instance Method Details
#as_json(options = {}) ⇒ object
Returns This object as a JSON key-value structure.
93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 |
# File 'lib/lockstep_sdk/models/webhook_rule_model.rb', line 93 def as_json(={}) { 'webhookRuleId' => @webhook_rule_id, 'webhookId' => @webhook_id, 'groupKey' => @group_key, 'tableKey' => @table_key, 'eventType' => @event_type, 'expirationDate' => @expiration_date, 'filter' => @filter, 'requestContentType' => @request_content_type, 'created' => @created, 'createdUserId' => @created_user_id, 'modified' => @modified, 'modifiedUserId' => @modified_user_id, } end |
#to_json(*options) ⇒ String
Returns This object converted to a JSON string.
112 113 114 |
# File 'lib/lockstep_sdk/models/webhook_rule_model.rb', line 112 def to_json(*) "[#{as_json(*).to_json(*)}]" end |