Class: Google::Apis::GmailV1::Label

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

Overview

Labels are used to categorize messages and threads within the user's mailbox. The maximum number of labels supported for a user's mailbox is 10,000.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**args) ⇒ Label

Returns a new instance of Label.



752
753
754
# File 'lib/google/apis/gmail_v1/classes.rb', line 752

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

Instance Attribute Details

#colorGoogle::Apis::GmailV1::LabelColor

The color to assign to the label. Color is only available for labels that have their type set to user. Corresponds to the JSON property color



697
698
699
# File 'lib/google/apis/gmail_v1/classes.rb', line 697

def color
  @color
end

#idString

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

Returns:

  • (String)


702
703
704
# File 'lib/google/apis/gmail_v1/classes.rb', line 702

def id
  @id
end

#label_list_visibilityString

The visibility of the label in the label list in the Gmail web interface. Corresponds to the JSON property labelListVisibility

Returns:

  • (String)


707
708
709
# File 'lib/google/apis/gmail_v1/classes.rb', line 707

def label_list_visibility
  @label_list_visibility
end

#message_list_visibilityString

The visibility of messages with this label in the message list in the Gmail web interface. Corresponds to the JSON property messageListVisibility

Returns:

  • (String)


713
714
715
# File 'lib/google/apis/gmail_v1/classes.rb', line 713

def message_list_visibility
  @message_list_visibility
end

#messages_totalFixnum

The total number of messages with the label. Corresponds to the JSON property messagesTotal

Returns:

  • (Fixnum)


718
719
720
# File 'lib/google/apis/gmail_v1/classes.rb', line 718

def messages_total
  @messages_total
end

#messages_unreadFixnum

The number of unread messages with the label. Corresponds to the JSON property messagesUnread

Returns:

  • (Fixnum)


723
724
725
# File 'lib/google/apis/gmail_v1/classes.rb', line 723

def messages_unread
  @messages_unread
end

#nameString

The display name of the label. Corresponds to the JSON property name

Returns:

  • (String)


728
729
730
# File 'lib/google/apis/gmail_v1/classes.rb', line 728

def name
  @name
end

#threads_totalFixnum

The total number of threads with the label. Corresponds to the JSON property threadsTotal

Returns:

  • (Fixnum)


733
734
735
# File 'lib/google/apis/gmail_v1/classes.rb', line 733

def threads_total
  @threads_total
end

#threads_unreadFixnum

The number of unread threads with the label. Corresponds to the JSON property threadsUnread

Returns:

  • (Fixnum)


738
739
740
# File 'lib/google/apis/gmail_v1/classes.rb', line 738

def threads_unread
  @threads_unread
end

#typeString

The owner type for the label. User labels are created by the user and can be modified and deleted by the user and can be applied to any message or thread. System labels are internally created and cannot be added, modified, or deleted. System labels may be able to be applied to or removed from messages and threads under some circumstances but this is not guaranteed. For example, users can apply and remove the INBOX and UNREAD labels from messages and threads, but cannot apply or remove the DRAFTS or SENT labels from messages or threads. Corresponds to the JSON property type

Returns:

  • (String)


750
751
752
# File 'lib/google/apis/gmail_v1/classes.rb', line 750

def type
  @type
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



757
758
759
760
761
762
763
764
765
766
767
768
# File 'lib/google/apis/gmail_v1/classes.rb', line 757

def update!(**args)
  @color = args[:color] if args.key?(:color)
  @id = args[:id] if args.key?(:id)
  @label_list_visibility = args[:label_list_visibility] if args.key?(:label_list_visibility)
  @message_list_visibility = args[:message_list_visibility] if args.key?(:message_list_visibility)
  @messages_total = args[:messages_total] if args.key?(:messages_total)
  @messages_unread = args[:messages_unread] if args.key?(:messages_unread)
  @name = args[:name] if args.key?(:name)
  @threads_total = args[:threads_total] if args.key?(:threads_total)
  @threads_unread = args[:threads_unread] if args.key?(:threads_unread)
  @type = args[:type] if args.key?(:type)
end