[e3d4e0a] | 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\Apigateway\Resource;
|
---|
| 19 |
|
---|
| 20 | use Google\Service\Apigateway\ApigatewayGateway;
|
---|
| 21 | use Google\Service\Apigateway\ApigatewayListGatewaysResponse;
|
---|
| 22 | use Google\Service\Apigateway\ApigatewayOperation;
|
---|
| 23 | use Google\Service\Apigateway\ApigatewayPolicy;
|
---|
| 24 | use Google\Service\Apigateway\ApigatewaySetIamPolicyRequest;
|
---|
| 25 | use Google\Service\Apigateway\ApigatewayTestIamPermissionsRequest;
|
---|
| 26 | use Google\Service\Apigateway\ApigatewayTestIamPermissionsResponse;
|
---|
| 27 |
|
---|
| 28 | /**
|
---|
| 29 | * The "gateways" collection of methods.
|
---|
| 30 | * Typical usage is:
|
---|
| 31 | * <code>
|
---|
| 32 | * $apigatewayService = new Google\Service\Apigateway(...);
|
---|
| 33 | * $gateways = $apigatewayService->projects_locations_gateways;
|
---|
| 34 | * </code>
|
---|
| 35 | */
|
---|
| 36 | class ProjectsLocationsGateways extends \Google\Service\Resource
|
---|
| 37 | {
|
---|
| 38 | /**
|
---|
| 39 | * Creates a new Gateway in a given project and location. (gateways.create)
|
---|
| 40 | *
|
---|
| 41 | * @param string $parent Required. Parent resource of the Gateway, of the form:
|
---|
| 42 | * `projects/locations`
|
---|
| 43 | * @param ApigatewayGateway $postBody
|
---|
| 44 | * @param array $optParams Optional parameters.
|
---|
| 45 | *
|
---|
| 46 | * @opt_param string gatewayId Required. Identifier to assign to the Gateway.
|
---|
| 47 | * Must be unique within scope of the parent resource.
|
---|
| 48 | * @return ApigatewayOperation
|
---|
| 49 | * @throws \Google\Service\Exception
|
---|
| 50 | */
|
---|
| 51 | public function create($parent, ApigatewayGateway $postBody, $optParams = [])
|
---|
| 52 | {
|
---|
| 53 | $params = ['parent' => $parent, 'postBody' => $postBody];
|
---|
| 54 | $params = array_merge($params, $optParams);
|
---|
| 55 | return $this->call('create', [$params], ApigatewayOperation::class);
|
---|
| 56 | }
|
---|
| 57 | /**
|
---|
| 58 | * Deletes a single Gateway. (gateways.delete)
|
---|
| 59 | *
|
---|
| 60 | * @param string $name Required. Resource name of the form:
|
---|
| 61 | * `projects/locations/gateways`
|
---|
| 62 | * @param array $optParams Optional parameters.
|
---|
| 63 | * @return ApigatewayOperation
|
---|
| 64 | * @throws \Google\Service\Exception
|
---|
| 65 | */
|
---|
| 66 | public function delete($name, $optParams = [])
|
---|
| 67 | {
|
---|
| 68 | $params = ['name' => $name];
|
---|
| 69 | $params = array_merge($params, $optParams);
|
---|
| 70 | return $this->call('delete', [$params], ApigatewayOperation::class);
|
---|
| 71 | }
|
---|
| 72 | /**
|
---|
| 73 | * Gets details of a single Gateway. (gateways.get)
|
---|
| 74 | *
|
---|
| 75 | * @param string $name Required. Resource name of the form:
|
---|
| 76 | * `projects/locations/gateways`
|
---|
| 77 | * @param array $optParams Optional parameters.
|
---|
| 78 | * @return ApigatewayGateway
|
---|
| 79 | * @throws \Google\Service\Exception
|
---|
| 80 | */
|
---|
| 81 | public function get($name, $optParams = [])
|
---|
| 82 | {
|
---|
| 83 | $params = ['name' => $name];
|
---|
| 84 | $params = array_merge($params, $optParams);
|
---|
| 85 | return $this->call('get', [$params], ApigatewayGateway::class);
|
---|
| 86 | }
|
---|
| 87 | /**
|
---|
| 88 | * Gets the access control policy for a resource. Returns an empty policy if the
|
---|
| 89 | * resource exists and does not have a policy set. (gateways.getIamPolicy)
|
---|
| 90 | *
|
---|
| 91 | * @param string $resource REQUIRED: The resource for which the policy is being
|
---|
| 92 | * requested. See [Resource
|
---|
| 93 | * names](https://cloud.google.com/apis/design/resource_names) for the
|
---|
| 94 | * appropriate value for this field.
|
---|
| 95 | * @param array $optParams Optional parameters.
|
---|
| 96 | *
|
---|
| 97 | * @opt_param int options.requestedPolicyVersion Optional. The maximum policy
|
---|
| 98 | * version that will be used to format the policy. Valid values are 0, 1, and 3.
|
---|
| 99 | * Requests specifying an invalid value will be rejected. Requests for policies
|
---|
| 100 | * with any conditional role bindings must specify version 3. Policies with no
|
---|
| 101 | * conditional role bindings may specify any valid value or leave the field
|
---|
| 102 | * unset. The policy in the response might use the policy version that you
|
---|
| 103 | * specified, or it might use a lower policy version. For example, if you
|
---|
| 104 | * specify version 3, but the policy has no conditional role bindings, the
|
---|
| 105 | * response uses version 1. To learn which resources support conditions in their
|
---|
| 106 | * IAM policies, see the [IAM
|
---|
| 107 | * documentation](https://cloud.google.com/iam/help/conditions/resource-
|
---|
| 108 | * policies).
|
---|
| 109 | * @return ApigatewayPolicy
|
---|
| 110 | * @throws \Google\Service\Exception
|
---|
| 111 | */
|
---|
| 112 | public function getIamPolicy($resource, $optParams = [])
|
---|
| 113 | {
|
---|
| 114 | $params = ['resource' => $resource];
|
---|
| 115 | $params = array_merge($params, $optParams);
|
---|
| 116 | return $this->call('getIamPolicy', [$params], ApigatewayPolicy::class);
|
---|
| 117 | }
|
---|
| 118 | /**
|
---|
| 119 | * Lists Gateways in a given project and location.
|
---|
| 120 | * (gateways.listProjectsLocationsGateways)
|
---|
| 121 | *
|
---|
| 122 | * @param string $parent Required. Parent resource of the Gateway, of the form:
|
---|
| 123 | * `projects/locations`
|
---|
| 124 | * @param array $optParams Optional parameters.
|
---|
| 125 | *
|
---|
| 126 | * @opt_param string filter Filter.
|
---|
| 127 | * @opt_param string orderBy Order by parameters.
|
---|
| 128 | * @opt_param int pageSize Page size.
|
---|
| 129 | * @opt_param string pageToken Page token.
|
---|
| 130 | * @return ApigatewayListGatewaysResponse
|
---|
| 131 | * @throws \Google\Service\Exception
|
---|
| 132 | */
|
---|
| 133 | public function listProjectsLocationsGateways($parent, $optParams = [])
|
---|
| 134 | {
|
---|
| 135 | $params = ['parent' => $parent];
|
---|
| 136 | $params = array_merge($params, $optParams);
|
---|
| 137 | return $this->call('list', [$params], ApigatewayListGatewaysResponse::class);
|
---|
| 138 | }
|
---|
| 139 | /**
|
---|
| 140 | * Updates the parameters of a single Gateway. (gateways.patch)
|
---|
| 141 | *
|
---|
| 142 | * @param string $name Output only. Resource name of the Gateway. Format:
|
---|
| 143 | * projects/{project}/locations/{location}/gateways/{gateway}
|
---|
| 144 | * @param ApigatewayGateway $postBody
|
---|
| 145 | * @param array $optParams Optional parameters.
|
---|
| 146 | *
|
---|
| 147 | * @opt_param string updateMask Field mask is used to specify the fields to be
|
---|
| 148 | * overwritten in the Gateway resource by the update. The fields specified in
|
---|
| 149 | * the update_mask are relative to the resource, not the full request. A field
|
---|
| 150 | * will be overwritten if it is in the mask. If the user does not provide a mask
|
---|
| 151 | * then all fields will be overwritten.
|
---|
| 152 | * @return ApigatewayOperation
|
---|
| 153 | * @throws \Google\Service\Exception
|
---|
| 154 | */
|
---|
| 155 | public function patch($name, ApigatewayGateway $postBody, $optParams = [])
|
---|
| 156 | {
|
---|
| 157 | $params = ['name' => $name, 'postBody' => $postBody];
|
---|
| 158 | $params = array_merge($params, $optParams);
|
---|
| 159 | return $this->call('patch', [$params], ApigatewayOperation::class);
|
---|
| 160 | }
|
---|
| 161 | /**
|
---|
| 162 | * Sets the access control policy on the specified resource. Replaces any
|
---|
| 163 | * existing policy. Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and
|
---|
| 164 | * `PERMISSION_DENIED` errors. (gateways.setIamPolicy)
|
---|
| 165 | *
|
---|
| 166 | * @param string $resource REQUIRED: The resource for which the policy is being
|
---|
| 167 | * specified. See [Resource
|
---|
| 168 | * names](https://cloud.google.com/apis/design/resource_names) for the
|
---|
| 169 | * appropriate value for this field.
|
---|
| 170 | * @param ApigatewaySetIamPolicyRequest $postBody
|
---|
| 171 | * @param array $optParams Optional parameters.
|
---|
| 172 | * @return ApigatewayPolicy
|
---|
| 173 | * @throws \Google\Service\Exception
|
---|
| 174 | */
|
---|
| 175 | public function setIamPolicy($resource, ApigatewaySetIamPolicyRequest $postBody, $optParams = [])
|
---|
| 176 | {
|
---|
| 177 | $params = ['resource' => $resource, 'postBody' => $postBody];
|
---|
| 178 | $params = array_merge($params, $optParams);
|
---|
| 179 | return $this->call('setIamPolicy', [$params], ApigatewayPolicy::class);
|
---|
| 180 | }
|
---|
| 181 | /**
|
---|
| 182 | * Returns permissions that a caller has on the specified resource. If the
|
---|
| 183 | * resource does not exist, this will return an empty set of permissions, not a
|
---|
| 184 | * `NOT_FOUND` error. Note: This operation is designed to be used for building
|
---|
| 185 | * permission-aware UIs and command-line tools, not for authorization checking.
|
---|
| 186 | * This operation may "fail open" without warning. (gateways.testIamPermissions)
|
---|
| 187 | *
|
---|
| 188 | * @param string $resource REQUIRED: The resource for which the policy detail is
|
---|
| 189 | * being requested. See [Resource
|
---|
| 190 | * names](https://cloud.google.com/apis/design/resource_names) for the
|
---|
| 191 | * appropriate value for this field.
|
---|
| 192 | * @param ApigatewayTestIamPermissionsRequest $postBody
|
---|
| 193 | * @param array $optParams Optional parameters.
|
---|
| 194 | * @return ApigatewayTestIamPermissionsResponse
|
---|
| 195 | * @throws \Google\Service\Exception
|
---|
| 196 | */
|
---|
| 197 | public function testIamPermissions($resource, ApigatewayTestIamPermissionsRequest $postBody, $optParams = [])
|
---|
| 198 | {
|
---|
| 199 | $params = ['resource' => $resource, 'postBody' => $postBody];
|
---|
| 200 | $params = array_merge($params, $optParams);
|
---|
| 201 | return $this->call('testIamPermissions', [$params], ApigatewayTestIamPermissionsResponse::class);
|
---|
| 202 | }
|
---|
| 203 | }
|
---|
| 204 |
|
---|
| 205 | // Adding a class alias for backwards compatibility with the previous class name.
|
---|
| 206 | class_alias(ProjectsLocationsGateways::class, 'Google_Service_Apigateway_Resource_ProjectsLocationsGateways');
|
---|