source: vendor/google/apiclient-services/src/CloudKMS/Resource/ProjectsLocationsKeyRings.php@ f9c482b

Last change on this file since f9c482b was f9c482b, checked in by Vlado 222039 <vlado.popovski@…>, 10 days ago

Upload new project files

  • Property mode set to 100644
File size: 7.6 KB
Line 
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
18namespace Google\Service\CloudKMS\Resource;
19
20use Google\Service\CloudKMS\KeyRing;
21use Google\Service\CloudKMS\ListKeyRingsResponse;
22use Google\Service\CloudKMS\Policy;
23use Google\Service\CloudKMS\SetIamPolicyRequest;
24use Google\Service\CloudKMS\TestIamPermissionsRequest;
25use Google\Service\CloudKMS\TestIamPermissionsResponse;
26
27/**
28 * The "keyRings" collection of methods.
29 * Typical usage is:
30 * <code>
31 * $cloudkmsService = new Google\Service\CloudKMS(...);
32 * $keyRings = $cloudkmsService->projects_locations_keyRings;
33 * </code>
34 */
35class ProjectsLocationsKeyRings extends \Google\Service\Resource
36{
37 /**
38 * Create a new KeyRing in a given Project and Location. (keyRings.create)
39 *
40 * @param string $parent Required. The resource name of the location associated
41 * with the KeyRings, in the format `projects/locations`.
42 * @param KeyRing $postBody
43 * @param array $optParams Optional parameters.
44 *
45 * @opt_param string keyRingId Required. It must be unique within a location and
46 * match the regular expression `[a-zA-Z0-9_-]{1,63}`
47 * @return KeyRing
48 * @throws \Google\Service\Exception
49 */
50 public function create($parent, KeyRing $postBody, $optParams = [])
51 {
52 $params = ['parent' => $parent, 'postBody' => $postBody];
53 $params = array_merge($params, $optParams);
54 return $this->call('create', [$params], KeyRing::class);
55 }
56 /**
57 * Returns metadata for a given KeyRing. (keyRings.get)
58 *
59 * @param string $name Required. The name of the KeyRing to get.
60 * @param array $optParams Optional parameters.
61 * @return KeyRing
62 * @throws \Google\Service\Exception
63 */
64 public function get($name, $optParams = [])
65 {
66 $params = ['name' => $name];
67 $params = array_merge($params, $optParams);
68 return $this->call('get', [$params], KeyRing::class);
69 }
70 /**
71 * Gets the access control policy for a resource. Returns an empty policy if the
72 * resource exists and does not have a policy set. (keyRings.getIamPolicy)
73 *
74 * @param string $resource REQUIRED: The resource for which the policy is being
75 * requested. See [Resource
76 * names](https://cloud.google.com/apis/design/resource_names) for the
77 * appropriate value for this field.
78 * @param array $optParams Optional parameters.
79 *
80 * @opt_param int options.requestedPolicyVersion Optional. The maximum policy
81 * version that will be used to format the policy. Valid values are 0, 1, and 3.
82 * Requests specifying an invalid value will be rejected. Requests for policies
83 * with any conditional role bindings must specify version 3. Policies with no
84 * conditional role bindings may specify any valid value or leave the field
85 * unset. The policy in the response might use the policy version that you
86 * specified, or it might use a lower policy version. For example, if you
87 * specify version 3, but the policy has no conditional role bindings, the
88 * response uses version 1. To learn which resources support conditions in their
89 * IAM policies, see the [IAM
90 * documentation](https://cloud.google.com/iam/help/conditions/resource-
91 * policies).
92 * @return Policy
93 * @throws \Google\Service\Exception
94 */
95 public function getIamPolicy($resource, $optParams = [])
96 {
97 $params = ['resource' => $resource];
98 $params = array_merge($params, $optParams);
99 return $this->call('getIamPolicy', [$params], Policy::class);
100 }
101 /**
102 * Lists KeyRings. (keyRings.listProjectsLocationsKeyRings)
103 *
104 * @param string $parent Required. The resource name of the location associated
105 * with the KeyRings, in the format `projects/locations`.
106 * @param array $optParams Optional parameters.
107 *
108 * @opt_param string filter Optional. Only include resources that match the
109 * filter in the response. For more information, see [Sorting and filtering list
110 * results](https://cloud.google.com/kms/docs/sorting-and-filtering).
111 * @opt_param string orderBy Optional. Specify how the results should be sorted.
112 * If not specified, the results will be sorted in the default order. For more
113 * information, see [Sorting and filtering list
114 * results](https://cloud.google.com/kms/docs/sorting-and-filtering).
115 * @opt_param int pageSize Optional. Optional limit on the number of KeyRings to
116 * include in the response. Further KeyRings can subsequently be obtained by
117 * including the ListKeyRingsResponse.next_page_token in a subsequent request.
118 * If unspecified, the server will pick an appropriate default.
119 * @opt_param string pageToken Optional. Optional pagination token, returned
120 * earlier via ListKeyRingsResponse.next_page_token.
121 * @return ListKeyRingsResponse
122 * @throws \Google\Service\Exception
123 */
124 public function listProjectsLocationsKeyRings($parent, $optParams = [])
125 {
126 $params = ['parent' => $parent];
127 $params = array_merge($params, $optParams);
128 return $this->call('list', [$params], ListKeyRingsResponse::class);
129 }
130 /**
131 * Sets the access control policy on the specified resource. Replaces any
132 * existing policy. Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and
133 * `PERMISSION_DENIED` errors. (keyRings.setIamPolicy)
134 *
135 * @param string $resource REQUIRED: The resource for which the policy is being
136 * specified. See [Resource
137 * names](https://cloud.google.com/apis/design/resource_names) for the
138 * appropriate value for this field.
139 * @param SetIamPolicyRequest $postBody
140 * @param array $optParams Optional parameters.
141 * @return Policy
142 * @throws \Google\Service\Exception
143 */
144 public function setIamPolicy($resource, SetIamPolicyRequest $postBody, $optParams = [])
145 {
146 $params = ['resource' => $resource, 'postBody' => $postBody];
147 $params = array_merge($params, $optParams);
148 return $this->call('setIamPolicy', [$params], Policy::class);
149 }
150 /**
151 * Returns permissions that a caller has on the specified resource. If the
152 * resource does not exist, this will return an empty set of permissions, not a
153 * `NOT_FOUND` error. Note: This operation is designed to be used for building
154 * permission-aware UIs and command-line tools, not for authorization checking.
155 * This operation may "fail open" without warning. (keyRings.testIamPermissions)
156 *
157 * @param string $resource REQUIRED: The resource for which the policy detail is
158 * being requested. See [Resource
159 * names](https://cloud.google.com/apis/design/resource_names) for the
160 * appropriate value for this field.
161 * @param TestIamPermissionsRequest $postBody
162 * @param array $optParams Optional parameters.
163 * @return TestIamPermissionsResponse
164 * @throws \Google\Service\Exception
165 */
166 public function testIamPermissions($resource, TestIamPermissionsRequest $postBody, $optParams = [])
167 {
168 $params = ['resource' => $resource, 'postBody' => $postBody];
169 $params = array_merge($params, $optParams);
170 return $this->call('testIamPermissions', [$params], TestIamPermissionsResponse::class);
171 }
172}
173
174// Adding a class alias for backwards compatibility with the previous class name.
175class_alias(ProjectsLocationsKeyRings::class, 'Google_Service_CloudKMS_Resource_ProjectsLocationsKeyRings');
Note: See TracBrowser for help on using the repository browser.