Class: LockstepSdk::WebhookHistoryTableStorageModel

Inherits:
Object
  • Object
show all
Defined in:
lib/lockstep_sdk/models/webhook_history_table_storage_model.rb

Overview

Represents the Webhook Trigger History

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(params = {}) ⇒ WebhookHistoryTableStorageModel

Initialize the WebhookHistoryTableStorageModel using the provided prototype



27
28
29
30
31
32
33
34
35
36
37
38
# File 'lib/lockstep_sdk/models/webhook_history_table_storage_model.rb', line 27

def initialize(params = {})
    @group_key = params.dig(:group_key)
    @webhook_id = params.dig(:webhook_id)
    @webhook_history_id = params.dig(:webhook_history_id)
    @event_type = params.dig(:event_type)
    @request_sent = params.dig(:request_sent)
    @is_successful = params.dig(:is_successful)
    @response_status_code = params.dig(:response_status_code)
    @process_result_message = params.dig(:process_result_message)
    @failure_count = params.dig(:failure_count)
    @timestamp = params.dig(:timestamp)
end

Instance Attribute Details

#event_typeString

Returns Event type which fired webhook [entity]..

Returns:

  • (String)

    Event type which fired webhook [entity].



54
55
56
# File 'lib/lockstep_sdk/models/webhook_history_table_storage_model.rb', line 54

def event_type
  @event_type
end

#failure_countInt32

Returns Number of times message failed to be sent over to callback url before succeeding or failing out. The maximum value should is based on webhook.

Returns:

  • (Int32)

    Number of times message failed to be sent over to callback url before succeeding or failing out. The maximum value should is based on webhook.



74
75
76
# File 'lib/lockstep_sdk/models/webhook_history_table_storage_model.rb', line 74

def failure_count
  @failure_count
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).



42
43
44
# File 'lib/lockstep_sdk/models/webhook_history_table_storage_model.rb', line 42

def group_key
  @group_key
end

#is_successfulBoolean

Returns Flag whether webhook notification was successful overall (if webhook disabled should always return true otherwise depends on the response from the callback url).

Returns:

  • (Boolean)

    Flag whether webhook notification was successful overall (if webhook disabled should always return true otherwise depends on the response from the callback url)



62
63
64
# File 'lib/lockstep_sdk/models/webhook_history_table_storage_model.rb', line 62

def is_successful
  @is_successful
end

#process_result_messageString

Returns Message containing information about the webhook callback results.

Returns:

  • (String)

    Message containing information about the webhook callback results



70
71
72
# File 'lib/lockstep_sdk/models/webhook_history_table_storage_model.rb', line 70

def process_result_message
  @process_result_message
end

#request_sentBoolean

Returns Flag whether request was sent to callback url successfully or blocked by failing or because it was disabled.

Returns:

  • (Boolean)

    Flag whether request was sent to callback url successfully or blocked by failing or because it was disabled.



58
59
60
# File 'lib/lockstep_sdk/models/webhook_history_table_storage_model.rb', line 58

def request_sent
  @request_sent
end

#response_status_codeString

Returns Response status code that is returned when calling a callback url.

Returns:

  • (String)

    Response status code that is returned when calling a callback url.



66
67
68
# File 'lib/lockstep_sdk/models/webhook_history_table_storage_model.rb', line 66

def response_status_code
  @response_status_code
end

#timestampDate-time

Returns Timestamp of when a request is sent to a webhook callback. Contains the last time message is sent if failures occur.

Returns:

  • (Date-time)

    Timestamp of when a request is sent to a webhook callback. Contains the last time message is sent if failures occur.



78
79
80
# File 'lib/lockstep_sdk/models/webhook_history_table_storage_model.rb', line 78

def timestamp
  @timestamp
end

#webhook_history_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.



50
51
52
# File 'lib/lockstep_sdk/models/webhook_history_table_storage_model.rb', line 50

def webhook_history_id
  @webhook_history_id
end

#webhook_idUuid

Returns The WebhookId uniquely identifies the webhook used to send notification that an event action has taken place.

Returns:

  • (Uuid)

    The WebhookId uniquely identifies the webhook used to send notification that an event action has taken place.



46
47
48
# File 'lib/lockstep_sdk/models/webhook_history_table_storage_model.rb', line 46

def webhook_id
  @webhook_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



82
83
84
85
86
87
88
89
90
91
92
93
94
95
# File 'lib/lockstep_sdk/models/webhook_history_table_storage_model.rb', line 82

def as_json(options={})
    {
        'groupKey' => @group_key,
        'webhookId' => @webhook_id,
        'webhookHistoryId' => @webhook_history_id,
        'eventType' => @event_type,
        'requestSent' => @request_sent,
        'isSuccessful' => @is_successful,
        'responseStatusCode' => @response_status_code,
        'processResultMessage' => @process_result_message,
        'failureCount' => @failure_count,
        'timestamp' => @timestamp,
    }
end

#to_json(*options) ⇒ String

Returns This object converted to a JSON string.

Returns:

  • (String)

    This object converted to a JSON string



99
100
101
# File 'lib/lockstep_sdk/models/webhook_history_table_storage_model.rb', line 99

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