Class: TrueTrial::Types::WebhookSubscription

Inherits:
Object
  • Object
show all
Defined in:
lib/truetrial/types/webhook_subscription.rb

Overview

Represents a webhook subscription returned from the TrueTrial API.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ WebhookSubscription

Returns a new instance of WebhookSubscription.



10
11
12
13
14
15
16
17
18
# File 'lib/truetrial/types/webhook_subscription.rb', line 10

def initialize(attributes = {})
  @id = attributes["id"]
  @url = attributes["url"]
  @events = attributes["events"]
  @secret = attributes["secret"]
  @active = attributes["active"]
  @created_at = attributes["created_at"]
  @updated_at = attributes["updated_at"]
end

Instance Attribute Details

#activeObject (readonly)

Returns the value of attribute active.



7
8
9
# File 'lib/truetrial/types/webhook_subscription.rb', line 7

def active
  @active
end

#created_atObject (readonly)

Returns the value of attribute created_at.



7
8
9
# File 'lib/truetrial/types/webhook_subscription.rb', line 7

def created_at
  @created_at
end

#eventsObject (readonly)

Returns the value of attribute events.



7
8
9
# File 'lib/truetrial/types/webhook_subscription.rb', line 7

def events
  @events
end

#idObject (readonly)

Returns the value of attribute id.



7
8
9
# File 'lib/truetrial/types/webhook_subscription.rb', line 7

def id
  @id
end

#secretObject (readonly)

Returns the value of attribute secret.



7
8
9
# File 'lib/truetrial/types/webhook_subscription.rb', line 7

def secret
  @secret
end

#updated_atObject (readonly)

Returns the value of attribute updated_at.



7
8
9
# File 'lib/truetrial/types/webhook_subscription.rb', line 7

def updated_at
  @updated_at
end

#urlObject (readonly)

Returns the value of attribute url.



7
8
9
# File 'lib/truetrial/types/webhook_subscription.rb', line 7

def url
  @url
end

Class Method Details

.from_hash(hash) ⇒ WebhookSubscription

Builds a WebhookSubscription from an API response hash.

Parameters:

  • hash (Hash)

    raw API response data

Returns:



24
25
26
# File 'lib/truetrial/types/webhook_subscription.rb', line 24

def self.from_hash(hash)
  new(hash)
end