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.
4441 4442 4443 4444 4445 4446 4447 4448 4449 4450 4451 |
# File 'lib/basecamp/generated/types.rb', line 4441 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.
4434 4435 4436 |
# File 'lib/basecamp/generated/types.rb', line 4434 def active @active end |
#app_url ⇒ Object
Returns the value of attribute app_url.
4434 4435 4436 |
# File 'lib/basecamp/generated/types.rb', line 4434 def app_url @app_url end |
#created_at ⇒ Object
Returns the value of attribute created_at.
4434 4435 4436 |
# File 'lib/basecamp/generated/types.rb', line 4434 def created_at @created_at end |
#id ⇒ Object
Returns the value of attribute id.
4434 4435 4436 |
# File 'lib/basecamp/generated/types.rb', line 4434 def id @id end |
#payload_url ⇒ Object
Returns the value of attribute payload_url.
4434 4435 4436 |
# File 'lib/basecamp/generated/types.rb', line 4434 def payload_url @payload_url end |
#recent_deliveries ⇒ Object
Returns the value of attribute recent_deliveries.
4434 4435 4436 |
# File 'lib/basecamp/generated/types.rb', line 4434 def recent_deliveries @recent_deliveries end |
#types ⇒ Object
Returns the value of attribute types.
4434 4435 4436 |
# File 'lib/basecamp/generated/types.rb', line 4434 def types @types end |
#updated_at ⇒ Object
Returns the value of attribute updated_at.
4434 4435 4436 |
# File 'lib/basecamp/generated/types.rb', line 4434 def updated_at @updated_at end |
#url ⇒ Object
Returns the value of attribute url.
4434 4435 4436 |
# File 'lib/basecamp/generated/types.rb', line 4434 def url @url end |
Class Method Details
.required_fields ⇒ Array<Symbol>
4437 4438 4439 |
# File 'lib/basecamp/generated/types.rb', line 4437 def self.required_fields %i[app_url created_at id payload_url updated_at url].freeze end |
Instance Method Details
#to_h ⇒ Object
4453 4454 4455 4456 4457 4458 4459 4460 4461 4462 4463 4464 4465 |
# File 'lib/basecamp/generated/types.rb', line 4453 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
4467 4468 4469 |
# File 'lib/basecamp/generated/types.rb', line 4467 def to_json(*args) to_h.to_json(*args) end |