source: vendor/google/apiclient-services/src/Networkconnectivity/Resource/ProjectsLocationsServiceConnectionPolicies.php@ f9c482b

Last change on this file since f9c482b was f9c482b, checked in by Vlado 222039 <vlado.popovski@…>, 10 days ago

Upload new project files

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