Class: Basecamp::Types::SearchResult

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

Overview

SearchResult

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(data = {}) ⇒ SearchResult

Returns a new instance of SearchResult.



4035
4036
4037
4038
4039
4040
4041
4042
4043
4044
4045
4046
4047
4048
4049
4050
4051
4052
4053
4054
4055
4056
4057
4058
4059
4060
4061
4062
4063
4064
4065
4066
4067
4068
4069
4070
4071
4072
4073
4074
4075
4076
4077
4078
4079
4080
4081
4082
4083
4084
# File 'lib/basecamp/generated/types.rb', line 4035

def initialize(data = {})
  @content = data["content"]
  @description = data["description"]
  @app_download_url = data["app_download_url"]
  @app_url = data["app_url"]
  @attachments = parse_array(data["attachments"], "SearchResultAttachment")
  @bookmark_url = data["bookmark_url"]
  @boosts_count = parse_integer(data["boosts_count"])
  @boosts_url = data["boosts_url"]
  @bubble_up_url = data["bubble_up_url"]
  @bucket = parse_type(data["bucket"], "RecordingBucket")
  @byte_size = parse_integer(data["byte_size"])
  @cards_count = parse_integer(data["cards_count"])
  @cards_url = data["cards_url"]
  @color = data["color"]
  @comment_count = parse_integer(data["comment_count"])
  @comments_count = parse_integer(data["comments_count"])
  @comments_url = data["comments_url"]
  @content_attachments = parse_array(data["content_attachments"], "RichTextAttachment")
  @content_type = data["content_type"]
  @created_at = parse_datetime(data["created_at"])
  @creator = parse_type(data["creator"], "Person")
  @description_attachments = parse_array(data["description_attachments"], "RichTextAttachment")
  @download_url = data["download_url"]
  @filename = data["filename"]
  @height = parse_integer(data["height"])
  @id = parse_integer(data["id"])
  @image_url = data["image_url"]
  @inherits_status = parse_boolean(data["inherits_status"])
  @language = data["language"]
  @on_hold = parse_type(data["on_hold"], "CardColumnOnHold")
  @parent = parse_type(data["parent"], "RecordingParent")
  @plain_text_content = data["plain_text_content"]
  @plain_text_description = data["plain_text_description"]
  @position = parse_integer(data["position"])
  @preview_url = data["preview_url"]
  @previewable = parse_boolean(data["previewable"])
  @sound_url = data["sound_url"]
  @status = data["status"]
  @subject = data["subject"]
  @subscribers = parse_array(data["subscribers"], "Person")
  @subscription_url = data["subscription_url"]
  @thumbnail_url = data["thumbnail_url"]
  @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"])
  @width = parse_integer(data["width"])
end

Instance Attribute Details

#app_download_urlObject

Returns the value of attribute app_download_url.



4028
4029
4030
# File 'lib/basecamp/generated/types.rb', line 4028

def app_download_url
  @app_download_url
end

#app_urlObject

Returns the value of attribute app_url.



4028
4029
4030
# File 'lib/basecamp/generated/types.rb', line 4028

def app_url
  @app_url
end

#attachmentsObject

Returns the value of attribute attachments.



4028
4029
4030
# File 'lib/basecamp/generated/types.rb', line 4028

def attachments
  @attachments
end

#bookmark_urlObject

Returns the value of attribute bookmark_url.



4028
4029
4030
# File 'lib/basecamp/generated/types.rb', line 4028

def bookmark_url
  @bookmark_url
end

#boosts_countObject

Returns the value of attribute boosts_count.



4028
4029
4030
# File 'lib/basecamp/generated/types.rb', line 4028

def boosts_count
  @boosts_count
end

#boosts_urlObject

Returns the value of attribute boosts_url.



4028
4029
4030
# File 'lib/basecamp/generated/types.rb', line 4028

def boosts_url
  @boosts_url
end

#bubble_up_urlObject

Returns the value of attribute bubble_up_url.



4028
4029
4030
# File 'lib/basecamp/generated/types.rb', line 4028

def bubble_up_url
  @bubble_up_url
end

#bucketObject

Returns the value of attribute bucket.



4028
4029
4030
# File 'lib/basecamp/generated/types.rb', line 4028

def bucket
  @bucket
end

#byte_sizeObject

Returns the value of attribute byte_size.



4028
4029
4030
# File 'lib/basecamp/generated/types.rb', line 4028

def byte_size
  @byte_size
end

#cards_countObject

Returns the value of attribute cards_count.



4028
4029
4030
# File 'lib/basecamp/generated/types.rb', line 4028

def cards_count
  @cards_count
end

