[e3d4e0a] | 1 | <?php
|
---|
| 2 | /*
|
---|
| 3 | * Copyright 2014 Google Inc.
|
---|
| 4 | *
|
---|
| 5 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not
|
---|
| 6 | * use this file except in compliance with the License. You may obtain a copy of
|
---|
| 7 | * the License at
|
---|
| 8 | *
|
---|
| 9 | * http://www.apache.org/licenses/LICENSE-2.0
|
---|
| 10 | *
|
---|
| 11 | * Unless required by applicable law or agreed to in writing, software
|
---|
| 12 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
---|
| 13 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
---|
| 14 | * License for the specific language governing permissions and limitations under
|
---|
| 15 | * the License.
|
---|
| 16 | */
|
---|
| 17 |
|
---|
| 18 | namespace Google\Service\MapsPlaces\Resource;
|
---|
| 19 |
|
---|
| 20 | use Google\Service\MapsPlaces\GoogleMapsPlacesV1PhotoMedia;
|
---|
| 21 |
|
---|
| 22 | /**
|
---|
| 23 | * The "photos" collection of methods.
|
---|
| 24 | * Typical usage is:
|
---|
| 25 | * <code>
|
---|
| 26 | * $placesService = new Google\Service\MapsPlaces(...);
|
---|
| 27 | * $photos = $placesService->places_photos;
|
---|
| 28 | * </code>
|
---|
| 29 | */
|
---|
| 30 | class PlacesPhotos extends \Google\Service\Resource
|
---|
| 31 | {
|
---|
| 32 | /**
|
---|
| 33 | * Get a photo media with a photo reference string. (photos.getMedia)
|
---|
| 34 | *
|
---|
| 35 | * @param string $name Required. The resource name of a photo media in the
|
---|
| 36 | * format: `places/{place_id}/photos/{photo_reference}/media`. The resource name
|
---|
| 37 | * of a photo as returned in a Place object's `photos.name` field comes with the
|
---|
| 38 | * format `places/{place_id}/photos/{photo_reference}`. You need to append
|
---|
| 39 | * `/media` at the end of the photo resource to get the photo media resource
|
---|
| 40 | * name.
|
---|
| 41 | * @param array $optParams Optional parameters.
|
---|
| 42 | *
|
---|
| 43 | * @opt_param int maxHeightPx Optional. Specifies the maximum desired height, in
|
---|
| 44 | * pixels, of the image. If the image is smaller than the values specified, the
|
---|
| 45 | * original image will be returned. If the image is larger in either dimension,
|
---|
| 46 | * it will be scaled to match the smaller of the two dimensions, restricted to
|
---|
| 47 | * its original aspect ratio. Both the max_height_px and max_width_px properties
|
---|
| 48 | * accept an integer between 1 and 4800, inclusively. If the value is not within
|
---|
| 49 | * the allowed range, an INVALID_ARGUMENT error will be returned. At least one
|
---|
| 50 | * of max_height_px or max_width_px needs to be specified. If neither
|
---|
| 51 | * max_height_px nor max_width_px is specified, an INVALID_ARGUMENT error will
|
---|
| 52 | * be returned.
|
---|
| 53 | * @opt_param int maxWidthPx Optional. Specifies the maximum desired width, in
|
---|
| 54 | * pixels, of the image. If the image is smaller than the values specified, the
|
---|
| 55 | * original image will be returned. If the image is larger in either dimension,
|
---|
| 56 | * it will be scaled to match the smaller of the two dimensions, restricted to
|
---|
| 57 | * its original aspect ratio. Both the max_height_px and max_width_px properties
|
---|
| 58 | * accept an integer between 1 and 4800, inclusively. If the value is not within
|
---|
| 59 | * the allowed range, an INVALID_ARGUMENT error will be returned. At least one
|
---|
| 60 | * of max_height_px or max_width_px needs to be specified. If neither
|
---|
| 61 | * max_height_px nor max_width_px is specified, an INVALID_ARGUMENT error will
|
---|
| 62 | * be returned.
|
---|
| 63 | * @opt_param bool skipHttpRedirect Optional. If set, skip the default HTTP
|
---|
| 64 | * redirect behavior and render a text format (for example, in JSON format for
|
---|
| 65 | * HTTP use case) response. If not set, an HTTP redirect will be issued to
|
---|
| 66 | * redirect the call to the image media. This option is ignored for non-HTTP
|
---|
| 67 | * requests.
|
---|
| 68 | * @return GoogleMapsPlacesV1PhotoMedia
|
---|
| 69 | * @throws \Google\Service\Exception
|
---|
| 70 | */
|
---|
| 71 | public function getMedia($name, $optParams = [])
|
---|
| 72 | {
|
---|
| 73 | $params = ['name' => $name];
|
---|
| 74 | $params = array_merge($params, $optParams);
|
---|
| 75 | return $this->call('getMedia', [$params], GoogleMapsPlacesV1PhotoMedia::class);
|
---|
| 76 | }
|
---|
| 77 | }
|
---|
| 78 |
|
---|
| 79 | // Adding a class alias for backwards compatibility with the previous class name.
|
---|
| 80 | class_alias(PlacesPhotos::class, 'Google_Service_MapsPlaces_Resource_PlacesPhotos');
|
---|