Google has announced the general availability of its new Google Photos Library API, designed to help developers create new experiences for (or at least help organize) our Google Photos libraries.
The new Google Photos Library API will allow developers to create new app experiences powered by Google Photos, including the ability to upload photos to the library or an album. The API will also allow you to find and filter photos based on their content, using a variety of categories like pets, selfies, and weddings. Other filter options include the photo’s date, location, and format (like JPG, PNG, etc). Photos found by the API can then be organized into albums and given additional info like title, description, and location.
The Google Photos Library API entered developer preview back in May, but it’s now available for all to use. Combined with today’s official launch are Java and PHP client libraries, to help developers get started quickly with the new API. The inclusion of a Java library clearly has Android developers in mind, so we may soon see a variety of new apps taking advantage of Google Photos.
You can read the official announcement on the Google Developers Blog, and developers interested in getting started with the Google Photos Library API should check out the documentation, including a thoughtful guide for migrating an app over from Google’s older Picasa APIs.
PHP developpers can use theses PHP libraries:
https://github.com/google/php-photoslibrary
or
Google API PHP Client
If you use older Google API PHP Client (e.g: v1.1.x) you can use this file to use Google Photos Library API
<?php require_once './vendor/autoload.php'; class Google_Service_v2 extends Google_Service { public $batchPath; public $rootUrl; private $client; /** * Create a new HTTP Batch handler for this service * * @return Google_Http_Batch */ public function createBatch() { return new Google_Http_Batch($this->client, false, $this->rootUrl, $this->batchPath); } } class Google_Service_Resource_v2 /* extends Google_Service_Resource*/ { private $rootUrl; private $stackParameters = array('alt' => array('type' => 'string', 'location' => 'query'), 'fields' => array('type' => 'string', 'location' => 'query'), 'trace' => array('type' => 'string', 'location' => 'query'), 'userIp' => array('type' => 'string', 'location' => 'query'), 'userip' => array('type' => 'string', 'location' => 'query'), 'quotaUser' => array('type' => 'string', 'location' => 'query'), 'data' => array ('type' => 'string', 'location' => 'body'), 'mimeType' => array('type' => 'string', 'location' => 'header'), 'uploadType' => array('type' => 'string', 'location' => 'query'), 'mediaUpload' => array('type' => 'complex', 'location' => 'query'), ); /** @var Google_Service $service */ private $service; /** @var Google_Client $client */ private $client; /** @var string $serviceName */ private $serviceName; /** @var string $resourceName */ private $resourceName; /** @var array $methods */ private $methods; public function __construct($service, $serviceName, $resourceName, $resource) { $this->rootUrl = $service->rootUrl; $this->service = $service; $this->client = $service->getClient(); $this->serviceName = $serviceName; $this->resourceName = $resourceName; $this->methods = isset($resource['methods']) ? $resource['methods'] : array($resourceName => $resource); } /** * TODO: This function needs simplifying. * @param $name * @param $arguments * @param $expectedClass - optional, the expected class name * @return Google_Http_Request|expectedClass * @throws Google_Exception */ public function call($name, $arguments, $expectedClass = null) { if (!isset($this->methods[$name])) { throw new Google_Exception("Unknown function: " . "{$this->serviceName}->{$this->resourceName}->{$name}()"); } $method = $this->methods[$name]; $parameters = $arguments[0]; // postBody is a special case since it's not defined in the discovery // document as parameter, but we abuse the param entry for storing it. $postBody = null; if (isset($parameters['postBody'])) { if ($parameters['postBody'] instanceof Google_Model) { // In the cases the post body is an existing object, we want // to use the smart method to create a simple object for // for JSONification. $parameters['postBody'] = $parameters['postBody']->toSimpleObject(); } else if (is_object($parameters['postBody'])) { // If the post body is another kind of object, we will try and // wrangle it into a sensible format. $parameters['postBody'] = $this->convertToArrayAndStripNulls($parameters['postBody']); } $postBody = (array )$parameters['postBody']; unset($parameters['postBody']); } // TODO: optParams here probably should have been // handled already - this may well be redundant code. if (isset($parameters['optParams'])) { $optParams = $parameters['optParams']; unset($parameters['optParams']); $parameters = array_merge($parameters, $optParams); } if (!isset($method['parameters'])) { $method['parameters'] = array(); } //var_dump($this->stackParameters);die(); $method['parameters'] = array_merge($this->stackParameters, $method['parameters']); foreach ($parameters as $key => $val) { if ($key != 'postBody' && !isset($method['parameters'][$key])) { throw new Google_Exception("($name) unknown parameter: '$key'"); } } foreach ($method['parameters'] as $paramName => $paramSpec) { if (isset($paramSpec['required']) && $paramSpec['required'] && !isset($parameters[$paramName])) { throw new Google_Exception("($name) missing required param: '$paramName'"); } if (isset($parameters[$paramName])) { $value = $parameters[$paramName]; $parameters[$paramName] = $paramSpec; $parameters[$paramName]['value'] = $value; unset($parameters[$paramName]['required']); } else { // Ensure we don't pass nulls. unset($parameters[$paramName]); } } // build the service uri $url = $this->createRequestUri($method['path'], $parameters); // NOTE: because we're creating the request by hand, // and because the service has a rootUrl property // the "base_uri" of the Http Client is not accounted for $request = new Google_Http_Request($url, $method['httpMethod'], ['content-type' => 'application/json'], $postBody ? json_encode($postBody) : ''); if ($postBody) { $contentTypeHeader = array(); $contentTypeHeader['content-type'] = 'application/json; charset=UTF-8'; $request->setRequestHeaders($contentTypeHeader); $request->setPostBody($postBody); } $request = $this->client->getAuth()->sign($request); $request->setExpectedClass($expectedClass); // support uploads if (isset($parameters['data'])) { $mimeType = isset($parameters['mimeType']) ? $parameters['mimeType']['value'] : 'application/octet-stream'; $data = $parameters['data']['value']; $upload = new Google_Http_MediaFileUpload($this->client, $request, $mimeType, $data); // pull down the modified request $request = $upload->getRequest(); } // if this is a media type, we will return the raw response // rather than using an expected class if (isset($parameters['alt']) && $parameters['alt']['value'] == 'media') { $expectedClass = null; } // if the client is marked for deferring, rather than // execute the request, return the response if ($this->client->shouldDefer()) { // @TODO find a better way to do this $request = $request->withHeader('X-Php-Expected-Class', $expectedClass); return $request; } return $this->client->execute($request, $expectedClass); } protected function convertToArrayAndStripNulls($o) { $o = (array )$o; foreach ($o as $k => $v) { if ($v === null) { unset($o[$k]); } elseif (is_object($v) || is_array($v)) { $o[$k] = $this->convertToArrayAndStripNulls($o[$k]); } } return $o; } /** * Parse/expand request parameters and create a fully qualified * request uri. * @static * @param string $restPath * @param array $params * @return string $requestUrl */ //see Google_Http_REST::createRequestUri public function createRequestUri($restPath, $params) { // Override the default servicePath address if the $restPath use a / if ('/' == substr($restPath, 0, 1)) { $requestUrl = substr($restPath, 1); } else { $requestUrl = $this->servicePath . $restPath; } // code for leading slash if ($this->rootUrl) { if ('/' !== substr($this->rootUrl, -1) && '/' !== substr($requestUrl, 0, 1)) { $requestUrl = '/' . $requestUrl; } $requestUrl = $this->rootUrl . $requestUrl; } $uriTemplateVars = array(); $queryVars = array(); foreach ($params as $paramName => $paramSpec) { if ($paramSpec['type'] == 'boolean') { $paramSpec['value'] = $paramSpec['value'] ? 'true' : 'false'; } if ($paramSpec['location'] == 'path') { $uriTemplateVars[$paramName] = $paramSpec['value']; } else if ($paramSpec['location'] == 'query') { if (is_array($paramSpec['value'])) { foreach ($paramSpec['value'] as $value) { $queryVars[] = $paramName . '=' . rawurlencode(rawurldecode($value)); } } else { $queryVars[] = $paramName . '=' . rawurlencode(rawurldecode($paramSpec['value'])); } } } if (count($uriTemplateVars)) { $uriTemplateParser = new Google_Utils_UriTemplate(); $requestUrl = $uriTemplateParser->parse($requestUrl, $uriTemplateVars); } if (count($queryVars)) { $requestUrl .= '?' . implode($queryVars, '&'); } return $requestUrl; } } class Google_Service_PhotosLibrary extends Google_Service_v2 { /** View the photos, videos and albums in your Google Photos. */ const DRIVE_PHOTOS_READONLY = "https://www.googleapis.com/auth/drive.photos.readonly"; /** View and manage your Google Photos library. */ const PHOTOSLIBRARY = "https://www.googleapis.com/auth/photoslibrary"; /** Add to your Google Photos library. */ const PHOTOSLIBRARY_APPENDONLY = "https://www.googleapis.com/auth/photoslibrary.appendonly"; /** View your Google Photos library. */ const PHOTOSLIBRARY_READONLY = "https://www.googleapis.com/auth/photoslibrary.readonly"; /** Manage photos added by this app. */ const PHOTOSLIBRARY_READONLY_APPCREATEDDATA = "https://www.googleapis.com/auth/photoslibrary.readonly.appcreateddata"; /** Manage and add to shared albums on your behalf. */ const PHOTOSLIBRARY_SHARING = "https://www.googleapis.com/auth/photoslibrary.sharing"; public $albums; public $mediaItems; public $sharedAlbums; public function __construct(Google_Client $client) { parent::__construct($client); $this->rootUrl = 'https://photoslibrary.googleapis.com/'; $this->servicePath = ''; $this->version = 'v1'; $this->serviceName = 'photoslibrary'; $this->albums = new Google_Service_PhotosLibrary_Resource_Albums($this, $this->serviceName, 'albums', array('methods' => array('addEnrichment' => array('path' => 'v1/albums/{+albumId}:addEnrichment', 'httpMethod' => 'POST', 'parameters' => array('albumId' => array('location' => 'path', 'type' => 'string', 'required' => true, ), ), ), 'create' => array('path' => 'v1/albums', 'httpMethod' => 'POST', 'parameters' => array(), ), 'get' => array('path' => 'v1/albums/{+albumId}', 'httpMethod' => 'GET', 'parameters' => array('albumId' => array ('location' => 'path', 'type' => 'string', 'required' => true, ), ), ), 'list' => array('path' => 'v1/albums', 'httpMethod' => 'GET', 'parameters' => array('pageToken' => array('location' => 'query', 'type' => 'string', ), 'pageSize' => array('location' => 'query', 'type' => 'integer', ), ), ), 'share' => array('path' => 'v1/albums/{+albumId}:share', 'httpMethod' => 'POST', 'parameters' => array('albumId' => array('location' => 'path', 'type' => 'string', 'required' => true, ), ), ), ))); $this->mediaItems = new Google_Service_PhotosLibrary_Resource_MediaItems($this, $this->serviceName, 'mediaItems', array('methods' => array('batchCreate' => array('path' => 'v1/mediaItems:batchCreate', 'httpMethod' => 'POST', 'parameters' => array(), ), 'get' => array('path' => 'v1/mediaItems/{+mediaItemId}', 'httpMethod' => 'GET', 'parameters' => array('mediaItemId' => array('location' => 'path', 'type' => 'string', 'required' => true, ), ), ), 'search' => array('path' => 'v1/mediaItems:search', 'httpMethod' => 'POST', 'parameters' => array(), ), ))); $this->sharedAlbums = new Google_Service_PhotosLibrary_Resource_SharedAlbums($this, $this->serviceName, 'sharedAlbums', array('methods' => array('join' => array('path' => 'v1/sharedAlbums:join', 'httpMethod' => 'POST', 'parameters' => array(), ), 'list' => array('path' => 'v1/sharedAlbums', 'httpMethod' => 'GET', 'parameters' => array('pageToken' => array('location' => 'query', 'type' => 'string', ), 'pageSize' => array('location' => 'query', 'type' => 'integer', ), ), ), ))); } } /** * The "albums" collection of methods. * Typical usage is: * <code> * $photoslibraryService = new Google_Service_PhotosLibrary(...); * $albums = $photoslibraryService->albums; * </code> */ class Google_Service_PhotosLibrary_Resource_Albums extends Google_Service_Resource_v2 { /** * Adds an enrichment to a specified position in a defined album. * (albums.addEnrichment) * * @param string $albumId Identifier of the album where the enrichment will be * added. * @param Google_Service_PhotosLibrary_AddEnrichmentToAlbumRequest $postBody * @param array $optParams Optional parameters. * @return Google_Service_PhotosLibrary_AddEnrichmentToAlbumResponse */ public function addEnrichment($albumId, Google_Service_PhotosLibrary_AddEnrichmentToAlbumRequest $postBody, $optParams = array()) { $params = array('albumId' => $albumId, 'postBody' => $postBody); $params = array_merge($params, $optParams); return $this->call('addEnrichment', array($params), "Google_Service_PhotosLibrary_AddEnrichmentToAlbumResponse"); } /** * Creates an album in a user's Google Photos library. (albums.create) * * @param Google_Service_PhotosLibrary_CreateAlbumRequest $postBody * @param array $optParams Optional parameters. * @return Google_Service_PhotosLibrary_Album */ public function create(Google_Service_PhotosLibrary_CreateAlbumRequest $postBody, $optParams = array ()) { $params = array('postBody' => $postBody); $params = array_merge($params, $optParams); return $this->call('create', array($params), "Google_Service_PhotosLibrary_Album"); } /** * Returns the album specified by the given album id. (albums.get) * * @param string $albumId Identifier of the album to be requested. * @param array $optParams Optional parameters. * @return Google_Service_PhotosLibrary_Album */ public function get($albumId, $optParams = array()) { $params = array('albumId' => $albumId); $params = array_merge($params, $optParams); return $this->call('get', array($params), "Google_Service_PhotosLibrary_Album"); } /** * Lists all albums shown to a user in the 'Albums' tab of the Google Photos * app. (albums.listAlbums) * * @param array $optParams Optional parameters. * * @opt_param string pageToken A continuation token to get the next page of the * results. Adding this to the request will return the rows after the pageToken. * The pageToken should be the value returned in the nextPageToken parameter in * the response to the listAlbums request. * @opt_param int pageSize Maximum number of albums to return in the response. * The default number of albums to return at a time is 20. The maximum page size * is 50. * @return Google_Service_PhotosLibrary_ListAlbumsResponse */ public function listAlbums($optParams = array()) { $params = array(); $params = array_merge($params, $optParams); return $this->call('list', array($params), "Google_Service_PhotosLibrary_ListAlbumsResponse"); } /** * Marks an album as 'shared' and accessible to other users. This action can * only be performed on albums which were created by the developer via the API. * (albums.share) * * @param string $albumId Identifier of the album to be shared. This album id * must belong to an album created by the developer. . * @param Google_Service_PhotosLibrary_ShareAlbumRequest $postBody * @param array $optParams Optional parameters. * @return Google_Service_PhotosLibrary_ShareAlbumResponse */ public function share($albumId, Google_Service_PhotosLibrary_ShareAlbumRequest $postBody, $optParams = array()) { $params = array('albumId' => $albumId, 'postBody' => $postBody); $params = array_merge($params, $optParams); return $this->call('share', array($params), "Google_Service_PhotosLibrary_ShareAlbumResponse"); } } /** * The "mediaItems" collection of methods. * Typical usage is: * <code> * $photoslibraryService = new Google_Service_PhotosLibrary(...); * $mediaItems = $photoslibraryService->mediaItems; * </code> */ class Google_Service_PhotosLibrary_Resource_MediaItems extends Google_Service_Resource_v2 { /** * Creates one or more media items in a user's Google Photos library. If an * album id is specified, the media item(s) are also added to the album. By * default the media item(s) will be added to the end of the library or album. * * If an album id and position are both defined, then the media items will be * added to the album at the specified position. * * If multiple media items are given, they will be inserted at the specified * position. (mediaItems.batchCreate) * * @param Google_Service_PhotosLibrary_BatchCreateMediaItemsRequest $postBody * @param array $optParams Optional parameters. * @return Google_Service_PhotosLibrary_BatchCreateMediaItemsResponse */ public function batchCreate(Google_Service_PhotosLibrary_BatchCreateMediaItemsRequest $postBody, $optParams = array()) { $params = array('postBody' => $postBody); $params = array_merge($params, $optParams); return $this->call('batchCreate', array($params), "Google_Service_PhotosLibrary_BatchCreateMediaItemsResponse"); } /** * Returns the media item specified based on a given media item id. * (mediaItems.get) * * @param string $mediaItemId Identifier of media item to be requested. * @param array $optParams Optional parameters. * @return Google_Service_PhotosLibrary_MediaItem */ public function get($mediaItemId, $optParams = array()) { $params = array('mediaItemId' => $mediaItemId); $params = array_merge($params, $optParams); return $this->call('get', array($params), "Google_Service_PhotosLibrary_MediaItem"); } /** * 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 will be returned. * * If an album is set, all media items in the specified album will be returned. * * If filters are specified, anything that matches the filters from the user's * library will be listed. * * If an album and filters are set, then this will result in an error. * (mediaItems.search) * * @param Google_Service_PhotosLibrary_SearchMediaItemsRequest $postBody * @param array $optParams Optional parameters. * @return Google_Service_PhotosLibrary_SearchMediaItemsResponse */ public function search(Google_Service_PhotosLibrary_SearchMediaItemsRequest $postBody, $optParams = array ()) { $params = array('postBody' => $postBody); $params = array_merge($params, $optParams); return $this->call('search', array($params), "Google_Service_PhotosLibrary_SearchMediaItemsResponse"); } } /** * The "sharedAlbums" collection of methods. * Typical usage is: * <code> * $photoslibraryService = new Google_Service_PhotosLibrary(...); * $sharedAlbums = $photoslibraryService->sharedAlbums; * </code> */ class Google_Service_PhotosLibrary_Resource_SharedAlbums extends Google_Service_Resource_v2 { /** * Joins a shared album on behalf of the Google Photos user. (sharedAlbums.join) * * @param Google_Service_PhotosLibrary_JoinSharedAlbumRequest $postBody * @param array $optParams Optional parameters. * @return Google_Service_PhotosLibrary_JoinSharedAlbumResponse */ public function join(Google_Service_PhotosLibrary_JoinSharedAlbumRequest $postBody, $optParams = array ()) { $params = array('postBody' => $postBody); $params = array_merge($params, $optParams); return $this->call('join', array($params), "Google_Service_PhotosLibrary_JoinSharedAlbumResponse"); } /** * Lists all shared albums shown to a user in the 'Sharing' tab of the Google * Photos app. (sharedAlbums.listSharedAlbums) * * @param array $optParams Optional parameters. * * @opt_param string pageToken A continuation token to get the next page of the * results. Adding this to the request will return the rows after the pageToken. * The pageToken should be the value returned in the nextPageToken parameter in * the response to the listSharedAlbums request. * @opt_param int pageSize Maximum number of albums to return in the response. * The default number of albums to return at a time is 20. The maximum page size * is 50. * @return Google_Service_PhotosLibrary_ListSharedAlbumsResponse */ public function listSharedAlbums($optParams = array()) { $params = array(); $params = array_merge($params, $optParams); return $this->call('list', array($params), "Google_Service_PhotosLibrary_ListSharedAlbumsResponse"); } } class Google_Service_PhotosLibrary_AddEnrichmentToAlbumRequest extends Google_Model { protected $albumPositionType = 'Google_Service_PhotosLibrary_AlbumPosition'; protected $albumPositionDataType = ''; protected $newEnrichmentItemType = 'Google_Service_PhotosLibrary_NewEnrichmentItem'; protected $newEnrichmentItemDataType = ''; /** * @param Google_Service_PhotosLibrary_AlbumPosition */ public function setAlbumPosition(Google_Service_PhotosLibrary_AlbumPosition $albumPosition) { $this->albumPosition = $albumPosition; } /** * @return Google_Service_PhotosLibrary_AlbumPosition */ public function getAlbumPosition() { return $this->albumPosition; } /** * @param Google_Service_PhotosLibrary_NewEnrichmentItem */ public function setNewEnrichmentItem(Google_Service_PhotosLibrary_NewEnrichmentItem $newEnrichmentItem) { $this->newEnrichmentItem = $newEnrichmentItem; } /** * @return Google_Service_PhotosLibrary_NewEnrichmentItem */ public function getNewEnrichmentItem() { return $this->newEnrichmentItem; } } class Google_Service_PhotosLibrary_AddEnrichmentToAlbumResponse extends Google_Model { protected $enrichmentItemType = 'Google_Service_PhotosLibrary_EnrichmentItem'; protected $enrichmentItemDataType = ''; /** * @param Google_Service_PhotosLibrary_EnrichmentItem */ public function setEnrichmentItem(Google_Service_PhotosLibrary_EnrichmentItem $enrichmentItem) { $this->enrichmentItem = $enrichmentItem; } /** * @return Google_Service_PhotosLibrary_EnrichmentItem */ public function getEnrichmentItem() { return $this->enrichmentItem; } } class Google_Service_PhotosLibrary_Album extends Google_Model { public $coverPhotoBaseUrl; public $id; public $isWriteable; public $productUrl; protected $shareInfoType = 'Google_Service_PhotosLibrary_ShareInfo'; protected $shareInfoDataType = ''; public $title; public $totalMediaItems; public function setCoverPhotoBaseUrl($coverPhotoBaseUrl) { $this->coverPhotoBaseUrl = $coverPhotoBaseUrl; } public function getCoverPhotoBaseUrl() { return $this->coverPhotoBaseUrl; } public function setId($id) { $this->id = $id; } public function getId() { return $this->id; } public function setIsWriteable($isWriteable) { $this->isWriteable = $isWriteable; } public function getIsWriteable() { return $this->isWriteable; } public function setProductUrl($productUrl) { $this->productUrl = $productUrl; } public function getProductUrl() { return $this->productUrl; } /** * @param Google_Service_PhotosLibrary_ShareInfo */ public function setShareInfo(Google_Service_PhotosLibrary_ShareInfo $shareInfo) { $this->shareInfo = $shareInfo; } /** * @return Google_Service_PhotosLibrary_ShareInfo */ public function getShareInfo() { return $this->shareInfo; } public function setTitle($title) { $this->title = $title; } public function getTitle() { return $this->title; } public function setTotalMediaItems($totalMediaItems) { $this->totalMediaItems = $totalMediaItems; } public function getTotalMediaItems() { return $this->totalMediaItems; } } class Google_Service_PhotosLibrary_AlbumPosition extends Google_Model { public $position; public $relativeEnrichmentItemId; public $relativeMediaItemId; public function setPosition($position) { $this->position = $position; } public function getPosition() { return $this->position; } public function setRelativeEnrichmentItemId($relativeEnrichmentItemId) { $this->relativeEnrichmentItemId = $relativeEnrichmentItemId; } public function getRelativeEnrichmentItemId() { return $this->relativeEnrichmentItemId; } public function setRelativeMediaItemId($relativeMediaItemId) { $this->relativeMediaItemId = $relativeMediaItemId; } public function getRelativeMediaItemId() { return $this->relativeMediaItemId; } } class Google_Service_PhotosLibrary_BatchCreateMediaItemsRequest extends Google_Collection { protected $collection_key = 'newMediaItems'; public $albumId; protected $albumPositionType = 'Google_Service_PhotosLibrary_AlbumPosition'; protected $albumPositionDataType = ''; protected $newMediaItemsType = 'Google_Service_PhotosLibrary_NewMediaItem'; protected $newMediaItemsDataType = 'array'; public function setAlbumId($albumId) { $this->albumId = $albumId; } public function getAlbumId() { return $this->albumId; } /** * @param Google_Service_PhotosLibrary_AlbumPosition */ public function setAlbumPosition(Google_Service_PhotosLibrary_AlbumPosition $albumPosition) { $this->albumPosition = $albumPosition; } /** * @return Google_Service_PhotosLibrary_AlbumPosition */ public function getAlbumPosition() { return $this->albumPosition; } /** * @param Google_Service_PhotosLibrary_NewMediaItem */ public function setNewMediaItems($newMediaItems) { $this->newMediaItems = $newMediaItems; } /** * @return Google_Service_PhotosLibrary_NewMediaItem */ public function getNewMediaItems() { return $this->newMediaItems; } } class Google_Service_PhotosLibrary_BatchCreateMediaItemsResponse extends Google_Collection { protected $collection_key = 'newMediaItemResults'; protected $newMediaItemResultsType = 'Google_Service_PhotosLibrary_NewMediaItemResult'; protected $newMediaItemResultsDataType = 'array'; /** * @param Google_Service_PhotosLibrary_NewMediaItemResult */ public function setNewMediaItemResults($newMediaItemResults) { $this->newMediaItemResults = $newMediaItemResults; } /** * @return Google_Service_PhotosLibrary_NewMediaItemResult */ public function getNewMediaItemResults() { return $this->newMediaItemResults; } } class Google_Service_PhotosLibrary_ContentFilter extends Google_Collection { protected $collection_key = 'includedContentCategories'; public $excludedContentCategories; public $includedContentCategories; public function setExcludedContentCategories($excludedContentCategories) { $this->excludedContentCategories = $excludedContentCategories; } public function getExcludedContentCategories() { return $this->excludedContentCategories; } public function setIncludedContentCategories($includedContentCategories) { $this->includedContentCategories = $includedContentCategories; } public function getIncludedContentCategories() { return $this->includedContentCategories; } } class Google_Service_PhotosLibrary_ContributorInfo extends Google_Model { public $displayName; public $profilePictureBaseUrl; public function setDisplayName($displayName) { $this->displayName = $displayName; } public function getDisplayName() { return $this->displayName; } public function setProfilePictureBaseUrl($profilePictureBaseUrl) { $this->profilePictureBaseUrl = $profilePictureBaseUrl; } public function getProfilePictureBaseUrl() { return $this->profilePictureBaseUrl; } } class Google_Service_PhotosLibrary_CreateAlbumRequest extends Google_Model { protected $albumType = 'Google_Service_PhotosLibrary_Album'; protected $albumDataType = ''; /** * @param Google_Service_PhotosLibrary_Album */ public function setAlbum(Google_Service_PhotosLibrary_Album $album) { $this->album = $album; } /** * @return Google_Service_PhotosLibrary_Album */ public function getAlbum() { return $this->album; } } class Google_Service_PhotosLibrary_Date extends Google_Model { public $day; public $month; public $year; public function setDay($day) { $this->day = $day; } public function getDay() { return $this->day; } public function setMonth($month) { $this->month = $month; } public function getMonth() { return $this->month; } public function setYear($year) { $this->year = $year; } public function getYear() { return $this->year; } } class Google_Service_PhotosLibrary_DateFilter extends Google_Collection { protected $collection_key = 'ranges'; protected $datesType = 'Google_Service_PhotosLibrary_Date'; protected $datesDataType = 'array'; protected $rangesType = 'Google_Service_PhotosLibrary_DateRange'; protected $rangesDataType = 'array'; /** * @param Google_Service_PhotosLibrary_Date */ public function setDates($dates) { $this->dates = $dates; } /** * @return Google_Service_PhotosLibrary_Date */ public function getDates() { return $this->dates; } /** * @param Google_Service_PhotosLibrary_DateRange */ public function setRanges($ranges) { $this->ranges = $ranges; } /** * @return Google_Service_PhotosLibrary_DateRange */ public function getRanges() { return $this->ranges; } } class Google_Service_PhotosLibrary_DateRange extends Google_Model { protected $endDateType = 'Google_Service_PhotosLibrary_Date'; protected $endDateDataType = ''; protected $startDateType = 'Google_Service_PhotosLibrary_Date'; protected $startDateDataType = ''; /** * @param Google_Service_PhotosLibrary_Date */ public function setEndDate(Google_Service_PhotosLibrary_Date $endDate) { $this->endDate = $endDate; } /** * @return Google_Service_PhotosLibrary_Date */ public function getEndDate() { return $this->endDate; } /** * @param Google_Service_PhotosLibrary_Date */ public function setStartDate(Google_Service_PhotosLibrary_Date $startDate) { $this->startDate = $startDate; } /** * @return Google_Service_PhotosLibrary_Date */ public function getStartDate() { return $this->startDate; } } class Google_Service_PhotosLibrary_EnrichmentItem extends Google_Model { public $id; public function setId($id) { $this->id = $id; } public function getId() { return $this->id; } } class Google_Service_PhotosLibrary_Filters extends Google_Model { protected $contentFilterType = 'Google_Service_PhotosLibrary_ContentFilter'; protected $contentFilterDataType = ''; protected $dateFilterType = 'Google_Service_PhotosLibrary_DateFilter'; protected $dateFilterDataType = ''; public $includeArchivedMedia; protected $mediaTypeFilterType = 'Google_Service_PhotosLibrary_MediaTypeFilter'; protected $mediaTypeFilterDataType = ''; /** * @param Google_Service_PhotosLibrary_ContentFilter */ public function setContentFilter(Google_Service_PhotosLibrary_ContentFilter $contentFilter) { $this->contentFilter = $contentFilter; } /** * @return Google_Service_PhotosLibrary_ContentFilter */ public function getContentFilter() { return $this->contentFilter; } /** * @param Google_Service_PhotosLibrary_DateFilter */ public function setDateFilter(Google_Service_PhotosLibrary_DateFilter $dateFilter) { $this->dateFilter = $dateFilter; } /** * @return Google_Service_PhotosLibrary_DateFilter */ public function getDateFilter() { return $this->dateFilter; } public function setIncludeArchivedMedia($includeArchivedMedia) { $this->includeArchivedMedia = $includeArchivedMedia; } public function getIncludeArchivedMedia() { return $this->includeArchivedMedia; } /** * @param Google_Service_PhotosLibrary_MediaTypeFilter */ public function setMediaTypeFilter(Google_Service_PhotosLibrary_MediaTypeFilter $mediaTypeFilter) { $this->mediaTypeFilter = $mediaTypeFilter; } /** * @return Google_Service_PhotosLibrary_MediaTypeFilter */ public function getMediaTypeFilter() { return $this->mediaTypeFilter; } } class Google_Service_PhotosLibrary_JoinSharedAlbumRequest extends Google_Model { public $shareToken; public function setShareToken($shareToken) { $this->shareToken = $shareToken; } public function getShareToken() { return $this->shareToken; } } class Google_Service_PhotosLibrary_JoinSharedAlbumResponse extends Google_Model { } class Google_Service_PhotosLibrary_LatLng extends Google_Model { public $latitude; public $longitude; public function setLatitude($latitude) { $this->latitude = $latitude; } public function getLatitude() { return $this->latitude; } public function setLongitude($longitude) { $this->longitude = $longitude; } public function getLongitude() { return $this->longitude; } } class Google_Service_PhotosLibrary_ListAlbumsResponse extends Google_Collection { protected $collection_key = 'albums'; protected $albumsType = 'Google_Service_PhotosLibrary_Album'; protected $albumsDataType = 'array'; public $nextPageToken; /** * @param Google_Service_PhotosLibrary_Album */ public function setAlbums($albums) { $this->albums = $albums; } /** * @return Google_Service_PhotosLibrary_Album */ public function getAlbums() { return $this->albums; } public function setNextPageToken($nextPageToken) { $this->nextPageToken = $nextPageToken; } public function getNextPageToken() { return $this->nextPageToken; } } class Google_Service_PhotosLibrary_ListSharedAlbumsResponse extends Google_Collection { protected $collection_key = 'sharedAlbums'; public $nextPageToken; protected $sharedAlbumsType = 'Google_Service_PhotosLibrary_Album'; protected $sharedAlbumsDataType = 'array'; public function setNextPageToken($nextPageToken) { $this->nextPageToken = $nextPageToken; } public function getNextPageToken() { return $this->nextPageToken; } /** * @param Google_Service_PhotosLibrary_Album */ public function setSharedAlbums($sharedAlbums) { $this->sharedAlbums = $sharedAlbums; } /** * @return Google_Service_PhotosLibrary_Album */ public function getSharedAlbums() { return $this->sharedAlbums; } } class Google_Service_PhotosLibrary_Location extends Google_Model { protected $latlngType = 'Google_Service_PhotosLibrary_LatLng'; protected $latlngDataType = ''; public $locationName; /** * @param Google_Service_PhotosLibrary_LatLng */ public function setLatlng(Google_Service_PhotosLibrary_LatLng $latlng) { $this->latlng = $latlng; } /** * @return Google_Service_PhotosLibrary_LatLng */ public function getLatlng() { return $this->latlng; } public function setLocationName($locationName) { $this->locationName = $locationName; } public function getLocationName() { return $this->locationName; } } class Google_Service_PhotosLibrary_LocationEnrichment extends Google_Model { protected $locationType = 'Google_Service_PhotosLibrary_Location'; protected $locationDataType = ''; /** * @param Google_Service_PhotosLibrary_Location */ public function setLocation(Google_Service_PhotosLibrary_Location $location) { $this->location = $location; } /** * @return Google_Service_PhotosLibrary_Location */ public function getLocation() { return $this->location; } } class Google_Service_PhotosLibrary_MapEnrichment extends Google_Model { protected $destinationType = 'Google_Service_PhotosLibrary_Location'; protected $destinationDataType = ''; protected $originType = 'Google_Service_PhotosLibrary_Location'; protected $originDataType = ''; /** * @param Google_Service_PhotosLibrary_Location */ public function setDestination(Google_Service_PhotosLibrary_Location $destination) { $this->destination = $destination; } /** * @return Google_Service_PhotosLibrary_Location */ public function getDestination() { return $this->destination; } /** * @param Google_Service_PhotosLibrary_Location */ public function setOrigin(Google_Service_PhotosLibrary_Location $origin) { $this->origin = $origin; } /** * @return Google_Service_PhotosLibrary_Location */ public function getOrigin() { return $this->origin; } } class Google_Service_PhotosLibrary_MediaItem extends Google_Model { public $baseUrl; protected $contributorInfoType = 'Google_Service_PhotosLibrary_ContributorInfo'; protected $contributorInfoDataType = ''; public $description; public $id; protected $mediaMetadataType = 'Google_Service_PhotosLibrary_MediaMetadata'; protected $mediaMetadataDataType = ''; public $mimeType; public $productUrl; public function setBaseUrl($baseUrl) { $this->baseUrl = $baseUrl; } public function getBaseUrl() { return $this->baseUrl; } /** * @param Google_Service_PhotosLibrary_ContributorInfo */ public function setContributorInfo(Google_Service_PhotosLibrary_ContributorInfo $contributorInfo) { $this->contributorInfo = $contributorInfo; } /** * @return Google_Service_PhotosLibrary_ContributorInfo */ public function getContributorInfo() { return $this->contributorInfo; } public function setDescription($description) { $this->description = $description; } public function getDescription() { return $this->description; } public function setId($id) { $this->id = $id; } public function getId() { return $this->id; } /** * @param Google_Service_PhotosLibrary_MediaMetadata */ public function setMediaMetadata(Google_Service_PhotosLibrary_MediaMetadata $mediaMetadata) { $this->mediaMetadata = $mediaMetadata; } /** * @return Google_Service_PhotosLibrary_MediaMetadata */ public function getMediaMetadata() { return $this->mediaMetadata; } public function setMimeType($mimeType) { $this->mimeType = $mimeType; } public function getMimeType() { return $this->mimeType; } public function setProductUrl($productUrl) { $this->productUrl = $productUrl; } public function getProductUrl() { return $this->productUrl; } } class Google_Service_PhotosLibrary_MediaMetadata extends Google_Model { public $creationTime; public $height; protected $photoType = 'Google_Service_PhotosLibrary_Photo'; protected $photoDataType = ''; protected $videoType = 'Google_Service_PhotosLibrary_Video'; protected $videoDataType = ''; public $width; public function setCreationTime($creationTime) { $this->creationTime = $creationTime; } public function getCreationTime() { return $this->creationTime; } public function setHeight($height) { $this->height = $height; } public function getHeight() { return $this->height; } /** * @param Google_Service_PhotosLibrary_Photo */ public function setPhoto(Google_Service_PhotosLibrary_Photo $photo) { $this->photo = $photo; } /** * @return Google_Service_PhotosLibrary_Photo */ public function getPhoto() { return $this->photo; } /** * @param Google_Service_PhotosLibrary_Video */ public function setVideo(Google_Service_PhotosLibrary_Video $video) { $this->video = $video; } /** * @return Google_Service_PhotosLibrary_Video */ public function getVideo() { return $this->video; } public function setWidth($width) { $this->width = $width; } public function getWidth() { return $this->width; } } class Google_Service_PhotosLibrary_MediaTypeFilter extends Google_Collection { protected $collection_key = 'mediaTypes'; public $mediaTypes; public function setMediaTypes($mediaTypes) { $this->mediaTypes = $mediaTypes; } public function getMediaTypes() { return $this->mediaTypes; } } class Google_Service_PhotosLibrary_NewEnrichmentItem extends Google_Model { protected $locationEnrichmentType = 'Google_Service_PhotosLibrary_LocationEnrichment'; protected $locationEnrichmentDataType = ''; protected $mapEnrichmentType = 'Google_Service_PhotosLibrary_MapEnrichment'; protected $mapEnrichmentDataType = ''; protected $textEnrichmentType = 'Google_Service_PhotosLibrary_TextEnrichment'; protected $textEnrichmentDataType = ''; /** * @param Google_Service_PhotosLibrary_LocationEnrichment */ public function setLocationEnrichment(Google_Service_PhotosLibrary_LocationEnrichment $locationEnrichment) { $this->locationEnrichment = $locationEnrichment; } /** * @return Google_Service_PhotosLibrary_LocationEnrichment */ public function getLocationEnrichment() { return $this->locationEnrichment; } /** * @param Google_Service_PhotosLibrary_MapEnrichment */ public function setMapEnrichment(Google_Service_PhotosLibrary_MapEnrichment $mapEnrichment) { $this->mapEnrichment = $mapEnrichment; } /** * @return Google_Service_PhotosLibrary_MapEnrichment */ public function getMapEnrichment() { return $this->mapEnrichment; } /** * @param Google_Service_PhotosLibrary_TextEnrichment */ public function setTextEnrichment(Google_Service_PhotosLibrary_TextEnrichment $textEnrichment) { $this->textEnrichment = $textEnrichment; } /** * @return Google_Service_PhotosLibrary_TextEnrichment */ public function getTextEnrichment() { return $this->textEnrichment; } } class Google_Service_PhotosLibrary_NewMediaItem extends Google_Model { public $description; protected $simpleMediaItemType = 'Google_Service_PhotosLibrary_SimpleMediaItem'; protected $simpleMediaItemDataType = ''; public function setDescription($description) { $this->description = $description; } public function getDescription() { return $this->description; } /** * @param Google_Service_PhotosLibrary_SimpleMediaItem */ public function setSimpleMediaItem(Google_Service_PhotosLibrary_SimpleMediaItem $simpleMediaItem) { $this->simpleMediaItem = $simpleMediaItem; } /** * @return Google_Service_PhotosLibrary_SimpleMediaItem */ public function getSimpleMediaItem() { return $this->simpleMediaItem; } } class Google_Service_PhotosLibrary_NewMediaItemResult extends Google_Model { protected $mediaItemType = 'Google_Service_PhotosLibrary_MediaItem'; protected $mediaItemDataType = ''; protected $statusType = 'Google_Service_PhotosLibrary_Status'; protected $statusDataType = ''; public $uploadToken; /** * @param Google_Service_PhotosLibrary_MediaItem */ public function setMediaItem(Google_Service_PhotosLibrary_MediaItem $mediaItem) { $this->mediaItem = $mediaItem; } /** * @return Google_Service_PhotosLibrary_MediaItem */ public function getMediaItem() { return $this->mediaItem; } /** * @param Google_Service_PhotosLibrary_Status */ public function setStatus(Google_Service_PhotosLibrary_Status $status) { $this->status = $status; } /** * @return Google_Service_PhotosLibrary_Status */ public function getStatus() { return $this->status; } public function setUploadToken($uploadToken) { $this->uploadToken = $uploadToken; } public function getUploadToken() { return $this->uploadToken; } } class Google_Service_PhotosLibrary_Photo extends Google_Model { public $apertureFNumber; public $cameraMake; public $cameraModel; public $exposureTime; public $focalLength; public $isoEquivalent; public function setApertureFNumber($apertureFNumber) { $this->apertureFNumber = $apertureFNumber; } public function getApertureFNumber() { return $this->apertureFNumber; } public function setCameraMake($cameraMake) { $this->cameraMake = $cameraMake; } public function getCameraMake() { return $this->cameraMake; } public function setCameraModel($cameraModel) { $this->cameraModel = $cameraModel; } public function getCameraModel() { return $this->cameraModel; } public function setExposureTime($exposureTime) { $this->exposureTime = $exposureTime; } public function getExposureTime() { return $this->exposureTime; } public function setFocalLength($focalLength) { $this->focalLength = $focalLength; } public function getFocalLength() { return $this->focalLength; } public function setIsoEquivalent($isoEquivalent) { $this->isoEquivalent = $isoEquivalent; } public function getIsoEquivalent() { return $this->isoEquivalent; } } class Google_Service_PhotosLibrary_SearchMediaItemsRequest extends Google_Model { public $albumId; protected $filtersType = 'Google_Service_PhotosLibrary_Filters'; protected $filtersDataType = ''; public $pageSize; public $pageToken; public function setAlbumId($albumId) { $this->albumId = $albumId; } public function getAlbumId() { return $this->albumId; } /** * @param Google_Service_PhotosLibrary_Filters */ public function setFilters(Google_Service_PhotosLibrary_Filters $filters) { $this->filters = $filters; } /** * @return Google_Service_PhotosLibrary_Filters */ public function getFilters() { return $this->filters; } public function setPageSize($pageSize) { $this->pageSize = $pageSize; } public function getPageSize() { return $this->pageSize; } public function setPageToken($pageToken) { $this->pageToken = $pageToken; } public function getPageToken() { return $this->pageToken; } } class Google_Service_PhotosLibrary_SearchMediaItemsResponse extends Google_Collection { protected $collection_key = 'mediaItems'; protected $mediaItemsType = 'Google_Service_PhotosLibrary_MediaItem'; protected $mediaItemsDataType = 'array'; public $nextPageToken; /** * @param Google_Service_PhotosLibrary_MediaItem */ public function setMediaItems($mediaItems) { $this->mediaItems = $mediaItems; } /** * @return Google_Service_PhotosLibrary_MediaItem */ public function getMediaItems() { return $this->mediaItems; } public function setNextPageToken($nextPageToken) { $this->nextPageToken = $nextPageToken; } public function getNextPageToken() { return $this->nextPageToken; } } class Google_Service_PhotosLibrary_ShareAlbumRequest extends Google_Model { protected $sharedAlbumOptionsType = 'Google_Service_PhotosLibrary_SharedAlbumOptions'; protected $sharedAlbumOptionsDataType = ''; /** * @param Google_Service_PhotosLibrary_SharedAlbumOptions */ public function setSharedAlbumOptions(Google_Service_PhotosLibrary_SharedAlbumOptions $sharedAlbumOptions) { $this->sharedAlbumOptions = $sharedAlbumOptions; } /** * @return Google_Service_PhotosLibrary_SharedAlbumOptions */ public function getSharedAlbumOptions() { return $this->sharedAlbumOptions; } } class Google_Service_PhotosLibrary_ShareAlbumResponse extends Google_Model { protected $shareInfoType = 'Google_Service_PhotosLibrary_ShareInfo'; protected $shareInfoDataType = ''; /** * @param Google_Service_PhotosLibrary_ShareInfo */ public function setShareInfo(Google_Service_PhotosLibrary_ShareInfo $shareInfo) { $this->shareInfo = $shareInfo; } /** * @return Google_Service_PhotosLibrary_ShareInfo */ public function getShareInfo() { return $this->shareInfo; } } class Google_Service_PhotosLibrary_ShareInfo extends Google_Model { public $shareToken; public $shareableUrl; protected $sharedAlbumOptionsType = 'Google_Service_PhotosLibrary_SharedAlbumOptions'; protected $sharedAlbumOptionsDataType = ''; public function setShareToken($shareToken) { $this->shareToken = $shareToken; } public function getShareToken() { return $this->shareToken; } public function setShareableUrl($shareableUrl) { $this->shareableUrl = $shareableUrl; } public function getShareableUrl() { return $this->shareableUrl; } /** * @param Google_Service_PhotosLibrary_SharedAlbumOptions */ public function setSharedAlbumOptions(Google_Service_PhotosLibrary_SharedAlbumOptions $sharedAlbumOptions) { $this->sharedAlbumOptions = $sharedAlbumOptions; } /** * @return Google_Service_PhotosLibrary_SharedAlbumOptions */ public function getSharedAlbumOptions() { return $this->sharedAlbumOptions; } } class Google_Service_PhotosLibrary_SharedAlbumOptions extends Google_Model { public $isCollaborative; public $isCommentable; public function setIsCollaborative($isCollaborative) { $this->isCollaborative = $isCollaborative; } public function getIsCollaborative() { return $this->isCollaborative; } public function setIsCommentable($isCommentable) { $this->isCommentable = $isCommentable; } public function getIsCommentable() { return $this->isCommentable; } } class Google_Service_PhotosLibrary_SimpleMediaItem extends Google_Model { public $uploadToken; public function setUploadToken($uploadToken) { $this->uploadToken = $uploadToken; } public function getUploadToken() { return $this->uploadToken; } } class Google_Service_PhotosLibrary_Status extends Google_Collection { protected $collection_key = 'details'; public $code; public $details; public $message; public function setCode($code) { $this->code = $code; } public function getCode() { return $this->code; } public function setDetails($details) { $this->details = $details; } public function getDetails() { return $this->details; } public function setMessage($message) { $this->message = $message; } public function getMessage() { return $this->message; } } class Google_Service_PhotosLibrary_TextEnrichment extends Google_Model { public $text; public function setText($text) { $this->text = $text; } public function getText() { return $this->text; } } class Google_Service_PhotosLibrary_Video extends Google_Model { public $cameraMake; public $cameraModel; public $fps; public $status; public function setCameraMake($cameraMake) { $this->cameraMake = $cameraMake; } public function getCameraMake() { return $this->cameraMake; } public function setCameraModel($cameraModel) { $this->cameraModel = $cameraModel; } public function getCameraModel() { return $this->cameraModel; } public function setFps($fps) { $this->fps = $fps; } public function getFps() { return $this->fps; } public function setStatus($status) { $this->status = $status; } public function getStatus() { return $this->status; } } ?>