#cards_urlObject

Returns the value of attribute cards_url.



4028
4029
4030
# File 'lib/basecamp/generated/types.rb', line 4028

def cards_url
  @cards_url
end

#colorObject

Returns the value of attribute color.



4028
4029
4030
# File 'lib/basecamp/generated/types.rb', line 4028

def color
  @color
end

#comment_countObject

Returns the value of attribute comment_count.



4028
4029
4030
# File 'lib/basecamp/generated/types.rb', line 4028

def comment_count
  @comment_count
end

#comments_countObject

Returns the value of attribute comments_count.



4028
4029
4030
# File 'lib/basecamp/generated/types.rb', line 4028

def comments_count
  @comments_count
end

#comments_urlObject

Returns the value of attribute comments_url.



4028
4029
4030
# File 'lib/basecamp/generated/types.rb', line 4028

def comments_url
  @comments_url
end

#contentObject

Returns the value of attribute content.



4028
4029
4030
# File 'lib/basecamp/generated/types.rb', line 4028

def content
  @content
end

#content_attachmentsObject

Returns the value of attribute content_attachments.



4028
4029
4030
# File 'lib/basecamp/generated/types.rb', line 4028

def content_attachments
  @content_attachments
end

#content_typeObject

Returns the value of attribute content_type.



4028
4029
4030
# File 'lib/basecamp/generated/types.rb', line 4028

def content_type
  @content_type
end

#created_atObject

Returns the value of attribute created_at.



4028
4029
4030
# File 'lib/basecamp/generated/types.rb', line 4028

def created_at
  @created_at
end

#creatorObject

Returns the value of attribute creator.



4028
4029
4030
# File 'lib/basecamp/generated/types.rb', line 4028

def creator
  @creator
end

#descriptionObject

Returns the value of attribute description.



4028
4029
4030
# File 'lib/basecamp/generated/types.rb', line 4028

def description
  @description
end

#description_attachmentsObject

Returns the value of attribute description_attachments.



4028
4029
4030
# File 'lib/basecamp/generated/types.rb', line 4028

def description_attachments
  @description_attachments
end

#download_urlObject

Returns the value of attribute download_url.



4028
4029
4030
# File 'lib/basecamp/generated/types.rb', line 4028

def download_url
  @download_url
end

#filenameObject

Returns the value of attribute filename.



4028
4029
4030
# File 'lib/basecamp/generated/types.rb', line 4028

def filename
  @filename
end

#heightObject

Returns the value of attribute height.



4028
4029
4030
# File 'lib/basecamp/generated/types.rb', line 4028

def height
  @height
end

#idObject

Returns the value of attribute id.



4028
4029
4030
# File 'lib/basecamp/generated/types.rb', line 4028

def id
  @id
end

#image_urlObject

Returns the value of attribute image_url.



4028
4029
4030
# File 'lib/basecamp/generated/types.rb', line 4028

def image_url
  @image_url
end

#inherits_statusObject

Returns the value of attribute inherits_status.



4028
4029
4030
# File 'lib/basecamp/generated/types.rb', line 4028

def inherits_status
  @inherits_status
end

#languageObject

Returns the value of attribute language.



4028
4029
4030
# File 'lib/basecamp/generated/types.rb', line 4028

def language
  @language
end

#on_holdObject

Returns the value of attribute on_hold.



4028
4029
4030
# File 'lib/basecamp/generated/types.rb', line 4028

def on_hold
  @on_hold
end

#parentObject

Returns the value of attribute parent.



4028
4029
4030
# File 'lib/basecamp/generated/types.rb', line 4028

def parent
  @parent
end

#plain_text_contentObject

Returns the value of attribute plain_text_content.



4028
4029
4030
# File 'lib/basecamp/generated/types.rb', line 4028

def plain_text_content
  @plain_text_content
end

#plain_text_descriptionObject

Returns the value of attribute plain_text_description.



4028
4029
4030
# File 'lib/basecamp/generated/types.rb', line 4028

def plain_text_description
  @plain_text_description
end

#positionObject

Returns the value of attribute position.



4028
4029
4030
# File 'lib/basecamp/generated/types.rb', line 4028

def position
  @position
end

#preview_urlObject

Returns the value of attribute preview_url.



4028
4029
4030
# File 'lib/basecamp/generated/types.rb', line 4028

def preview_url
  @preview_url
end

#previewableObject

Returns the value of attribute previewable.



4028
4029
4030
# File 'lib/basecamp/generated/types.rb', line 4028

def previewable
  @previewable
end

#sound_urlObject

Returns the value of attribute sound_url.



4028
4029
4030
# File 'lib/basecamp/generated/types.rb', line 4028

