[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\ArtifactregistryEmpty;
|
---|
| 21 | use Google\Service\ArtifactRegistry\GoogleDevtoolsArtifactregistryV1Rule;
|
---|
| 22 | use Google\Service\ArtifactRegistry\ListRulesResponse;
|
---|
| 23 |
|
---|
| 24 | /**
|
---|
| 25 | * The "rules" collection of methods.
|
---|
| 26 | * Typical usage is:
|
---|
| 27 | * <code>
|
---|
| 28 | * $artifactregistryService = new Google\Service\ArtifactRegistry(...);
|
---|
| 29 | * $rules = $artifactregistryService->projects_locations_repositories_rules;
|
---|
| 30 | * </code>
|
---|
| 31 | */
|
---|
| 32 | class ProjectsLocationsRepositoriesRules extends \Google\Service\Resource
|
---|
| 33 | {
|
---|
| 34 | /**
|
---|
| 35 | * Creates a rule. (rules.create)
|
---|
| 36 | *
|
---|
| 37 | * @param string $parent Required. The name of the parent resource where the
|
---|
| 38 | * rule will be created.
|
---|
| 39 | * @param GoogleDevtoolsArtifactregistryV1Rule $postBody
|
---|
| 40 | * @param array $optParams Optional parameters.
|
---|
| 41 | *
|
---|
| 42 | * @opt_param string ruleId The rule id to use for this repository.
|
---|
| 43 | * @return GoogleDevtoolsArtifactregistryV1Rule
|
---|
| 44 | * @throws \Google\Service\Exception
|
---|
| 45 | */
|
---|
| 46 | public function create($parent, GoogleDevtoolsArtifactregistryV1Rule $postBody, $optParams = [])
|
---|
| 47 | {
|
---|
| 48 | $params = ['parent' => $parent, 'postBody' => $postBody];
|
---|
| 49 | $params = array_merge($params, $optParams);
|
---|
| 50 | return $this->call('create', [$params], GoogleDevtoolsArtifactregistryV1Rule::class);
|
---|
| 51 | }
|
---|
| 52 | /**
|
---|
| 53 | * Deletes a rule. (rules.delete)
|
---|
| 54 | *
|
---|
| 55 | * @param string $name Required. The name of the rule to delete.
|
---|
| 56 | * @param array $optParams Optional parameters.
|
---|
| 57 | * @return ArtifactregistryEmpty
|
---|
| 58 | * @throws \Google\Service\Exception
|
---|
| 59 | */
|
---|
| 60 | public function delete($name, $optParams = [])
|
---|
| 61 | {
|
---|
| 62 | $params = ['name' => $name];
|
---|
| 63 | $params = array_merge($params, $optParams);
|
---|
| 64 | return $this->call('delete', [$params], ArtifactregistryEmpty::class);
|
---|
| 65 | }
|
---|
| 66 | /**
|
---|
| 67 | * Gets a rule. (rules.get)
|
---|
| 68 | *
|
---|
| 69 | * @param string $name Required. The name of the rule to retrieve.
|
---|
| 70 | * @param array $optParams Optional parameters.
|
---|
| 71 | * @return GoogleDevtoolsArtifactregistryV1Rule
|
---|
| 72 | * @throws \Google\Service\Exception
|
---|
| 73 | */
|
---|
| 74 | public function get($name, $optParams = [])
|
---|
| 75 | {
|
---|
| 76 | $params = ['name' => $name];
|
---|
| 77 | $params = array_merge($params, $optParams);
|
---|
| 78 | return $this->call('get', [$params], GoogleDevtoolsArtifactregistryV1Rule::class);
|
---|
| 79 | }
|
---|
| 80 | /**
|
---|
| 81 | * Lists rules. (rules.listProjectsLocationsRepositoriesRules)
|
---|
| 82 | *
|
---|
| 83 | * @param string $parent Required. The name of the parent repository whose rules
|
---|
| 84 | * will be listed. For example: `projects/p1/locations/us-
|
---|
| 85 | * central1/repositories/repo1`.
|
---|
| 86 | * @param array $optParams Optional parameters.
|
---|
| 87 | *
|
---|
| 88 | * @opt_param int pageSize The maximum number of rules to return. Maximum page
|
---|
| 89 | * size is 1,000.
|
---|
| 90 | * @opt_param string pageToken The next_page_token value returned from a
|
---|
| 91 | * previous list request, if any.
|
---|
| 92 | * @return ListRulesResponse
|
---|
| 93 | * @throws \Google\Service\Exception
|
---|
| 94 | */
|
---|
| 95 | public function listProjectsLocationsRepositoriesRules($parent, $optParams = [])
|
---|
| 96 | {
|
---|
| 97 | $params = ['parent' => $parent];
|
---|
| 98 | $params = array_merge($params, $optParams);
|
---|
| 99 | return $this->call('list', [$params], ListRulesResponse::class);
|
---|
| 100 | }
|
---|
| 101 | /**
|
---|
| 102 | * Updates a rule. (rules.patch)
|
---|
| 103 | *
|
---|
| 104 | * @param string $name The name of the rule, for example:
|
---|
| 105 | * `projects/p1/locations/us-central1/repositories/repo1/rules/rule1`.
|
---|
| 106 | * @param GoogleDevtoolsArtifactregistryV1Rule $postBody
|
---|
| 107 | * @param array $optParams Optional parameters.
|
---|
| 108 | *
|
---|
| 109 | * @opt_param string updateMask The update mask applies to the resource. For the
|
---|
| 110 | * `FieldMask` definition, see https://developers.google.com/protocol-
|
---|
| 111 | * buffers/docs/reference/google.protobuf#fieldmask
|
---|
| 112 | * @return GoogleDevtoolsArtifactregistryV1Rule
|
---|
| 113 | * @throws \Google\Service\Exception
|
---|
| 114 | */
|
---|
| 115 | public function patch($name, GoogleDevtoolsArtifactregistryV1Rule $postBody, $optParams = [])
|
---|
| 116 | {
|
---|
| 117 | $params = ['name' => $name, 'postBody' => $postBody];
|
---|
| 118 | $params = array_merge($params, $optParams);
|
---|
| 119 | return $this->call('patch', [$params], GoogleDevtoolsArtifactregistryV1Rule::class);
|
---|
| 120 | }
|
---|
| 121 | }
|
---|
| 122 |
|
---|
| 123 | // Adding a class alias for backwards compatibility with the previous class name.
|
---|
| 124 | class_alias(ProjectsLocationsRepositoriesRules::class, 'Google_Service_ArtifactRegistry_Resource_ProjectsLocationsRepositoriesRules');
|
---|