Class: Basecamp::Types::Webhook
- Inherits:
-
Object
- Object
- Basecamp::Types::Webhook
- Includes:
- TypeHelpers
- Defined in:
- lib/basecamp/generated/types.rb
Overview
Webhook
Instance Attribute Summary collapse
-
#active ⇒ Object
Returns the value of attribute active.
-
#app_url ⇒ Object
Returns the value of attribute app_url.
-
#created_at ⇒ Object
Returns the value of attribute created_at.
-
#id ⇒ Object
Returns the value of attribute id.
-
#payload_url ⇒ Object
Returns the value of attribute payload_url.
-
#recent_deliveries ⇒ Object
Returns the value of attribute recent_deliveries.
-
#types ⇒ Object
Returns the value of attribute types.
-
#updated_at ⇒ Object
Returns the value of attribute updated_at.
-
#url ⇒ Object
Returns the value of attribute url.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(data = {}) ⇒ Webhook
constructor
A new instance of Webhook.
- #to_h ⇒ Object
- #to_json(*args) ⇒ Object
Constructor Details
#initialize(data = {}) ⇒ Webhook
Returns a new instance of Webhook.
5217 5218 5219 5220 5221 5222 5223 5224 5225 5226 5227 |
# File 'lib/basecamp/generated/types.rb', line 5217 def initialize(data = {}) @app_url = data["app_url"] @created_at = parse_datetime(data["created_at"]) @id = parse_integer(data["id"]) @payload_url = data["payload_url"] @updated_at = parse_datetime(data["updated_at"]) @url = data["url"] @active = parse_boolean(data["active"]) @recent_deliveries = parse_array(data["recent_deliveries"], "WebhookDelivery") @types = data["types"] end |
Instance Attribute Details
#active ⇒ Object
Returns the value of attribute active.
5210 5211 5212 |
# File 'lib/basecamp/generated/types.rb', line 5210 def active @active end |
#app_url ⇒ Object
Returns the value of attribute app_url.
5210 5211 5212 |
# File 'lib/basecamp/generated/types.rb', line 5210 def app_url @app_url end |
#created_at ⇒ Object
Returns the value of attribute created_at.
5210 5211 5212 |
# File 'lib/basecamp/generated/types.rb', line 5210 def created_at @created_at end |
#id ⇒ Object
Returns the value of attribute id.
5210 5211 5212 |
# File 'lib/basecamp/generated/types.rb', line 5210 def id @id end |
#payload_url ⇒ Object
Returns the value of attribute payload_url.
5210 5211 5212 |
# File 'lib/basecamp/generated/types.rb', line 5210 def payload_url @payload_url end |
#recent_deliveries ⇒ Object
Returns the value of attribute recent_deliveries.
5210 5211 5212 |
# File 'lib/basecamp/generated/types.rb', line 5210 def recent_deliveries @recent_deliveries end |
#types ⇒ Object
Returns the value of attribute types.
5210 5211 5212 |
# File 'lib/basecamp/generated/types.rb', line 5210 def types @types end |
#updated_at ⇒ Object
Returns the value of attribute updated_at.
5210 5211 5212 |
# File 'lib/basecamp/generated/types.rb', line 5210 def updated_at @updated_at end |
#url ⇒ Object
Returns the value of attribute url.
5210 5211 5212 |
# File 'lib/basecamp/generated/types.rb', line 5210 def url @url end |
Class Method Details
.required_fields ⇒ Array<Symbol>
5213 5214 5215 |
# File 'lib/basecamp/generated/types.rb', line 5213 def self.required_fields %i[app_url created_at id payload_url updated_at url].freeze end |
Instance Method Details
#to_h ⇒ Object
5229 5230 5231 5232 5233 5234 5235 5236 5237 5238 5239 5240 5241 |
# File 'lib/basecamp/generated/types.rb', line 5229 def to_h { "app_url" => @app_url, "created_at" => @created_at, "id" => @id, "payload_url" => @payload_url, "updated_at" => @updated_at, "url" => @url, "active" => @active, "recent_deliveries" => @recent_deliveries, "types" => @types, }.compact end |
#to_json(*args) ⇒ Object
5243 5244 5245 |
# File 'lib/basecamp/generated/types.rb', line 5243 def to_json(*args) to_h.to_json(*args) end |