Class: LockstepSdk::WebhookRuleModel

Inherits:
Object
  • Object
show all
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

Instance Method Summary collapse

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

#createdDate-time

Returns The date this webhook rule was created.

Returns:

  • (Date-time)

    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_idUuid

Returns The ID of the user who created this webhook rule.

Returns:

  • (Uuid)

    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_typeString

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

Returns:

  • (String)

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

Returns:

  • (Date-time)

    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

#filterString

Returns The filter for this webhook rule (if necessary) . See [Searchlight Query Language](developer.lockstep.io/docs/querying-with-searchlight).

Returns:



69
70
71
# File 'lib/lockstep_sdk/models/webhook_rule_model.rb', line 69

def filter
  @filter
end

#group_keyUuid

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

Returns:

  • (Uuid)

    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

#modifiedDate-time

Returns The date this webhook rule was last modified.

Returns:

  • (Date-time)

    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_idUuid

Returns The ID of the user who last modified this webhook rule.

Returns:

  • (Uuid)

    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_typeString

Returns The format of the content to be returned in the webhook notifications. Current options are ‘Full’ or ‘Id’.

Returns:

  • (String)

    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_keyString

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

Returns:

  • (String)

    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_idUuid

Returns The unique Webhook ID that will be used to fire the webhook for this rule.

Returns:

  • (Uuid)

    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_idUuid

Returns The unique ID of this record, automatically assigned by Lockstep when this record is added to the Lockstep platform.

Returns:

  • (Uuid)

    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.

Returns:

  • (object)

    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(options={})
    {
        '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.

Returns:

  • (String)

    This object converted to a JSON string



112
113
114
# File 'lib/lockstep_sdk/models/webhook_rule_model.rb', line 112

def to_json(*options)
    "[#{as_json(*options).to_json(*options)}]"
end