Class: Basecamp::Types::Notification

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

Overview

Notification

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(data = {}) ⇒ Notification

Returns a new instance of Notification.



2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
# File 'lib/basecamp/generated/types.rb', line 2128

def initialize(data = {})
  @created_at = parse_datetime(data["created_at"])
  @id = parse_integer(data["id"])
  @updated_at = parse_datetime(data["updated_at"])
  @app_url = data["app_url"]
  @bookmark_url = data["bookmark_url"]
  @bubble_up_at = parse_datetime(data["bubble_up_at"])
  @bubble_up_url = data["bubble_up_url"]
  @bucket_name = data["bucket_name"]
  @content_excerpt = data["content_excerpt"]
  @creator = parse_type(data["creator"], "Person")
  @image_url = data["image_url"]
  @memory_url = data["memory_url"]
  @named = parse_boolean(data["named"])
  @participants = parse_array(data["participants"], "Person")
  @previewable_attachments = parse_array(data["previewable_attachments"], "PreviewableAttachment")
  @read_at = parse_datetime(data["read_at"])
  @readable_identifier = data["readable_identifier"]
  @readable_sgid = data["readable_sgid"]
  @section = data["section"]
  @subscribed = parse_boolean(data["subscribed"])
  @subscription_url = data["subscription_url"]
  @title = data["title"]
  @type = data["type"]
  @unread_at = parse_datetime(data["unread_at"])
  @unread_count = parse_integer(data["unread_count"])
  @unread_url = data["unread_url"]
end

Instance Attribute Details

#app_urlObject

Returns the value of attribute app_url.



2121
2122
2123
# File 'lib/basecamp/generated/types.rb', line 2121

def app_url
  @app_url
end

#bookmark_urlObject

Returns the value of attribute bookmark_url.



2121
2122
2123
# File 'lib/basecamp/generated/types.rb', line 2121

def bookmark_url
  @bookmark_url
end

#bubble_up_atObject

Returns the value of attribute bubble_up_at.



2121
2122
2123
# File 'lib/basecamp/generated/types.rb', line 2121

def bubble_up_at
  @bubble_up_at
end

#bubble_up_urlObject

Returns the value of attribute bubble_up_url.



2121
2122
2123
# File 'lib/basecamp/generated/types.rb', line 2121

def bubble_up_url
  @bubble_up_url
end

#bucket_nameObject

Returns the value of attribute bucket_name.



2121
2122
2123
# File 'lib/basecamp/generated/types.rb', line 2121

def bucket_name
  @bucket_name
end

#content_excerptObject

Returns the value of attribute content_excerpt.



2121
2122
2123
# File 'lib/basecamp/generated/types.rb', line 2121

def content_excerpt
  @content_excerpt
end

#created_atObject

Returns the value of attribute created_at.



2121
2122
2123
# File 'lib/basecamp/generated/types.rb', line 2121

def created_at
  @created_at
end

#creatorObject

Returns the value of attribute creator.



2121
2122
2123
# File 'lib/basecamp/generated/types.rb', line 2121

def creator
  @creator
end

#idObject

Returns the value of attribute id.



2121
2122
2123
# File 'lib/basecamp/generated/types.rb', line 2121

def id
  @id
end

#image_urlObject

Returns the value of attribute image_url.



2121
2122
2123
# File 'lib/basecamp/generated/types.rb', line 2121

def image_url
  @image_url
end

#memory_urlObject

Returns the value of attribute memory_url.



2121
2122
2123
# File 'lib/basecamp/generated/types.rb', line 2121

def memory_url
  @memory_url
end

#namedObject

Returns the value of attribute named.



2121
2122
2123
# File 'lib/basecamp/generated/types.rb', line 2121

def named
  @named
end

#participantsObject

Returns the value of attribute participants.



2121
2122
2123
# File 'lib/basecamp/generated/types.rb', line 2121

