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