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