patch method
Update the album with the specified id
.
Only the id
, title
and cover_photo_media_item_id
fields of the album
are read. The album must have been created by the developer via the API
and must be owned by the user.
request
- The metadata request object.
Request parameters:
id
- Identifier for the album. This is a persistent identifier that can
be used between sessions to identify this album.
Value must have pattern ^\[^/\]+$
.
updateMask
- Required. Indicate what fields in the provided album to
update. The only valid values are title
and cover_photo_media_item_id
.
$fields
- Selector specifying which fields to include in a partial
response.
Completes with a Album.
Completes with a commons.ApiRequestError if the API endpoint returned an error.
If the used http.Client
completes with an error when making a REST call,
this method will complete with the same error.
Implementation
async.Future<Album> patch(
Album request,
core.String id, {
core.String? updateMask,
core.String? $fields,
}) async {
final body_ = convert.json.encode(request);
final queryParams_ = <core.String, core.List<core.String>>{
if (updateMask != null) 'updateMask': [updateMask],
if ($fields != null) 'fields': [$fields],
};
final url_ = 'v1/albums/' + core.Uri.encodeFull('$id');
final response_ = await _requester.request(
url_,
'PATCH',
body: body_,
queryParams: queryParams_,
);
return Album.fromJson(response_ as core.Map<core.String, core.dynamic>);
}