def participants
  @participants
end

#previewable_attachmentsObject

Returns the value of attribute previewable_attachments.



2121
2122
2123
# File 'lib/basecamp/generated/types.rb', line 2121

def previewable_attachments
  @previewable_attachments
end

#read_atObject

Returns the value of attribute read_at.



2121
2122
2123
# File 'lib/basecamp/generated/types.rb', line 2121

def read_at
  @read_at
end

#readable_identifierObject

Returns the value of attribute readable_identifier.



2121
2122
2123
# File 'lib/basecamp/generated/types.rb', line 2121

def readable_identifier
  @readable_identifier
end

#readable_sgidObject

Returns the value of attribute readable_sgid.



2121
2122
2123
# File 'lib/basecamp/generated/types.rb', line 2121

def readable_sgid
  @readable_sgid
end

#sectionObject

Returns the value of attribute section.



2121
2122
2123
# File 'lib/basecamp/generated/types.rb', line 2121

def section
  @section
end

#subscribedObject

Returns the value of attribute subscribed.



2121
2122
2123
# File 'lib/basecamp/generated/types.rb', line 2121

def subscribed
  @subscribed
end

#subscription_urlObject

Returns the value of attribute subscription_url.



2121
2122
2123
# File 'lib/basecamp/generated/types.rb', line 2121

def subscription_url
  @subscription_url
end

#titleObject

Returns the value of attribute title.



2121
2122
2123
# File 'lib/basecamp/generated/types.rb', line 2121

def title
  @title
end

#typeObject

Returns the value of attribute type.



2121
2122
2123
# File 'lib/basecamp/generated/types.rb', line 2121

def type
  @type
end

#unread_atObject

Returns the value of attribute unread_at.



2121
2122
2123
# File 'lib/basecamp/generated/types.rb', line 2121

def unread_at
  @unread_at
end

#unread_countObject

Returns the value of attribute unread_count.



2121
2122
2123
# File 'lib/basecamp/generated/types.rb', line 2121

def unread_count
  @unread_count
end

#unread_urlObject

Returns the value of attribute unread_url.



2121
2122
2123
# File 'lib/basecamp/generated/types.rb', line 2121

def unread_url
  @unread_url
end

#updated_atObject

Returns the value of attribute updated_at.



2121
2122
2123
# File 'lib/basecamp/generated/types.rb', line 2121

def updated_at
  @updated_at
end

Class Method Details

.required_fieldsArray<Symbol>

Returns:

  • (Array<Symbol>)


2124
2125
2126
# File 'lib/basecamp/generated/types.rb', line 2124

def self.required_fields
  %i[created_at id updated_at].freeze
end

Instance Method Details

#to_hObject



2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
# File 'lib/basecamp/generated/types.rb', line 2157

def to_h
  {
    "created_at" => @created_at,
    "id" => @id,
    "updated_at" => @updated_at,
    "app_url" => @app_url,
    "bookmark_url" => @bookmark_url,
    "bubble_up_at" => @bubble_up_at,
    "bubble_up_url" => @bubble_up_url,
    "bucket_name" => @bucket_name,
    "content_excerpt" => @content_excerpt,
    "creator" => @creator,
    "image_url" => @image_url,
    "memory_url" => @memory_url,
    "named" => @named,
    "participants" => @participants,
    "previewable_attachments" => @previewable_attachments,
    "read_at" => @read_at,
    "readable_identifier" => @readable_identifier,
    "readable_sgid" => @readable_sgid,
    "section" => @section,
    "subscribed" => @subscribed,
    "subscription_url" => @subscription_url,
    "title" => @title,
    "type" => @type,
    "unread_at" => @unread_at,
    "unread_count" => @unread_count,
    "unread_url" => @unread_url,
  }.compact
end

#to_json(*args) ⇒ Object



2188
2189
2190
# File 'lib/basecamp/generated/types.rb', line 2188

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