batchGet method
Returns the list of media items for the specified media item identifiers.
Items are returned in the same order as the supplied identifiers.
Request parameters:
mediaItemIds
- Required. Identifiers of the media items to be requested.
Must not contain repeated identifiers and cannot be empty. The maximum
number of media items that can be retrieved in one call is 50.
$fields
- Selector specifying which fields to include in a partial
response.
Completes with a BatchGetMediaItemsResponse.
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<BatchGetMediaItemsResponse> batchGet({
core.List<core.String>? mediaItemIds,
core.String? $fields,
}) async {
final queryParams_ = <core.String, core.List<core.String>>{
if (mediaItemIds != null) 'mediaItemIds': mediaItemIds,
if ($fields != null) 'fields': [$fields],
};
const url_ = 'v1/mediaItems:batchGet';
final response_ = await _requester.request(
url_,
'GET',
queryParams: queryParams_,
);
return BatchGetMediaItemsResponse.fromJson(
response_ as core.Map<core.String, core.dynamic>);
}