get method
Gets the metadata of the specified Photo.
This method returns the following error codes: * google.rpc.Code.PERMISSION_DENIED if the requesting user did not create the requested Photo. * google.rpc.Code.NOT_FOUND if the requested Photo does not exist. * google.rpc.Code.UNAVAILABLE if the requested Photo is still being indexed.
Request parameters:
photoId
- Required. ID of the Photo.
languageCode
- The BCP-47 language code, such as "en-US" or "sr-Latn".
For more information, see
http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. If
language_code is unspecified, the user's language preference for Google
services is used.
view
- Required. Specifies if a download URL for the photo bytes should
be returned in the Photo response.
Possible string values are:
- "BASIC" : Server responses do not include the download URL for the photo bytes. The default value.
- "INCLUDE_DOWNLOAD_URL" : Server responses include the download URL for the photo bytes.
$fields
- Selector specifying which fields to include in a partial
response.
Completes with a Photo.
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<Photo> get(
core.String photoId, {
core.String? languageCode,
core.String? view,
core.String? $fields,
}) async {
final queryParams_ = <core.String, core.List<core.String>>{
if (languageCode != null) 'languageCode': [languageCode],
if (view != null) 'view': [view],
if ($fields != null) 'fields': [$fields],
};
final url_ = 'v1/photo/' + commons.escapeVariable('$photoId');
final response_ = await _requester.request(
url_,
'GET',
queryParams: queryParams_,
);
return Photo.fromJson(response_ as core.Map<core.String, core.dynamic>);
}