Class: Google::Apis::PhotoslibraryV1::SearchMediaItemsRequest

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

Request to search for media items in a user's library. If the album id is specified, this call will return the list of media items in the album. If neither filters nor album id are specified, this call will return all media items in a user's Google Photos library. If filters are specified, this call will return all media items in the user's library which fulfills the criteria based upon the filters. Filters and album id must not both be set, as this will result in an invalid request.

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

Returns a new instance of SearchMediaItemsRequest



1036
1037
1038
# File 'generated/google/apis/photoslibrary_v1/classes.rb', line 1036

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

Instance Attribute Details

#album_idString

Identifier of an album. If populated will list all media items in specified album. Cannot be set in conjunction with any filters. Corresponds to the JSON property albumId

Returns:

  • (String)


1013
1014
1015
# File 'generated/google/apis/photoslibrary_v1/classes.rb', line 1013

def album_id
  @album_id
end

#filtersGoogle::Apis::PhotoslibraryV1::Filters

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



1020
1021
1022
# File 'generated/google/apis/photoslibrary_v1/classes.rb', line 1020

def filters
  @filters
end

#page_sizeFixnum

Maximum number of media items to return in the response. The default number of media items to return at a time is 100. The maximum page size is 500. Corresponds to the JSON property pageSize

Returns:

  • (Fixnum)


1026
1027
1028
# File 'generated/google/apis/photoslibrary_v1/classes.rb', line 1026

def page_size
  @page_size
end

#page_tokenString

A continuation token to get the next page of the results. Adding this to the request will return the rows after the pageToken. The pageToken should be the value returned in the nextPageToken parameter in the response to the searchMediaItems request. Corresponds to the JSON property pageToken

Returns:

  • (String)


1034
1035
1036
# File 'generated/google/apis/photoslibrary_v1/classes.rb', line 1034

def page_token
  @page_token
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



1041
1042
1043
1044
1045
1046
# File 'generated/google/apis/photoslibrary_v1/classes.rb', line 1041

def update!(**args)
  @album_id = args[:album_id] if args.key?(:album_id)
  @filters = args[:filters] if args.key?(:filters)
  @page_size = args[:page_size] if args.key?(:page_size)
  @page_token = args[:page_token] if args.key?(:page_token)
end