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.



3490
3491
3492
3493
3494
3495
3496
3497
3498
3499
3500
3501
3502
3503
3504
3505
3506
3507
3508
3509
3510
3511
3512
3513
# File 'lib/basecamp/generated/types.rb', line 3490

def initialize(data = {})
  @app_url = data["app_url"]
  @content = data["content"]
  @description = data["description"]
  @id = parse_integer(data["id"])
  @title = data["title"]
  @type = data["type"]
  @url = data["url"]
  @bookmark_url = data["bookmark_url"]
  @bubble_up_url = data["bubble_up_url"]
  @bucket = parse_type(data["bucket"], "RecordingBucket")
  @content_attachments = parse_array(data["content_attachments"], "RichTextAttachment")
  @created_at = parse_datetime(data["created_at"])
  @creator = parse_type(data["creator"], "Person")
  @description_attachments = parse_array(data["description_attachments"], "RichTextAttachment")
  @inherits_status = parse_boolean(data["inherits_status"])
  @parent = parse_type(data["parent"], "RecordingParent")
  @plain_text_content = data["plain_text_content"]
  @plain_text_description = data["plain_text_description"]
  @status = data["status"]
  @subject = data["subject"]
  @updated_at = parse_datetime(data["updated_at"])
  @visible_to_clients = parse_boolean(data["visible_to_clients"])
end

Instance Attribute Details

#app_urlObject

Returns the value of attribute app_url.



3483
3484
3485
# File 'lib/basecamp/generated/types.rb', line 3483

def app_url
  @app_url
end

#bookmark_urlObject

Returns the value of attribute bookmark_url.



3483
3484
3485
# File 'lib/basecamp/generated/types.rb', line 3483

def bookmark_url
  @bookmark_url
end

#bubble_up_urlObject

Returns the value of attribute bubble_up_url.



3483
3484
3485
# File 'lib/basecamp/generated/types.rb', line 3483

def bubble_up_url
  @bubble_up_url
end

#bucketObject

Returns the value of attribute bucket.



3483
3484
3485
# File 'lib/basecamp/generated/types.rb', line 3483

def bucket
  @bucket
end

#contentObject

Returns the value of attribute content.



3483
3484
3485
# File 'lib/basecamp/generated/types.rb', line 3483

def content
  @content
end

#content_attachmentsObject

Returns the value of attribute content_attachments.



3483
3484
3485
# File 'lib/basecamp/generated/types.rb', line 3483

def content_attachments
  @content_attachments
end

#created_atObject

Returns the value of attribute created_at.



3483
3484
3485
# File 'lib/basecamp/generated/types.rb', line 3483

def created_at
  @created_at
end

#creatorObject

Returns the value of attribute creator.



3483
3484
3485
# File 'lib/basecamp/generated/types.rb', line 3483

def creator
  @creator
end

#descriptionObject

Returns the value of attribute description.



3483
3484
3485
# File 'lib/basecamp/generated/types.rb', line 3483

def description
  @description
end

#description_attachmentsObject

Returns the value of attribute description_attachments.



3483
3484
3485
# File 'lib/basecamp/generated/types.rb', line 3483

def description_attachments
  @description_attachments
end

#idObject

Returns the value of attribute id.



3483
3484
3485
# File 'lib/basecamp/generated/types.rb', line 3483

def id
  @id
end

#inherits_statusObject

Returns the value of attribute inherits_status.



3483
3484
3485
# File 'lib/basecamp/generated/types.rb', line 3483

def inherits_status
  @inherits_status
end

#parentObject

Returns the value of attribute parent.



3483
3484
3485
# File 'lib/basecamp/generated/types.rb', line 3483

def parent
  @parent
end

#plain_text_contentObject

Returns the value of attribute plain_text_content.



3483
3484
3485
# File 'lib/basecamp/generated/types.rb', line 3483

def plain_text_content
  @plain_text_content
end

#plain_text_descriptionObject

Returns the value of attribute plain_text_description.



3483
3484
3485
# File 'lib/basecamp/generated/types.rb', line 3483

def plain_text_description
  @plain_text_description
end

#statusObject

Returns the value of attribute status.



3483
3484
3485
# File 'lib/basecamp/generated/types.rb', line 3483

def status
  @status
end

#subjectObject

Returns the value of attribute subject.



3483
3484
3485
# File 'lib/basecamp/generated/types.rb', line 3483

def subject
  @subject
end

#titleObject

Returns the value of attribute title.



3483
3484
3485
# File 'lib/basecamp/generated/types.rb', line 3483

def title
  @title
end

#typeObject

Returns the value of attribute type.



3483
3484
3485
# File 'lib/basecamp/generated/types.rb', line 3483

def type
  @type
end

#updated_atObject

Returns the value of attribute updated_at.



3483
3484
3485
# File 'lib/basecamp/generated/types.rb', line 3483

def updated_at
  @updated_at
end

#urlObject

Returns the value of attribute url.



3483
3484
3485
# File 'lib/basecamp/generated/types.rb', line 3483

def url
  @url
end

#visible_to_clientsObject

Returns the value of attribute visible_to_clients.



3483
3484
3485
# File 'lib/basecamp/generated/types.rb', line 3483

def visible_to_clients
  @visible_to_clients
end

Class Method Details

.required_fieldsArray<Symbol>

Returns:

  • (Array<Symbol>)


3486
3487
3488
# File 'lib/basecamp/generated/types.rb', line 3486

def self.required_fields
  %i[app_url content description id title type url].freeze
end

Instance Method Details

#to_hObject



3515
3516
3517
3518
3519
3520
3521
3522
3523
3524
3525
3526
3527
3528
3529
3530
3531
3532
3533
3534
3535
3536
3537
3538
3539
3540
# File 'lib/basecamp/generated/types.rb', line 3515

def to_h
  {
    "app_url" => @app_url,
    "content" => @content,
    "description" => @description,
    "id" => @id,
    "title" => @title,
    "type" => @type,
    "url" => @url,
    "bookmark_url" => @bookmark_url,
    "bubble_up_url" => @bubble_up_url,
    "bucket" => @bucket,
    "content_attachments" => @content_attachments,
    "created_at" => @created_at,
    "creator" => @creator,
    "description_attachments" => @description_attachments,
    "inherits_status" => @inherits_status,
    "parent" => @parent,
    "plain_text_content" => @plain_text_content,
    "plain_text_description" => @plain_text_description,
    "status" => @status,
    "subject" => @subject,
    "updated_at" => @updated_at,
    "visible_to_clients" => @visible_to_clients,
  }.reject { |k, v| v.nil? && !["content", "description"].include?(k) }
end

#to_json(*args) ⇒ Object



3542
3543
3544
# File 'lib/basecamp/generated/types.rb', line 3542

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