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\Networkconnectivity\Resource;
|
---|
19 |
|
---|
20 | use Google\Service\Networkconnectivity\GoogleLongrunningOperation;
|
---|
21 | use Google\Service\Networkconnectivity\ListSpokesResponse;
|
---|
22 | use Google\Service\Networkconnectivity\Policy;
|
---|
23 | use Google\Service\Networkconnectivity\SetIamPolicyRequest;
|
---|
24 | use Google\Service\Networkconnectivity\Spoke;
|
---|
25 | use Google\Service\Networkconnectivity\TestIamPermissionsRequest;
|
---|
26 | use Google\Service\Networkconnectivity\TestIamPermissionsResponse;
|
---|
27 |
|
---|
28 | /**
|
---|
29 | * The "spokes" collection of methods.
|
---|
30 | * Typical usage is:
|
---|
31 | * <code>
|
---|
32 | * $networkconnectivityService = new Google\Service\Networkconnectivity(...);
|
---|
33 | * $spokes = $networkconnectivityService->projects_locations_spokes;
|
---|
34 | * </code>
|
---|
35 | */
|
---|
36 | class ProjectsLocationsSpokes extends \Google\Service\Resource
|
---|
37 | {
|
---|
38 | /**
|
---|
39 | * Creates a Network Connectivity Center spoke. (spokes.create)
|
---|
40 | *
|
---|
41 | * @param string $parent Required. The parent resource.
|
---|
42 | * @param Spoke $postBody
|
---|
43 | * @param array $optParams Optional parameters.
|
---|
44 | *
|
---|
45 | * @opt_param string requestId Optional. A request ID to identify requests.
|
---|
46 | * Specify a unique request ID so that if you must retry your request, the
|
---|
47 | * server knows to ignore the request if it has already been completed. The
|
---|
48 | * server guarantees that a request doesn't result in creation of duplicate
|
---|
49 | * commitments for at least 60 minutes. For example, consider a situation where
|
---|
50 | * you make an initial request and the request times out. If you make the
|
---|
51 | * request again with the same request ID, the server can check to see whether
|
---|
52 | * the original operation was received. If it was, the server ignores the second
|
---|
53 | * request. This behavior prevents clients from mistakenly creating duplicate
|
---|
54 | * commitments. The request ID must be a valid UUID, with the exception that
|
---|
55 | * zero UUID is not supported (00000000-0000-0000-0000-000000000000).
|
---|
56 | * @opt_param string spokeId Required. Unique id for the spoke to create.
|
---|
57 | * @return GoogleLongrunningOperation
|
---|
58 | * @throws \Google\Service\Exception
|
---|
59 | */
|
---|
60 | public function create($parent, Spoke $postBody, $optParams = [])
|
---|
61 | {
|
---|
62 | $params = ['parent' => $parent, 'postBody' => $postBody];
|
---|
63 | $params = array_merge($params, $optParams);
|
---|
64 | return $this->call('create', [$params], GoogleLongrunningOperation::class);
|
---|
65 | }
|
---|
66 | /**
|
---|
67 | * Deletes a Network Connectivity Center spoke. (spokes.delete)
|
---|
68 | *
|
---|
69 | * @param string $name Required. The name of the spoke to delete.
|
---|
70 | * @param array $optParams Optional parameters.
|
---|
71 | *
|
---|
72 | * @opt_param string requestId Optional. A request ID to identify requests.
|
---|
73 | * Specify a unique request ID so that if you must retry your request, the
|
---|
74 | * server knows to ignore the request if it has already been completed. The
|
---|
75 | * server guarantees that a request doesn't result in creation of duplicate
|
---|
76 | * commitments for at least 60 minutes. For example, consider a situation where
|
---|
77 | * you make an initial request and the request times out. If you make the
|
---|
78 | * request again with the same request ID, the server can check to see whether
|
---|
79 | * the original operation was received. If it was, the server ignores the second
|
---|
80 | * request. This behavior prevents clients from mistakenly creating duplicate
|
---|
81 | * commitments. The request ID must be a valid UUID, with the exception that
|
---|
82 | * zero UUID is not supported (00000000-0000-0000-0000-000000000000).
|
---|
83 | * @return GoogleLongrunningOperation
|
---|
84 | * @throws \Google\Service\Exception
|
---|
85 | */
|
---|
86 | public function delete($name, $optParams = [])
|
---|
87 | {
|
---|
88 | $params = ['name' => $name];
|
---|
89 | $params = array_merge($params, $optParams);
|
---|
90 | return $this->call('delete', [$params], GoogleLongrunningOperation::class);
|
---|
91 | }
|
---|
92 | /**
|
---|
93 | * Gets details about a Network Connectivity Center spoke. (spokes.get)
|
---|
94 | *
|
---|
95 | * @param string $name Required. The name of the spoke resource.
|
---|
96 | * @param array $optParams Optional parameters.
|
---|
97 | * @return Spoke
|
---|
98 | * @throws \Google\Service\Exception
|
---|
99 | */
|
---|
100 | public function get($name, $optParams = [])
|
---|
101 | {
|
---|
102 | $params = ['name' => $name];
|
---|
103 | $params = array_merge($params, $optParams);
|
---|
104 | return $this->call('get', [$params], Spoke::class);
|
---|
105 | }
|
---|
106 | /**
|
---|
107 | * Gets the access control policy for a resource. Returns an empty policy if the
|
---|
108 | * resource exists and does not have a policy set. (spokes.getIamPolicy)
|
---|
109 | *
|
---|
110 | * @param string $resource REQUIRED: The resource for which the policy is being
|
---|
111 | * requested. See [Resource
|
---|
112 | * names](https://cloud.google.com/apis/design/resource_names) for the
|
---|
113 | * appropriate value for this field.
|
---|
114 | * @param array $optParams Optional parameters.
|
---|
115 | *
|
---|
116 | * @opt_param int options.requestedPolicyVersion Optional. The maximum policy
|
---|
117 | * version that will be used to format the policy. Valid values are 0, 1, and 3.
|
---|
118 | * Requests specifying an invalid value will be rejected. Requests for policies
|
---|
119 | * with any conditional role bindings must specify version 3. Policies with no
|
---|
120 | * conditional role bindings may specify any valid value or leave the field
|
---|
121 | * unset. The policy in the response might use the policy version that you
|
---|
122 | * specified, or it might use a lower policy version. For example, if you
|
---|
123 | * specify version 3, but the policy has no conditional role bindings, the
|
---|
124 | * response uses version 1. To learn which resources support conditions in their
|
---|
125 | * IAM policies, see the [IAM
|
---|
126 | * documentation](https://cloud.google.com/iam/help/conditions/resource-
|
---|
127 | * policies).
|
---|
128 | * @return Policy
|
---|
129 | * @throws \Google\Service\Exception
|
---|
130 | */
|
---|
131 | public function getIamPolicy($resource, $optParams = [])
|
---|
132 | {
|
---|
133 | $params = ['resource' => $resource];
|
---|
134 | $params = array_merge($params, $optParams);
|
---|
135 | return $this->call('getIamPolicy', [$params], Policy::class);
|
---|
136 | }
|
---|
137 | /**
|
---|
138 | * Lists the Network Connectivity Center spokes in a specified project and
|
---|
139 | * location. (spokes.listProjectsLocationsSpokes)
|
---|
140 | *
|
---|
141 | * @param string $parent Required. The parent resource.
|
---|
142 | * @param array $optParams Optional parameters.
|
---|
143 | *
|
---|
144 | * @opt_param string filter An expression that filters the list of results.
|
---|
145 | * @opt_param string orderBy Sort the results by a certain order.
|
---|
146 | * @opt_param int pageSize The maximum number of results to return per page.
|
---|
147 | * @opt_param string pageToken The page token.
|
---|
148 | * @return ListSpokesResponse
|
---|
149 | * @throws \Google\Service\Exception
|
---|
150 | */
|
---|
151 | public function listProjectsLocationsSpokes($parent, $optParams = [])
|
---|
152 | {
|
---|
153 | $params = ['parent' => $parent];
|
---|
154 | $params = array_merge($params, $optParams);
|
---|
155 | return $this->call('list', [$params], ListSpokesResponse::class);
|
---|
156 | }
|
---|
157 | /**
|
---|
158 | * Updates the parameters of a Network Connectivity Center spoke. (spokes.patch)
|
---|
159 | *
|
---|
160 | * @param string $name Immutable. The name of the spoke. Spoke names must be
|
---|
161 | * unique. They use the following form:
|
---|
162 | * `projects/{project_number}/locations/{region}/spokes/{spoke_id}`
|
---|
163 | * @param Spoke $postBody
|
---|
164 | * @param array $optParams Optional parameters.
|
---|
165 | *
|
---|
166 | * @opt_param string requestId Optional. A request ID to identify requests.
|
---|
167 | * Specify a unique request ID so that if you must retry your request, the
|
---|
168 | * server knows to ignore the request if it has already been completed. The
|
---|
169 | * server guarantees that a request doesn't result in creation of duplicate
|
---|
170 | * commitments for at least 60 minutes. For example, consider a situation where
|
---|
171 | * you make an initial request and the request times out. If you make the
|
---|
172 | * request again with the same request ID, the server can check to see whether
|
---|
173 | * the original operation was received. If it was, the server ignores the second
|
---|
174 | * request. This behavior prevents clients from mistakenly creating duplicate
|
---|
175 | * commitments. The request ID must be a valid UUID, with the exception that
|
---|
176 | * zero UUID is not supported (00000000-0000-0000-0000-000000000000).
|
---|
177 | * @opt_param string updateMask Optional. In the case of an update to an
|
---|
178 | * existing spoke, field mask is used to specify the fields to be overwritten.
|
---|
179 | * The fields specified in the update_mask are relative to the resource, not the
|
---|
180 | * full request. A field is overwritten if it is in the mask. If the user does
|
---|
181 | * not provide a mask, then all fields are overwritten.
|
---|
182 | * @return GoogleLongrunningOperation
|
---|
183 | * @throws \Google\Service\Exception
|
---|
184 | */
|
---|
185 | public function patch($name, Spoke $postBody, $optParams = [])
|
---|
186 | {
|
---|
187 | $params = ['name' => $name, 'postBody' => $postBody];
|
---|
188 | $params = array_merge($params, $optParams);
|
---|
189 | return $this->call('patch', [$params], GoogleLongrunningOperation::class);
|
---|
190 | }
|
---|
191 | /**
|
---|
192 | * Sets the access control policy on the specified resource. Replaces any
|
---|
193 | * existing policy. Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and
|
---|
194 | * `PERMISSION_DENIED` errors. (spokes.setIamPolicy)
|
---|
195 | *
|
---|
196 | * @param string $resource REQUIRED: The resource for which the policy is being
|
---|
197 | * specified. See [Resource
|
---|
198 | * names](https://cloud.google.com/apis/design/resource_names) for the
|
---|
199 | * appropriate value for this field.
|
---|
200 | * @param SetIamPolicyRequest $postBody
|
---|
201 | * @param array $optParams Optional parameters.
|
---|
202 | * @return Policy
|
---|
203 | * @throws \Google\Service\Exception
|
---|
204 | */
|
---|
205 | public function setIamPolicy($resource, SetIamPolicyRequest $postBody, $optParams = [])
|
---|
206 | {
|
---|
207 | $params = ['resource' => $resource, 'postBody' => $postBody];
|
---|
208 | $params = array_merge($params, $optParams);
|
---|
209 | return $this->call('setIamPolicy', [$params], Policy::class);
|
---|
210 | }
|
---|
211 | /**
|
---|
212 | * Returns permissions that a caller has on the specified resource. If the
|
---|
213 | * resource does not exist, this will return an empty set of permissions, not a
|
---|
214 | * `NOT_FOUND` error. Note: This operation is designed to be used for building
|
---|
215 | * permission-aware UIs and command-line tools, not for authorization checking.
|
---|
216 | * This operation may "fail open" without warning. (spokes.testIamPermissions)
|
---|
217 | *
|
---|
218 | * @param string $resource REQUIRED: The resource for which the policy detail is
|
---|
219 | * being requested. See [Resource
|
---|
220 | * names](https://cloud.google.com/apis/design/resource_names) for the
|
---|
221 | * appropriate value for this field.
|
---|
222 | * @param TestIamPermissionsRequest $postBody
|
---|
223 | * @param array $optParams Optional parameters.
|
---|
224 | * @return TestIamPermissionsResponse
|
---|
225 | * @throws \Google\Service\Exception
|
---|
226 | */
|
---|
227 | public function testIamPermissions($resource, TestIamPermissionsRequest $postBody, $optParams = [])
|
---|
228 | {
|
---|
229 | $params = ['resource' => $resource, 'postBody' => $postBody];
|
---|
230 | $params = array_merge($params, $optParams);
|
---|
231 | return $this->call('testIamPermissions', [$params], TestIamPermissionsResponse::class);
|
---|
232 | }
|
---|
233 | }
|
---|
234 |
|
---|
235 | // Adding a class alias for backwards compatibility with the previous class name.
|
---|
236 | class_alias(ProjectsLocationsSpokes::class, 'Google_Service_Networkconnectivity_Resource_ProjectsLocationsSpokes');
|
---|