Class: Google::Apis::GmailV1::MessagePartBody

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

The body of 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) ⇒ MessagePartBody

Returns a new instance of MessagePartBody.


886
887
888
# File 'generated/google/apis/gmail_v1/classes.rb', line 886

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

Instance Attribute Details

#attachment_idString

When present, contains the ID of an external attachment that can be retrieved in a separate messages.attachments.get request. When not present, the entire content of the message part body is contained in the data field. Corresponds to the JSON property attachmentId

Returns:

  • (String)

871
872
873
# File 'generated/google/apis/gmail_v1/classes.rb', line 871

def attachment_id
  @attachment_id
end

#dataString

The body data of a MIME message part. May be empty for MIME container types that have no message body or when the body data is sent as a separate attachment. An attachment ID is present if the body data is contained in a separate attachment. Corresponds to the JSON property data

Returns:

  • (String)

879
880
881
# File 'generated/google/apis/gmail_v1/classes.rb', line 879

def data
  @data
end

#sizeFixnum

Total number of bytes in the body of the message part. Corresponds to the JSON property size

Returns:

  • (Fixnum)

884
885
886
# File 'generated/google/apis/gmail_v1/classes.rb', line 884

def size
  @size
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object


891
892
893
894
895
# File 'generated/google/apis/gmail_v1/classes.rb', line 891

def update!(**args)
  @attachment_id = args[:attachment_id] if args.key?(:attachment_id)
  @data = args[:data] if args.key?(:data)
  @size = args[:size] if args.key?(:size)
end