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