[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\ApigeeRegistry\Resource;
|
---|
| 19 |
|
---|
| 20 | use Google\Service\ApigeeRegistry\ApiVersion;
|
---|
| 21 | use Google\Service\ApigeeRegistry\ApigeeregistryEmpty;
|
---|
| 22 | use Google\Service\ApigeeRegistry\ListApiVersionsResponse;
|
---|
| 23 | use Google\Service\ApigeeRegistry\Policy;
|
---|
| 24 | use Google\Service\ApigeeRegistry\SetIamPolicyRequest;
|
---|
| 25 | use Google\Service\ApigeeRegistry\TestIamPermissionsRequest;
|
---|
| 26 | use Google\Service\ApigeeRegistry\TestIamPermissionsResponse;
|
---|
| 27 |
|
---|
| 28 | /**
|
---|
| 29 | * The "versions" collection of methods.
|
---|
| 30 | * Typical usage is:
|
---|
| 31 | * <code>
|
---|
| 32 | * $apigeeregistryService = new Google\Service\ApigeeRegistry(...);
|
---|
| 33 | * $versions = $apigeeregistryService->projects_locations_apis_versions;
|
---|
| 34 | * </code>
|
---|
| 35 | */
|
---|
| 36 | class ProjectsLocationsApisVersions extends \Google\Service\Resource
|
---|
| 37 | {
|
---|
| 38 | /**
|
---|
| 39 | * Creates a specified version. (versions.create)
|
---|
| 40 | *
|
---|
| 41 | * @param string $parent Required. The parent, which owns this collection of
|
---|
| 42 | * versions. Format: `projects/locations/apis`
|
---|
| 43 | * @param ApiVersion $postBody
|
---|
| 44 | * @param array $optParams Optional parameters.
|
---|
| 45 | *
|
---|
| 46 | * @opt_param string apiVersionId Required. The ID to use for the version, which
|
---|
| 47 | * will become the final component of the version's resource name. This value
|
---|
| 48 | * should be 1-63 characters, and valid characters are /a-z-/. Following
|
---|
| 49 | * AIP-162, IDs must not have the form of a UUID.
|
---|
| 50 | * @return ApiVersion
|
---|
| 51 | * @throws \Google\Service\Exception
|
---|
| 52 | */
|
---|
| 53 | public function create($parent, ApiVersion $postBody, $optParams = [])
|
---|
| 54 | {
|
---|
| 55 | $params = ['parent' => $parent, 'postBody' => $postBody];
|
---|
| 56 | $params = array_merge($params, $optParams);
|
---|
| 57 | return $this->call('create', [$params], ApiVersion::class);
|
---|
| 58 | }
|
---|
| 59 | /**
|
---|
| 60 | * Removes a specified version and all of the resources that it owns.
|
---|
| 61 | * (versions.delete)
|
---|
| 62 | *
|
---|
| 63 | * @param string $name Required. The name of the version to delete. Format:
|
---|
| 64 | * `projects/locations/apis/versions`
|
---|
| 65 | * @param array $optParams Optional parameters.
|
---|
| 66 | *
|
---|
| 67 | * @opt_param bool force If set to true, any child resources will also be
|
---|
| 68 | * deleted. (Otherwise, the request will only work if there are no child
|
---|
| 69 | * resources.)
|
---|
| 70 | * @return ApigeeregistryEmpty
|
---|
| 71 | * @throws \Google\Service\Exception
|
---|
| 72 | */
|
---|
| 73 | public function delete($name, $optParams = [])
|
---|
| 74 | {
|
---|
| 75 | $params = ['name' => $name];
|
---|
| 76 | $params = array_merge($params, $optParams);
|
---|
| 77 | return $this->call('delete', [$params], ApigeeregistryEmpty::class);
|
---|
| 78 | }
|
---|
| 79 | /**
|
---|
| 80 | * Returns a specified version. (versions.get)
|
---|
| 81 | *
|
---|
| 82 | * @param string $name Required. The name of the version to retrieve. Format:
|
---|
| 83 | * `projects/locations/apis/versions`
|
---|
| 84 | * @param array $optParams Optional parameters.
|
---|
| 85 | * @return ApiVersion
|
---|
| 86 | * @throws \Google\Service\Exception
|
---|
| 87 | */
|
---|
| 88 | public function get($name, $optParams = [])
|
---|
| 89 | {
|
---|
| 90 | $params = ['name' => $name];
|
---|
| 91 | $params = array_merge($params, $optParams);
|
---|
| 92 | return $this->call('get', [$params], ApiVersion::class);
|
---|
| 93 | }
|
---|
| 94 | /**
|
---|
| 95 | * Gets the access control policy for a resource. Returns an empty policy if the
|
---|
| 96 | * resource exists and does not have a policy set. (versions.getIamPolicy)
|
---|
| 97 | *
|
---|
| 98 | * @param string $resource REQUIRED: The resource for which the policy is being
|
---|
| 99 | * requested. See [Resource
|
---|
| 100 | * names](https://cloud.google.com/apis/design/resource_names) for the
|
---|
| 101 | * appropriate value for this field.
|
---|
| 102 | * @param array $optParams Optional parameters.
|
---|
| 103 | *
|
---|
| 104 | * @opt_param int options.requestedPolicyVersion Optional. The maximum policy
|
---|
| 105 | * version that will be used to format the policy. Valid values are 0, 1, and 3.
|
---|
| 106 | * Requests specifying an invalid value will be rejected. Requests for policies
|
---|
| 107 | * with any conditional role bindings must specify version 3. Policies with no
|
---|
| 108 | * conditional role bindings may specify any valid value or leave the field
|
---|
| 109 | * unset. The policy in the response might use the policy version that you
|
---|
| 110 | * specified, or it might use a lower policy version. For example, if you
|
---|
| 111 | * specify version 3, but the policy has no conditional role bindings, the
|
---|
| 112 | * response uses version 1. To learn which resources support conditions in their
|
---|
| 113 | * IAM policies, see the [IAM
|
---|
| 114 | * documentation](https://cloud.google.com/iam/help/conditions/resource-
|
---|
| 115 | * policies).
|
---|
| 116 | * @return Policy
|
---|
| 117 | * @throws \Google\Service\Exception
|
---|
| 118 | */
|
---|
| 119 | public function getIamPolicy($resource, $optParams = [])
|
---|
| 120 | {
|
---|
| 121 | $params = ['resource' => $resource];
|
---|
| 122 | $params = array_merge($params, $optParams);
|
---|
| 123 | return $this->call('getIamPolicy', [$params], Policy::class);
|
---|
| 124 | }
|
---|
| 125 | /**
|
---|
| 126 | * Returns matching versions. (versions.listProjectsLocationsApisVersions)
|
---|
| 127 | *
|
---|
| 128 | * @param string $parent Required. The parent, which owns this collection of
|
---|
| 129 | * versions. Format: `projects/locations/apis`
|
---|
| 130 | * @param array $optParams Optional parameters.
|
---|
| 131 | *
|
---|
| 132 | * @opt_param string filter An expression that can be used to filter the list.
|
---|
| 133 | * Filters use the Common Expression Language and can refer to all message
|
---|
| 134 | * fields.
|
---|
| 135 | * @opt_param string orderBy A comma-separated list of fields, e.g. "foo,bar"
|
---|
| 136 | * Fields can be sorted in descending order using the "desc" identifier, e.g.
|
---|
| 137 | * "foo desc,bar"
|
---|
| 138 | * @opt_param int pageSize The maximum number of versions to return. The service
|
---|
| 139 | * may return fewer than this value. If unspecified, at most 50 values will be
|
---|
| 140 | * returned. The maximum is 1000; values above 1000 will be coerced to 1000.
|
---|
| 141 | * @opt_param string pageToken A page token, received from a previous
|
---|
| 142 | * `ListApiVersions` call. Provide this to retrieve the subsequent page. When
|
---|
| 143 | * paginating, all other parameters provided to `ListApiVersions` must match the
|
---|
| 144 | * call that provided the page token.
|
---|
| 145 | * @return ListApiVersionsResponse
|
---|
| 146 | * @throws \Google\Service\Exception
|
---|
| 147 | */
|
---|
| 148 | public function listProjectsLocationsApisVersions($parent, $optParams = [])
|
---|
| 149 | {
|
---|
| 150 | $params = ['parent' => $parent];
|
---|
| 151 | $params = array_merge($params, $optParams);
|
---|
| 152 | return $this->call('list', [$params], ListApiVersionsResponse::class);
|
---|
| 153 | }
|
---|
| 154 | /**
|
---|
| 155 | * Used to modify a specified version. (versions.patch)
|
---|
| 156 | *
|
---|
| 157 | * @param string $name Resource name.
|
---|
| 158 | * @param ApiVersion $postBody
|
---|
| 159 | * @param array $optParams Optional parameters.
|
---|
| 160 | *
|
---|
| 161 | * @opt_param bool allowMissing If set to true, and the version is not found, a
|
---|
| 162 | * new version will be created. In this situation, `update_mask` is ignored.
|
---|
| 163 | * @opt_param string updateMask The list of fields to be updated. If omitted,
|
---|
| 164 | * all fields are updated that are set in the request message (fields set to
|
---|
| 165 | * default values are ignored). If an asterisk "*" is specified, all fields are
|
---|
| 166 | * updated, including fields that are unspecified/default in the request.
|
---|
| 167 | * @return ApiVersion
|
---|
| 168 | * @throws \Google\Service\Exception
|
---|
| 169 | */
|
---|
| 170 | public function patch($name, ApiVersion $postBody, $optParams = [])
|
---|
| 171 | {
|
---|
| 172 | $params = ['name' => $name, 'postBody' => $postBody];
|
---|
| 173 | $params = array_merge($params, $optParams);
|
---|
| 174 | return $this->call('patch', [$params], ApiVersion::class);
|
---|
| 175 | }
|
---|
| 176 | /**
|
---|
| 177 | * Sets the access control policy on the specified resource. Replaces any
|
---|
| 178 | * existing policy. Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and
|
---|
| 179 | * `PERMISSION_DENIED` errors. (versions.setIamPolicy)
|
---|
| 180 | *
|
---|
| 181 | * @param string $resource REQUIRED: The resource for which the policy is being
|
---|
| 182 | * specified. See [Resource
|
---|
| 183 | * names](https://cloud.google.com/apis/design/resource_names) for the
|
---|
| 184 | * appropriate value for this field.
|
---|
| 185 | * @param SetIamPolicyRequest $postBody
|
---|
| 186 | * @param array $optParams Optional parameters.
|
---|
| 187 | * @return Policy
|
---|
| 188 | * @throws \Google\Service\Exception
|
---|
| 189 | */
|
---|
| 190 | public function setIamPolicy($resource, SetIamPolicyRequest $postBody, $optParams = [])
|
---|
| 191 | {
|
---|
| 192 | $params = ['resource' => $resource, 'postBody' => $postBody];
|
---|
| 193 | $params = array_merge($params, $optParams);
|
---|
| 194 | return $this->call('setIamPolicy', [$params], Policy::class);
|
---|
| 195 | }
|
---|
| 196 | /**
|
---|
| 197 | * Returns permissions that a caller has on the specified resource. If the
|
---|
| 198 | * resource does not exist, this will return an empty set of permissions, not a
|
---|
| 199 | * `NOT_FOUND` error. Note: This operation is designed to be used for building
|
---|
| 200 | * permission-aware UIs and command-line tools, not for authorization checking.
|
---|
| 201 | * This operation may "fail open" without warning. (versions.testIamPermissions)
|
---|
| 202 | *
|
---|
| 203 | * @param string $resource REQUIRED: The resource for which the policy detail is
|
---|
| 204 | * being requested. See [Resource
|
---|
| 205 | * names](https://cloud.google.com/apis/design/resource_names) for the
|
---|
| 206 | * appropriate value for this field.
|
---|
| 207 | * @param TestIamPermissionsRequest $postBody
|
---|
| 208 | * @param array $optParams Optional parameters.
|
---|
| 209 | * @return TestIamPermissionsResponse
|
---|
| 210 | * @throws \Google\Service\Exception
|
---|
| 211 | */
|
---|
| 212 | public function testIamPermissions($resource, TestIamPermissionsRequest $postBody, $optParams = [])
|
---|
| 213 | {
|
---|
| 214 | $params = ['resource' => $resource, 'postBody' => $postBody];
|
---|
| 215 | $params = array_merge($params, $optParams);
|
---|
| 216 | return $this->call('testIamPermissions', [$params], TestIamPermissionsResponse::class);
|
---|
| 217 | }
|
---|
| 218 | }
|
---|
| 219 |
|
---|
| 220 | // Adding a class alias for backwards compatibility with the previous class name.
|
---|
| 221 | class_alias(ProjectsLocationsApisVersions::class, 'Google_Service_ApigeeRegistry_Resource_ProjectsLocationsApisVersions');
|
---|