Struct google_photoslibrary1::api::MediaItemMethods
source · pub struct MediaItemMethods<'a, S>where
S: 'a,{ /* private fields */ }
Expand description
A builder providing access to all methods supported on mediaItem resources.
It is not used directly, but through the PhotosLibrary
hub.
§Example
Instantiate a resource builder
extern crate hyper;
extern crate hyper_rustls;
extern crate google_photoslibrary1 as photoslibrary1;
use std::default::Default;
use photoslibrary1::{PhotosLibrary, oauth2, hyper, hyper_rustls, chrono, FieldMask};
let secret: oauth2::ApplicationSecret = Default::default();
let auth = oauth2::InstalledFlowAuthenticator::builder(
secret,
oauth2::InstalledFlowReturnMethod::HTTPRedirect,
).build().await.unwrap();
let mut hub = PhotosLibrary::new(hyper::Client::builder().build(hyper_rustls::HttpsConnectorBuilder::new().with_native_roots().https_or_http().enable_http1().build()), auth);
// Usually you wouldn't bind this to a variable, but keep calling *CallBuilders*
// like `batch_create(...)`, `batch_get(...)`, `get(...)`, `list(...)`, `patch(...)` and `search(...)`
// to build up your call.
let rb = hub.media_items();
Implementations§
source§impl<'a, S> MediaItemMethods<'a, S>
impl<'a, S> MediaItemMethods<'a, S>
sourcepub fn batch_create(
&self,
request: BatchCreateMediaItemsRequest
) -> MediaItemBatchCreateCall<'a, S>
pub fn batch_create( &self, request: BatchCreateMediaItemsRequest ) -> MediaItemBatchCreateCall<'a, S>
Create a builder to help you perform the following task:
Creates one or more media items in a user’s Google Photos library. This is the second step for creating a media item. For details regarding Step 1, uploading the raw bytes to a Google Server, see Uploading media. This call adds the media item to the library. If an album id
is specified, the call adds the media item to the album too. Each album can contain up to 20,000 media items. By default, the media item will be added to the end of the library or album. If an album id
and position are both defined, the media item is added to the album at the specified position. If the call contains multiple media items, they’re added at the specified position. If you are creating a media item in a shared album where you are not the owner, you are not allowed to position the media item. Doing so will result in a BAD REQUEST
error.
§Arguments
request
- No description provided.
sourcepub fn batch_get(&self) -> MediaItemBatchGetCall<'a, S>
pub fn batch_get(&self) -> MediaItemBatchGetCall<'a, S>
Create a builder to help you perform the following task:
Returns the list of media items for the specified media item identifiers. Items are returned in the same order as the supplied identifiers.
sourcepub fn get(&self, media_item_id: &str) -> MediaItemGetCall<'a, S>
pub fn get(&self, media_item_id: &str) -> MediaItemGetCall<'a, S>
Create a builder to help you perform the following task:
Returns the media item for the specified media item identifier.
§Arguments
mediaItemId
- Required. Identifier of the media item to be requested.
sourcepub fn list(&self) -> MediaItemListCall<'a, S>
pub fn list(&self) -> MediaItemListCall<'a, S>
Create a builder to help you perform the following task:
List all media items from a user’s Google Photos library.
sourcepub fn patch(&self, request: MediaItem, id: &str) -> MediaItemPatchCall<'a, S>
pub fn patch(&self, request: MediaItem, id: &str) -> MediaItemPatchCall<'a, S>
Create a builder to help you perform the following task:
Update the media item with the specified id
. Only the id
and description
fields of the media item are read. The media item must have been created by the developer via the API and must be owned by the user.
§Arguments
request
- No description provided.id
- Identifier for the media item. This is a persistent identifier that can be used between sessions to identify this media item.
sourcepub fn search(
&self,
request: SearchMediaItemsRequest
) -> MediaItemSearchCall<'a, S>
pub fn search( &self, request: SearchMediaItemsRequest ) -> MediaItemSearchCall<'a, S>
Create a builder to help you perform the following task:
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 are returned. If an album is set, all media items in the specified album are returned. If filters are specified, media items that match the filters from the user’s library are listed. If you set both the album and the filters, the request results in an error.
§Arguments
request
- No description provided.