Class: Google::Apis::GmailV1::MessagePart

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

A single MIME message part.

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) ⇒ MessagePart

Returns a new instance of MessagePart.



847
848
849
# File 'generated/google/apis/gmail_v1/classes.rb', line 847

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

Instance Attribute Details

#bodyGoogle::Apis::GmailV1::MessagePartBody

The body of a single MIME message part. Corresponds to the JSON property body



814
815
816
# File 'generated/google/apis/gmail_v1/classes.rb', line 814

def body
  @body
end

#filenameString

The filename of the attachment. Only present if this message part represents an attachment. Corresponds to the JSON property filename

Returns:

  • (String)


820
821
822
# File 'generated/google/apis/gmail_v1/classes.rb', line 820

def filename
  @filename
end

#headersArray<Google::Apis::GmailV1::MessagePartHeader>

List of headers on this message part. For the top-level message part, representing the entire message payload, it will contain the standard RFC 2822 email headers such as To, From, and Subject. Corresponds to the JSON property headers



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

def headers
  @headers
end

#mime_typeString

The MIME type of the message part. Corresponds to the JSON property mimeType

Returns:

  • (String)


832
833
834
# File 'generated/google/apis/gmail_v1/classes.rb', line 832

def mime_type
  @mime_type
end

#part_idString

The immutable ID of the message part. Corresponds to the JSON property partId

Returns:

  • (String)


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

def part_id
  @part_id
end

#partsArray<Google::Apis::GmailV1::MessagePart>

The child MIME message parts of this part. This only applies to container MIME message parts, for example multipart/*. For non- container MIME message part types, such as text/plain, this field is empty. For more information, see RFC 1521. Corresponds to the JSON property parts



845
846
847
# File 'generated/google/apis/gmail_v1/classes.rb', line 845

def parts
  @parts
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



852
853
854
855
856
857
858
859
# File 'generated/google/apis/gmail_v1/classes.rb', line 852

def update!(**args)
  @body = args[:body] if args.key?(:body)
  @filename = args[:filename] if args.key?(:filename)
  @headers = args[:headers] if args.key?(:headers)
  @mime_type = args[:mime_type] if args.key?(:mime_type)
  @part_id = args[:part_id] if args.key?(:part_id)
  @parts = args[:parts] if args.key?(:parts)
end