Class: Google::Apis::GmailV1::Message

Inherits:
Object
  • Object
show all
Includes:
Core::Hashable, Core::JsonObjectSupport
Defined in:
generated/google/apis/gmail_v1/classes.rb,
generated/google/apis/gmail_v1/representations.rb,
generated/google/apis/gmail_v1/representations.rb

Overview

An email message.

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Core::JsonObjectSupport

#to_json

Methods included from Core::Hashable

process_value, #to_h

Constructor Details

#initialize(**args) ⇒ Message

Returns a new instance of Message



840
841
842
# File 'generated/google/apis/gmail_v1/classes.rb', line 840

def initialize(**args)
   update!(**args)
end

Instance Attribute Details

#history_idFixnum

The ID of the last history record that modified this message. Corresponds to the JSON property historyId

Returns:

  • (Fixnum)


785
786
787
# File 'generated/google/apis/gmail_v1/classes.rb', line 785

def history_id
  @history_id
end

#idString

The immutable ID of the message. Corresponds to the JSON property id

Returns:

  • (String)


790
791
792
# File 'generated/google/apis/gmail_v1/classes.rb', line 790

def id
  @id
end

#internal_dateFixnum

The internal message creation timestamp (epoch ms), which determines ordering in the inbox. For normal SMTP-received email, this represents the time the message was originally accepted by Google, which is more reliable than the Date header. However, for API-migrated mail, it can be configured by client to be based on the Date header. Corresponds to the JSON property internalDate

Returns:

  • (Fixnum)


799
800
801
# File 'generated/google/apis/gmail_v1/classes.rb', line 799

def internal_date
  @internal_date
end

#label_idsArray<String>

List of IDs of labels applied to this message. Corresponds to the JSON property labelIds

Returns:

  • (Array<String>)


804
805
806
# File 'generated/google/apis/gmail_v1/classes.rb', line 804

def label_ids
  @label_ids
end

#payloadGoogle::Apis::GmailV1::MessagePart

A single MIME message part. Corresponds to the JSON property payload



809
810
811
# File 'generated/google/apis/gmail_v1/classes.rb', line 809

def payload
  @payload
end

#rawString

The entire email message in an RFC 2822 formatted and base64url encoded string. Returned in messages.get and drafts.get responses when the format=RAW parameter is supplied. Corresponds to the JSON property raw NOTE: Values are automatically base64 encoded/decoded in the client library.

Returns:

  • (String)


817
818
819
# File 'generated/google/apis/gmail_v1/classes.rb', line 817

def raw
  @raw
end

#size_estimateFixnum

Estimated size in bytes of the message. Corresponds to the JSON property sizeEstimate

Returns:

  • (Fixnum)


822
823
824
# File 'generated/google/apis/gmail_v1/classes.rb', line 822

def size_estimate
  @size_estimate
end

#snippetString

A short part of the message text. Corresponds to the JSON property snippet

Returns:

  • (String)


827
828
829
# File 'generated/google/apis/gmail_v1/classes.rb', line 827

def snippet
  @snippet
end

#thread_idString

The ID of the thread the message belongs to. To add a message or draft to a thread, the following criteria must be met:

  • The requested threadId must be specified on the Message or Draft.Message you supply with your request.
  • The References and In-Reply-To headers must be set in compliance with the RFC 2822 standard.
  • The Subject headers must match. Corresponds to the JSON property threadId

Returns:

  • (String)


838
839
840
# File 'generated/google/apis/gmail_v1/classes.rb', line 838

def thread_id
  @thread_id
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



845
846
847
848
849
850
851
852
853
854
855
# File 'generated/google/apis/gmail_v1/classes.rb', line 845

def update!(**args)
  @history_id = args[:history_id] if args.key?(:history_id)
  @id = args[:id] if args.key?(:id)
  @internal_date = args[:internal_date] if args.key?(:internal_date)
  @label_ids = args[:label_ids] if args.key?(:label_ids)
  @payload = args[:payload] if args.key?(:payload)
  @raw = args[:raw] if args.key?(:raw)
  @size_estimate = args[:size_estimate] if args.key?(:size_estimate)
  @snippet = args[:snippet] if args.key?(:snippet)
  @thread_id = args[:thread_id] if args.key?(:thread_id)
end