[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\PolyService\Resource;
|
---|
| 19 |
|
---|
| 20 | use Google\Service\PolyService\Asset;
|
---|
| 21 | use Google\Service\PolyService\ListAssetsResponse;
|
---|
| 22 |
|
---|
| 23 | /**
|
---|
| 24 | * The "assets" collection of methods.
|
---|
| 25 | * Typical usage is:
|
---|
| 26 | * <code>
|
---|
| 27 | * $polyService = new Google\Service\PolyService(...);
|
---|
| 28 | * $assets = $polyService->assets;
|
---|
| 29 | * </code>
|
---|
| 30 | */
|
---|
| 31 | class Assets extends \Google\Service\Resource
|
---|
| 32 | {
|
---|
| 33 | /**
|
---|
| 34 | * Returns detailed information about an asset given its name. PRIVATE assets
|
---|
| 35 | * are returned only if the currently authenticated user (via OAuth token) is
|
---|
| 36 | * the author of the asset. (assets.get)
|
---|
| 37 | *
|
---|
| 38 | * @param string $name Required. An asset's name in the form
|
---|
| 39 | * `assets/{ASSET_ID}`.
|
---|
| 40 | * @param array $optParams Optional parameters.
|
---|
| 41 | * @return Asset
|
---|
| 42 | */
|
---|
| 43 | public function get($name, $optParams = [])
|
---|
| 44 | {
|
---|
| 45 | $params = ['name' => $name];
|
---|
| 46 | $params = array_merge($params, $optParams);
|
---|
| 47 | return $this->call('get', [$params], Asset::class);
|
---|
| 48 | }
|
---|
| 49 | /**
|
---|
| 50 | * Lists all public, remixable assets. These are assets with an access level of
|
---|
| 51 | * PUBLIC and published under the CC-By license. (assets.listAssets)
|
---|
| 52 | *
|
---|
| 53 | * @param array $optParams Optional parameters.
|
---|
| 54 | *
|
---|
| 55 | * @opt_param string category Filter assets based on the specified category.
|
---|
| 56 | * Supported values are: `animals`, `architecture`, `art`, `food`, `nature`,
|
---|
| 57 | * `objects`, `people`, `scenes`, `technology`, and `transport`.
|
---|
| 58 | * @opt_param bool curated Return only assets that have been curated by the Poly
|
---|
| 59 | * team.
|
---|
| 60 | * @opt_param string format Return only assets with the matching format.
|
---|
| 61 | * Acceptable values are: `BLOCKS`, `FBX`, `GLTF`, `GLTF2`, `OBJ`, `TILT`.
|
---|
| 62 | * @opt_param string keywords One or more search terms to be matched against all
|
---|
| 63 | * text that Poly has indexed for assets, which includes display_name,
|
---|
| 64 | * description, and tags. Multiple keywords should be separated by spaces.
|
---|
| 65 | * @opt_param string maxComplexity Returns assets that are of the specified
|
---|
| 66 | * complexity or less. Defaults to COMPLEX. For example, a request for MEDIUM
|
---|
| 67 | * assets also includes SIMPLE assets.
|
---|
| 68 | * @opt_param string orderBy Specifies an ordering for assets. Acceptable values
|
---|
| 69 | * are: `BEST`, `NEWEST`, `OLDEST`. Defaults to `BEST`, which ranks assets based
|
---|
| 70 | * on a combination of popularity and other features.
|
---|
| 71 | * @opt_param int pageSize The maximum number of assets to be returned. This
|
---|
| 72 | * value must be between `1` and `100`. Defaults to `20`.
|
---|
| 73 | * @opt_param string pageToken Specifies a continuation token from a previous
|
---|
| 74 | * search whose results were split into multiple pages. To get the next page,
|
---|
| 75 | * submit the same request specifying the value from next_page_token.
|
---|
| 76 | * @return ListAssetsResponse
|
---|
| 77 | */
|
---|
| 78 | public function listAssets($optParams = [])
|
---|
| 79 | {
|
---|
| 80 | $params = [];
|
---|
| 81 | $params = array_merge($params, $optParams);
|
---|
| 82 | return $this->call('list', [$params], ListAssetsResponse::class);
|
---|
| 83 | }
|
---|
| 84 | }
|
---|
| 85 |
|
---|
| 86 | // Adding a class alias for backwards compatibility with the previous class name.
|
---|
| 87 | class_alias(Assets::class, 'Google_Service_PolyService_Resource_Assets');
|
---|