source: vendor/google/apiclient-services/src/Eventarc/Resource/ProjectsLocationsEnrollments.php

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

Upload project files

  • Property mode set to 100644
File size: 9.8 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\Eventarc\Resource;
19
20use Google\Service\Eventarc\Enrollment;
21use Google\Service\Eventarc\GoogleLongrunningOperation;
22use Google\Service\Eventarc\ListEnrollmentsResponse;
23use Google\Service\Eventarc\Policy;
24use Google\Service\Eventarc\SetIamPolicyRequest;
25use Google\Service\Eventarc\TestIamPermissionsRequest;
26use Google\Service\Eventarc\TestIamPermissionsResponse;
27
28/**
29 * The "enrollments" collection of methods.
30 * Typical usage is:
31 * <code>
32 * $eventarcService = new Google\Service\Eventarc(...);
33 * $enrollments = $eventarcService->projects_locations_enrollments;
34 * </code>
35 */
36class ProjectsLocationsEnrollments extends \Google\Service\Resource
37{
38 /**
39 * Create a new Enrollment in a particular project and location.
40 * (enrollments.create)
41 *
42 * @param string $parent Required. The parent collection in which to add this
43 * enrollment.
44 * @param Enrollment $postBody
45 * @param array $optParams Optional parameters.
46 *
47 * @opt_param string enrollmentId Required. The user-provided ID to be assigned
48 * to the Enrollment. It should match the format
49 * (^[a-z]([a-z0-9-]{0,61}[a-z0-9])?$).
50 * @opt_param bool validateOnly Optional. If set, validate the request and
51 * preview the review, but do not post it.
52 * @return GoogleLongrunningOperation
53 * @throws \Google\Service\Exception
54 */
55 public function create($parent, Enrollment $postBody, $optParams = [])
56 {
57 $params = ['parent' => $parent, 'postBody' => $postBody];
58 $params = array_merge($params, $optParams);
59 return $this->call('create', [$params], GoogleLongrunningOperation::class);
60 }
61 /**
62 * Delete a single Enrollment. (enrollments.delete)
63 *
64 * @param string $name Required. The name of the Enrollment to be deleted.
65 * @param array $optParams Optional parameters.
66 *
67 * @opt_param bool allowMissing Optional. If set to true, and the Enrollment is
68 * not found, the request will succeed but no action will be taken on the
69 * server.
70 * @opt_param string etag Optional. If provided, the Enrollment will only be
71 * deleted if the etag matches the current etag on the resource.
72 * @opt_param bool validateOnly Optional. If set, validate the request and
73 * preview the review, but do not post it.
74 * @return GoogleLongrunningOperation
75 * @throws \Google\Service\Exception
76 */
77 public function delete($name, $optParams = [])
78 {
79 $params = ['name' => $name];
80 $params = array_merge($params, $optParams);
81 return $this->call('delete', [$params], GoogleLongrunningOperation::class);
82 }
83 /**
84 * Get a single Enrollment. (enrollments.get)
85 *
86 * @param string $name Required. The name of the Enrollment to get.
87 * @param array $optParams Optional parameters.
88 * @return Enrollment
89 * @throws \Google\Service\Exception
90 */
91 public function get($name, $optParams = [])
92 {
93 $params = ['name' => $name];
94 $params = array_merge($params, $optParams);
95 return $this->call('get', [$params], Enrollment::class);
96 }
97 /**
98 * Gets the access control policy for a resource. Returns an empty policy if the
99 * resource exists and does not have a policy set. (enrollments.getIamPolicy)
100 *
101 * @param string $resource REQUIRED: The resource for which the policy is being
102 * requested. See [Resource
103 * names](https://cloud.google.com/apis/design/resource_names) for the
104 * appropriate value for this field.
105 * @param array $optParams Optional parameters.
106 *
107 * @opt_param int options.requestedPolicyVersion Optional. The maximum policy
108 * version that will be used to format the policy. Valid values are 0, 1, and 3.
109 * Requests specifying an invalid value will be rejected. Requests for policies
110 * with any conditional role bindings must specify version 3. Policies with no
111 * conditional role bindings may specify any valid value or leave the field
112 * unset. The policy in the response might use the policy version that you
113 * specified, or it might use a lower policy version. For example, if you
114 * specify version 3, but the policy has no conditional role bindings, the
115 * response uses version 1. To learn which resources support conditions in their
116 * IAM policies, see the [IAM
117 * documentation](https://cloud.google.com/iam/help/conditions/resource-
118 * policies).
119 * @return Policy
120 * @throws \Google\Service\Exception
121 */
122 public function getIamPolicy($resource, $optParams = [])
123 {
124 $params = ['resource' => $resource];
125 $params = array_merge($params, $optParams);
126 return $this->call('getIamPolicy', [$params], Policy::class);
127 }
128 /**
129 * List Enrollments. (enrollments.listProjectsLocationsEnrollments)
130 *
131 * @param string $parent Required. The parent collection to list triggers on.
132 * @param array $optParams Optional parameters.
133 *
134 * @opt_param string filter Optional. The filter field that the list request
135 * will filter on. Possible filtersare described in https://google.aip.dev/160.
136 * @opt_param string orderBy Optional. The sorting order of the resources
137 * returned. Value should be a comma-separated list of fields. The default
138 * sorting order is ascending. To specify descending order for a field, append a
139 * `desc` suffix; for example: `name desc, update_time`.
140 * @opt_param int pageSize Optional. The maximum number of results to return on
141 * each page. Note: The service may send fewer.
142 * @opt_param string pageToken Optional. The page token; provide the value from
143 * the `next_page_token` field in a previous call to retrieve the subsequent
144 * page. When paginating, all other parameters provided must match the previous
145 * call that provided the page token.
146 * @return ListEnrollmentsResponse
147 * @throws \Google\Service\Exception
148 */
149 public function listProjectsLocationsEnrollments($parent, $optParams = [])
150 {
151 $params = ['parent' => $parent];
152 $params = array_merge($params, $optParams);
153 return $this->call('list', [$params], ListEnrollmentsResponse::class);
154 }
155 /**
156 * Update a single Enrollment. (enrollments.patch)
157 *
158 * @param string $name Identifier. Resource name of the form
159 * projects/{project}/locations/{location}/enrollments/{enrollment}
160 * @param Enrollment $postBody
161 * @param array $optParams Optional parameters.
162 *
163 * @opt_param bool allowMissing Optional. If set to true, and the Enrollment is
164 * not found, a new Enrollment will be created. In this situation, `update_mask`
165 * is ignored.
166 * @opt_param string updateMask Optional. The fields to be updated; only fields
167 * explicitly provided are updated. If no field mask is provided, all provided
168 * fields in the request are updated. To update all fields, provide a field mask
169 * of "*".
170 * @opt_param bool validateOnly Optional. If set, validate the request and
171 * preview the review, but do not post it.
172 * @return GoogleLongrunningOperation
173 * @throws \Google\Service\Exception
174 */
175 public function patch($name, Enrollment $postBody, $optParams = [])
176 {
177 $params = ['name' => $name, 'postBody' => $postBody];
178 $params = array_merge($params, $optParams);
179 return $this->call('patch', [$params], GoogleLongrunningOperation::class);
180 }
181 /**
182 * Sets the access control policy on the specified resource. Replaces any
183 * existing policy. Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and
184 * `PERMISSION_DENIED` errors. (enrollments.setIamPolicy)
185 *
186 * @param string $resource REQUIRED: The resource for which the policy is being
187 * specified. See [Resource
188 * names](https://cloud.google.com/apis/design/resource_names) for the
189 * appropriate value for this field.
190 * @param SetIamPolicyRequest $postBody
191 * @param array $optParams Optional parameters.
192 * @return Policy
193 * @throws \Google\Service\Exception
194 */
195 public function setIamPolicy($resource, SetIamPolicyRequest $postBody, $optParams = [])
196 {
197 $params = ['resource' => $resource, 'postBody' => $postBody];
198 $params = array_merge($params, $optParams);
199 return $this->call('setIamPolicy', [$params], Policy::class);
200 }
201 /**
202 * Returns permissions that a caller has on the specified resource. If the
203 * resource does not exist, this will return an empty set of permissions, not a
204 * `NOT_FOUND` error. Note: This operation is designed to be used for building
205 * permission-aware UIs and command-line tools, not for authorization checking.
206 * This operation may "fail open" without warning.
207 * (enrollments.testIamPermissions)
208 *
209 * @param string $resource REQUIRED: The resource for which the policy detail is
210 * being requested. See [Resource
211 * names](https://cloud.google.com/apis/design/resource_names) for the
212 * appropriate value for this field.
213 * @param TestIamPermissionsRequest $postBody
214 * @param array $optParams Optional parameters.
215 * @return TestIamPermissionsResponse
216 * @throws \Google\Service\Exception
217 */
218 public function testIamPermissions($resource, TestIamPermissionsRequest $postBody, $optParams = [])
219 {
220 $params = ['resource' => $resource, 'postBody' => $postBody];
221 $params = array_merge($params, $optParams);
222 return $this->call('testIamPermissions', [$params], TestIamPermissionsResponse::class);
223 }
224}
225
226// Adding a class alias for backwards compatibility with the previous class name.
227class_alias(ProjectsLocationsEnrollments::class, 'Google_Service_Eventarc_Resource_ProjectsLocationsEnrollments');
Note: See TracBrowser for help on using the repository browser.