Class: Basecamp::Types::WebhookDelivery

Inherits:
Object
  • Object
show all
Includes:
TypeHelpers
Defined in:
lib/basecamp/generated/types.rb

Overview

WebhookDelivery

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(data = {}) ⇒ WebhookDelivery

Returns a new instance of WebhookDelivery.



5223
5224
5225
5226
5227
5228
# File 'lib/basecamp/generated/types.rb', line 5223

def initialize(data = {})
  @created_at = parse_datetime(data["created_at"])
  @id = parse_integer(data["id"])
  @request = parse_type(data["request"], "WebhookDeliveryRequest")
  @response = parse_type(data["response"], "WebhookDeliveryResponse")
end

Instance Attribute Details

#created_atObject

Returns the value of attribute created_at.



5221
5222
5223
# File 'lib/basecamp/generated/types.rb', line 5221

def created_at
  @created_at
end

#idObject

Returns the value of attribute id.



5221
5222
5223
# File 'lib/basecamp/generated/types.rb', line 5221

def id
  @id
end

#requestObject

Returns the value of attribute request.



5221
5222
5223
# File 'lib/basecamp/generated/types.rb', line 5221

def request
  @request
end

#responseObject

Returns the value of attribute response.



5221
5222
5223
# File 'lib/basecamp/generated/types.rb', line 5221

def response
  @response
end

Instance Method Details

#to_hObject



5230
5231
5232
5233
5234
5235
5236
5237
# File 'lib/basecamp/generated/types.rb', line 5230

def to_h
  {
    "created_at" => @created_at,
    "id" => @id,
    "request" => @request,
    "response" => @response,
  }.compact
end

#to_json(*args) ⇒ Object



5239
5240
5241
# File 'lib/basecamp/generated/types.rb', line 5239

def to_json(*args)
  to_h.to_json(*args)
end