patch method
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.
request
- The metadata request object.
Request parameters:
id
- Identifier for the media item. This is a persistent identifier that
can be used between sessions to identify this media item.
Value must have pattern ^\[^/\]+$
.
updateMask
- Required. Indicate what fields in the provided media item
to update. The only valid value is description
.
$fields
- Selector specifying which fields to include in a partial
response.
Completes with a MediaItem.
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<MediaItem> patch(
MediaItem 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/mediaItems/' + core.Uri.encodeFull('$id');
final response_ = await _requester.request(
url_,
'PATCH',
body: body_,
queryParams: queryParams_,
);
return MediaItem.fromJson(response_ as core.Map<core.String, core.dynamic>);
}