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

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

Labels are used to categorize messages and threads within the user's mailbox.

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

Returns a new instance of Label



547
548
549
# File 'generated/google/apis/gmail_v1/classes.rb', line 547

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

Instance Attribute Details

#colorGoogle::Apis::GmailV1::LabelColor

The Color to assign to the label. Only available for labels with type User. Will not be set if the label doesn't have both a text_color and background_color configured. Corresponds to the JSON property color



493
494
495
# File 'generated/google/apis/gmail_v1/classes.rb', line 493

def color
  @color
end

#idString

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

Returns:

  • (String)


498
499
500
# File 'generated/google/apis/gmail_v1/classes.rb', line 498

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)


503
504
505
# File 'generated/google/apis/gmail_v1/classes.rb', line 503

def label_list_visibility
  @label_list_visibility
end

#message_list_visibilityString

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

Returns:

  • (String)


508
509
510
# File 'generated/google/apis/gmail_v1/classes.rb', line 508

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)


513
514
515
# File 'generated/google/apis/gmail_v1/classes.rb', line 513

def messages_total
  @messages_total
end

#messages_unreadFixnum

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

Returns:

  • (Fixnum)


518
519
520
# File 'generated/google/apis/gmail_v1/classes.rb', line 518

def messages_unread
  @messages_unread
end

#nameString

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

Returns:

  • (String)


523
524
525
# File 'generated/google/apis/gmail_v1/classes.rb', line 523

def name
  @name
end

#threads_totalFixnum

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

Returns:

  • (Fixnum)


528
529
530
# File 'generated/google/apis/gmail_v1/classes.rb', line 528

def threads_total
  @threads_total
end

#threads_unreadFixnum

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

Returns:

  • (Fixnum)


533
534
535
# File 'generated/google/apis/gmail_v1/classes.rb', line 533

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)


545
546
547
# File 'generated/google/apis/gmail_v1/classes.rb', line 545

def type
  @type
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



552
553
554
555
556
557
558
559
560
561
562
563
# File 'generated/google/apis/gmail_v1/classes.rb', line 552

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