[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\Storage\Resource;
|
---|
| 19 |
|
---|
| 20 | use Google\Service\Storage\AnywhereCache as AnywhereCacheModel;
|
---|
| 21 | use Google\Service\Storage\AnywhereCaches;
|
---|
| 22 | use Google\Service\Storage\GoogleLongrunningOperation;
|
---|
| 23 |
|
---|
| 24 | /**
|
---|
| 25 | * The "anywhereCache" collection of methods.
|
---|
| 26 | * Typical usage is:
|
---|
| 27 | * <code>
|
---|
| 28 | * $storageService = new Google\Service\Storage(...);
|
---|
| 29 | * $anywhereCache = $storageService->anywhereCache;
|
---|
| 30 | * </code>
|
---|
| 31 | */
|
---|
| 32 | class AnywhereCache extends \Google\Service\Resource
|
---|
| 33 | {
|
---|
| 34 | /**
|
---|
| 35 | * Disables an Anywhere Cache instance. (anywhereCache.disable)
|
---|
| 36 | *
|
---|
| 37 | * @param string $bucket Name of the parent bucket.
|
---|
| 38 | * @param string $anywhereCacheId The ID of requested Anywhere Cache instance.
|
---|
| 39 | * @param array $optParams Optional parameters.
|
---|
| 40 | * @return AnywhereCacheModel
|
---|
| 41 | */
|
---|
| 42 | public function disable($bucket, $anywhereCacheId, $optParams = [])
|
---|
| 43 | {
|
---|
| 44 | $params = ['bucket' => $bucket, 'anywhereCacheId' => $anywhereCacheId];
|
---|
| 45 | $params = array_merge($params, $optParams);
|
---|
| 46 | return $this->call('disable', [$params], AnywhereCacheModel::class);
|
---|
| 47 | }
|
---|
| 48 | /**
|
---|
| 49 | * Returns the metadata of an Anywhere Cache instance. (anywhereCache.get)
|
---|
| 50 | *
|
---|
| 51 | * @param string $bucket Name of the parent bucket.
|
---|
| 52 | * @param string $anywhereCacheId The ID of requested Anywhere Cache instance.
|
---|
| 53 | * @param array $optParams Optional parameters.
|
---|
| 54 | * @return AnywhereCacheModel
|
---|
| 55 | */
|
---|
| 56 | public function get($bucket, $anywhereCacheId, $optParams = [])
|
---|
| 57 | {
|
---|
| 58 | $params = ['bucket' => $bucket, 'anywhereCacheId' => $anywhereCacheId];
|
---|
| 59 | $params = array_merge($params, $optParams);
|
---|
| 60 | return $this->call('get', [$params], AnywhereCacheModel::class);
|
---|
| 61 | }
|
---|
| 62 | /**
|
---|
| 63 | * Creates an Anywhere Cache instance. (anywhereCache.insert)
|
---|
| 64 | *
|
---|
| 65 | * @param string $bucket Name of the parent bucket.
|
---|
| 66 | * @param AnywhereCacheModel $postBody
|
---|
| 67 | * @param array $optParams Optional parameters.
|
---|
| 68 | * @return GoogleLongrunningOperation
|
---|
| 69 | */
|
---|
| 70 | public function insert($bucket, AnywhereCacheModel $postBody, $optParams = [])
|
---|
| 71 | {
|
---|
| 72 | $params = ['bucket' => $bucket, 'postBody' => $postBody];
|
---|
| 73 | $params = array_merge($params, $optParams);
|
---|
| 74 | return $this->call('insert', [$params], GoogleLongrunningOperation::class);
|
---|
| 75 | }
|
---|
| 76 | /**
|
---|
| 77 | * Returns a list of Anywhere Cache instances of the bucket matching the
|
---|
| 78 | * criteria. (anywhereCache.listAnywhereCache)
|
---|
| 79 | *
|
---|
| 80 | * @param string $bucket Name of the parent bucket.
|
---|
| 81 | * @param array $optParams Optional parameters.
|
---|
| 82 | *
|
---|
| 83 | * @opt_param int pageSize Maximum number of items return in a single page of
|
---|
| 84 | * responses. Maximum 1000.
|
---|
| 85 | * @opt_param string pageToken A previously-returned page token representing
|
---|
| 86 | * part of the larger set of results to view.
|
---|
| 87 | * @return AnywhereCaches
|
---|
| 88 | */
|
---|
| 89 | public function listAnywhereCache($bucket, $optParams = [])
|
---|
| 90 | {
|
---|
| 91 | $params = ['bucket' => $bucket];
|
---|
| 92 | $params = array_merge($params, $optParams);
|
---|
| 93 | return $this->call('list', [$params], AnywhereCaches::class);
|
---|
| 94 | }
|
---|
| 95 | /**
|
---|
| 96 | * Pauses an Anywhere Cache instance. (anywhereCache.pause)
|
---|
| 97 | *
|
---|
| 98 | * @param string $bucket Name of the parent bucket.
|
---|
| 99 | * @param string $anywhereCacheId The ID of requested Anywhere Cache instance.
|
---|
| 100 | * @param array $optParams Optional parameters.
|
---|
| 101 | * @return AnywhereCacheModel
|
---|
| 102 | */
|
---|
| 103 | public function pause($bucket, $anywhereCacheId, $optParams = [])
|
---|
| 104 | {
|
---|
| 105 | $params = ['bucket' => $bucket, 'anywhereCacheId' => $anywhereCacheId];
|
---|
| 106 | $params = array_merge($params, $optParams);
|
---|
| 107 | return $this->call('pause', [$params], AnywhereCacheModel::class);
|
---|
| 108 | }
|
---|
| 109 | /**
|
---|
| 110 | * Resumes a paused or disabled Anywhere Cache instance. (anywhereCache.resume)
|
---|
| 111 | *
|
---|
| 112 | * @param string $bucket Name of the parent bucket.
|
---|
| 113 | * @param string $anywhereCacheId The ID of requested Anywhere Cache instance.
|
---|
| 114 | * @param array $optParams Optional parameters.
|
---|
| 115 | * @return AnywhereCacheModel
|
---|
| 116 | */
|
---|
| 117 | public function resume($bucket, $anywhereCacheId, $optParams = [])
|
---|
| 118 | {
|
---|
| 119 | $params = ['bucket' => $bucket, 'anywhereCacheId' => $anywhereCacheId];
|
---|
| 120 | $params = array_merge($params, $optParams);
|
---|
| 121 | return $this->call('resume', [$params], AnywhereCacheModel::class);
|
---|
| 122 | }
|
---|
| 123 | /**
|
---|
| 124 | * Updates the config(ttl and admissionPolicy) of an Anywhere Cache instance.
|
---|
| 125 | * (anywhereCache.update)
|
---|
| 126 | *
|
---|
| 127 | * @param string $bucket Name of the parent bucket.
|
---|
| 128 | * @param string $anywhereCacheId The ID of requested Anywhere Cache instance.
|
---|
| 129 | * @param AnywhereCacheModel $postBody
|
---|
| 130 | * @param array $optParams Optional parameters.
|
---|
| 131 | * @return GoogleLongrunningOperation
|
---|
| 132 | */
|
---|
| 133 | public function update($bucket, $anywhereCacheId, AnywhereCacheModel $postBody, $optParams = [])
|
---|
| 134 | {
|
---|
| 135 | $params = ['bucket' => $bucket, 'anywhereCacheId' => $anywhereCacheId, 'postBody' => $postBody];
|
---|
| 136 | $params = array_merge($params, $optParams);
|
---|
| 137 | return $this->call('update', [$params], GoogleLongrunningOperation::class);
|
---|
| 138 | }
|
---|
| 139 | }
|
---|
| 140 |
|
---|
| 141 | // Adding a class alias for backwards compatibility with the previous class name.
|
---|
| 142 | class_alias(AnywhereCache::class, 'Google_Service_Storage_Resource_AnywhereCache');
|
---|