def sound_url
  @sound_url
end

#statusObject

Returns the value of attribute status.



4028
4029
4030
# File 'lib/basecamp/generated/types.rb', line 4028

def status
  @status
end

#subjectObject

Returns the value of attribute subject.



4028
4029
4030
# File 'lib/basecamp/generated/types.rb', line 4028

def subject
  @subject
end

#subscribersObject

Returns the value of attribute subscribers.



4028
4029
4030
# File 'lib/basecamp/generated/types.rb', line 4028

def subscribers
  @subscribers
end

#subscription_urlObject

Returns the value of attribute subscription_url.



4028
4029
4030
# File 'lib/basecamp/generated/types.rb', line 4028

def subscription_url
  @subscription_url
end

#thumbnail_urlObject

Returns the value of attribute thumbnail_url.



4028
4029
4030
# File 'lib/basecamp/generated/types.rb', line 4028

def thumbnail_url
  @thumbnail_url
end

#titleObject

Returns the value of attribute title.



4028
4029
4030
# File 'lib/basecamp/generated/types.rb', line 4028

def title
  @title
end

#typeObject

Returns the value of attribute type.



4028
4029
4030
# File 'lib/basecamp/generated/types.rb', line 4028

def type
  @type
end

#updated_atObject

Returns the value of attribute updated_at.



4028
4029
4030
# File 'lib/basecamp/generated/types.rb', line 4028

def updated_at
  @updated_at
end

#urlObject

Returns the value of attribute url.



4028
4029
4030
# File 'lib/basecamp/generated/types.rb', line 4028

def url
  @url
end

#visible_to_clientsObject

Returns the value of attribute visible_to_clients.



4028
4029
4030
# File 'lib/basecamp/generated/types.rb', line 4028

def visible_to_clients
  @visible_to_clients
end

#widthObject

Returns the value of attribute width.



4028
4029
4030
# File 'lib/basecamp/generated/types.rb', line 4028

def width
  @width
end

Class Method Details

.required_fieldsArray<Symbol>

Returns:

  • (Array<Symbol>)


4031
4032
4033
# File 'lib/basecamp/generated/types.rb', line 4031

def self.required_fields
  %i[content description].freeze
end

Instance Method Details

#to_hObject



4086
4087
4088
4089
4090
4091
4092
4093
4094
4095
4096
4097
4098
4099
4100
4101
4102
4103
4104
4105
4106
4107
4108
4109
4110
4111
4112
4113
4114
4115
4116
4117
4118
4119
4120
4121
4122
4123
4124
4125
4126
4127
4128
4129
4130
4131
4132
4133
4134
4135
4136
4137
# File 'lib/basecamp/generated/types.rb', line 4086

def to_h
  {
    "content" => @content,
    "description" => @description,
    "app_download_url" => @app_download_url,
    "app_url" => @app_url,
    "attachments" => @attachments,
    "bookmark_url" => @bookmark_url,
    "boosts_count" => @boosts_count,
    "boosts_url" => @boosts_url,
    "bubble_up_url" => @bubble_up_url,
    "bucket" => @bucket,
    "byte_size" => @byte_size,
    "cards_count" => @cards_count,
    "cards_url" => @cards_url,
    "color" => @color,
    "comment_count" => @comment_count,
    "comments_count" => @comments_count,
    "comments_url" => @comments_url,
    "content_attachments" => @content_attachments,
    "content_type" => @content_type,
    "created_at" => @created_at,
    "creator" => @creator,
    "description_attachments" => @description_attachments,
    "download_url" => @download_url,
    "filename" => @filename,
    "height" => @height,
    "id" => @id,
    "image_url" => @image_url,
    "inherits_status" => @inherits_status,
    "language" => @language,
    "on_hold" => @on_hold,
    "parent" => @parent,
    "plain_text_content" => @plain_text_content,
    "plain_text_description" => @plain_text_description,
    "position" => @position,
    "preview_url" => @preview_url,
    "previewable" => @previewable,
    "sound_url" => @sound_url,
    "status" => @status,
    "subject" => @subject,
    "subscribers" => @subscribers,
    "subscription_url" => @subscription_url,
    "thumbnail_url" => @thumbnail_url,
    "title" => @title,
    "type" => @type,
    "updated_at" => @updated_at,
    "url" => @url,
    "visible_to_clients" => @visible_to_clients,
    "width" => @width,
  }.reject { |k, v| v.nil? && !["content", "description"].include?(k) }
end

#to_json(*args) ⇒ Object



4139
4140
4141
# File 'lib/basecamp/generated/types.rb', line 4139

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