Class: Google::Apis::PhotoslibraryV1::Filters

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

Overview

Filters that can be applied to a media item search. If multiple filter options are specified, they are treated as AND with each other.

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

Returns a new instance of Filters



488
489
490
# File 'generated/google/apis/photoslibrary_v1/classes.rb', line 488

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

Instance Attribute Details

#content_filterGoogle::Apis::PhotoslibraryV1::ContentFilter

This filter is used to define which results to return based on the contents of the media item. It is possible to specify a list of categories to include, and/or a list of categories to exclude. Within each list, the categories are combined with an OR. For example, if the content filter looks like: included_content_categories: [c1, c2, c3] It would get media items that contain (c1 OR c2 OR c3). And if the content filter looks like: excluded_content_categories: [c1, c2, c3] It would get media items that contain NOT (c1 OR c2 OR c3). You can also include some categories while excluding others, as in this proto: included_content_categories: [c1, c2], excluded_content_category: [c3, c4] It would get media items that contain (c1 OR c2) AND NOT (c3 OR c4). A category that appears in includedContentategories must not appear in excludedContentCategories. Corresponds to the JSON property contentFilter



466
467
468
# File 'generated/google/apis/photoslibrary_v1/classes.rb', line 466

def content_filter
  @content_filter
end

#date_filterGoogle::Apis::PhotoslibraryV1::DateFilter

This filter defines the allowed dates or date ranges for the media returned. It is possible to pick a set of specific dates and a set of date ranges. Corresponds to the JSON property dateFilter



472
473
474
# File 'generated/google/apis/photoslibrary_v1/classes.rb', line 472

def date_filter
  @date_filter
end

#include_archived_mediaBoolean Also known as: include_archived_media?

If set, the results will include media items that the user has archived. Defaults to false (archived media items are not included). Corresponds to the JSON property includeArchivedMedia

Returns:

  • (Boolean)


478
479
480
# File 'generated/google/apis/photoslibrary_v1/classes.rb', line 478

def include_archived_media
  @include_archived_media
end

#media_type_filterGoogle::Apis::PhotoslibraryV1::MediaTypeFilter

This filter defines the type of media items to be returned, for example videos or photos. All the specified media types are treated as an OR with each other. Corresponds to the JSON property mediaTypeFilter



486
487
488
# File 'generated/google/apis/photoslibrary_v1/classes.rb', line 486

def media_type_filter
  @media_type_filter
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



493
494
495
496
497
498
# File 'generated/google/apis/photoslibrary_v1/classes.rb', line 493

def update!(**args)
  @content_filter = args[:content_filter] if args.key?(:content_filter)
  @date_filter = args[:date_filter] if args.key?(:date_filter)
  @include_archived_media = args[:include_archived_media] if args.key?(:include_archived_media)
  @media_type_filter = args[:media_type_filter] if args.key?(:media_type_filter)
end