[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\ApigatewayApiConfig;
|
---|
| 21 | use Google\Service\Apigateway\ApigatewayListApiConfigsResponse;
|
---|
| 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 "configs" collection of methods.
|
---|
| 30 | * Typical usage is:
|
---|
| 31 | * <code>
|
---|
| 32 | * $apigatewayService = new Google\Service\Apigateway(...);
|
---|
| 33 | * $configs = $apigatewayService->projects_locations_apis_configs;
|
---|
| 34 | * </code>
|
---|
| 35 | */
|
---|
| 36 | class ProjectsLocationsApisConfigs extends \Google\Service\Resource
|
---|
| 37 | {
|
---|
| 38 | /**
|
---|
| 39 | * Creates a new ApiConfig in a given project and location. (configs.create)
|
---|
| 40 | *
|
---|
| 41 | * @param string $parent Required. Parent resource of the API Config, of the
|
---|
| 42 | * form: `projects/locations/global/apis`
|
---|
| 43 | * @param ApigatewayApiConfig $postBody
|
---|
| 44 | * @param array $optParams Optional parameters.
|
---|
| 45 | *
|
---|
| 46 | * @opt_param string apiConfigId Required. Identifier to assign to the API
|
---|
| 47 | * Config. Must be unique within scope of the parent resource.
|
---|
| 48 | * @return ApigatewayOperation
|
---|
| 49 | * @throws \Google\Service\Exception
|
---|
| 50 | */
|
---|
| 51 | public function create($parent, ApigatewayApiConfig $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 ApiConfig. (configs.delete)
|
---|
| 59 | *
|
---|
| 60 | * @param string $name Required. Resource name of the form:
|
---|
| 61 | * `projects/locations/global/apis/configs`
|
---|
| 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 ApiConfig. (configs.get)
|
---|
| 74 | *
|
---|
| 75 | * @param string $name Required. Resource name of the form:
|
---|
| 76 | * `projects/locations/global/apis/configs`
|
---|
| 77 | * @param array $optParams Optional parameters.
|
---|
| 78 | *
|
---|
| 79 | * @opt_param string view Specifies which fields of the API Config are returned
|
---|
| 80 | * in the response. Defaults to `BASIC` view.
|
---|
| 81 | * @return ApigatewayApiConfig
|
---|
| 82 | * @throws \Google\Service\Exception
|
---|
| 83 | */
|
---|
| 84 | public function get($name, $optParams = [])
|
---|
| 85 | {
|
---|
| 86 | $params = ['name' => $name];
|
---|
| 87 | $params = array_merge($params, $optParams);
|
---|
| 88 | return $this->call('get', [$params], ApigatewayApiConfig::class);
|
---|
| 89 | }
|
---|
| 90 | /**
|
---|
| 91 | * Gets the access control policy for a resource. Returns an empty policy if the
|
---|
| 92 | * resource exists and does not have a policy set. (configs.getIamPolicy)
|
---|
| 93 | *
|
---|
| 94 | * @param string $resource REQUIRED: The resource for which the policy is being
|
---|
| 95 | * requested. See [Resource
|
---|
| 96 | * names](https://cloud.google.com/apis/design/resource_names) for the
|
---|
| 97 | * appropriate value for this field.
|
---|
| 98 | * @param array $optParams Optional parameters.
|
---|
| 99 | *
|
---|
| 100 | * @opt_param int options.requestedPolicyVersion Optional. The maximum policy
|
---|
| 101 | * version that will be used to format the policy. Valid values are 0, 1, and 3.
|
---|
| 102 | * Requests specifying an invalid value will be rejected. Requests for policies
|
---|
| 103 | * with any conditional role bindings must specify version 3. Policies with no
|
---|
| 104 | * conditional role bindings may specify any valid value or leave the field
|
---|
| 105 | * unset. The policy in the response might use the policy version that you
|
---|
| 106 | * specified, or it might use a lower policy version. For example, if you
|
---|
| 107 | * specify version 3, but the policy has no conditional role bindings, the
|
---|
| 108 | * response uses version 1. To learn which resources support conditions in their
|
---|
| 109 | * IAM policies, see the [IAM
|
---|
| 110 | * documentation](https://cloud.google.com/iam/help/conditions/resource-
|
---|
| 111 | * policies).
|
---|
| 112 | * @return ApigatewayPolicy
|
---|
| 113 | * @throws \Google\Service\Exception
|
---|
| 114 | */
|
---|
| 115 | public function getIamPolicy($resource, $optParams = [])
|
---|
| 116 | {
|
---|
| 117 | $params = ['resource' => $resource];
|
---|
| 118 | $params = array_merge($params, $optParams);
|
---|
| 119 | return $this->call('getIamPolicy', [$params], ApigatewayPolicy::class);
|
---|
| 120 | }
|
---|
| 121 | /**
|
---|
| 122 | * Lists ApiConfigs in a given project and location.
|
---|
| 123 | * (configs.listProjectsLocationsApisConfigs)
|
---|
| 124 | *
|
---|
| 125 | * @param string $parent Required. Parent resource of the API Config, of the
|
---|
| 126 | * form: `projects/locations/global/apis`
|
---|
| 127 | * @param array $optParams Optional parameters.
|
---|
| 128 | *
|
---|
| 129 | * @opt_param string filter Filter.
|
---|
| 130 | * @opt_param string orderBy Order by parameters.
|
---|
| 131 | * @opt_param int pageSize Page size.
|
---|
| 132 | * @opt_param string pageToken Page token.
|
---|
| 133 | * @return ApigatewayListApiConfigsResponse
|
---|
| 134 | * @throws \Google\Service\Exception
|
---|
| 135 | */
|
---|
| 136 | public function listProjectsLocationsApisConfigs($parent, $optParams = [])
|
---|
| 137 | {
|
---|
| 138 | $params = ['parent' => $parent];
|
---|
| 139 | $params = array_merge($params, $optParams);
|
---|
| 140 | return $this->call('list', [$params], ApigatewayListApiConfigsResponse::class);
|
---|
| 141 | }
|
---|
| 142 | /**
|
---|
| 143 | * Updates the parameters of a single ApiConfig. (configs.patch)
|
---|
| 144 | *
|
---|
| 145 | * @param string $name Output only. Resource name of the API Config. Format:
|
---|
| 146 | * projects/{project}/locations/global/apis/{api}/configs/{api_config}
|
---|
| 147 | * @param ApigatewayApiConfig $postBody
|
---|
| 148 | * @param array $optParams Optional parameters.
|
---|
| 149 | *
|
---|
| 150 | * @opt_param string updateMask Field mask is used to specify the fields to be
|
---|
| 151 | * overwritten in the ApiConfig resource by the update. The fields specified in
|
---|
| 152 | * the update_mask are relative to the resource, not the full request. A field
|
---|
| 153 | * will be overwritten if it is in the mask. If the user does not provide a mask
|
---|
| 154 | * then all fields will be overwritten.
|
---|
| 155 | * @return ApigatewayOperation
|
---|
| 156 | * @throws \Google\Service\Exception
|
---|
| 157 | */
|
---|
| 158 | public function patch($name, ApigatewayApiConfig $postBody, $optParams = [])
|
---|
| 159 | {
|
---|
| 160 | $params = ['name' => $name, 'postBody' => $postBody];
|
---|
| 161 | $params = array_merge($params, $optParams);
|
---|
| 162 | return $this->call('patch', [$params], ApigatewayOperation::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. (configs.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 ApigatewaySetIamPolicyRequest $postBody
|
---|
| 174 | * @param array $optParams Optional parameters.
|
---|
| 175 | * @return ApigatewayPolicy
|
---|
| 176 | * @throws \Google\Service\Exception
|
---|
| 177 | */
|
---|
| 178 | public function setIamPolicy($resource, ApigatewaySetIamPolicyRequest $postBody, $optParams = [])
|
---|
| 179 | {
|
---|
| 180 | $params = ['resource' => $resource, 'postBody' => $postBody];
|
---|
| 181 | $params = array_merge($params, $optParams);
|
---|
| 182 | return $this->call('setIamPolicy', [$params], ApigatewayPolicy::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. (configs.testIamPermissions)
|
---|
| 190 | *
|
---|
| 191 | * @param string $resource REQUIRED: The resource for which the policy detail is
|
---|
| 192 | * being requested. See [Resource
|
---|
| 193 | * names](https://cloud.google.com/apis/design/resource_names) for the
|
---|
| 194 | * appropriate value for this field.
|
---|
| 195 | * @param ApigatewayTestIamPermissionsRequest $postBody
|
---|
| 196 | * @param array $optParams Optional parameters.
|
---|
| 197 | * @return ApigatewayTestIamPermissionsResponse
|
---|
| 198 | * @throws \Google\Service\Exception
|
---|
| 199 | */
|
---|
| 200 | public function testIamPermissions($resource, ApigatewayTestIamPermissionsRequest $postBody, $optParams = [])
|
---|
| 201 | {
|
---|
| 202 | $params = ['resource' => $resource, 'postBody' => $postBody];
|
---|
| 203 | $params = array_merge($params, $optParams);
|
---|
| 204 | return $this->call('testIamPermissions', [$params], ApigatewayTestIamPermissionsResponse::class);
|
---|
| 205 | }
|
---|
| 206 | }
|
---|
| 207 |
|
---|
| 208 | // Adding a class alias for backwards compatibility with the previous class name.
|
---|
| 209 | class_alias(ProjectsLocationsApisConfigs::class, 'Google_Service_Apigateway_Resource_ProjectsLocationsApisConfigs');
|
---|