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\ChannelConnection;
|
---|
21 | use Google\Service\Eventarc\GoogleLongrunningOperation;
|
---|
22 | use Google\Service\Eventarc\ListChannelConnectionsResponse;
|
---|
23 | use Google\Service\Eventarc\Policy;
|
---|
24 | use Google\Service\Eventarc\SetIamPolicyRequest;
|
---|
25 | use Google\Service\Eventarc\TestIamPermissionsRequest;
|
---|
26 | use Google\Service\Eventarc\TestIamPermissionsResponse;
|
---|
27 |
|
---|
28 | /**
|
---|
29 | * The "channelConnections" collection of methods.
|
---|
30 | * Typical usage is:
|
---|
31 | * <code>
|
---|
32 | * $eventarcService = new Google\Service\Eventarc(...);
|
---|
33 | * $channelConnections = $eventarcService->projects_locations_channelConnections;
|
---|
34 | * </code>
|
---|
35 | */
|
---|
36 | class ProjectsLocationsChannelConnections extends \Google\Service\Resource
|
---|
37 | {
|
---|
38 | /**
|
---|
39 | * Create a new ChannelConnection in a particular project and location.
|
---|
40 | * (channelConnections.create)
|
---|
41 | *
|
---|
42 | * @param string $parent Required. The parent collection in which to add this
|
---|
43 | * channel connection.
|
---|
44 | * @param ChannelConnection $postBody
|
---|
45 | * @param array $optParams Optional parameters.
|
---|
46 | *
|
---|
47 | * @opt_param string channelConnectionId Required. The user-provided ID to be
|
---|
48 | * assigned to the channel connection.
|
---|
49 | * @return GoogleLongrunningOperation
|
---|
50 | * @throws \Google\Service\Exception
|
---|
51 | */
|
---|
52 | public function create($parent, ChannelConnection $postBody, $optParams = [])
|
---|
53 | {
|
---|
54 | $params = ['parent' => $parent, 'postBody' => $postBody];
|
---|
55 | $params = array_merge($params, $optParams);
|
---|
56 | return $this->call('create', [$params], GoogleLongrunningOperation::class);
|
---|
57 | }
|
---|
58 | /**
|
---|
59 | * Delete a single ChannelConnection. (channelConnections.delete)
|
---|
60 | *
|
---|
61 | * @param string $name Required. The name of the channel connection to delete.
|
---|
62 | * @param array $optParams Optional parameters.
|
---|
63 | * @return GoogleLongrunningOperation
|
---|
64 | * @throws \Google\Service\Exception
|
---|
65 | */
|
---|
66 | public function delete($name, $optParams = [])
|
---|
67 | {
|
---|
68 | $params = ['name' => $name];
|
---|
69 | $params = array_merge($params, $optParams);
|
---|
70 | return $this->call('delete', [$params], GoogleLongrunningOperation::class);
|
---|
71 | }
|
---|
72 | /**
|
---|
73 | * Get a single ChannelConnection. (channelConnections.get)
|
---|
74 | *
|
---|
75 | * @param string $name Required. The name of the channel connection to get.
|
---|
76 | * @param array $optParams Optional parameters.
|
---|
77 | * @return ChannelConnection
|
---|
78 | * @throws \Google\Service\Exception
|
---|
79 | */
|
---|
80 | public function get($name, $optParams = [])
|
---|
81 | {
|
---|
82 | $params = ['name' => $name];
|
---|
83 | $params = array_merge($params, $optParams);
|
---|
84 | return $this->call('get', [$params], ChannelConnection::class);
|
---|
85 | }
|
---|
86 | /**
|
---|
87 | * Gets the access control policy for a resource. Returns an empty policy if the
|
---|
88 | * resource exists and does not have a policy set.
|
---|
89 | * (channelConnections.getIamPolicy)
|
---|
90 | *
|
---|
91 | * @param string $resource REQUIRED: The resource for which the policy is being
|
---|
92 | * requested. See [Resource
|
---|
93 | * names](https://cloud.google.com/apis/design/resource_names) for the
|
---|
94 | * appropriate value for this field.
|
---|
95 | * @param array $optParams Optional parameters.
|
---|
96 | *
|
---|
97 | * @opt_param int options.requestedPolicyVersion Optional. The maximum policy
|
---|
98 | * version that will be used to format the policy. Valid values are 0, 1, and 3.
|
---|
99 | * Requests specifying an invalid value will be rejected. Requests for policies
|
---|
100 | * with any conditional role bindings must specify version 3. Policies with no
|
---|
101 | * conditional role bindings may specify any valid value or leave the field
|
---|
102 | * unset. The policy in the response might use the policy version that you
|
---|
103 | * specified, or it might use a lower policy version. For example, if you
|
---|
104 | * specify version 3, but the policy has no conditional role bindings, the
|
---|
105 | * response uses version 1. To learn which resources support conditions in their
|
---|
106 | * IAM policies, see the [IAM
|
---|
107 | * documentation](https://cloud.google.com/iam/help/conditions/resource-
|
---|
108 | * policies).
|
---|
109 | * @return Policy
|
---|
110 | * @throws \Google\Service\Exception
|
---|
111 | */
|
---|
112 | public function getIamPolicy($resource, $optParams = [])
|
---|
113 | {
|
---|
114 | $params = ['resource' => $resource];
|
---|
115 | $params = array_merge($params, $optParams);
|
---|
116 | return $this->call('getIamPolicy', [$params], Policy::class);
|
---|
117 | }
|
---|
118 | /**
|
---|
119 | * List channel connections.
|
---|
120 | * (channelConnections.listProjectsLocationsChannelConnections)
|
---|
121 | *
|
---|
122 | * @param string $parent Required. The parent collection from which to list
|
---|
123 | * channel connections.
|
---|
124 | * @param array $optParams Optional parameters.
|
---|
125 | *
|
---|
126 | * @opt_param int pageSize The maximum number of channel connections to return
|
---|
127 | * on each page. Note: The service may send fewer responses.
|
---|
128 | * @opt_param string pageToken The page token; provide the value from the
|
---|
129 | * `next_page_token` field in a previous `ListChannelConnections` call to
|
---|
130 | * retrieve the subsequent page. When paginating, all other parameters provided
|
---|
131 | * to `ListChannelConnetions` match the call that provided the page token.
|
---|
132 | * @return ListChannelConnectionsResponse
|
---|
133 | * @throws \Google\Service\Exception
|
---|
134 | */
|
---|
135 | public function listProjectsLocationsChannelConnections($parent, $optParams = [])
|
---|
136 | {
|
---|
137 | $params = ['parent' => $parent];
|
---|
138 | $params = array_merge($params, $optParams);
|
---|
139 | return $this->call('list', [$params], ListChannelConnectionsResponse::class);
|
---|
140 | }
|
---|
141 | /**
|
---|
142 | * Sets the access control policy on the specified resource. Replaces any
|
---|
143 | * existing policy. Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and
|
---|
144 | * `PERMISSION_DENIED` errors. (channelConnections.setIamPolicy)
|
---|
145 | *
|
---|
146 | * @param string $resource REQUIRED: The resource for which the policy is being
|
---|
147 | * specified. See [Resource
|
---|
148 | * names](https://cloud.google.com/apis/design/resource_names) for the
|
---|
149 | * appropriate value for this field.
|
---|
150 | * @param SetIamPolicyRequest $postBody
|
---|
151 | * @param array $optParams Optional parameters.
|
---|
152 | * @return Policy
|
---|
153 | * @throws \Google\Service\Exception
|
---|
154 | */
|
---|
155 | public function setIamPolicy($resource, SetIamPolicyRequest $postBody, $optParams = [])
|
---|
156 | {
|
---|
157 | $params = ['resource' => $resource, 'postBody' => $postBody];
|
---|
158 | $params = array_merge($params, $optParams);
|
---|
159 | return $this->call('setIamPolicy', [$params], Policy::class);
|
---|
160 | }
|
---|
161 | /**
|
---|
162 | * Returns permissions that a caller has on the specified resource. If the
|
---|
163 | * resource does not exist, this will return an empty set of permissions, not a
|
---|
164 | * `NOT_FOUND` error. Note: This operation is designed to be used for building
|
---|
165 | * permission-aware UIs and command-line tools, not for authorization checking.
|
---|
166 | * This operation may "fail open" without warning.
|
---|
167 | * (channelConnections.testIamPermissions)
|
---|
168 | *
|
---|
169 | * @param string $resource REQUIRED: The resource for which the policy detail is
|
---|
170 | * being requested. See [Resource
|
---|
171 | * names](https://cloud.google.com/apis/design/resource_names) for the
|
---|
172 | * appropriate value for this field.
|
---|
173 | * @param TestIamPermissionsRequest $postBody
|
---|
174 | * @param array $optParams Optional parameters.
|
---|
175 | * @return TestIamPermissionsResponse
|
---|
176 | * @throws \Google\Service\Exception
|
---|
177 | */
|
---|
178 | public function testIamPermissions($resource, TestIamPermissionsRequest $postBody, $optParams = [])
|
---|
179 | {
|
---|
180 | $params = ['resource' => $resource, 'postBody' => $postBody];
|
---|
181 | $params = array_merge($params, $optParams);
|
---|
182 | return $this->call('testIamPermissions', [$params], TestIamPermissionsResponse::class);
|
---|
183 | }
|
---|
184 | }
|
---|
185 |
|
---|
186 | // Adding a class alias for backwards compatibility with the previous class name.
|
---|
187 | class_alias(ProjectsLocationsChannelConnections::class, 'Google_Service_Eventarc_Resource_ProjectsLocationsChannelConnections');
|
---|