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\BeyondCorp\Resource;
|
---|
19 |
|
---|
20 | use Google\Service\BeyondCorp\AppGateway;
|
---|
21 | use Google\Service\BeyondCorp\GoogleIamV1Policy;
|
---|
22 | use Google\Service\BeyondCorp\GoogleIamV1SetIamPolicyRequest;
|
---|
23 | use Google\Service\BeyondCorp\GoogleIamV1TestIamPermissionsRequest;
|
---|
24 | use Google\Service\BeyondCorp\GoogleIamV1TestIamPermissionsResponse;
|
---|
25 | use Google\Service\BeyondCorp\GoogleLongrunningOperation;
|
---|
26 | use Google\Service\BeyondCorp\ListAppGatewaysResponse;
|
---|
27 | use Google\Service\BeyondCorp\ShouldThrottleResponse;
|
---|
28 |
|
---|
29 | /**
|
---|
30 | * The "appGateways" collection of methods.
|
---|
31 | * Typical usage is:
|
---|
32 | * <code>
|
---|
33 | * $beyondcorpService = new Google\Service\BeyondCorp(...);
|
---|
34 | * $appGateways = $beyondcorpService->projects_locations_appGateways;
|
---|
35 | * </code>
|
---|
36 | */
|
---|
37 | class ProjectsLocationsAppGateways extends \Google\Service\Resource
|
---|
38 | {
|
---|
39 | /**
|
---|
40 | * Creates a new AppGateway in a given project and location.
|
---|
41 | * (appGateways.create)
|
---|
42 | *
|
---|
43 | * @param string $parent Required. The resource project name of the AppGateway
|
---|
44 | * location using the form: `projects/{project_id}/locations/{location_id}`
|
---|
45 | * @param AppGateway $postBody
|
---|
46 | * @param array $optParams Optional parameters.
|
---|
47 | *
|
---|
48 | * @opt_param string appGatewayId Optional. User-settable AppGateway resource
|
---|
49 | * ID. * Must start with a letter. * Must contain between 4-63 characters from
|
---|
50 | * `/a-z-/`. * Must end with a number or a letter.
|
---|
51 | * @opt_param string requestId Optional. An optional request ID to identify
|
---|
52 | * requests. Specify a unique request ID so that if you must retry your request,
|
---|
53 | * the server will know to ignore the request if it has already been completed.
|
---|
54 | * The server will guarantee that for at least 60 minutes since the first
|
---|
55 | * request. For example, consider a situation where you make an initial request
|
---|
56 | * and the request times out. If you make the request again with the same
|
---|
57 | * request ID, the server can check if original operation with the same request
|
---|
58 | * ID was received, and if so, will ignore the second request. This prevents
|
---|
59 | * clients from accidentally creating duplicate commitments. The request ID must
|
---|
60 | * be a valid UUID with the exception that zero UUID is not supported
|
---|
61 | * (00000000-0000-0000-0000-000000000000).
|
---|
62 | * @opt_param bool validateOnly Optional. If set, validates request by executing
|
---|
63 | * a dry-run which would not alter the resource in any way.
|
---|
64 | * @return GoogleLongrunningOperation
|
---|
65 | * @throws \Google\Service\Exception
|
---|
66 | */
|
---|
67 | public function create($parent, AppGateway $postBody, $optParams = [])
|
---|
68 | {
|
---|
69 | $params = ['parent' => $parent, 'postBody' => $postBody];
|
---|
70 | $params = array_merge($params, $optParams);
|
---|
71 | return $this->call('create', [$params], GoogleLongrunningOperation::class);
|
---|
72 | }
|
---|
73 | /**
|
---|
74 | * Deletes a single AppGateway. (appGateways.delete)
|
---|
75 | *
|
---|
76 | * @param string $name Required. BeyondCorp AppGateway name using the form:
|
---|
77 | * `projects/{project_id}/locations/{location_id}/appGateways/{app_gateway_id}`
|
---|
78 | * @param array $optParams Optional parameters.
|
---|
79 | *
|
---|
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 | * @opt_param bool validateOnly Optional. If set, validates request by executing
|
---|
92 | * a dry-run which would not alter the resource in any way.
|
---|
93 | * @return GoogleLongrunningOperation
|
---|
94 | * @throws \Google\Service\Exception
|
---|
95 | */
|
---|
96 | public function delete($name, $optParams = [])
|
---|
97 | {
|
---|
98 | $params = ['name' => $name];
|
---|
99 | $params = array_merge($params, $optParams);
|
---|
100 | return $this->call('delete', [$params], GoogleLongrunningOperation::class);
|
---|
101 | }
|
---|
102 | /**
|
---|
103 | * Gets details of a single AppGateway. (appGateways.get)
|
---|
104 | *
|
---|
105 | * @param string $name Required. BeyondCorp AppGateway name using the form:
|
---|
106 | * `projects/{project_id}/locations/{location_id}/appGateways/{app_gateway_id}`
|
---|
107 | * @param array $optParams Optional parameters.
|
---|
108 | * @return AppGateway
|
---|
109 | * @throws \Google\Service\Exception
|
---|
110 | */
|
---|
111 | public function get($name, $optParams = [])
|
---|
112 | {
|
---|
113 | $params = ['name' => $name];
|
---|
114 | $params = array_merge($params, $optParams);
|
---|
115 | return $this->call('get', [$params], AppGateway::class);
|
---|
116 | }
|
---|
117 | /**
|
---|
118 | * Gets the access control policy for a resource. Returns an empty policy if the
|
---|
119 | * resource exists and does not have a policy set. (appGateways.getIamPolicy)
|
---|
120 | *
|
---|
121 | * @param string $resource REQUIRED: The resource for which the policy is being
|
---|
122 | * requested. See [Resource
|
---|
123 | * names](https://cloud.google.com/apis/design/resource_names) for the
|
---|
124 | * appropriate value for this field.
|
---|
125 | * @param array $optParams Optional parameters.
|
---|
126 | *
|
---|
127 | * @opt_param int options.requestedPolicyVersion Optional. The maximum policy
|
---|
128 | * version that will be used to format the policy. Valid values are 0, 1, and 3.
|
---|
129 | * Requests specifying an invalid value will be rejected. Requests for policies
|
---|
130 | * with any conditional role bindings must specify version 3. Policies with no
|
---|
131 | * conditional role bindings may specify any valid value or leave the field
|
---|
132 | * unset. The policy in the response might use the policy version that you
|
---|
133 | * specified, or it might use a lower policy version. For example, if you
|
---|
134 | * specify version 3, but the policy has no conditional role bindings, the
|
---|
135 | * response uses version 1. To learn which resources support conditions in their
|
---|
136 | * IAM policies, see the [IAM
|
---|
137 | * documentation](https://cloud.google.com/iam/help/conditions/resource-
|
---|
138 | * policies).
|
---|
139 | * @return GoogleIamV1Policy
|
---|
140 | * @throws \Google\Service\Exception
|
---|
141 | */
|
---|
142 | public function getIamPolicy($resource, $optParams = [])
|
---|
143 | {
|
---|
144 | $params = ['resource' => $resource];
|
---|
145 | $params = array_merge($params, $optParams);
|
---|
146 | return $this->call('getIamPolicy', [$params], GoogleIamV1Policy::class);
|
---|
147 | }
|
---|
148 | /**
|
---|
149 | * Lists AppGateways in a given project and location.
|
---|
150 | * (appGateways.listProjectsLocationsAppGateways)
|
---|
151 | *
|
---|
152 | * @param string $parent Required. The resource name of the AppGateway location
|
---|
153 | * using the form: `projects/{project_id}/locations/{location_id}`
|
---|
154 | * @param array $optParams Optional parameters.
|
---|
155 | *
|
---|
156 | * @opt_param string filter Optional. A filter specifying constraints of a list
|
---|
157 | * operation.
|
---|
158 | * @opt_param string orderBy Optional. Specifies the ordering of results. See
|
---|
159 | * [Sorting
|
---|
160 | * order](https://cloud.google.com/apis/design/design_patterns#sorting_order)
|
---|
161 | * for more information.
|
---|
162 | * @opt_param int pageSize Optional. The maximum number of items to return. If
|
---|
163 | * not specified, a default value of 50 will be used by the service. Regardless
|
---|
164 | * of the page_size value, the response may include a partial list and a caller
|
---|
165 | * should only rely on response's next_page_token to determine if there are more
|
---|
166 | * instances left to be queried.
|
---|
167 | * @opt_param string pageToken Optional. The next_page_token value returned from
|
---|
168 | * a previous ListAppGatewaysRequest, if any.
|
---|
169 | * @return ListAppGatewaysResponse
|
---|
170 | * @throws \Google\Service\Exception
|
---|
171 | */
|
---|
172 | public function listProjectsLocationsAppGateways($parent, $optParams = [])
|
---|
173 | {
|
---|
174 | $params = ['parent' => $parent];
|
---|
175 | $params = array_merge($params, $optParams);
|
---|
176 | return $this->call('list', [$params], ListAppGatewaysResponse::class);
|
---|
177 | }
|
---|
178 | /**
|
---|
179 | * Sets the access control policy on the specified resource. Replaces any
|
---|
180 | * existing policy. Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and
|
---|
181 | * `PERMISSION_DENIED` errors. (appGateways.setIamPolicy)
|
---|
182 | *
|
---|
183 | * @param string $resource REQUIRED: The resource for which the policy is being
|
---|
184 | * specified. See [Resource
|
---|
185 | * names](https://cloud.google.com/apis/design/resource_names) for the
|
---|
186 | * appropriate value for this field.
|
---|
187 | * @param GoogleIamV1SetIamPolicyRequest $postBody
|
---|
188 | * @param array $optParams Optional parameters.
|
---|
189 | * @return GoogleIamV1Policy
|
---|
190 | * @throws \Google\Service\Exception
|
---|
191 | */
|
---|
192 | public function setIamPolicy($resource, GoogleIamV1SetIamPolicyRequest $postBody, $optParams = [])
|
---|
193 | {
|
---|
194 | $params = ['resource' => $resource, 'postBody' => $postBody];
|
---|
195 | $params = array_merge($params, $optParams);
|
---|
196 | return $this->call('setIamPolicy', [$params], GoogleIamV1Policy::class);
|
---|
197 | }
|
---|
198 | /**
|
---|
199 | * Calls the Bouncer method ShouldThrottle to check if a request should be
|
---|
200 | * throttled. (appGateways.shouldThrottle)
|
---|
201 | *
|
---|
202 | * @param string $name Required. Name of the resource
|
---|
203 | * @param array $optParams Optional parameters.
|
---|
204 | *
|
---|
205 | * @opt_param int port Optional. The port that is being throttled
|
---|
206 | * @opt_param string requestedAmount Optional. The current throughput through
|
---|
207 | * the port (mbps)
|
---|
208 | * @return ShouldThrottleResponse
|
---|
209 | * @throws \Google\Service\Exception
|
---|
210 | */
|
---|
211 | public function shouldThrottle($name, $optParams = [])
|
---|
212 | {
|
---|
213 | $params = ['name' => $name];
|
---|
214 | $params = array_merge($params, $optParams);
|
---|
215 | return $this->call('shouldThrottle', [$params], ShouldThrottleResponse::class);
|
---|
216 | }
|
---|
217 | /**
|
---|
218 | * Returns permissions that a caller has on the specified resource. If the
|
---|
219 | * resource does not exist, this will return an empty set of permissions, not a
|
---|
220 | * `NOT_FOUND` error. Note: This operation is designed to be used for building
|
---|
221 | * permission-aware UIs and command-line tools, not for authorization checking.
|
---|
222 | * This operation may "fail open" without warning.
|
---|
223 | * (appGateways.testIamPermissions)
|
---|
224 | *
|
---|
225 | * @param string $resource REQUIRED: The resource for which the policy detail is
|
---|
226 | * being requested. See [Resource
|
---|
227 | * names](https://cloud.google.com/apis/design/resource_names) for the
|
---|
228 | * appropriate value for this field.
|
---|
229 | * @param GoogleIamV1TestIamPermissionsRequest $postBody
|
---|
230 | * @param array $optParams Optional parameters.
|
---|
231 | * @return GoogleIamV1TestIamPermissionsResponse
|
---|
232 | * @throws \Google\Service\Exception
|
---|
233 | */
|
---|
234 | public function testIamPermissions($resource, GoogleIamV1TestIamPermissionsRequest $postBody, $optParams = [])
|
---|
235 | {
|
---|
236 | $params = ['resource' => $resource, 'postBody' => $postBody];
|
---|
237 | $params = array_merge($params, $optParams);
|
---|
238 | return $this->call('testIamPermissions', [$params], GoogleIamV1TestIamPermissionsResponse::class);
|
---|
239 | }
|
---|
240 | }
|
---|
241 |
|
---|
242 | // Adding a class alias for backwards compatibility with the previous class name.
|
---|
243 | class_alias(ProjectsLocationsAppGateways::class, 'Google_Service_BeyondCorp_Resource_ProjectsLocationsAppGateways');
|
---|