Class: Basecamp::Types::Message

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

Overview

Message

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(data = {}) ⇒ Message

Returns a new instance of Message.



2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
# File 'lib/basecamp/generated/types.rb', line 2028

def initialize(data = {})
  @app_url = data["app_url"]
  @bucket = parse_type(data["bucket"], "TodoBucket")
  @content = data["content"]
  @content_attachments = parse_array(data["content_attachments"], "RichTextAttachment")
  @created_at = parse_datetime(data["created_at"])
  @creator = parse_type(data["creator"], "Person")
  @id = parse_integer(data["id"])
  @inherits_status = parse_boolean(data["inherits_status"])
  @parent = parse_type(data["parent"], "RecordingParent")
  @status = data["status"]
  @subject = data["subject"]
  @title = data["title"]
  @type = data["type"]
  @updated_at = parse_datetime(data["updated_at"])
  @url = data["url"]
  @visible_to_clients = parse_boolean(data["visible_to_clients"])
  @bookmark_url = data["bookmark_url"]
  @boosts_count = parse_integer(data["boosts_count"])
  @boosts_url = data["boosts_url"]
  @category = parse_type(data["category"], "MessageType")
  @comments_count = parse_integer(data["comments_count"])
  @comments_url = data["comments_url"]
  @subscription_url = data["subscription_url"]
end

Instance Attribute Details

#app_urlObject

Returns the value of attribute app_url.



2021
2022
2023
# File 'lib/basecamp/generated/types.rb', line 2021

def app_url
  @app_url
end

#bookmark_urlObject

Returns the value of attribute bookmark_url.



2021
2022
2023
# File 'lib/basecamp/generated/types.rb', line 2021

def bookmark_url
  @bookmark_url
end

#boosts_countObject

Returns the value of attribute boosts_count.



2021
2022
2023
# File 'lib/basecamp/generated/types.rb', line 2021

def boosts_count
  @boosts_count
end

#boosts_urlObject

Returns the value of attribute boosts_url.



2021
2022
2023
# File 'lib/basecamp/generated/types.rb', line 2021

def boosts_url
  @boosts_url
end

#bucketObject

Returns the value of attribute bucket.



2021
2022
2023
# File 'lib/basecamp/generated/types.rb', line 2021

def bucket
  @bucket
end

#categoryObject

Returns the value of attribute category.



2021
2022
2023
# File 'lib/basecamp/generated/types.rb', line 2021

def category
  @category
end

#comments_countObject

Returns the value of attribute comments_count.



2021
2022
2023
# File 'lib/basecamp/generated/types.rb', line 2021

def comments_count
  @comments_count
end

#comments_urlObject

Returns the value of attribute comments_url.



2021
2022
2023
# File 'lib/basecamp/generated/types.rb', line 2021

def comments_url
  @comments_url
end

#contentObject

Returns the value of attribute content.



2021
2022
2023
# File 'lib/basecamp/generated/types.rb', line 2021

def content
  @content
end

#content_attachmentsObject

Returns the value of attribute content_attachments.



2021
2022
2023
# File 'lib/basecamp/generated/types.rb', line 2021

def content_attachments
  @content_attachments
end

#created_atObject

Returns the value of attribute created_at.



2021
2022
2023
# File 'lib/basecamp/generated/types.rb', line 2021

def created_at
  @created_at
end

#creatorObject

Returns the value of attribute creator.



2021
2022
2023
# File 'lib/basecamp/generated/types.rb', line 2021

def creator
  @creator
end

#idObject

Returns the value of attribute id.



2021
2022
2023
# File 'lib/basecamp/generated/types.rb', line 2021

def id
  @id
end

#inherits_statusObject

Returns the value of attribute inherits_status.



2021
2022
2023
# File 'lib/basecamp/generated/types.rb', line 2021

def inherits_status
  @inherits_status
end

#parentObject

Returns the value of attribute parent.



2021
2022
2023
# File 'lib/basecamp/generated/types.rb', line 2021

def parent
  @parent
end

#statusObject

Returns the value of attribute status.



2021
2022
2023
# File 'lib/basecamp/generated/types.rb', line 2021

def status
  @status
end

#subjectObject

Returns the value of attribute subject.



2021
2022
2023
# File 'lib/basecamp/generated/types.rb', line 2021

def subject
  @subject
end

#subscription_urlObject

Returns the value of attribute subscription_url.



2021
2022
2023
# File 'lib/basecamp/generated/types.rb', line 2021

def subscription_url
  @subscription_url
end

#titleObject

Returns the value of attribute title.



2021
2022
2023
# File 'lib/basecamp/generated/types.rb', line 2021

def title
  @title
end

#typeObject

Returns the value of attribute type.



2021
2022
2023
# File 'lib/basecamp/generated/types.rb', line 2021

def type
  @type
end

#updated_atObject

Returns the value of attribute updated_at.



2021
2022
2023
# File 'lib/basecamp/generated/types.rb', line 2021

def updated_at
  @updated_at
end

#urlObject

Returns the value of attribute url.



2021
2022
2023
# File 'lib/basecamp/generated/types.rb', line 2021

def url
  @url
end

#visible_to_clientsObject

Returns the value of attribute visible_to_clients.



2021
2022
2023
# File 'lib/basecamp/generated/types.rb', line 2021

def visible_to_clients
  @visible_to_clients
end

Class Method Details

.required_fieldsArray<Symbol>

Returns:

  • (Array<Symbol>)


2024
2025
2026
# File 'lib/basecamp/generated/types.rb', line 2024

def self.required_fields
  %i[app_url bucket content content_attachments created_at creator id inherits_status parent status subject title type updated_at url visible_to_clients].freeze
end

Instance Method Details

#to_hObject



2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
# File 'lib/basecamp/generated/types.rb', line 2054

def to_h
  {
    "app_url" => @app_url,
    "bucket" => @bucket,
    "content" => @content,
    "content_attachments" => @content_attachments,
    "created_at" => @created_at,
    "creator" => @creator,
    "id" => @id,
    "inherits_status" => @inherits_status,
    "parent" => @parent,
    "status" => @status,
    "subject" => @subject,
    "title" => @title,
    "type" => @type,
    "updated_at" => @updated_at,
    "url" => @url,
    "visible_to_clients" => @visible_to_clients,
    "bookmark_url" => @bookmark_url,
    "boosts_count" => @boosts_count,
    "boosts_url" => @boosts_url,
    "category" => @category,
    "comments_count" => @comments_count,
    "comments_url" => @comments_url,
    "subscription_url" => @subscription_url,
  }.compact
end

#to_json(*args) ⇒ Object



2082
2083
2084
# File 'lib/basecamp/generated/types.rb', line 2082

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