[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\GKEHub\Resource;
|
---|
| 19 |
|
---|
| 20 | use Google\Service\GKEHub\Feature;
|
---|
| 21 | use Google\Service\GKEHub\ListFeaturesResponse;
|
---|
| 22 | use Google\Service\GKEHub\Operation;
|
---|
| 23 | use Google\Service\GKEHub\Policy;
|
---|
| 24 | use Google\Service\GKEHub\SetIamPolicyRequest;
|
---|
| 25 | use Google\Service\GKEHub\TestIamPermissionsRequest;
|
---|
| 26 | use Google\Service\GKEHub\TestIamPermissionsResponse;
|
---|
| 27 |
|
---|
| 28 | /**
|
---|
| 29 | * The "features" collection of methods.
|
---|
| 30 | * Typical usage is:
|
---|
| 31 | * <code>
|
---|
| 32 | * $gkehubService = new Google\Service\GKEHub(...);
|
---|
| 33 | * $features = $gkehubService->projects_locations_features;
|
---|
| 34 | * </code>
|
---|
| 35 | */
|
---|
| 36 | class ProjectsLocationsFeatures extends \Google\Service\Resource
|
---|
| 37 | {
|
---|
| 38 | /**
|
---|
| 39 | * Adds a new Feature. (features.create)
|
---|
| 40 | *
|
---|
| 41 | * @param string $parent Required. The parent (project and location) where the
|
---|
| 42 | * Feature will be created. Specified in the format `projects/locations`.
|
---|
| 43 | * @param Feature $postBody
|
---|
| 44 | * @param array $optParams Optional parameters.
|
---|
| 45 | *
|
---|
| 46 | * @opt_param string featureId The ID of the feature to create.
|
---|
| 47 | * @opt_param string requestId A request ID to identify requests. Specify a
|
---|
| 48 | * unique request ID so that if you must retry your request, the server will
|
---|
| 49 | * know to ignore the request if it has already been completed. The server will
|
---|
| 50 | * guarantee that for at least 60 minutes after the first request. For example,
|
---|
| 51 | * consider a situation where you make an initial request and the request times
|
---|
| 52 | * out. If you make the request again with the same request ID, the server can
|
---|
| 53 | * check if original operation with the same request ID was received, and if so,
|
---|
| 54 | * will ignore the second request. This prevents clients from accidentally
|
---|
| 55 | * creating duplicate commitments. The request ID must be a valid UUID with the
|
---|
| 56 | * exception that zero UUID is not supported
|
---|
| 57 | * (00000000-0000-0000-0000-000000000000).
|
---|
| 58 | * @return Operation
|
---|
| 59 | * @throws \Google\Service\Exception
|
---|
| 60 | */
|
---|
| 61 | public function create($parent, Feature $postBody, $optParams = [])
|
---|
| 62 | {
|
---|
| 63 | $params = ['parent' => $parent, 'postBody' => $postBody];
|
---|
| 64 | $params = array_merge($params, $optParams);
|
---|
| 65 | return $this->call('create', [$params], Operation::class);
|
---|
| 66 | }
|
---|
| 67 | /**
|
---|
| 68 | * Removes a Feature. (features.delete)
|
---|
| 69 | *
|
---|
| 70 | * @param string $name Required. The Feature resource name in the format
|
---|
| 71 | * `projects/locations/features`.
|
---|
| 72 | * @param array $optParams Optional parameters.
|
---|
| 73 | *
|
---|
| 74 | * @opt_param bool force If set to true, the delete will ignore any outstanding
|
---|
| 75 | * resources for this Feature (that is, `FeatureState.has_resources` is set to
|
---|
| 76 | * true). These resources will NOT be cleaned up or modified in any way.
|
---|
| 77 | * @opt_param string requestId Optional. A request ID to identify requests.
|
---|
| 78 | * Specify a unique request ID so that if you must retry your request, the
|
---|
| 79 | * server will know to ignore the request if it has already been completed. The
|
---|
| 80 | * server will guarantee that for at least 60 minutes after the first request.
|
---|
| 81 | * For example, consider a situation where you make an initial request and the
|
---|
| 82 | * request times out. If you make the request again with the same request ID,
|
---|
| 83 | * the server can check if original operation with the same request ID was
|
---|
| 84 | * received, and if so, will ignore the second request. This prevents clients
|
---|
| 85 | * from accidentally creating duplicate commitments. The request ID must be a
|
---|
| 86 | * valid UUID with the exception that zero UUID is not supported
|
---|
| 87 | * (00000000-0000-0000-0000-000000000000).
|
---|
| 88 | * @return Operation
|
---|
| 89 | * @throws \Google\Service\Exception
|
---|
| 90 | */
|
---|
| 91 | public function delete($name, $optParams = [])
|
---|
| 92 | {
|
---|
| 93 | $params = ['name' => $name];
|
---|
| 94 | $params = array_merge($params, $optParams);
|
---|
| 95 | return $this->call('delete', [$params], Operation::class);
|
---|
| 96 | }
|
---|
| 97 | /**
|
---|
| 98 | * Gets details of a single Feature. (features.get)
|
---|
| 99 | *
|
---|
| 100 | * @param string $name Required. The Feature resource name in the format
|
---|
| 101 | * `projects/locations/features`
|
---|
| 102 | * @param array $optParams Optional parameters.
|
---|
| 103 | *
|
---|
| 104 | * @opt_param bool returnPartialSuccess Optional. If set to true, the response
|
---|
| 105 | * will return partial results when some regions are unreachable and the
|
---|
| 106 | * unreachable field in Feature proto will be populated. If set to false, the
|
---|
| 107 | * request will fail when some regions are unreachable.
|
---|
| 108 | * @return Feature
|
---|
| 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], Feature::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. (features.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 Policy
|
---|
| 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], Policy::class);
|
---|
| 147 | }
|
---|
| 148 | /**
|
---|
| 149 | * Lists Features in a given project and location.
|
---|
| 150 | * (features.listProjectsLocationsFeatures)
|
---|
| 151 | *
|
---|
| 152 | * @param string $parent Required. The parent (project and location) where the
|
---|
| 153 | * Features will be listed. Specified in the format `projects/locations`.
|
---|
| 154 | * @param array $optParams Optional parameters.
|
---|
| 155 | *
|
---|
| 156 | * @opt_param string filter Lists Features that match the filter expression,
|
---|
| 157 | * following the syntax outlined in https://google.aip.dev/160. Examples: -
|
---|
| 158 | * Feature with the name "servicemesh" in project "foo-proj": name =
|
---|
| 159 | * "projects/foo-proj/locations/global/features/servicemesh" - Features that
|
---|
| 160 | * have a label called `foo`: labels.foo:* - Features that have a label called
|
---|
| 161 | * `foo` whose value is `bar`: labels.foo = bar
|
---|
| 162 | * @opt_param string orderBy One or more fields to compare and use to sort the
|
---|
| 163 | * output. See https://google.aip.dev/132#ordering.
|
---|
| 164 | * @opt_param int pageSize When requesting a 'page' of resources, `page_size`
|
---|
| 165 | * specifies number of resources to return. If unspecified or set to 0, all
|
---|
| 166 | * resources will be returned.
|
---|
| 167 | * @opt_param string pageToken Token returned by previous call to `ListFeatures`
|
---|
| 168 | * which specifies the position in the list from where to continue listing the
|
---|
| 169 | * resources.
|
---|
| 170 | * @opt_param bool returnPartialSuccess Optional. If set to true, the response
|
---|
| 171 | * will return partial results when some regions are unreachable and the
|
---|
| 172 | * unreachable field in Feature proto will be populated. If set to false, the
|
---|
| 173 | * request will fail when some regions are unreachable.
|
---|
| 174 | * @return ListFeaturesResponse
|
---|
| 175 | * @throws \Google\Service\Exception
|
---|
| 176 | */
|
---|
| 177 | public function listProjectsLocationsFeatures($parent, $optParams = [])
|
---|
| 178 | {
|
---|
| 179 | $params = ['parent' => $parent];
|
---|
| 180 | $params = array_merge($params, $optParams);
|
---|
| 181 | return $this->call('list', [$params], ListFeaturesResponse::class);
|
---|
| 182 | }
|
---|
| 183 | /**
|
---|
| 184 | * Updates an existing Feature. (features.patch)
|
---|
| 185 | *
|
---|
| 186 | * @param string $name Required. The Feature resource name in the format
|
---|
| 187 | * `projects/locations/features`.
|
---|
| 188 | * @param Feature $postBody
|
---|
| 189 | * @param array $optParams Optional parameters.
|
---|
| 190 | *
|
---|
| 191 | * @opt_param string requestId A request ID to identify requests. Specify a
|
---|
| 192 | * unique request ID so that if you must retry your request, the server will
|
---|
| 193 | * know to ignore the request if it has already been completed. The server will
|
---|
| 194 | * guarantee that for at least 60 minutes after the first request. For example,
|
---|
| 195 | * consider a situation where you make an initial request and the request times
|
---|
| 196 | * out. If you make the request again with the same request ID, the server can
|
---|
| 197 | * check if original operation with the same request ID was received, and if so,
|
---|
| 198 | * will ignore the second request. This prevents clients from accidentally
|
---|
| 199 | * creating duplicate commitments. The request ID must be a valid UUID with the
|
---|
| 200 | * exception that zero UUID is not supported
|
---|
| 201 | * (00000000-0000-0000-0000-000000000000).
|
---|
| 202 | * @opt_param string updateMask Mask of fields to update.
|
---|
| 203 | * @return Operation
|
---|
| 204 | * @throws \Google\Service\Exception
|
---|
| 205 | */
|
---|
| 206 | public function patch($name, Feature $postBody, $optParams = [])
|
---|
| 207 | {
|
---|
| 208 | $params = ['name' => $name, 'postBody' => $postBody];
|
---|
| 209 | $params = array_merge($params, $optParams);
|
---|
| 210 | return $this->call('patch', [$params], Operation::class);
|
---|
| 211 | }
|
---|
| 212 | /**
|
---|
| 213 | * Sets the access control policy on the specified resource. Replaces any
|
---|
| 214 | * existing policy. Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and
|
---|
| 215 | * `PERMISSION_DENIED` errors. (features.setIamPolicy)
|
---|
| 216 | *
|
---|
| 217 | * @param string $resource REQUIRED: The resource for which the policy is being
|
---|
| 218 | * specified. See [Resource
|
---|
| 219 | * names](https://cloud.google.com/apis/design/resource_names) for the
|
---|
| 220 | * appropriate value for this field.
|
---|
| 221 | * @param SetIamPolicyRequest $postBody
|
---|
| 222 | * @param array $optParams Optional parameters.
|
---|
| 223 | * @return Policy
|
---|
| 224 | * @throws \Google\Service\Exception
|
---|
| 225 | */
|
---|
| 226 | public function setIamPolicy($resource, SetIamPolicyRequest $postBody, $optParams = [])
|
---|
| 227 | {
|
---|
| 228 | $params = ['resource' => $resource, 'postBody' => $postBody];
|
---|
| 229 | $params = array_merge($params, $optParams);
|
---|
| 230 | return $this->call('setIamPolicy', [$params], Policy::class);
|
---|
| 231 | }
|
---|
| 232 | /**
|
---|
| 233 | * Returns permissions that a caller has on the specified resource. If the
|
---|
| 234 | * resource does not exist, this will return an empty set of permissions, not a
|
---|
| 235 | * `NOT_FOUND` error. Note: This operation is designed to be used for building
|
---|
| 236 | * permission-aware UIs and command-line tools, not for authorization checking.
|
---|
| 237 | * This operation may "fail open" without warning. (features.testIamPermissions)
|
---|
| 238 | *
|
---|
| 239 | * @param string $resource REQUIRED: The resource for which the policy detail is
|
---|
| 240 | * being requested. See [Resource
|
---|
| 241 | * names](https://cloud.google.com/apis/design/resource_names) for the
|
---|
| 242 | * appropriate value for this field.
|
---|
| 243 | * @param TestIamPermissionsRequest $postBody
|
---|
| 244 | * @param array $optParams Optional parameters.
|
---|
| 245 | * @return TestIamPermissionsResponse
|
---|
| 246 | * @throws \Google\Service\Exception
|
---|
| 247 | */
|
---|
| 248 | public function testIamPermissions($resource, TestIamPermissionsRequest $postBody, $optParams = [])
|
---|
| 249 | {
|
---|
| 250 | $params = ['resource' => $resource, 'postBody' => $postBody];
|
---|
| 251 | $params = array_merge($params, $optParams);
|
---|
| 252 | return $this->call('testIamPermissions', [$params], TestIamPermissionsResponse::class);
|
---|
| 253 | }
|
---|
| 254 | }
|
---|
| 255 |
|
---|
| 256 | // Adding a class alias for backwards compatibility with the previous class name.
|
---|
| 257 | class_alias(ProjectsLocationsFeatures::class, 'Google_Service_GKEHub_Resource_ProjectsLocationsFeatures');
|
---|