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