[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\ArtifactRegistry\Resource;
|
---|
| 19 |
|
---|
| 20 | use Google\Service\ArtifactRegistry\ListRepositoriesResponse;
|
---|
| 21 | use Google\Service\ArtifactRegistry\Operation;
|
---|
| 22 | use Google\Service\ArtifactRegistry\Policy;
|
---|
| 23 | use Google\Service\ArtifactRegistry\Repository;
|
---|
| 24 | use Google\Service\ArtifactRegistry\SetIamPolicyRequest;
|
---|
| 25 | use Google\Service\ArtifactRegistry\TestIamPermissionsRequest;
|
---|
| 26 | use Google\Service\ArtifactRegistry\TestIamPermissionsResponse;
|
---|
| 27 |
|
---|
| 28 | /**
|
---|
| 29 | * The "repositories" collection of methods.
|
---|
| 30 | * Typical usage is:
|
---|
| 31 | * <code>
|
---|
| 32 | * $artifactregistryService = new Google\Service\ArtifactRegistry(...);
|
---|
| 33 | * $repositories = $artifactregistryService->projects_locations_repositories;
|
---|
| 34 | * </code>
|
---|
| 35 | */
|
---|
| 36 | class ProjectsLocationsRepositories extends \Google\Service\Resource
|
---|
| 37 | {
|
---|
| 38 | /**
|
---|
| 39 | * Creates a repository. The returned Operation will finish once the repository
|
---|
| 40 | * has been created. Its response will be the created Repository.
|
---|
| 41 | * (repositories.create)
|
---|
| 42 | *
|
---|
| 43 | * @param string $parent Required. The name of the parent resource where the
|
---|
| 44 | * repository will be created.
|
---|
| 45 | * @param Repository $postBody
|
---|
| 46 | * @param array $optParams Optional parameters.
|
---|
| 47 | *
|
---|
| 48 | * @opt_param string repositoryId Required. The repository id to use for this
|
---|
| 49 | * repository.
|
---|
| 50 | * @return Operation
|
---|
| 51 | * @throws \Google\Service\Exception
|
---|
| 52 | */
|
---|
| 53 | public function create($parent, Repository $postBody, $optParams = [])
|
---|
| 54 | {
|
---|
| 55 | $params = ['parent' => $parent, 'postBody' => $postBody];
|
---|
| 56 | $params = array_merge($params, $optParams);
|
---|
| 57 | return $this->call('create', [$params], Operation::class);
|
---|
| 58 | }
|
---|
| 59 | /**
|
---|
| 60 | * Deletes a repository and all of its contents. The returned Operation will
|
---|
| 61 | * finish once the repository has been deleted. It will not have any Operation
|
---|
| 62 | * metadata and will return a google.protobuf.Empty response.
|
---|
| 63 | * (repositories.delete)
|
---|
| 64 | *
|
---|
| 65 | * @param string $name Required. The name of the repository to delete.
|
---|
| 66 | * @param array $optParams Optional parameters.
|
---|
| 67 | * @return Operation
|
---|
| 68 | * @throws \Google\Service\Exception
|
---|
| 69 | */
|
---|
| 70 | public function delete($name, $optParams = [])
|
---|
| 71 | {
|
---|
| 72 | $params = ['name' => $name];
|
---|
| 73 | $params = array_merge($params, $optParams);
|
---|
| 74 | return $this->call('delete', [$params], Operation::class);
|
---|
| 75 | }
|
---|
| 76 | /**
|
---|
| 77 | * Gets a repository. (repositories.get)
|
---|
| 78 | *
|
---|
| 79 | * @param string $name Required. The name of the repository to retrieve.
|
---|
| 80 | * @param array $optParams Optional parameters.
|
---|
| 81 | * @return Repository
|
---|
| 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], Repository::class);
|
---|
| 89 | }
|
---|
| 90 | /**
|
---|
| 91 | * Gets the IAM policy for a given resource. (repositories.getIamPolicy)
|
---|
| 92 | *
|
---|
| 93 | * @param string $resource REQUIRED: The resource for which the policy is being
|
---|
| 94 | * requested. See [Resource
|
---|
| 95 | * names](https://cloud.google.com/apis/design/resource_names) for the
|
---|
| 96 | * appropriate value for this field.
|
---|
| 97 | * @param array $optParams Optional parameters.
|
---|
| 98 | *
|
---|
| 99 | * @opt_param int options.requestedPolicyVersion Optional. The maximum policy
|
---|
| 100 | * version that will be used to format the policy. Valid values are 0, 1, and 3.
|
---|
| 101 | * Requests specifying an invalid value will be rejected. Requests for policies
|
---|
| 102 | * with any conditional role bindings must specify version 3. Policies with no
|
---|
| 103 | * conditional role bindings may specify any valid value or leave the field
|
---|
| 104 | * unset. The policy in the response might use the policy version that you
|
---|
| 105 | * specified, or it might use a lower policy version. For example, if you
|
---|
| 106 | * specify version 3, but the policy has no conditional role bindings, the
|
---|
| 107 | * response uses version 1. To learn which resources support conditions in their
|
---|
| 108 | * IAM policies, see the [IAM
|
---|
| 109 | * documentation](https://cloud.google.com/iam/help/conditions/resource-
|
---|
| 110 | * policies).
|
---|
| 111 | * @return Policy
|
---|
| 112 | * @throws \Google\Service\Exception
|
---|
| 113 | */
|
---|
| 114 | public function getIamPolicy($resource, $optParams = [])
|
---|
| 115 | {
|
---|
| 116 | $params = ['resource' => $resource];
|
---|
| 117 | $params = array_merge($params, $optParams);
|
---|
| 118 | return $this->call('getIamPolicy', [$params], Policy::class);
|
---|
| 119 | }
|
---|
| 120 | /**
|
---|
| 121 | * Lists repositories. (repositories.listProjectsLocationsRepositories)
|
---|
| 122 | *
|
---|
| 123 | * @param string $parent Required. The name of the parent resource whose
|
---|
| 124 | * repositories will be listed.
|
---|
| 125 | * @param array $optParams Optional parameters.
|
---|
| 126 | *
|
---|
| 127 | * @opt_param string filter Optional. An expression for filtering the results of
|
---|
| 128 | * the request. Filter rules are case insensitive. The fields eligible for
|
---|
| 129 | * filtering are: * `name` Examples of using a filter: To filter the results of
|
---|
| 130 | * your request to repositories with the name `my-repo` in project `my-project`
|
---|
| 131 | * in the `us-central` region, append the following filter expression to your
|
---|
| 132 | * request: * `name="projects/my-project/locations/us-central1/repositories/my-
|
---|
| 133 | * repo"` You can also use wildcards to match any number of characters before or
|
---|
| 134 | * after the value: * `name="projects/my-project/locations/us-
|
---|
| 135 | * central1/repositories/my-*"` * `name="projects/my-project/locations/us-
|
---|
| 136 | * central1/repositoriesrepo"` * `name="projects/my-project/locations/us-
|
---|
| 137 | * central1/repositoriesrepo*"`
|
---|
| 138 | * @opt_param string orderBy Optional. The field to order the results by.
|
---|
| 139 | * @opt_param int pageSize The maximum number of repositories to return. Maximum
|
---|
| 140 | * page size is 1,000.
|
---|
| 141 | * @opt_param string pageToken The next_page_token value returned from a
|
---|
| 142 | * previous list request, if any.
|
---|
| 143 | * @return ListRepositoriesResponse
|
---|
| 144 | * @throws \Google\Service\Exception
|
---|
| 145 | */
|
---|
| 146 | public function listProjectsLocationsRepositories($parent, $optParams = [])
|
---|
| 147 | {
|
---|
| 148 | $params = ['parent' => $parent];
|
---|
| 149 | $params = array_merge($params, $optParams);
|
---|
| 150 | return $this->call('list', [$params], ListRepositoriesResponse::class);
|
---|
| 151 | }
|
---|
| 152 | /**
|
---|
| 153 | * Updates a repository. (repositories.patch)
|
---|
| 154 | *
|
---|
| 155 | * @param string $name The name of the repository, for example:
|
---|
| 156 | * `projects/p1/locations/us-central1/repositories/repo1`. For each location in
|
---|
| 157 | * a project, repository names must be unique.
|
---|
| 158 | * @param Repository $postBody
|
---|
| 159 | * @param array $optParams Optional parameters.
|
---|
| 160 | *
|
---|
| 161 | * @opt_param string updateMask The update mask applies to the resource. For the
|
---|
| 162 | * `FieldMask` definition, see https://developers.google.com/protocol-
|
---|
| 163 | * buffers/docs/reference/google.protobuf#fieldmask
|
---|
| 164 | * @return Repository
|
---|
| 165 | * @throws \Google\Service\Exception
|
---|
| 166 | */
|
---|
| 167 | public function patch($name, Repository $postBody, $optParams = [])
|
---|
| 168 | {
|
---|
| 169 | $params = ['name' => $name, 'postBody' => $postBody];
|
---|
| 170 | $params = array_merge($params, $optParams);
|
---|
| 171 | return $this->call('patch', [$params], Repository::class);
|
---|
| 172 | }
|
---|
| 173 | /**
|
---|
| 174 | * Updates the IAM policy for a given resource. (repositories.setIamPolicy)
|
---|
| 175 | *
|
---|
| 176 | * @param string $resource REQUIRED: The resource for which the policy is being
|
---|
| 177 | * specified. See [Resource
|
---|
| 178 | * names](https://cloud.google.com/apis/design/resource_names) for the
|
---|
| 179 | * appropriate value for this field.
|
---|
| 180 | * @param SetIamPolicyRequest $postBody
|
---|
| 181 | * @param array $optParams Optional parameters.
|
---|
| 182 | * @return Policy
|
---|
| 183 | * @throws \Google\Service\Exception
|
---|
| 184 | */
|
---|
| 185 | public function setIamPolicy($resource, SetIamPolicyRequest $postBody, $optParams = [])
|
---|
| 186 | {
|
---|
| 187 | $params = ['resource' => $resource, 'postBody' => $postBody];
|
---|
| 188 | $params = array_merge($params, $optParams);
|
---|
| 189 | return $this->call('setIamPolicy', [$params], Policy::class);
|
---|
| 190 | }
|
---|
| 191 | /**
|
---|
| 192 | * Tests if the caller has a list of permissions on a resource.
|
---|
| 193 | * (repositories.testIamPermissions)
|
---|
| 194 | *
|
---|
| 195 | * @param string $resource REQUIRED: The resource for which the policy detail is
|
---|
| 196 | * being requested. See [Resource
|
---|
| 197 | * names](https://cloud.google.com/apis/design/resource_names) for the
|
---|
| 198 | * appropriate value for this field.
|
---|
| 199 | * @param TestIamPermissionsRequest $postBody
|
---|
| 200 | * @param array $optParams Optional parameters.
|
---|
| 201 | * @return TestIamPermissionsResponse
|
---|
| 202 | * @throws \Google\Service\Exception
|
---|
| 203 | */
|
---|
| 204 | public function testIamPermissions($resource, TestIamPermissionsRequest $postBody, $optParams = [])
|
---|
| 205 | {
|
---|
| 206 | $params = ['resource' => $resource, 'postBody' => $postBody];
|
---|
| 207 | $params = array_merge($params, $optParams);
|
---|
| 208 | return $this->call('testIamPermissions', [$params], TestIamPermissionsResponse::class);
|
---|
| 209 | }
|
---|
| 210 | }
|
---|
| 211 |
|
---|
| 212 | // Adding a class alias for backwards compatibility with the previous class name.
|
---|
| 213 | class_alias(ProjectsLocationsRepositories::class, 'Google_Service_ArtifactRegistry_Resource_ProjectsLocationsRepositories');
|
---|