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