Class: Google::Apis::PhotoslibraryV1::PhotosLibraryService
- Inherits:
-
Core::BaseService
- Object
- Core::BaseService
- Google::Apis::PhotoslibraryV1::PhotosLibraryService
- Defined in:
- generated/google/apis/photoslibrary_v1/service.rb
Overview
Photos Library API
Manage photos, videos, and albums in Google Photos
Instance Attribute Summary collapse
-
#key ⇒ String
API key.
-
#quota_user ⇒ String
Available to use for quota purposes for server-side applications.
Attributes inherited from Core::BaseService
#authorization, #base_path, #batch_path, #client, #client_options, #request_options, #root_url, #upload_path
Instance Method Summary collapse
-
#add_enrichment_to_album(album_id, add_enrichment_to_album_request_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::PhotoslibraryV1::AddEnrichmentToAlbumResponse
Adds an enrichment to a specified position in a defined album.
-
#batch_create_media_items(batch_create_media_items_request_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::PhotoslibraryV1::BatchCreateMediaItemsResponse
Creates one or more media items in a user's Google Photos library.
-
#create_album(create_album_request_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::PhotoslibraryV1::Album
Creates an album in a user's Google Photos library.
-
#get_album(album_id, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::PhotoslibraryV1::Album
Returns the album specified by the given album id.
-
#get_media_item(media_item_id, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::PhotoslibraryV1::MediaItem
Returns the media item specified based on a given media item id.
-
#initialize ⇒ PhotosLibraryService
constructor
A new instance of PhotosLibraryService.
-
#join_shared_album(join_shared_album_request_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::PhotoslibraryV1::JoinSharedAlbumResponse
Joins a shared album on behalf of the Google Photos user.
-
#list_albums(page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::PhotoslibraryV1::ListAlbumsResponse
Lists all albums shown to a user in the 'Albums' tab of the Google Photos app.
-
#list_shared_albums(page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::PhotoslibraryV1::ListSharedAlbumsResponse
Lists all shared albums shown to a user in the 'Sharing' tab of the Google Photos app.
-
#search_media_items(search_media_items_request_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::PhotoslibraryV1::SearchMediaItemsResponse
Searches for media items in a user's Google Photos library.
-
#share_album(album_id, share_album_request_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::PhotoslibraryV1::ShareAlbumResponse
Marks an album as 'shared' and accessible to other users.
Methods inherited from Core::BaseService
#batch, #batch_upload, #fetch_all, #http
Methods included from Core::Logging
Constructor Details
#initialize ⇒ PhotosLibraryService
Returns a new instance of PhotosLibraryService
45 46 47 48 |
# File 'generated/google/apis/photoslibrary_v1/service.rb', line 45 def initialize super('https://photoslibrary.googleapis.com/', '') @batch_path = 'batch' end |
Instance Attribute Details
#key ⇒ String
Returns API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
38 39 40 |
# File 'generated/google/apis/photoslibrary_v1/service.rb', line 38 def key @key end |
#quota_user ⇒ String
Returns Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
43 44 45 |
# File 'generated/google/apis/photoslibrary_v1/service.rb', line 43 def quota_user @quota_user end |
Instance Method Details
#add_enrichment_to_album(album_id, add_enrichment_to_album_request_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::PhotoslibraryV1::AddEnrichmentToAlbumResponse
Adds an enrichment to a specified position in a defined album.
71 72 73 74 75 76 77 78 79 80 81 |
# File 'generated/google/apis/photoslibrary_v1/service.rb', line 71 def add_enrichment_to_album(album_id, add_enrichment_to_album_request_object = nil, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:post, 'v1/albums/{+albumId}:addEnrichment', ) command.request_representation = Google::Apis::PhotoslibraryV1::AddEnrichmentToAlbumRequest::Representation command.request_object = add_enrichment_to_album_request_object command.response_representation = Google::Apis::PhotoslibraryV1::AddEnrichmentToAlbumResponse::Representation command.response_class = Google::Apis::PhotoslibraryV1::AddEnrichmentToAlbumResponse command.params['albumId'] = album_id unless album_id.nil? command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? execute_or_queue_command(command, &block) end |
#batch_create_media_items(batch_create_media_items_request_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::PhotoslibraryV1::BatchCreateMediaItemsResponse
Creates one or more media items in a user's Google Photos library. If an album id is specified, the media item(s) are also added to the album. By default the media item(s) will be added to the end of the library or album. If an album id and position are both defined, then the media items will be added to the album at the specified position. If multiple media items are given, they will be inserted at the specified position.
244 245 246 247 248 249 250 251 252 253 |
# File 'generated/google/apis/photoslibrary_v1/service.rb', line 244 def batch_create_media_items(batch_create_media_items_request_object = nil, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:post, 'v1/mediaItems:batchCreate', ) command.request_representation = Google::Apis::PhotoslibraryV1::BatchCreateMediaItemsRequest::Representation command.request_object = batch_create_media_items_request_object command.response_representation = Google::Apis::PhotoslibraryV1::BatchCreateMediaItemsResponse::Representation command.response_class = Google::Apis::PhotoslibraryV1::BatchCreateMediaItemsResponse command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? execute_or_queue_command(command, &block) end |
#create_album(create_album_request_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::PhotoslibraryV1::Album
Creates an album in a user's Google Photos library.
102 103 104 105 106 107 108 109 110 111 |
# File 'generated/google/apis/photoslibrary_v1/service.rb', line 102 def create_album(create_album_request_object = nil, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:post, 'v1/albums', ) command.request_representation = Google::Apis::PhotoslibraryV1::CreateAlbumRequest::Representation command.request_object = create_album_request_object command.response_representation = Google::Apis::PhotoslibraryV1::Album::Representation command.response_class = Google::Apis::PhotoslibraryV1::Album command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? execute_or_queue_command(command, &block) end |
#get_album(album_id, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::PhotoslibraryV1::Album
Returns the album specified by the given album id.
133 134 135 136 137 138 139 140 141 |
# File 'generated/google/apis/photoslibrary_v1/service.rb', line 133 def get_album(album_id, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:get, 'v1/albums/{+albumId}', ) command.response_representation = Google::Apis::PhotoslibraryV1::Album::Representation command.response_class = Google::Apis::PhotoslibraryV1::Album command.params['albumId'] = album_id unless album_id.nil? command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? execute_or_queue_command(command, &block) end |
#get_media_item(media_item_id, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::PhotoslibraryV1::MediaItem
Returns the media item specified based on a given media item id.
275 276 277 278 279 280 281 282 283 |
# File 'generated/google/apis/photoslibrary_v1/service.rb', line 275 def get_media_item(media_item_id, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:get, 'v1/mediaItems/{+mediaItemId}', ) command.response_representation = Google::Apis::PhotoslibraryV1::MediaItem::Representation command.response_class = Google::Apis::PhotoslibraryV1::MediaItem command.params['mediaItemId'] = media_item_id unless media_item_id.nil? command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? execute_or_queue_command(command, &block) end |
#join_shared_album(join_shared_album_request_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::PhotoslibraryV1::JoinSharedAlbumResponse
Joins a shared album on behalf of the Google Photos user.
341 342 343 344 345 346 347 348 349 350 |
# File 'generated/google/apis/photoslibrary_v1/service.rb', line 341 def join_shared_album(join_shared_album_request_object = nil, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:post, 'v1/sharedAlbums:join', ) command.request_representation = Google::Apis::PhotoslibraryV1::JoinSharedAlbumRequest::Representation command.request_object = join_shared_album_request_object command.response_representation = Google::Apis::PhotoslibraryV1::JoinSharedAlbumResponse::Representation command.response_class = Google::Apis::PhotoslibraryV1::JoinSharedAlbumResponse command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? execute_or_queue_command(command, &block) end |
#list_albums(page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::PhotoslibraryV1::ListAlbumsResponse
Lists all albums shown to a user in the 'Albums' tab of the Google Photos app.
170 171 172 173 174 175 176 177 178 179 |
# File 'generated/google/apis/photoslibrary_v1/service.rb', line 170 def list_albums(page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:get, 'v1/albums', ) command.response_representation = Google::Apis::PhotoslibraryV1::ListAlbumsResponse::Representation command.response_class = Google::Apis::PhotoslibraryV1::ListAlbumsResponse command.query['pageSize'] = page_size unless page_size.nil? command.query['pageToken'] = page_token unless page_token.nil? command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? execute_or_queue_command(command, &block) end |
#list_shared_albums(page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::PhotoslibraryV1::ListSharedAlbumsResponse
Lists all shared albums shown to a user in the 'Sharing' tab of the Google Photos app.
379 380 381 382 383 384 385 386 387 388 |
# File 'generated/google/apis/photoslibrary_v1/service.rb', line 379 def list_shared_albums(page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:get, 'v1/sharedAlbums', ) command.response_representation = Google::Apis::PhotoslibraryV1::ListSharedAlbumsResponse::Representation command.response_class = Google::Apis::PhotoslibraryV1::ListSharedAlbumsResponse command.query['pageSize'] = page_size unless page_size.nil? command.query['pageToken'] = page_token unless page_token.nil? command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? execute_or_queue_command(command, &block) end |
#search_media_items(search_media_items_request_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::PhotoslibraryV1::SearchMediaItemsResponse
Searches for media items in a user's Google Photos library. If no filters are set, then all media items in the user's library will be returned. If an album is set, all media items in the specified album will be returned. If filters are specified, anything that matches the filters from the user's library will be listed. If an album and filters are set, then this will result in an error.
311 312 313 314 315 316 317 318 319 320 |
# File 'generated/google/apis/photoslibrary_v1/service.rb', line 311 def search_media_items(search_media_items_request_object = nil, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:post, 'v1/mediaItems:search', ) command.request_representation = Google::Apis::PhotoslibraryV1::SearchMediaItemsRequest::Representation command.request_object = search_media_items_request_object command.response_representation = Google::Apis::PhotoslibraryV1::SearchMediaItemsResponse::Representation command.response_class = Google::Apis::PhotoslibraryV1::SearchMediaItemsResponse command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? execute_or_queue_command(command, &block) end |
#share_album(album_id, share_album_request_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::PhotoslibraryV1::ShareAlbumResponse
Marks an album as 'shared' and accessible to other users. This action can only be performed on albums which were created by the developer via the API.
206 207 208 209 210 211 212 213 214 215 216 |
# File 'generated/google/apis/photoslibrary_v1/service.rb', line 206 def share_album(album_id, share_album_request_object = nil, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:post, 'v1/albums/{+albumId}:share', ) command.request_representation = Google::Apis::PhotoslibraryV1::ShareAlbumRequest::Representation command.request_object = share_album_request_object command.response_representation = Google::Apis::PhotoslibraryV1::ShareAlbumResponse::Representation command.response_class = Google::Apis::PhotoslibraryV1::ShareAlbumResponse command.params['albumId'] = album_id unless album_id.nil? command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? execute_or_queue_command(command, &block) end |