Class: Google::Apis::GmailV1::Filter

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

Resource definition for Gmail filters. Filters apply to specific messages instead of an entire email thread.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**args) ⇒ Filter

Returns a new instance of Filter.



341
342
343
# File 'lib/google/apis/gmail_v1/classes.rb', line 341

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

Instance Attribute Details

#actionGoogle::Apis::GmailV1::FilterAction

A set of actions to perform on a message. Corresponds to the JSON property action



329
330
331
# File 'lib/google/apis/gmail_v1/classes.rb', line 329

def action
  @action
end

#criteriaGoogle::Apis::GmailV1::FilterCriteria

Message matching criteria. Corresponds to the JSON property criteria



334
335
336
# File 'lib/google/apis/gmail_v1/classes.rb', line 334

def criteria
  @criteria
end

#idString

The server assigned ID of the filter. Corresponds to the JSON property id

Returns:

  • (String)


339
340
341
# File 'lib/google/apis/gmail_v1/classes.rb', line 339

def id
  @id
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



346
347
348
349
350
# File 'lib/google/apis/gmail_v1/classes.rb', line 346

def update!(**args)
  @action = args[:action] if args.key?(:action)
  @criteria = args[:criteria] if args.key?(:criteria)
  @id = args[:id] if args.key?(:id)
end