[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\Logging\Resource;
|
---|
| 19 |
|
---|
| 20 | use Google\Service\Logging\ListBucketsResponse;
|
---|
| 21 | use Google\Service\Logging\LogBucket;
|
---|
| 22 | use Google\Service\Logging\LoggingEmpty;
|
---|
| 23 | use Google\Service\Logging\Operation;
|
---|
| 24 | use Google\Service\Logging\UndeleteBucketRequest;
|
---|
| 25 |
|
---|
| 26 | /**
|
---|
| 27 | * The "buckets" collection of methods.
|
---|
| 28 | * Typical usage is:
|
---|
| 29 | * <code>
|
---|
| 30 | * $loggingService = new Google\Service\Logging(...);
|
---|
| 31 | * $buckets = $loggingService->organizations_locations_buckets;
|
---|
| 32 | * </code>
|
---|
| 33 | */
|
---|
| 34 | class OrganizationsLocationsBuckets extends \Google\Service\Resource
|
---|
| 35 | {
|
---|
| 36 | /**
|
---|
| 37 | * Creates a log bucket that can be used to store log entries. After a bucket
|
---|
| 38 | * has been created, the bucket's location cannot be changed. (buckets.create)
|
---|
| 39 | *
|
---|
| 40 | * @param string $parent Required. The resource in which to create the log
|
---|
| 41 | * bucket: "projects/[PROJECT_ID]/locations/[LOCATION_ID]" For
|
---|
| 42 | * example:"projects/my-project/locations/global"
|
---|
| 43 | * @param LogBucket $postBody
|
---|
| 44 | * @param array $optParams Optional parameters.
|
---|
| 45 | *
|
---|
| 46 | * @opt_param string bucketId Required. A client-assigned identifier such as
|
---|
| 47 | * "my-bucket". Identifiers are limited to 100 characters and can include only
|
---|
| 48 | * letters, digits, underscores, hyphens, and periods. Bucket identifiers must
|
---|
| 49 | * start with an alphanumeric character.
|
---|
| 50 | * @return LogBucket
|
---|
| 51 | * @throws \Google\Service\Exception
|
---|
| 52 | */
|
---|
| 53 | public function create($parent, LogBucket $postBody, $optParams = [])
|
---|
| 54 | {
|
---|
| 55 | $params = ['parent' => $parent, 'postBody' => $postBody];
|
---|
| 56 | $params = array_merge($params, $optParams);
|
---|
| 57 | return $this->call('create', [$params], LogBucket::class);
|
---|
| 58 | }
|
---|
| 59 | /**
|
---|
| 60 | * Creates a log bucket asynchronously that can be used to store log
|
---|
| 61 | * entries.After a bucket has been created, the bucket's location cannot be
|
---|
| 62 | * changed. (buckets.createAsync)
|
---|
| 63 | *
|
---|
| 64 | * @param string $parent Required. The resource in which to create the log
|
---|
| 65 | * bucket: "projects/[PROJECT_ID]/locations/[LOCATION_ID]" For
|
---|
| 66 | * example:"projects/my-project/locations/global"
|
---|
| 67 | * @param LogBucket $postBody
|
---|
| 68 | * @param array $optParams Optional parameters.
|
---|
| 69 | *
|
---|
| 70 | * @opt_param string bucketId Required. A client-assigned identifier such as
|
---|
| 71 | * "my-bucket". Identifiers are limited to 100 characters and can include only
|
---|
| 72 | * letters, digits, underscores, hyphens, and periods. Bucket identifiers must
|
---|
| 73 | * start with an alphanumeric character.
|
---|
| 74 | * @return Operation
|
---|
| 75 | * @throws \Google\Service\Exception
|
---|
| 76 | */
|
---|
| 77 | public function createAsync($parent, LogBucket $postBody, $optParams = [])
|
---|
| 78 | {
|
---|
| 79 | $params = ['parent' => $parent, 'postBody' => $postBody];
|
---|
| 80 | $params = array_merge($params, $optParams);
|
---|
| 81 | return $this->call('createAsync', [$params], Operation::class);
|
---|
| 82 | }
|
---|
| 83 | /**
|
---|
| 84 | * Deletes a log bucket.Changes the bucket's lifecycle_state to the
|
---|
| 85 | * DELETE_REQUESTED state. After 7 days, the bucket will be purged and all log
|
---|
| 86 | * entries in the bucket will be permanently deleted. (buckets.delete)
|
---|
| 87 | *
|
---|
| 88 | * @param string $name Required. The full resource name of the bucket to delete.
|
---|
| 89 | * "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
|
---|
| 90 | * "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
|
---|
| 91 | * "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET
|
---|
| 92 | * _ID]" "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" For
|
---|
| 93 | * example:"projects/my-project/locations/global/buckets/my-bucket"
|
---|
| 94 | * @param array $optParams Optional parameters.
|
---|
| 95 | * @return LoggingEmpty
|
---|
| 96 | * @throws \Google\Service\Exception
|
---|
| 97 | */
|
---|
| 98 | public function delete($name, $optParams = [])
|
---|
| 99 | {
|
---|
| 100 | $params = ['name' => $name];
|
---|
| 101 | $params = array_merge($params, $optParams);
|
---|
| 102 | return $this->call('delete', [$params], LoggingEmpty::class);
|
---|
| 103 | }
|
---|
| 104 | /**
|
---|
| 105 | * Gets a log bucket. (buckets.get)
|
---|
| 106 | *
|
---|
| 107 | * @param string $name Required. The resource name of the bucket:
|
---|
| 108 | * "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
|
---|
| 109 | * "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
|
---|
| 110 | * "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET
|
---|
| 111 | * _ID]" "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" For
|
---|
| 112 | * example:"projects/my-project/locations/global/buckets/my-bucket"
|
---|
| 113 | * @param array $optParams Optional parameters.
|
---|
| 114 | * @return LogBucket
|
---|
| 115 | * @throws \Google\Service\Exception
|
---|
| 116 | */
|
---|
| 117 | public function get($name, $optParams = [])
|
---|
| 118 | {
|
---|
| 119 | $params = ['name' => $name];
|
---|
| 120 | $params = array_merge($params, $optParams);
|
---|
| 121 | return $this->call('get', [$params], LogBucket::class);
|
---|
| 122 | }
|
---|
| 123 | /**
|
---|
| 124 | * Lists log buckets. (buckets.listOrganizationsLocationsBuckets)
|
---|
| 125 | *
|
---|
| 126 | * @param string $parent Required. The parent resource whose buckets are to be
|
---|
| 127 | * listed: "projects/[PROJECT_ID]/locations/[LOCATION_ID]"
|
---|
| 128 | * "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]"
|
---|
| 129 | * "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]"
|
---|
| 130 | * "folders/[FOLDER_ID]/locations/[LOCATION_ID]" Note: The locations portion of
|
---|
| 131 | * the resource must be specified, but supplying the character - in place of
|
---|
| 132 | * LOCATION_ID will return all buckets.
|
---|
| 133 | * @param array $optParams Optional parameters.
|
---|
| 134 | *
|
---|
| 135 | * @opt_param int pageSize Optional. The maximum number of results to return
|
---|
| 136 | * from this request. Non-positive values are ignored. The presence of
|
---|
| 137 | * nextPageToken in the response indicates that more results might be available.
|
---|
| 138 | * @opt_param string pageToken Optional. If present, then retrieve the next
|
---|
| 139 | * batch of results from the preceding call to this method. pageToken must be
|
---|
| 140 | * the value of nextPageToken from the previous response. The values of other
|
---|
| 141 | * method parameters should be identical to those in the previous call.
|
---|
| 142 | * @return ListBucketsResponse
|
---|
| 143 | * @throws \Google\Service\Exception
|
---|
| 144 | */
|
---|
| 145 | public function listOrganizationsLocationsBuckets($parent, $optParams = [])
|
---|
| 146 | {
|
---|
| 147 | $params = ['parent' => $parent];
|
---|
| 148 | $params = array_merge($params, $optParams);
|
---|
| 149 | return $this->call('list', [$params], ListBucketsResponse::class);
|
---|
| 150 | }
|
---|
| 151 | /**
|
---|
| 152 | * Updates a log bucket.If the bucket has a lifecycle_state of DELETE_REQUESTED,
|
---|
| 153 | * then FAILED_PRECONDITION will be returned.After a bucket has been created,
|
---|
| 154 | * the bucket's location cannot be changed. (buckets.patch)
|
---|
| 155 | *
|
---|
| 156 | * @param string $name Required. The full resource name of the bucket to update.
|
---|
| 157 | * "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
|
---|
| 158 | * "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
|
---|
| 159 | * "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET
|
---|
| 160 | * _ID]" "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" For
|
---|
| 161 | * example:"projects/my-project/locations/global/buckets/my-bucket"
|
---|
| 162 | * @param LogBucket $postBody
|
---|
| 163 | * @param array $optParams Optional parameters.
|
---|
| 164 | *
|
---|
| 165 | * @opt_param string updateMask Required. Field mask that specifies the fields
|
---|
| 166 | * in bucket that need an update. A bucket field will be overwritten if, and
|
---|
| 167 | * only if, it is in the update mask. name and output only fields cannot be
|
---|
| 168 | * updated.For a detailed FieldMask definition, see:
|
---|
| 169 | * https://developers.google.com/protocol-
|
---|
| 170 | * buffers/docs/reference/google.protobuf#google.protobuf.FieldMaskFor example:
|
---|
| 171 | * updateMask=retention_days
|
---|
| 172 | * @return LogBucket
|
---|
| 173 | * @throws \Google\Service\Exception
|
---|
| 174 | */
|
---|
| 175 | public function patch($name, LogBucket $postBody, $optParams = [])
|
---|
| 176 | {
|
---|
| 177 | $params = ['name' => $name, 'postBody' => $postBody];
|
---|
| 178 | $params = array_merge($params, $optParams);
|
---|
| 179 | return $this->call('patch', [$params], LogBucket::class);
|
---|
| 180 | }
|
---|
| 181 | /**
|
---|
| 182 | * Undeletes a log bucket. A bucket that has been deleted can be undeleted
|
---|
| 183 | * within the grace period of 7 days. (buckets.undelete)
|
---|
| 184 | *
|
---|
| 185 | * @param string $name Required. The full resource name of the bucket to
|
---|
| 186 | * undelete. "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
|
---|
| 187 | * "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
|
---|
| 188 | * "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET
|
---|
| 189 | * _ID]" "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" For
|
---|
| 190 | * example:"projects/my-project/locations/global/buckets/my-bucket"
|
---|
| 191 | * @param UndeleteBucketRequest $postBody
|
---|
| 192 | * @param array $optParams Optional parameters.
|
---|
| 193 | * @return LoggingEmpty
|
---|
| 194 | * @throws \Google\Service\Exception
|
---|
| 195 | */
|
---|
| 196 | public function undelete($name, UndeleteBucketRequest $postBody, $optParams = [])
|
---|
| 197 | {
|
---|
| 198 | $params = ['name' => $name, 'postBody' => $postBody];
|
---|
| 199 | $params = array_merge($params, $optParams);
|
---|
| 200 | return $this->call('undelete', [$params], LoggingEmpty::class);
|
---|
| 201 | }
|
---|
| 202 | /**
|
---|
| 203 | * Updates a log bucket asynchronously.If the bucket has a lifecycle_state of
|
---|
| 204 | * DELETE_REQUESTED, then FAILED_PRECONDITION will be returned.After a bucket
|
---|
| 205 | * has been created, the bucket's location cannot be changed.
|
---|
| 206 | * (buckets.updateAsync)
|
---|
| 207 | *
|
---|
| 208 | * @param string $name Required. The full resource name of the bucket to update.
|
---|
| 209 | * "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
|
---|
| 210 | * "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
|
---|
| 211 | * "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET
|
---|
| 212 | * _ID]" "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" For
|
---|
| 213 | * example:"projects/my-project/locations/global/buckets/my-bucket"
|
---|
| 214 | * @param LogBucket $postBody
|
---|
| 215 | * @param array $optParams Optional parameters.
|
---|
| 216 | *
|
---|
| 217 | * @opt_param string updateMask Required. Field mask that specifies the fields
|
---|
| 218 | * in bucket that need an update. A bucket field will be overwritten if, and
|
---|
| 219 | * only if, it is in the update mask. name and output only fields cannot be
|
---|
| 220 | * updated.For a detailed FieldMask definition, see:
|
---|
| 221 | * https://developers.google.com/protocol-
|
---|
| 222 | * buffers/docs/reference/google.protobuf#google.protobuf.FieldMaskFor example:
|
---|
| 223 | * updateMask=retention_days
|
---|
| 224 | * @return Operation
|
---|
| 225 | * @throws \Google\Service\Exception
|
---|
| 226 | */
|
---|
| 227 | public function updateAsync($name, LogBucket $postBody, $optParams = [])
|
---|
| 228 | {
|
---|
| 229 | $params = ['name' => $name, 'postBody' => $postBody];
|
---|
| 230 | $params = array_merge($params, $optParams);
|
---|
| 231 | return $this->call('updateAsync', [$params], Operation::class);
|
---|
| 232 | }
|
---|
| 233 | }
|
---|
| 234 |
|
---|
| 235 | // Adding a class alias for backwards compatibility with the previous class name.
|
---|
| 236 | class_alias(OrganizationsLocationsBuckets::class, 'Google_Service_Logging_Resource_OrganizationsLocationsBuckets');
|
---|