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