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\Looker\Resource;
|
---|
19 |
|
---|
20 | use Google\Service\Looker\ExportInstanceRequest;
|
---|
21 | use Google\Service\Looker\ImportInstanceRequest;
|
---|
22 | use Google\Service\Looker\Instance;
|
---|
23 | use Google\Service\Looker\ListInstancesResponse;
|
---|
24 | use Google\Service\Looker\Operation;
|
---|
25 | use Google\Service\Looker\Policy;
|
---|
26 | use Google\Service\Looker\RestartInstanceRequest;
|
---|
27 | use Google\Service\Looker\SetIamPolicyRequest;
|
---|
28 | use Google\Service\Looker\TestIamPermissionsRequest;
|
---|
29 | use Google\Service\Looker\TestIamPermissionsResponse;
|
---|
30 |
|
---|
31 | /**
|
---|
32 | * The "instances" collection of methods.
|
---|
33 | * Typical usage is:
|
---|
34 | * <code>
|
---|
35 | * $lookerService = new Google\Service\Looker(...);
|
---|
36 | * $instances = $lookerService->projects_locations_instances;
|
---|
37 | * </code>
|
---|
38 | */
|
---|
39 | class ProjectsLocationsInstances extends \Google\Service\Resource
|
---|
40 | {
|
---|
41 | /**
|
---|
42 | * Creates a new Instance in a given project and location. (instances.create)
|
---|
43 | *
|
---|
44 | * @param string $parent Required. Format:
|
---|
45 | * `projects/{project}/locations/{location}`.
|
---|
46 | * @param Instance $postBody
|
---|
47 | * @param array $optParams Optional parameters.
|
---|
48 | *
|
---|
49 | * @opt_param string instanceId Required. The unique instance identifier. Must
|
---|
50 | * contain only lowercase letters, numbers, or hyphens, with the first character
|
---|
51 | * a letter and the last a letter or a number. 63 characters maximum.
|
---|
52 | * @return Operation
|
---|
53 | * @throws \Google\Service\Exception
|
---|
54 | */
|
---|
55 | public function create($parent, Instance $postBody, $optParams = [])
|
---|
56 | {
|
---|
57 | $params = ['parent' => $parent, 'postBody' => $postBody];
|
---|
58 | $params = array_merge($params, $optParams);
|
---|
59 | return $this->call('create', [$params], Operation::class);
|
---|
60 | }
|
---|
61 | /**
|
---|
62 | * Delete instance. (instances.delete)
|
---|
63 | *
|
---|
64 | * @param string $name Required. Format:
|
---|
65 | * `projects/{project}/locations/{location}/instances/{instance}`.
|
---|
66 | * @param array $optParams Optional parameters.
|
---|
67 | *
|
---|
68 | * @opt_param bool force Whether to force cascading delete.
|
---|
69 | * @return Operation
|
---|
70 | * @throws \Google\Service\Exception
|
---|
71 | */
|
---|
72 | public function delete($name, $optParams = [])
|
---|
73 | {
|
---|
74 | $params = ['name' => $name];
|
---|
75 | $params = array_merge($params, $optParams);
|
---|
76 | return $this->call('delete', [$params], Operation::class);
|
---|
77 | }
|
---|
78 | /**
|
---|
79 | * Export instance. (instances.export)
|
---|
80 | *
|
---|
81 | * @param string $name Required. Format:
|
---|
82 | * `projects/{project}/locations/{location}/instances/{instance}`.
|
---|
83 | * @param ExportInstanceRequest $postBody
|
---|
84 | * @param array $optParams Optional parameters.
|
---|
85 | * @return Operation
|
---|
86 | * @throws \Google\Service\Exception
|
---|
87 | */
|
---|
88 | public function export($name, ExportInstanceRequest $postBody, $optParams = [])
|
---|
89 | {
|
---|
90 | $params = ['name' => $name, 'postBody' => $postBody];
|
---|
91 | $params = array_merge($params, $optParams);
|
---|
92 | return $this->call('export', [$params], Operation::class);
|
---|
93 | }
|
---|
94 | /**
|
---|
95 | * Gets details of a single Instance. (instances.get)
|
---|
96 | *
|
---|
97 | * @param string $name Required. Format:
|
---|
98 | * `projects/{project}/locations/{location}/instances/{instance}`.
|
---|
99 | * @param array $optParams Optional parameters.
|
---|
100 | * @return Instance
|
---|
101 | * @throws \Google\Service\Exception
|
---|
102 | */
|
---|
103 | public function get($name, $optParams = [])
|
---|
104 | {
|
---|
105 | $params = ['name' => $name];
|
---|
106 | $params = array_merge($params, $optParams);
|
---|
107 | return $this->call('get', [$params], Instance::class);
|
---|
108 | }
|
---|
109 | /**
|
---|
110 | * Gets the access control policy for a resource. Returns an empty policy if the
|
---|
111 | * resource exists and does not have a policy set. (instances.getIamPolicy)
|
---|
112 | *
|
---|
113 | * @param string $resource REQUIRED: The resource for which the policy is being
|
---|
114 | * requested. See [Resource
|
---|
115 | * names](https://cloud.google.com/apis/design/resource_names) for the
|
---|
116 | * appropriate value for this field.
|
---|
117 | * @param array $optParams Optional parameters.
|
---|
118 | *
|
---|
119 | * @opt_param int options.requestedPolicyVersion Optional. The maximum policy
|
---|
120 | * version that will be used to format the policy. Valid values are 0, 1, and 3.
|
---|
121 | * Requests specifying an invalid value will be rejected. Requests for policies
|
---|
122 | * with any conditional role bindings must specify version 3. Policies with no
|
---|
123 | * conditional role bindings may specify any valid value or leave the field
|
---|
124 | * unset. The policy in the response might use the policy version that you
|
---|
125 | * specified, or it might use a lower policy version. For example, if you
|
---|
126 | * specify version 3, but the policy has no conditional role bindings, the
|
---|
127 | * response uses version 1. To learn which resources support conditions in their
|
---|
128 | * IAM policies, see the [IAM
|
---|
129 | * documentation](https://cloud.google.com/iam/help/conditions/resource-
|
---|
130 | * policies).
|
---|
131 | * @return Policy
|
---|
132 | * @throws \Google\Service\Exception
|
---|
133 | */
|
---|
134 | public function getIamPolicy($resource, $optParams = [])
|
---|
135 | {
|
---|
136 | $params = ['resource' => $resource];
|
---|
137 | $params = array_merge($params, $optParams);
|
---|
138 | return $this->call('getIamPolicy', [$params], Policy::class);
|
---|
139 | }
|
---|
140 | /**
|
---|
141 | * Import instance. (instances.import)
|
---|
142 | *
|
---|
143 | * @param string $name Required. Format:
|
---|
144 | * `projects/{project}/locations/{location}/instances/{instance}`.
|
---|
145 | * @param ImportInstanceRequest $postBody
|
---|
146 | * @param array $optParams Optional parameters.
|
---|
147 | * @return Operation
|
---|
148 | * @throws \Google\Service\Exception
|
---|
149 | */
|
---|
150 | public function import($name, ImportInstanceRequest $postBody, $optParams = [])
|
---|
151 | {
|
---|
152 | $params = ['name' => $name, 'postBody' => $postBody];
|
---|
153 | $params = array_merge($params, $optParams);
|
---|
154 | return $this->call('import', [$params], Operation::class);
|
---|
155 | }
|
---|
156 | /**
|
---|
157 | * Lists Instances in a given project and location.
|
---|
158 | * (instances.listProjectsLocationsInstances)
|
---|
159 | *
|
---|
160 | * @param string $parent Required. Format:
|
---|
161 | * `projects/{project}/locations/{location}`.
|
---|
162 | * @param array $optParams Optional parameters.
|
---|
163 | *
|
---|
164 | * @opt_param int pageSize The maximum number of instances to return. If
|
---|
165 | * unspecified at most 256 will be returned. The maximum possible value is 2048.
|
---|
166 | * @opt_param string pageToken A page token received from a previous
|
---|
167 | * ListInstancesRequest.
|
---|
168 | * @return ListInstancesResponse
|
---|
169 | * @throws \Google\Service\Exception
|
---|
170 | */
|
---|
171 | public function listProjectsLocationsInstances($parent, $optParams = [])
|
---|
172 | {
|
---|
173 | $params = ['parent' => $parent];
|
---|
174 | $params = array_merge($params, $optParams);
|
---|
175 | return $this->call('list', [$params], ListInstancesResponse::class);
|
---|
176 | }
|
---|
177 | /**
|
---|
178 | * Update Instance. (instances.patch)
|
---|
179 | *
|
---|
180 | * @param string $name Output only. Format:
|
---|
181 | * `projects/{project}/locations/{location}/instances/{instance}`.
|
---|
182 | * @param Instance $postBody
|
---|
183 | * @param array $optParams Optional parameters.
|
---|
184 | *
|
---|
185 | * @opt_param string updateMask Required. Field mask used to specify the fields
|
---|
186 | * to be overwritten in the Instance resource by the update. The fields
|
---|
187 | * specified in the mask are relative to the resource, not the full request. A
|
---|
188 | * field will be overwritten if it is in the mask.
|
---|
189 | * @return Operation
|
---|
190 | * @throws \Google\Service\Exception
|
---|
191 | */
|
---|
192 | public function patch($name, Instance $postBody, $optParams = [])
|
---|
193 | {
|
---|
194 | $params = ['name' => $name, 'postBody' => $postBody];
|
---|
195 | $params = array_merge($params, $optParams);
|
---|
196 | return $this->call('patch', [$params], Operation::class);
|
---|
197 | }
|
---|
198 | /**
|
---|
199 | * Restart instance. (instances.restart)
|
---|
200 | *
|
---|
201 | * @param string $name Required. Format:
|
---|
202 | * `projects/{project}/locations/{location}/instances/{instance}`.
|
---|
203 | * @param RestartInstanceRequest $postBody
|
---|
204 | * @param array $optParams Optional parameters.
|
---|
205 | * @return Operation
|
---|
206 | * @throws \Google\Service\Exception
|
---|
207 | */
|
---|
208 | public function restart($name, RestartInstanceRequest $postBody, $optParams = [])
|
---|
209 | {
|
---|
210 | $params = ['name' => $name, 'postBody' => $postBody];
|
---|
211 | $params = array_merge($params, $optParams);
|
---|
212 | return $this->call('restart', [$params], Operation::class);
|
---|
213 | }
|
---|
214 | /**
|
---|
215 | * Sets the access control policy on the specified resource. Replaces any
|
---|
216 | * existing policy. Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and
|
---|
217 | * `PERMISSION_DENIED` errors. (instances.setIamPolicy)
|
---|
218 | *
|
---|
219 | * @param string $resource REQUIRED: The resource for which the policy is being
|
---|
220 | * specified. See [Resource
|
---|
221 | * names](https://cloud.google.com/apis/design/resource_names) for the
|
---|
222 | * appropriate value for this field.
|
---|
223 | * @param SetIamPolicyRequest $postBody
|
---|
224 | * @param array $optParams Optional parameters.
|
---|
225 | * @return Policy
|
---|
226 | * @throws \Google\Service\Exception
|
---|
227 | */
|
---|
228 | public function setIamPolicy($resource, SetIamPolicyRequest $postBody, $optParams = [])
|
---|
229 | {
|
---|
230 | $params = ['resource' => $resource, 'postBody' => $postBody];
|
---|
231 | $params = array_merge($params, $optParams);
|
---|
232 | return $this->call('setIamPolicy', [$params], Policy::class);
|
---|
233 | }
|
---|
234 | /**
|
---|
235 | * Returns permissions that a caller has on the specified resource. If the
|
---|
236 | * resource does not exist, this will return an empty set of permissions, not a
|
---|
237 | * `NOT_FOUND` error. Note: This operation is designed to be used for building
|
---|
238 | * permission-aware UIs and command-line tools, not for authorization checking.
|
---|
239 | * This operation may "fail open" without warning.
|
---|
240 | * (instances.testIamPermissions)
|
---|
241 | *
|
---|
242 | * @param string $resource REQUIRED: The resource for which the policy detail is
|
---|
243 | * being requested. See [Resource
|
---|
244 | * names](https://cloud.google.com/apis/design/resource_names) for the
|
---|
245 | * appropriate value for this field.
|
---|
246 | * @param TestIamPermissionsRequest $postBody
|
---|
247 | * @param array $optParams Optional parameters.
|
---|
248 | * @return TestIamPermissionsResponse
|
---|
249 | * @throws \Google\Service\Exception
|
---|
250 | */
|
---|
251 | public function testIamPermissions($resource, TestIamPermissionsRequest $postBody, $optParams = [])
|
---|
252 | {
|
---|
253 | $params = ['resource' => $resource, 'postBody' => $postBody];
|
---|
254 | $params = array_merge($params, $optParams);
|
---|
255 | return $this->call('testIamPermissions', [$params], TestIamPermissionsResponse::class);
|
---|
256 | }
|
---|
257 | }
|
---|
258 |
|
---|
259 | // Adding a class alias for backwards compatibility with the previous class name.
|
---|
260 | class_alias(ProjectsLocationsInstances::class, 'Google_Service_Looker_Resource_ProjectsLocationsInstances');
|
---|