gestione documentale avanzata 1 parte

This commit is contained in:
2026-05-28 09:34:28 +02:00
parent 3471befb1a
commit f2b0833b90
34482 changed files with 4312269 additions and 546 deletions
@@ -0,0 +1,142 @@
<?php
/*
* Copyright 2014 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*/
namespace Google\Service\Storage\Resource;
use Google\Service\Storage\AnywhereCache as AnywhereCacheModel;
use Google\Service\Storage\AnywhereCaches;
use Google\Service\Storage\GoogleLongrunningOperation;
/**
* The "anywhereCache" collection of methods.
* Typical usage is:
* <code>
* $storageService = new Google\Service\Storage(...);
* $anywhereCache = $storageService->anywhereCache;
* </code>
*/
class AnywhereCache extends \Google\Service\Resource
{
/**
* Disables an Anywhere Cache instance. (anywhereCache.disable)
*
* @param string $bucket Name of the parent bucket.
* @param string $anywhereCacheId The ID of requested Anywhere Cache instance.
* @param array $optParams Optional parameters.
* @return AnywhereCacheModel
*/
public function disable($bucket, $anywhereCacheId, $optParams = [])
{
$params = ['bucket' => $bucket, 'anywhereCacheId' => $anywhereCacheId];
$params = array_merge($params, $optParams);
return $this->call('disable', [$params], AnywhereCacheModel::class);
}
/**
* Returns the metadata of an Anywhere Cache instance. (anywhereCache.get)
*
* @param string $bucket Name of the parent bucket.
* @param string $anywhereCacheId The ID of requested Anywhere Cache instance.
* @param array $optParams Optional parameters.
* @return AnywhereCacheModel
*/
public function get($bucket, $anywhereCacheId, $optParams = [])
{
$params = ['bucket' => $bucket, 'anywhereCacheId' => $anywhereCacheId];
$params = array_merge($params, $optParams);
return $this->call('get', [$params], AnywhereCacheModel::class);
}
/**
* Creates an Anywhere Cache instance. (anywhereCache.insert)
*
* @param string $bucket Name of the parent bucket.
* @param AnywhereCacheModel $postBody
* @param array $optParams Optional parameters.
* @return GoogleLongrunningOperation
*/
public function insert($bucket, AnywhereCacheModel $postBody, $optParams = [])
{
$params = ['bucket' => $bucket, 'postBody' => $postBody];
$params = array_merge($params, $optParams);
return $this->call('insert', [$params], GoogleLongrunningOperation::class);
}
/**
* Returns a list of Anywhere Cache instances of the bucket matching the
* criteria. (anywhereCache.listAnywhereCache)
*
* @param string $bucket Name of the parent bucket.
* @param array $optParams Optional parameters.
*
* @opt_param int pageSize Maximum number of items return in a single page of
* responses. Maximum 1000.
* @opt_param string pageToken A previously-returned page token representing
* part of the larger set of results to view.
* @return AnywhereCaches
*/
public function listAnywhereCache($bucket, $optParams = [])
{
$params = ['bucket' => $bucket];
$params = array_merge($params, $optParams);
return $this->call('list', [$params], AnywhereCaches::class);
}
/**
* Pauses an Anywhere Cache instance. (anywhereCache.pause)
*
* @param string $bucket Name of the parent bucket.
* @param string $anywhereCacheId The ID of requested Anywhere Cache instance.
* @param array $optParams Optional parameters.
* @return AnywhereCacheModel
*/
public function pause($bucket, $anywhereCacheId, $optParams = [])
{
$params = ['bucket' => $bucket, 'anywhereCacheId' => $anywhereCacheId];
$params = array_merge($params, $optParams);
return $this->call('pause', [$params], AnywhereCacheModel::class);
}
/**
* Resumes a paused or disabled Anywhere Cache instance. (anywhereCache.resume)
*
* @param string $bucket Name of the parent bucket.
* @param string $anywhereCacheId The ID of requested Anywhere Cache instance.
* @param array $optParams Optional parameters.
* @return AnywhereCacheModel
*/
public function resume($bucket, $anywhereCacheId, $optParams = [])
{
$params = ['bucket' => $bucket, 'anywhereCacheId' => $anywhereCacheId];
$params = array_merge($params, $optParams);
return $this->call('resume', [$params], AnywhereCacheModel::class);
}
/**
* Updates the config(ttl and admissionPolicy) of an Anywhere Cache instance.
* (anywhereCache.update)
*
* @param string $bucket Name of the parent bucket.
* @param string $anywhereCacheId The ID of requested Anywhere Cache instance.
* @param AnywhereCacheModel $postBody
* @param array $optParams Optional parameters.
* @return GoogleLongrunningOperation
*/
public function update($bucket, $anywhereCacheId, AnywhereCacheModel $postBody, $optParams = [])
{
$params = ['bucket' => $bucket, 'anywhereCacheId' => $anywhereCacheId, 'postBody' => $postBody];
$params = array_merge($params, $optParams);
return $this->call('update', [$params], GoogleLongrunningOperation::class);
}
}
// Adding a class alias for backwards compatibility with the previous class name.
class_alias(AnywhereCache::class, 'Google_Service_Storage_Resource_AnywhereCache');
@@ -0,0 +1,148 @@
<?php
/*
* Copyright 2014 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*/
namespace Google\Service\Storage\Resource;
use Google\Service\Storage\AnywhereCache;
use Google\Service\Storage\AnywhereCaches as AnywhereCachesModel;
use Google\Service\Storage\GoogleLongrunningOperation;
/**
* The "anywhereCaches" collection of methods.
* Typical usage is:
* <code>
* $storageService = new Google\Service\Storage(...);
* $anywhereCaches = $storageService->anywhereCaches;
* </code>
*/
class AnywhereCaches extends \Google\Service\Resource
{
/**
* Disables an Anywhere Cache instance. (anywhereCaches.disable)
*
* @param string $bucket Name of the parent bucket.
* @param string $anywhereCacheId The ID of requested Anywhere Cache instance.
* @param array $optParams Optional parameters.
* @return AnywhereCache
* @throws \Google\Service\Exception
*/
public function disable($bucket, $anywhereCacheId, $optParams = [])
{
$params = ['bucket' => $bucket, 'anywhereCacheId' => $anywhereCacheId];
$params = array_merge($params, $optParams);
return $this->call('disable', [$params], AnywhereCache::class);
}
/**
* Returns the metadata of an Anywhere Cache instance. (anywhereCaches.get)
*
* @param string $bucket Name of the parent bucket.
* @param string $anywhereCacheId The ID of requested Anywhere Cache instance.
* @param array $optParams Optional parameters.
* @return AnywhereCache
* @throws \Google\Service\Exception
*/
public function get($bucket, $anywhereCacheId, $optParams = [])
{
$params = ['bucket' => $bucket, 'anywhereCacheId' => $anywhereCacheId];
$params = array_merge($params, $optParams);
return $this->call('get', [$params], AnywhereCache::class);
}
/**
* Creates an Anywhere Cache instance. (anywhereCaches.insert)
*
* @param string $bucket Name of the parent bucket.
* @param AnywhereCache $postBody
* @param array $optParams Optional parameters.
* @return GoogleLongrunningOperation
* @throws \Google\Service\Exception
*/
public function insert($bucket, AnywhereCache $postBody, $optParams = [])
{
$params = ['bucket' => $bucket, 'postBody' => $postBody];
$params = array_merge($params, $optParams);
return $this->call('insert', [$params], GoogleLongrunningOperation::class);
}
/**
* Returns a list of Anywhere Cache instances of the bucket matching the
* criteria. (anywhereCaches.listAnywhereCaches)
*
* @param string $bucket Name of the parent bucket.
* @param array $optParams Optional parameters.
*
* @opt_param int pageSize Maximum number of items to return in a single page of
* responses. Maximum 1000.
* @opt_param string pageToken A previously-returned page token representing
* part of the larger set of results to view.
* @return AnywhereCachesModel
* @throws \Google\Service\Exception
*/
public function listAnywhereCaches($bucket, $optParams = [])
{
$params = ['bucket' => $bucket];
$params = array_merge($params, $optParams);
return $this->call('list', [$params], AnywhereCachesModel::class);
}
/**
* Pauses an Anywhere Cache instance. (anywhereCaches.pause)
*
* @param string $bucket Name of the parent bucket.
* @param string $anywhereCacheId The ID of requested Anywhere Cache instance.
* @param array $optParams Optional parameters.
* @return AnywhereCache
* @throws \Google\Service\Exception
*/
public function pause($bucket, $anywhereCacheId, $optParams = [])
{
$params = ['bucket' => $bucket, 'anywhereCacheId' => $anywhereCacheId];
$params = array_merge($params, $optParams);
return $this->call('pause', [$params], AnywhereCache::class);
}
/**
* Resumes a paused or disabled Anywhere Cache instance. (anywhereCaches.resume)
*
* @param string $bucket Name of the parent bucket.
* @param string $anywhereCacheId The ID of requested Anywhere Cache instance.
* @param array $optParams Optional parameters.
* @return AnywhereCache
* @throws \Google\Service\Exception
*/
public function resume($bucket, $anywhereCacheId, $optParams = [])
{
$params = ['bucket' => $bucket, 'anywhereCacheId' => $anywhereCacheId];
$params = array_merge($params, $optParams);
return $this->call('resume', [$params], AnywhereCache::class);
}
/**
* Updates the config of an Anywhere Cache instance. (anywhereCaches.update)
*
* @param string $bucket Name of the parent bucket.
* @param string $anywhereCacheId The ID of requested Anywhere Cache instance.
* @param AnywhereCache $postBody
* @param array $optParams Optional parameters.
* @return GoogleLongrunningOperation
* @throws \Google\Service\Exception
*/
public function update($bucket, $anywhereCacheId, AnywhereCache $postBody, $optParams = [])
{
$params = ['bucket' => $bucket, 'anywhereCacheId' => $anywhereCacheId, 'postBody' => $postBody];
$params = array_merge($params, $optParams);
return $this->call('update', [$params], GoogleLongrunningOperation::class);
}
}
// Adding a class alias for backwards compatibility with the previous class name.
class_alias(AnywhereCaches::class, 'Google_Service_Storage_Resource_AnywhereCaches');
@@ -0,0 +1,156 @@
<?php
/*
* Copyright 2014 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*/
namespace Google\Service\Storage\Resource;
use Google\Service\Storage\BucketAccessControl;
use Google\Service\Storage\BucketAccessControls as BucketAccessControlsModel;
/**
* The "bucketAccessControls" collection of methods.
* Typical usage is:
* <code>
* $storageService = new Google\Service\Storage(...);
* $bucketAccessControls = $storageService->bucketAccessControls;
* </code>
*/
class BucketAccessControls extends \Google\Service\Resource
{
/**
* Permanently deletes the ACL entry for the specified entity on the specified
* bucket. (bucketAccessControls.delete)
*
* @param string $bucket Name of a bucket.
* @param string $entity The entity holding the permission. Can be user-userId,
* user-emailAddress, group-groupId, group-emailAddress, allUsers, or
* allAuthenticatedUsers.
* @param array $optParams Optional parameters.
*
* @opt_param string userProject The project to be billed for this request.
* Required for Requester Pays buckets.
* @throws \Google\Service\Exception
*/
public function delete($bucket, $entity, $optParams = [])
{
$params = ['bucket' => $bucket, 'entity' => $entity];
$params = array_merge($params, $optParams);
return $this->call('delete', [$params]);
}
/**
* Returns the ACL entry for the specified entity on the specified bucket.
* (bucketAccessControls.get)
*
* @param string $bucket Name of a bucket.
* @param string $entity The entity holding the permission. Can be user-userId,
* user-emailAddress, group-groupId, group-emailAddress, allUsers, or
* allAuthenticatedUsers.
* @param array $optParams Optional parameters.
*
* @opt_param string userProject The project to be billed for this request.
* Required for Requester Pays buckets.
* @return BucketAccessControl
* @throws \Google\Service\Exception
*/
public function get($bucket, $entity, $optParams = [])
{
$params = ['bucket' => $bucket, 'entity' => $entity];
$params = array_merge($params, $optParams);
return $this->call('get', [$params], BucketAccessControl::class);
}
/**
* Creates a new ACL entry on the specified bucket.
* (bucketAccessControls.insert)
*
* @param string $bucket Name of a bucket.
* @param BucketAccessControl $postBody
* @param array $optParams Optional parameters.
*
* @opt_param string userProject The project to be billed for this request.
* Required for Requester Pays buckets.
* @return BucketAccessControl
* @throws \Google\Service\Exception
*/
public function insert($bucket, BucketAccessControl $postBody, $optParams = [])
{
$params = ['bucket' => $bucket, 'postBody' => $postBody];
$params = array_merge($params, $optParams);
return $this->call('insert', [$params], BucketAccessControl::class);
}
/**
* Retrieves ACL entries on the specified bucket.
* (bucketAccessControls.listBucketAccessControls)
*
* @param string $bucket Name of a bucket.
* @param array $optParams Optional parameters.
*
* @opt_param string userProject The project to be billed for this request.
* Required for Requester Pays buckets.
* @return BucketAccessControlsModel
* @throws \Google\Service\Exception
*/
public function listBucketAccessControls($bucket, $optParams = [])
{
$params = ['bucket' => $bucket];
$params = array_merge($params, $optParams);
return $this->call('list', [$params], BucketAccessControlsModel::class);
}
/**
* Patches an ACL entry on the specified bucket. (bucketAccessControls.patch)
*
* @param string $bucket Name of a bucket.
* @param string $entity The entity holding the permission. Can be user-userId,
* user-emailAddress, group-groupId, group-emailAddress, allUsers, or
* allAuthenticatedUsers.
* @param BucketAccessControl $postBody
* @param array $optParams Optional parameters.
*
* @opt_param string userProject The project to be billed for this request.
* Required for Requester Pays buckets.
* @return BucketAccessControl
* @throws \Google\Service\Exception
*/
public function patch($bucket, $entity, BucketAccessControl $postBody, $optParams = [])
{
$params = ['bucket' => $bucket, 'entity' => $entity, 'postBody' => $postBody];
$params = array_merge($params, $optParams);
return $this->call('patch', [$params], BucketAccessControl::class);
}
/**
* Updates an ACL entry on the specified bucket. (bucketAccessControls.update)
*
* @param string $bucket Name of a bucket.
* @param string $entity The entity holding the permission. Can be user-userId,
* user-emailAddress, group-groupId, group-emailAddress, allUsers, or
* allAuthenticatedUsers.
* @param BucketAccessControl $postBody
* @param array $optParams Optional parameters.
*
* @opt_param string userProject The project to be billed for this request.
* Required for Requester Pays buckets.
* @return BucketAccessControl
* @throws \Google\Service\Exception
*/
public function update($bucket, $entity, BucketAccessControl $postBody, $optParams = [])
{
$params = ['bucket' => $bucket, 'entity' => $entity, 'postBody' => $postBody];
$params = array_merge($params, $optParams);
return $this->call('update', [$params], BucketAccessControl::class);
}
}
// Adding a class alias for backwards compatibility with the previous class name.
class_alias(BucketAccessControls::class, 'Google_Service_Storage_Resource_BucketAccessControls');
@@ -0,0 +1,339 @@
<?php
/*
* Copyright 2014 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*/
namespace Google\Service\Storage\Resource;
use Google\Service\Storage\Bucket;
use Google\Service\Storage\BucketStorageLayout;
use Google\Service\Storage\Buckets as BucketsModel;
use Google\Service\Storage\GoogleLongrunningOperation;
use Google\Service\Storage\Policy;
use Google\Service\Storage\RelocateBucketRequest;
use Google\Service\Storage\TestIamPermissionsResponse;
/**
* The "buckets" collection of methods.
* Typical usage is:
* <code>
* $storageService = new Google\Service\Storage(...);
* $buckets = $storageService->buckets;
* </code>
*/
class Buckets extends \Google\Service\Resource
{
/**
* Deletes an empty bucket. Deletions are permanent unless soft delete is
* enabled on the bucket. (buckets.delete)
*
* @param string $bucket Name of a bucket.
* @param array $optParams Optional parameters.
*
* @opt_param string ifMetagenerationMatch If set, only deletes the bucket if
* its metageneration matches this value.
* @opt_param string ifMetagenerationNotMatch If set, only deletes the bucket if
* its metageneration does not match this value.
* @opt_param string userProject The project to be billed for this request.
* Required for Requester Pays buckets.
* @throws \Google\Service\Exception
*/
public function delete($bucket, $optParams = [])
{
$params = ['bucket' => $bucket];
$params = array_merge($params, $optParams);
return $this->call('delete', [$params]);
}
/**
* Returns metadata for the specified bucket. (buckets.get)
*
* @param string $bucket Name of a bucket.
* @param array $optParams Optional parameters.
*
* @opt_param string generation If present, specifies the generation of the
* bucket. This is required if softDeleted is true.
* @opt_param string ifMetagenerationMatch Makes the return of the bucket
* metadata conditional on whether the bucket's current metageneration matches
* the given value.
* @opt_param string ifMetagenerationNotMatch Makes the return of the bucket
* metadata conditional on whether the bucket's current metageneration does not
* match the given value.
* @opt_param string projection Set of properties to return. Defaults to noAcl.
* @opt_param bool softDeleted If true, return the soft-deleted version of this
* bucket. The default is false. For more information, see [Soft
* Delete](https://cloud.google.com/storage/docs/soft-delete).
* @opt_param string userProject The project to be billed for this request.
* Required for Requester Pays buckets.
* @return Bucket
* @throws \Google\Service\Exception
*/
public function get($bucket, $optParams = [])
{
$params = ['bucket' => $bucket];
$params = array_merge($params, $optParams);
return $this->call('get', [$params], Bucket::class);
}
/**
* Returns an IAM policy for the specified bucket. (buckets.getIamPolicy)
*
* @param string $bucket Name of a bucket.
* @param array $optParams Optional parameters.
*
* @opt_param int optionsRequestedPolicyVersion The IAM policy format version to
* be returned. If the optionsRequestedPolicyVersion is for an older version
* that doesn't support part of the requested IAM policy, the request fails.
* @opt_param string userProject The project to be billed for this request.
* Required for Requester Pays buckets.
* @return Policy
* @throws \Google\Service\Exception
*/
public function getIamPolicy($bucket, $optParams = [])
{
$params = ['bucket' => $bucket];
$params = array_merge($params, $optParams);
return $this->call('getIamPolicy', [$params], Policy::class);
}
/**
* Returns the storage layout configuration for the specified bucket. Note that
* this operation requires storage.objects.list permission.
* (buckets.getStorageLayout)
*
* @param string $bucket Name of a bucket.
* @param array $optParams Optional parameters.
*
* @opt_param string prefix An optional prefix used for permission check. It is
* useful when the caller only has storage.objects.list permission under a
* specific prefix.
* @return BucketStorageLayout
* @throws \Google\Service\Exception
*/
public function getStorageLayout($bucket, $optParams = [])
{
$params = ['bucket' => $bucket];
$params = array_merge($params, $optParams);
return $this->call('getStorageLayout', [$params], BucketStorageLayout::class);
}
/**
* Creates a new bucket. (buckets.insert)
*
* @param string $project A valid API project identifier.
* @param Bucket $postBody
* @param array $optParams Optional parameters.
*
* @opt_param bool enableObjectRetention When set to true, object retention is
* enabled for this bucket.
* @opt_param string predefinedAcl Apply a predefined set of access controls to
* this bucket.
* @opt_param string predefinedDefaultObjectAcl Apply a predefined set of
* default object access controls to this bucket.
* @opt_param string projection Set of properties to return. Defaults to noAcl,
* unless the bucket resource specifies acl or defaultObjectAcl properties, when
* it defaults to full.
* @opt_param string userProject The project to be billed for this request.
* @return Bucket
* @throws \Google\Service\Exception
*/
public function insert($project, Bucket $postBody, $optParams = [])
{
$params = ['project' => $project, 'postBody' => $postBody];
$params = array_merge($params, $optParams);
return $this->call('insert', [$params], Bucket::class);
}
/**
* Retrieves a list of buckets for a given project. (buckets.listBuckets)
*
* @param string $project A valid API project identifier.
* @param array $optParams Optional parameters.
*
* @opt_param string maxResults Maximum number of buckets to return in a single
* response. The service will use this parameter or 1,000 items, whichever is
* smaller.
* @opt_param string pageToken A previously-returned page token representing
* part of the larger set of results to view.
* @opt_param string prefix Filter results to buckets whose names begin with
* this prefix.
* @opt_param string projection Set of properties to return. Defaults to noAcl.
* @opt_param bool returnPartialSuccess If true, return a list of bucket
* resource names for buckets that are in unreachable locations.
* @opt_param bool softDeleted If true, only soft-deleted bucket versions will
* be returned. The default is false. For more information, see [Soft
* Delete](https://cloud.google.com/storage/docs/soft-delete).
* @opt_param string userProject The project to be billed for this request.
* @return BucketsModel
* @throws \Google\Service\Exception
*/
public function listBuckets($project, $optParams = [])
{
$params = ['project' => $project];
$params = array_merge($params, $optParams);
return $this->call('list', [$params], BucketsModel::class);
}
/**
* Locks retention policy on a bucket. (buckets.lockRetentionPolicy)
*
* @param string $bucket Name of a bucket.
* @param string $ifMetagenerationMatch Makes the operation conditional on
* whether bucket's current metageneration matches the given value.
* @param array $optParams Optional parameters.
*
* @opt_param string userProject The project to be billed for this request.
* Required for Requester Pays buckets.
* @return Bucket
* @throws \Google\Service\Exception
*/
public function lockRetentionPolicy($bucket, $ifMetagenerationMatch, $optParams = [])
{
$params = ['bucket' => $bucket, 'ifMetagenerationMatch' => $ifMetagenerationMatch];
$params = array_merge($params, $optParams);
return $this->call('lockRetentionPolicy', [$params], Bucket::class);
}
/**
* Patches a bucket. Changes to the bucket will be readable immediately after
* writing, but configuration changes may take time to propagate.
* (buckets.patch)
*
* @param string $bucket Name of a bucket.
* @param Bucket $postBody
* @param array $optParams Optional parameters.
*
* @opt_param string ifMetagenerationMatch Makes the return of the bucket
* metadata conditional on whether the bucket's current metageneration matches
* the given value.
* @opt_param string ifMetagenerationNotMatch Makes the return of the bucket
* metadata conditional on whether the bucket's current metageneration does not
* match the given value.
* @opt_param string predefinedAcl Apply a predefined set of access controls to
* this bucket.
* @opt_param string predefinedDefaultObjectAcl Apply a predefined set of
* default object access controls to this bucket.
* @opt_param string projection Set of properties to return. Defaults to full.
* @opt_param string userProject The project to be billed for this request.
* Required for Requester Pays buckets.
* @return Bucket
* @throws \Google\Service\Exception
*/
public function patch($bucket, Bucket $postBody, $optParams = [])
{
$params = ['bucket' => $bucket, 'postBody' => $postBody];
$params = array_merge($params, $optParams);
return $this->call('patch', [$params], Bucket::class);
}
/**
* Initiates a long-running Relocate Bucket operation on the specified bucket.
* (buckets.relocate)
*
* @param string $bucket Name of the bucket to be moved.
* @param RelocateBucketRequest $postBody
* @param array $optParams Optional parameters.
* @return GoogleLongrunningOperation
* @throws \Google\Service\Exception
*/
public function relocate($bucket, RelocateBucketRequest $postBody, $optParams = [])
{
$params = ['bucket' => $bucket, 'postBody' => $postBody];
$params = array_merge($params, $optParams);
return $this->call('relocate', [$params], GoogleLongrunningOperation::class);
}
/**
* Restores a soft-deleted bucket. (buckets.restore)
*
* @param string $bucket Name of a bucket.
* @param string $generation Generation of a bucket.
* @param array $optParams Optional parameters.
*
* @opt_param string projection Set of properties to return. Defaults to full.
* @opt_param string userProject The project to be billed for this request.
* Required for Requester Pays buckets.
* @return Bucket
* @throws \Google\Service\Exception
*/
public function restore($bucket, $generation, $optParams = [])
{
$params = ['bucket' => $bucket, 'generation' => $generation];
$params = array_merge($params, $optParams);
return $this->call('restore', [$params], Bucket::class);
}
/**
* Updates an IAM policy for the specified bucket. (buckets.setIamPolicy)
*
* @param string $bucket Name of a bucket.
* @param Policy $postBody
* @param array $optParams Optional parameters.
*
* @opt_param string userProject The project to be billed for this request.
* Required for Requester Pays buckets.
* @return Policy
* @throws \Google\Service\Exception
*/
public function setIamPolicy($bucket, Policy $postBody, $optParams = [])
{
$params = ['bucket' => $bucket, 'postBody' => $postBody];
$params = array_merge($params, $optParams);
return $this->call('setIamPolicy', [$params], Policy::class);
}
/**
* Tests a set of permissions on the given bucket to see which, if any, are held
* by the caller. (buckets.testIamPermissions)
*
* @param string $bucket Name of a bucket.
* @param string|array $permissions Permissions to test.
* @param array $optParams Optional parameters.
*
* @opt_param string userProject The project to be billed for this request.
* Required for Requester Pays buckets.
* @return TestIamPermissionsResponse
* @throws \Google\Service\Exception
*/
public function testIamPermissions($bucket, $permissions, $optParams = [])
{
$params = ['bucket' => $bucket, 'permissions' => $permissions];
$params = array_merge($params, $optParams);
return $this->call('testIamPermissions', [$params], TestIamPermissionsResponse::class);
}
/**
* Updates a bucket. Changes to the bucket will be readable immediately after
* writing, but configuration changes may take time to propagate.
* (buckets.update)
*
* @param string $bucket Name of a bucket.
* @param Bucket $postBody
* @param array $optParams Optional parameters.
*
* @opt_param string ifMetagenerationMatch Makes the return of the bucket
* metadata conditional on whether the bucket's current metageneration matches
* the given value.
* @opt_param string ifMetagenerationNotMatch Makes the return of the bucket
* metadata conditional on whether the bucket's current metageneration does not
* match the given value.
* @opt_param string predefinedAcl Apply a predefined set of access controls to
* this bucket.
* @opt_param string predefinedDefaultObjectAcl Apply a predefined set of
* default object access controls to this bucket.
* @opt_param string projection Set of properties to return. Defaults to full.
* @opt_param string userProject The project to be billed for this request.
* Required for Requester Pays buckets.
* @return Bucket
* @throws \Google\Service\Exception
*/
public function update($bucket, Bucket $postBody, $optParams = [])
{
$params = ['bucket' => $bucket, 'postBody' => $postBody];
$params = array_merge($params, $optParams);
return $this->call('update', [$params], Bucket::class);
}
}
// Adding a class alias for backwards compatibility with the previous class name.
class_alias(Buckets::class, 'Google_Service_Storage_Resource_Buckets');
@@ -0,0 +1,48 @@
<?php
/*
* Copyright 2014 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*/
namespace Google\Service\Storage\Resource;
use Google\Service\Storage\Channel;
/**
* The "channels" collection of methods.
* Typical usage is:
* <code>
* $storageService = new Google\Service\Storage(...);
* $channels = $storageService->channels;
* </code>
*/
class Channels extends \Google\Service\Resource
{
/**
* Stop watching resources through this channel (channels.stop)
*
* @param Channel $postBody
* @param array $optParams Optional parameters.
* @throws \Google\Service\Exception
*/
public function stop(Channel $postBody, $optParams = [])
{
$params = ['postBody' => $postBody];
$params = array_merge($params, $optParams);
return $this->call('stop', [$params]);
}
}
// Adding a class alias for backwards compatibility with the previous class name.
class_alias(Channels::class, 'Google_Service_Storage_Resource_Channels');
@@ -0,0 +1,163 @@
<?php
/*
* Copyright 2014 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*/
namespace Google\Service\Storage\Resource;
use Google\Service\Storage\ObjectAccessControl;
use Google\Service\Storage\ObjectAccessControls as ObjectAccessControlsModel;
/**
* The "defaultObjectAccessControls" collection of methods.
* Typical usage is:
* <code>
* $storageService = new Google\Service\Storage(...);
* $defaultObjectAccessControls = $storageService->defaultObjectAccessControls;
* </code>
*/
class DefaultObjectAccessControls extends \Google\Service\Resource
{
/**
* Permanently deletes the default object ACL entry for the specified entity on
* the specified bucket. (defaultObjectAccessControls.delete)
*
* @param string $bucket Name of a bucket.
* @param string $entity The entity holding the permission. Can be user-userId,
* user-emailAddress, group-groupId, group-emailAddress, allUsers, or
* allAuthenticatedUsers.
* @param array $optParams Optional parameters.
*
* @opt_param string userProject The project to be billed for this request.
* Required for Requester Pays buckets.
* @throws \Google\Service\Exception
*/
public function delete($bucket, $entity, $optParams = [])
{
$params = ['bucket' => $bucket, 'entity' => $entity];
$params = array_merge($params, $optParams);
return $this->call('delete', [$params]);
}
/**
* Returns the default object ACL entry for the specified entity on the
* specified bucket. (defaultObjectAccessControls.get)
*
* @param string $bucket Name of a bucket.
* @param string $entity The entity holding the permission. Can be user-userId,
* user-emailAddress, group-groupId, group-emailAddress, allUsers, or
* allAuthenticatedUsers.
* @param array $optParams Optional parameters.
*
* @opt_param string userProject The project to be billed for this request.
* Required for Requester Pays buckets.
* @return ObjectAccessControl
* @throws \Google\Service\Exception
*/
public function get($bucket, $entity, $optParams = [])
{
$params = ['bucket' => $bucket, 'entity' => $entity];
$params = array_merge($params, $optParams);
return $this->call('get', [$params], ObjectAccessControl::class);
}
/**
* Creates a new default object ACL entry on the specified bucket.
* (defaultObjectAccessControls.insert)
*
* @param string $bucket Name of a bucket.
* @param ObjectAccessControl $postBody
* @param array $optParams Optional parameters.
*
* @opt_param string userProject The project to be billed for this request.
* Required for Requester Pays buckets.
* @return ObjectAccessControl
* @throws \Google\Service\Exception
*/
public function insert($bucket, ObjectAccessControl $postBody, $optParams = [])
{
$params = ['bucket' => $bucket, 'postBody' => $postBody];
$params = array_merge($params, $optParams);
return $this->call('insert', [$params], ObjectAccessControl::class);
}
/**
* Retrieves default object ACL entries on the specified bucket.
* (defaultObjectAccessControls.listDefaultObjectAccessControls)
*
* @param string $bucket Name of a bucket.
* @param array $optParams Optional parameters.
*
* @opt_param string ifMetagenerationMatch If present, only return default ACL
* listing if the bucket's current metageneration matches this value.
* @opt_param string ifMetagenerationNotMatch If present, only return default
* ACL listing if the bucket's current metageneration does not match the given
* value.
* @opt_param string userProject The project to be billed for this request.
* Required for Requester Pays buckets.
* @return ObjectAccessControlsModel
* @throws \Google\Service\Exception
*/
public function listDefaultObjectAccessControls($bucket, $optParams = [])
{
$params = ['bucket' => $bucket];
$params = array_merge($params, $optParams);
return $this->call('list', [$params], ObjectAccessControlsModel::class);
}
/**
* Patches a default object ACL entry on the specified bucket.
* (defaultObjectAccessControls.patch)
*
* @param string $bucket Name of a bucket.
* @param string $entity The entity holding the permission. Can be user-userId,
* user-emailAddress, group-groupId, group-emailAddress, allUsers, or
* allAuthenticatedUsers.
* @param ObjectAccessControl $postBody
* @param array $optParams Optional parameters.
*
* @opt_param string userProject The project to be billed for this request.
* Required for Requester Pays buckets.
* @return ObjectAccessControl
* @throws \Google\Service\Exception
*/
public function patch($bucket, $entity, ObjectAccessControl $postBody, $optParams = [])
{
$params = ['bucket' => $bucket, 'entity' => $entity, 'postBody' => $postBody];
$params = array_merge($params, $optParams);
return $this->call('patch', [$params], ObjectAccessControl::class);
}
/**
* Updates a default object ACL entry on the specified bucket.
* (defaultObjectAccessControls.update)
*
* @param string $bucket Name of a bucket.
* @param string $entity The entity holding the permission. Can be user-userId,
* user-emailAddress, group-groupId, group-emailAddress, allUsers, or
* allAuthenticatedUsers.
* @param ObjectAccessControl $postBody
* @param array $optParams Optional parameters.
*
* @opt_param string userProject The project to be billed for this request.
* Required for Requester Pays buckets.
* @return ObjectAccessControl
* @throws \Google\Service\Exception
*/
public function update($bucket, $entity, ObjectAccessControl $postBody, $optParams = [])
{
$params = ['bucket' => $bucket, 'entity' => $entity, 'postBody' => $postBody];
$params = array_merge($params, $optParams);
return $this->call('update', [$params], ObjectAccessControl::class);
}
}
// Adding a class alias for backwards compatibility with the previous class name.
class_alias(DefaultObjectAccessControls::class, 'Google_Service_Storage_Resource_DefaultObjectAccessControls');
@@ -0,0 +1,178 @@
<?php
/*
* Copyright 2014 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*/
namespace Google\Service\Storage\Resource;
use Google\Service\Storage\Folder;
use Google\Service\Storage\Folders as FoldersModel;
use Google\Service\Storage\GoogleLongrunningOperation;
/**
* The "folders" collection of methods.
* Typical usage is:
* <code>
* $storageService = new Google\Service\Storage(...);
* $folders = $storageService->folders;
* </code>
*/
class Folders extends \Google\Service\Resource
{
/**
* Permanently deletes a folder. Only applicable to buckets with hierarchical
* namespace enabled. (folders.delete)
*
* @param string $bucket Name of the bucket in which the folder resides.
* @param string $folder Name of a folder.
* @param array $optParams Optional parameters.
*
* @opt_param string ifMetagenerationMatch If set, only deletes the folder if
* its metageneration matches this value.
* @opt_param string ifMetagenerationNotMatch If set, only deletes the folder if
* its metageneration does not match this value.
* @throws \Google\Service\Exception
*/
public function delete($bucket, $folder, $optParams = [])
{
$params = ['bucket' => $bucket, 'folder' => $folder];
$params = array_merge($params, $optParams);
return $this->call('delete', [$params]);
}
/**
* Deletes a folder recursively. Only applicable to buckets with hierarchical
* namespace enabled. (folders.deleteRecursive)
*
* @param string $bucket Name of the bucket in which the folder resides.
* @param string $folder Name of a folder.
* @param array $optParams Optional parameters.
*
* @opt_param string ifMetagenerationMatch If set, only deletes the folder if
* its metageneration matches this value.
* @opt_param string ifMetagenerationNotMatch If set, only deletes the folder if
* its metageneration does not match this value.
* @return GoogleLongrunningOperation
* @throws \Google\Service\Exception
*/
public function deleteRecursive($bucket, $folder, $optParams = [])
{
$params = ['bucket' => $bucket, 'folder' => $folder];
$params = array_merge($params, $optParams);
return $this->call('deleteRecursive', [$params], GoogleLongrunningOperation::class);
}
/**
* Returns metadata for the specified folder. Only applicable to buckets with
* hierarchical namespace enabled. (folders.get)
*
* @param string $bucket Name of the bucket in which the folder resides.
* @param string $folder Name of a folder.
* @param array $optParams Optional parameters.
*
* @opt_param string ifMetagenerationMatch Makes the return of the folder
* metadata conditional on whether the folder's current metageneration matches
* the given value.
* @opt_param string ifMetagenerationNotMatch Makes the return of the folder
* metadata conditional on whether the folder's current metageneration does not
* match the given value.
* @return Folder
* @throws \Google\Service\Exception
*/
public function get($bucket, $folder, $optParams = [])
{
$params = ['bucket' => $bucket, 'folder' => $folder];
$params = array_merge($params, $optParams);
return $this->call('get', [$params], Folder::class);
}
/**
* Creates a new folder. Only applicable to buckets with hierarchical namespace
* enabled. (folders.insert)
*
* @param string $bucket Name of the bucket in which the folder resides.
* @param Folder $postBody
* @param array $optParams Optional parameters.
*
* @opt_param bool recursive If true, any parent folder which doesn't exist will
* be created automatically.
* @return Folder
* @throws \Google\Service\Exception
*/
public function insert($bucket, Folder $postBody, $optParams = [])
{
$params = ['bucket' => $bucket, 'postBody' => $postBody];
$params = array_merge($params, $optParams);
return $this->call('insert', [$params], Folder::class);
}
/**
* Retrieves a list of folders matching the criteria. Only applicable to buckets
* with hierarchical namespace enabled. (folders.listFolders)
*
* @param string $bucket Name of the bucket in which to look for folders.
* @param array $optParams Optional parameters.
*
* @opt_param string delimiter Returns results in a directory-like mode. The
* only supported value is '/'. If set, items will only contain folders that
* either exactly match the prefix, or are one level below the prefix.
* @opt_param string endOffset Filter results to folders whose names are
* lexicographically before endOffset. If startOffset is also set, the folders
* listed will have names between startOffset (inclusive) and endOffset
* (exclusive).
* @opt_param int pageSize Maximum number of items to return in a single page of
* responses.
* @opt_param string pageToken A previously-returned page token representing
* part of the larger set of results to view.
* @opt_param string prefix Filter results to folders whose paths begin with
* this prefix. If set, the value must either be an empty string or end with a
* '/'.
* @opt_param string startOffset Filter results to folders whose names are
* lexicographically equal to or after startOffset. If endOffset is also set,
* the folders listed will have names between startOffset (inclusive) and
* endOffset (exclusive).
* @return FoldersModel
* @throws \Google\Service\Exception
*/
public function listFolders($bucket, $optParams = [])
{
$params = ['bucket' => $bucket];
$params = array_merge($params, $optParams);
return $this->call('list', [$params], FoldersModel::class);
}
/**
* Renames a source folder to a destination folder. Only applicable to buckets
* with hierarchical namespace enabled. (folders.rename)
*
* @param string $bucket Name of the bucket in which the folders are in.
* @param string $sourceFolder Name of the source folder.
* @param string $destinationFolder Name of the destination folder.
* @param array $optParams Optional parameters.
*
* @opt_param string ifSourceMetagenerationMatch Makes the operation conditional
* on whether the source object's current metageneration matches the given
* value.
* @opt_param string ifSourceMetagenerationNotMatch Makes the operation
* conditional on whether the source object's current metageneration does not
* match the given value.
* @return GoogleLongrunningOperation
* @throws \Google\Service\Exception
*/
public function rename($bucket, $sourceFolder, $destinationFolder, $optParams = [])
{
$params = ['bucket' => $bucket, 'sourceFolder' => $sourceFolder, 'destinationFolder' => $destinationFolder];
$params = array_merge($params, $optParams);
return $this->call('rename', [$params], GoogleLongrunningOperation::class);
}
}
// Adding a class alias for backwards compatibility with the previous class name.
class_alias(Folders::class, 'Google_Service_Storage_Resource_Folders');
@@ -0,0 +1,182 @@
<?php
/*
* Copyright 2014 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*/
namespace Google\Service\Storage\Resource;
use Google\Service\Storage\ManagedFolder;
use Google\Service\Storage\ManagedFolders as ManagedFoldersModel;
use Google\Service\Storage\Policy;
use Google\Service\Storage\TestIamPermissionsResponse;
/**
* The "managedFolders" collection of methods.
* Typical usage is:
* <code>
* $storageService = new Google\Service\Storage(...);
* $managedFolders = $storageService->managedFolders;
* </code>
*/
class ManagedFolders extends \Google\Service\Resource
{
/**
* Permanently deletes a managed folder. (managedFolders.delete)
*
* @param string $bucket Name of the bucket containing the managed folder.
* @param string $managedFolder The managed folder name/path.
* @param array $optParams Optional parameters.
*
* @opt_param bool allowNonEmpty Allows the deletion of a managed folder even if
* it is not empty. A managed folder is empty if there are no objects or managed
* folders that it applies to. Callers must have
* storage.managedFolders.setIamPolicy permission.
* @opt_param string ifMetagenerationMatch If set, only deletes the managed
* folder if its metageneration matches this value.
* @opt_param string ifMetagenerationNotMatch If set, only deletes the managed
* folder if its metageneration does not match this value.
* @throws \Google\Service\Exception
*/
public function delete($bucket, $managedFolder, $optParams = [])
{
$params = ['bucket' => $bucket, 'managedFolder' => $managedFolder];
$params = array_merge($params, $optParams);
return $this->call('delete', [$params]);
}
/**
* Returns metadata of the specified managed folder. (managedFolders.get)
*
* @param string $bucket Name of the bucket containing the managed folder.
* @param string $managedFolder The managed folder name/path.
* @param array $optParams Optional parameters.
*
* @opt_param string ifMetagenerationMatch Makes the return of the managed
* folder metadata conditional on whether the managed folder's current
* metageneration matches the given value.
* @opt_param string ifMetagenerationNotMatch Makes the return of the managed
* folder metadata conditional on whether the managed folder's current
* metageneration does not match the given value.
* @return ManagedFolder
* @throws \Google\Service\Exception
*/
public function get($bucket, $managedFolder, $optParams = [])
{
$params = ['bucket' => $bucket, 'managedFolder' => $managedFolder];
$params = array_merge($params, $optParams);
return $this->call('get', [$params], ManagedFolder::class);
}
/**
* Returns an IAM policy for the specified managed folder.
* (managedFolders.getIamPolicy)
*
* @param string $bucket Name of the bucket containing the managed folder.
* @param string $managedFolder The managed folder name/path.
* @param array $optParams Optional parameters.
*
* @opt_param int optionsRequestedPolicyVersion The IAM policy format version to
* be returned. If the optionsRequestedPolicyVersion is for an older version
* that doesn't support part of the requested IAM policy, the request fails.
* @opt_param string userProject The project to be billed for this request.
* Required for Requester Pays buckets.
* @return Policy
* @throws \Google\Service\Exception
*/
public function getIamPolicy($bucket, $managedFolder, $optParams = [])
{
$params = ['bucket' => $bucket, 'managedFolder' => $managedFolder];
$params = array_merge($params, $optParams);
return $this->call('getIamPolicy', [$params], Policy::class);
}
/**
* Creates a new managed folder. (managedFolders.insert)
*
* @param string $bucket Name of the bucket containing the managed folder.
* @param ManagedFolder $postBody
* @param array $optParams Optional parameters.
* @return ManagedFolder
* @throws \Google\Service\Exception
*/
public function insert($bucket, ManagedFolder $postBody, $optParams = [])
{
$params = ['bucket' => $bucket, 'postBody' => $postBody];
$params = array_merge($params, $optParams);
return $this->call('insert', [$params], ManagedFolder::class);
}
/**
* Lists managed folders in the given bucket.
* (managedFolders.listManagedFolders)
*
* @param string $bucket Name of the bucket containing the managed folder.
* @param array $optParams Optional parameters.
*
* @opt_param int pageSize Maximum number of items to return in a single page of
* responses.
* @opt_param string pageToken A previously-returned page token representing
* part of the larger set of results to view.
* @opt_param string prefix The managed folder name/path prefix to filter the
* output list of results.
* @return ManagedFoldersModel
* @throws \Google\Service\Exception
*/
public function listManagedFolders($bucket, $optParams = [])
{
$params = ['bucket' => $bucket];
$params = array_merge($params, $optParams);
return $this->call('list', [$params], ManagedFoldersModel::class);
}
/**
* Updates an IAM policy for the specified managed folder.
* (managedFolders.setIamPolicy)
*
* @param string $bucket Name of the bucket containing the managed folder.
* @param string $managedFolder The managed folder name/path.
* @param Policy $postBody
* @param array $optParams Optional parameters.
*
* @opt_param string userProject The project to be billed for this request.
* Required for Requester Pays buckets.
* @return Policy
* @throws \Google\Service\Exception
*/
public function setIamPolicy($bucket, $managedFolder, Policy $postBody, $optParams = [])
{
$params = ['bucket' => $bucket, 'managedFolder' => $managedFolder, 'postBody' => $postBody];
$params = array_merge($params, $optParams);
return $this->call('setIamPolicy', [$params], Policy::class);
}
/**
* Tests a set of permissions on the given managed folder to see which, if any,
* are held by the caller. (managedFolders.testIamPermissions)
*
* @param string $bucket Name of the bucket containing the managed folder.
* @param string $managedFolder The managed folder name/path.
* @param string|array $permissions Permissions to test.
* @param array $optParams Optional parameters.
*
* @opt_param string userProject The project to be billed for this request.
* Required for Requester Pays buckets.
* @return TestIamPermissionsResponse
* @throws \Google\Service\Exception
*/
public function testIamPermissions($bucket, $managedFolder, $permissions, $optParams = [])
{
$params = ['bucket' => $bucket, 'managedFolder' => $managedFolder, 'permissions' => $permissions];
$params = array_merge($params, $optParams);
return $this->call('testIamPermissions', [$params], TestIamPermissionsResponse::class);
}
}
// Adding a class alias for backwards compatibility with the previous class name.
class_alias(ManagedFolders::class, 'Google_Service_Storage_Resource_ManagedFolders');
@@ -0,0 +1,108 @@
<?php
/*
* Copyright 2014 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*/
namespace Google\Service\Storage\Resource;
use Google\Service\Storage\Notification;
use Google\Service\Storage\Notifications as NotificationsModel;
/**
* The "notifications" collection of methods.
* Typical usage is:
* <code>
* $storageService = new Google\Service\Storage(...);
* $notifications = $storageService->notifications;
* </code>
*/
class Notifications extends \Google\Service\Resource
{
/**
* Permanently deletes a notification subscription. (notifications.delete)
*
* @param string $bucket The parent bucket of the notification.
* @param string $notification ID of the notification to delete.
* @param array $optParams Optional parameters.
*
* @opt_param string userProject The project to be billed for this request.
* Required for Requester Pays buckets.
* @throws \Google\Service\Exception
*/
public function delete($bucket, $notification, $optParams = [])
{
$params = ['bucket' => $bucket, 'notification' => $notification];
$params = array_merge($params, $optParams);
return $this->call('delete', [$params]);
}
/**
* View a notification configuration. (notifications.get)
*
* @param string $bucket The parent bucket of the notification.
* @param string $notification Notification ID
* @param array $optParams Optional parameters.
*
* @opt_param string userProject The project to be billed for this request.
* Required for Requester Pays buckets.
* @return Notification
* @throws \Google\Service\Exception
*/
public function get($bucket, $notification, $optParams = [])
{
$params = ['bucket' => $bucket, 'notification' => $notification];
$params = array_merge($params, $optParams);
return $this->call('get', [$params], Notification::class);
}
/**
* Creates a notification subscription for a given bucket.
* (notifications.insert)
*
* @param string $bucket The parent bucket of the notification.
* @param Notification $postBody
* @param array $optParams Optional parameters.
*
* @opt_param string userProject The project to be billed for this request.
* Required for Requester Pays buckets.
* @return Notification
* @throws \Google\Service\Exception
*/
public function insert($bucket, Notification $postBody, $optParams = [])
{
$params = ['bucket' => $bucket, 'postBody' => $postBody];
$params = array_merge($params, $optParams);
return $this->call('insert', [$params], Notification::class);
}
/**
* Retrieves a list of notification subscriptions for a given bucket.
* (notifications.listNotifications)
*
* @param string $bucket Name of a Google Cloud Storage bucket.
* @param array $optParams Optional parameters.
*
* @opt_param string userProject The project to be billed for this request.
* Required for Requester Pays buckets.
* @return NotificationsModel
* @throws \Google\Service\Exception
*/
public function listNotifications($bucket, $optParams = [])
{
$params = ['bucket' => $bucket];
$params = array_merge($params, $optParams);
return $this->call('list', [$params], NotificationsModel::class);
}
}
// Adding a class alias for backwards compatibility with the previous class name.
class_alias(Notifications::class, 'Google_Service_Storage_Resource_Notifications');
@@ -0,0 +1,186 @@
<?php
/*
* Copyright 2014 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*/
namespace Google\Service\Storage\Resource;
use Google\Service\Storage\ObjectAccessControl;
use Google\Service\Storage\ObjectAccessControls as ObjectAccessControlsModel;
/**
* The "objectAccessControls" collection of methods.
* Typical usage is:
* <code>
* $storageService = new Google\Service\Storage(...);
* $objectAccessControls = $storageService->objectAccessControls;
* </code>
*/
class ObjectAccessControls extends \Google\Service\Resource
{
/**
* Permanently deletes the ACL entry for the specified entity on the specified
* object. (objectAccessControls.delete)
*
* @param string $bucket Name of a bucket.
* @param string $object Name of the object. For information about how to URL
* encode object names to be path safe, see [Encoding URI Path
* Parts](https://cloud.google.com/storage/docs/request-endpoints#encoding).
* @param string $entity The entity holding the permission. Can be user-userId,
* user-emailAddress, group-groupId, group-emailAddress, allUsers, or
* allAuthenticatedUsers.
* @param array $optParams Optional parameters.
*
* @opt_param string generation If present, selects a specific revision of this
* object (as opposed to the latest version, the default).
* @opt_param string userProject The project to be billed for this request.
* Required for Requester Pays buckets.
* @throws \Google\Service\Exception
*/
public function delete($bucket, $object, $entity, $optParams = [])
{
$params = ['bucket' => $bucket, 'object' => $object, 'entity' => $entity];
$params = array_merge($params, $optParams);
return $this->call('delete', [$params]);
}
/**
* Returns the ACL entry for the specified entity on the specified object.
* (objectAccessControls.get)
*
* @param string $bucket Name of a bucket.
* @param string $object Name of the object. For information about how to URL
* encode object names to be path safe, see [Encoding URI Path
* Parts](https://cloud.google.com/storage/docs/request-endpoints#encoding).
* @param string $entity The entity holding the permission. Can be user-userId,
* user-emailAddress, group-groupId, group-emailAddress, allUsers, or
* allAuthenticatedUsers.
* @param array $optParams Optional parameters.
*
* @opt_param string generation If present, selects a specific revision of this
* object (as opposed to the latest version, the default).
* @opt_param string userProject The project to be billed for this request.
* Required for Requester Pays buckets.
* @return ObjectAccessControl
* @throws \Google\Service\Exception
*/
public function get($bucket, $object, $entity, $optParams = [])
{
$params = ['bucket' => $bucket, 'object' => $object, 'entity' => $entity];
$params = array_merge($params, $optParams);
return $this->call('get', [$params], ObjectAccessControl::class);
}
/**
* Creates a new ACL entry on the specified object.
* (objectAccessControls.insert)
*
* @param string $bucket Name of a bucket.
* @param string $object Name of the object. For information about how to URL
* encode object names to be path safe, see [Encoding URI Path
* Parts](https://cloud.google.com/storage/docs/request-endpoints#encoding).
* @param ObjectAccessControl $postBody
* @param array $optParams Optional parameters.
*
* @opt_param string generation If present, selects a specific revision of this
* object (as opposed to the latest version, the default).
* @opt_param string userProject The project to be billed for this request.
* Required for Requester Pays buckets.
* @return ObjectAccessControl
* @throws \Google\Service\Exception
*/
public function insert($bucket, $object, ObjectAccessControl $postBody, $optParams = [])
{
$params = ['bucket' => $bucket, 'object' => $object, 'postBody' => $postBody];
$params = array_merge($params, $optParams);
return $this->call('insert', [$params], ObjectAccessControl::class);
}
/**
* Retrieves ACL entries on the specified object.
* (objectAccessControls.listObjectAccessControls)
*
* @param string $bucket Name of a bucket.
* @param string $object Name of the object. For information about how to URL
* encode object names to be path safe, see [Encoding URI Path
* Parts](https://cloud.google.com/storage/docs/request-endpoints#encoding).
* @param array $optParams Optional parameters.
*
* @opt_param string generation If present, selects a specific revision of this
* object (as opposed to the latest version, the default).
* @opt_param string userProject The project to be billed for this request.
* Required for Requester Pays buckets.
* @return ObjectAccessControlsModel
* @throws \Google\Service\Exception
*/
public function listObjectAccessControls($bucket, $object, $optParams = [])
{
$params = ['bucket' => $bucket, 'object' => $object];
$params = array_merge($params, $optParams);
return $this->call('list', [$params], ObjectAccessControlsModel::class);
}
/**
* Patches an ACL entry on the specified object. (objectAccessControls.patch)
*
* @param string $bucket Name of a bucket.
* @param string $object Name of the object. For information about how to URL
* encode object names to be path safe, see [Encoding URI Path
* Parts](https://cloud.google.com/storage/docs/request-endpoints#encoding).
* @param string $entity The entity holding the permission. Can be user-userId,
* user-emailAddress, group-groupId, group-emailAddress, allUsers, or
* allAuthenticatedUsers.
* @param ObjectAccessControl $postBody
* @param array $optParams Optional parameters.
*
* @opt_param string generation If present, selects a specific revision of this
* object (as opposed to the latest version, the default).
* @opt_param string userProject The project to be billed for this request.
* Required for Requester Pays buckets.
* @return ObjectAccessControl
* @throws \Google\Service\Exception
*/
public function patch($bucket, $object, $entity, ObjectAccessControl $postBody, $optParams = [])
{
$params = ['bucket' => $bucket, 'object' => $object, 'entity' => $entity, 'postBody' => $postBody];
$params = array_merge($params, $optParams);
return $this->call('patch', [$params], ObjectAccessControl::class);
}
/**
* Updates an ACL entry on the specified object. (objectAccessControls.update)
*
* @param string $bucket Name of a bucket.
* @param string $object Name of the object. For information about how to URL
* encode object names to be path safe, see [Encoding URI Path
* Parts](https://cloud.google.com/storage/docs/request-endpoints#encoding).
* @param string $entity The entity holding the permission. Can be user-userId,
* user-emailAddress, group-groupId, group-emailAddress, allUsers, or
* allAuthenticatedUsers.
* @param ObjectAccessControl $postBody
* @param array $optParams Optional parameters.
*
* @opt_param string generation If present, selects a specific revision of this
* object (as opposed to the latest version, the default).
* @opt_param string userProject The project to be billed for this request.
* Required for Requester Pays buckets.
* @return ObjectAccessControl
* @throws \Google\Service\Exception
*/
public function update($bucket, $object, $entity, ObjectAccessControl $postBody, $optParams = [])
{
$params = ['bucket' => $bucket, 'object' => $object, 'entity' => $entity, 'postBody' => $postBody];
$params = array_merge($params, $optParams);
return $this->call('update', [$params], ObjectAccessControl::class);
}
}
// Adding a class alias for backwards compatibility with the previous class name.
class_alias(ObjectAccessControls::class, 'Google_Service_Storage_Resource_ObjectAccessControls');
@@ -0,0 +1,723 @@
<?php
/*
* Copyright 2014 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*/
namespace Google\Service\Storage\Resource;
use Google\Service\Storage\BulkRestoreObjectsRequest;
use Google\Service\Storage\Channel;
use Google\Service\Storage\ComposeRequest;
use Google\Service\Storage\GoogleLongrunningOperation;
use Google\Service\Storage\Objects as ObjectsModel;
use Google\Service\Storage\Policy;
use Google\Service\Storage\RewriteResponse;
use Google\Service\Storage\StorageObject;
use Google\Service\Storage\TestIamPermissionsResponse;
/**
* The "objects" collection of methods.
* Typical usage is:
* <code>
* $storageService = new Google\Service\Storage(...);
* $objects = $storageService->objects;
* </code>
*/
class Objects extends \Google\Service\Resource
{
/**
* Initiates a long-running bulk restore operation on the specified bucket.
* (objects.bulkRestore)
*
* @param string $bucket Name of the bucket in which the object resides.
* @param BulkRestoreObjectsRequest $postBody
* @param array $optParams Optional parameters.
* @return GoogleLongrunningOperation
* @throws \Google\Service\Exception
*/
public function bulkRestore($bucket, BulkRestoreObjectsRequest $postBody, $optParams = [])
{
$params = ['bucket' => $bucket, 'postBody' => $postBody];
$params = array_merge($params, $optParams);
return $this->call('bulkRestore', [$params], GoogleLongrunningOperation::class);
}
/**
* Concatenates a list of existing objects into a new object in the same bucket.
* (objects.compose)
*
* @param string $destinationBucket Name of the bucket containing the source
* objects. The destination object is stored in this bucket.
* @param string $destinationObject Name of the new object. For information
* about how to URL encode object names to be path safe, see [Encoding URI Path
* Parts](https://cloud.google.com/storage/docs/request-endpoints#encoding).
* @param ComposeRequest $postBody
* @param array $optParams Optional parameters.
*
* @opt_param string destinationPredefinedAcl Apply a predefined set of access
* controls to the destination object.
* @opt_param string dropContextGroups Specifies which groups of Object Contexts
* from the source object(s) should be dropped from the destination object.
* @opt_param string ifGenerationMatch Makes the operation conditional on
* whether the object's current generation matches the given value. Setting to 0
* makes the operation succeed only if there are no live versions of the object.
* @opt_param string ifMetagenerationMatch Makes the operation conditional on
* whether the object's current metageneration matches the given value.
* @opt_param string kmsKeyName Resource name of the Cloud KMS key, of the form
* projects/my-project/locations/global/keyRings/my-kr/cryptoKeys/my-key, that
* will be used to encrypt the object. Overrides the object metadata's
* kms_key_name value, if any.
* @opt_param string userProject The project to be billed for this request.
* Required for Requester Pays buckets.
* @return StorageObject
* @throws \Google\Service\Exception
*/
public function compose($destinationBucket, $destinationObject, ComposeRequest $postBody, $optParams = [])
{
$params = ['destinationBucket' => $destinationBucket, 'destinationObject' => $destinationObject, 'postBody' => $postBody];
$params = array_merge($params, $optParams);
return $this->call('compose', [$params], StorageObject::class);
}
/**
* Copies a source object to a destination object. Optionally overrides
* metadata. (objects.copy)
*
* @param string $sourceBucket Name of the bucket in which to find the source
* object.
* @param string $sourceObject Name of the source object. For information about
* how to URL encode object names to be path safe, see [Encoding URI Path
* Parts](https://cloud.google.com/storage/docs/request-endpoints#encoding).
* @param string $destinationBucket Name of the bucket in which to store the new
* object. Overrides the provided object metadata's bucket value, if any.For
* information about how to URL encode object names to be path safe, see
* [Encoding URI Path Parts](https://cloud.google.com/storage/docs/request-
* endpoints#encoding).
* @param string $destinationObject Name of the new object. Required when the
* object metadata is not otherwise provided. Overrides the object metadata's
* name value, if any.
* @param StorageObject $postBody
* @param array $optParams Optional parameters.
*
* @opt_param string destinationKmsKeyName Resource name of the Cloud KMS key,
* of the form projects/my-project/locations/global/keyRings/my-
* kr/cryptoKeys/my-key, that will be used to encrypt the object. Overrides the
* object metadata's kms_key_name value, if any.
* @opt_param string destinationPredefinedAcl Apply a predefined set of access
* controls to the destination object.
* @opt_param string ifGenerationMatch Makes the operation conditional on
* whether the destination object's current generation matches the given value.
* Setting to 0 makes the operation succeed only if there are no live versions
* of the object.
* @opt_param string ifGenerationNotMatch Makes the operation conditional on
* whether the destination object's current generation does not match the given
* value. If no live object exists, the precondition fails. Setting to 0 makes
* the operation succeed only if there is a live version of the object.
* @opt_param string ifMetagenerationMatch Makes the operation conditional on
* whether the destination object's current metageneration matches the given
* value.
* @opt_param string ifMetagenerationNotMatch Makes the operation conditional on
* whether the destination object's current metageneration does not match the
* given value.
* @opt_param string ifSourceGenerationMatch Makes the operation conditional on
* whether the source object's current generation matches the given value.
* @opt_param string ifSourceGenerationNotMatch Makes the operation conditional
* on whether the source object's current generation does not match the given
* value.
* @opt_param string ifSourceMetagenerationMatch Makes the operation conditional
* on whether the source object's current metageneration matches the given
* value.
* @opt_param string ifSourceMetagenerationNotMatch Makes the operation
* conditional on whether the source object's current metageneration does not
* match the given value.
* @opt_param string projection Set of properties to return. Defaults to noAcl,
* unless the object resource specifies the acl property, when it defaults to
* full.
* @opt_param string sourceGeneration If present, selects a specific revision of
* the source object (as opposed to the latest version, the default).
* @opt_param string userProject The project to be billed for this request.
* Required for Requester Pays buckets.
* @return StorageObject
* @throws \Google\Service\Exception
*/
public function copy($sourceBucket, $sourceObject, $destinationBucket, $destinationObject, StorageObject $postBody, $optParams = [])
{
$params = ['sourceBucket' => $sourceBucket, 'sourceObject' => $sourceObject, 'destinationBucket' => $destinationBucket, 'destinationObject' => $destinationObject, 'postBody' => $postBody];
$params = array_merge($params, $optParams);
return $this->call('copy', [$params], StorageObject::class);
}
/**
* Deletes an object and its metadata. Deletions are permanent if versioning is
* not enabled for the bucket, or if the generation parameter is used.
* (objects.delete)
*
* @param string $bucket Name of the bucket in which the object resides.
* @param string $object Name of the object. For information about how to URL
* encode object names to be path safe, see [Encoding URI Path
* Parts](https://cloud.google.com/storage/docs/request-endpoints#encoding).
* @param array $optParams Optional parameters.
*
* @opt_param string generation If present, permanently deletes a specific
* revision of this object (as opposed to the latest version, the default).
* @opt_param string ifGenerationMatch Makes the operation conditional on
* whether the object's current generation matches the given value. Setting to 0
* makes the operation succeed only if there are no live versions of the object.
* @opt_param string ifGenerationNotMatch Makes the operation conditional on
* whether the object's current generation does not match the given value. If no
* live object exists, the precondition fails. Setting to 0 makes the operation
* succeed only if there is a live version of the object.
* @opt_param string ifMetagenerationMatch Makes the operation conditional on
* whether the object's current metageneration matches the given value.
* @opt_param string ifMetagenerationNotMatch Makes the operation conditional on
* whether the object's current metageneration does not match the given value.
* @opt_param string userProject The project to be billed for this request.
* Required for Requester Pays buckets.
* @throws \Google\Service\Exception
*/
public function delete($bucket, $object, $optParams = [])
{
$params = ['bucket' => $bucket, 'object' => $object];
$params = array_merge($params, $optParams);
return $this->call('delete', [$params]);
}
/**
* Retrieves an object or its metadata. (objects.get)
*
* @param string $bucket Name of the bucket in which the object resides.
* @param string $object Name of the object. For information about how to URL
* encode object names to be path safe, see [Encoding URI Path
* Parts](https://cloud.google.com/storage/docs/request-endpoints#encoding).
* @param array $optParams Optional parameters.
*
* @opt_param string generation If present, selects a specific revision of this
* object (as opposed to the latest version, the default).
* @opt_param string ifGenerationMatch Makes the operation conditional on
* whether the object's current generation matches the given value. Setting to 0
* makes the operation succeed only if there are no live versions of the object.
* @opt_param string ifGenerationNotMatch Makes the operation conditional on
* whether the object's current generation does not match the given value. If no
* live object exists, the precondition fails. Setting to 0 makes the operation
* succeed only if there is a live version of the object.
* @opt_param string ifMetagenerationMatch Makes the operation conditional on
* whether the object's current metageneration matches the given value.
* @opt_param string ifMetagenerationNotMatch Makes the operation conditional on
* whether the object's current metageneration does not match the given value.
* @opt_param string projection Set of properties to return. Defaults to noAcl.
* @opt_param string restoreToken Restore token used to differentiate soft-
* deleted objects with the same name and generation. Only applicable for
* hierarchical namespace buckets and if softDeleted is set to true. This
* parameter is optional, and is only required in the rare case when there are
* multiple soft-deleted objects with the same name and generation.
* @opt_param bool softDeleted If true, only soft-deleted object versions will
* be listed. The default is false. For more information, see [Soft
* Delete](https://cloud.google.com/storage/docs/soft-delete).
* @opt_param string userProject The project to be billed for this request.
* Required for Requester Pays buckets.
* @return StorageObject
* @throws \Google\Service\Exception
*/
public function get($bucket, $object, $optParams = [])
{
$params = ['bucket' => $bucket, 'object' => $object];
$params = array_merge($params, $optParams);
return $this->call('get', [$params], StorageObject::class);
}
/**
* Returns an IAM policy for the specified object. (objects.getIamPolicy)
*
* @param string $bucket Name of the bucket in which the object resides.
* @param string $object Name of the object. For information about how to URL
* encode object names to be path safe, see [Encoding URI Path
* Parts](https://cloud.google.com/storage/docs/request-endpoints#encoding).
* @param array $optParams Optional parameters.
*
* @opt_param string generation If present, selects a specific revision of this
* object (as opposed to the latest version, the default).
* @opt_param string userProject The project to be billed for this request.
* Required for Requester Pays buckets.
* @return Policy
* @throws \Google\Service\Exception
*/
public function getIamPolicy($bucket, $object, $optParams = [])
{
$params = ['bucket' => $bucket, 'object' => $object];
$params = array_merge($params, $optParams);
return $this->call('getIamPolicy', [$params], Policy::class);
}
/**
* Stores a new object and metadata. (objects.insert)
*
* @param string $bucket Name of the bucket in which to store the new object.
* Overrides the provided object metadata's bucket value, if any.
* @param StorageObject $postBody
* @param array $optParams Optional parameters.
*
* @opt_param string contentEncoding If set, sets the contentEncoding property
* of the final object to this value. Setting this parameter is equivalent to
* setting the contentEncoding metadata property. This can be useful when
* uploading an object with uploadType=media to indicate the encoding of the
* content being uploaded.
* @opt_param string ifGenerationMatch Makes the operation conditional on
* whether the object's current generation matches the given value. Setting to 0
* makes the operation succeed only if there are no live versions of the object.
* @opt_param string ifGenerationNotMatch Makes the operation conditional on
* whether the object's current generation does not match the given value. If no
* live object exists, the precondition fails. Setting to 0 makes the operation
* succeed only if there is a live version of the object.
* @opt_param string ifMetagenerationMatch Makes the operation conditional on
* whether the object's current metageneration matches the given value.
* @opt_param string ifMetagenerationNotMatch Makes the operation conditional on
* whether the object's current metageneration does not match the given value.
* @opt_param string kmsKeyName Resource name of the Cloud KMS key, of the form
* projects/my-project/locations/global/keyRings/my-kr/cryptoKeys/my-key, that
* will be used to encrypt the object. Overrides the object metadata's
* kms_key_name value, if any.
* @opt_param string name Name of the object. Required when the object metadata
* is not otherwise provided. Overrides the object metadata's name value, if
* any. For information about how to URL encode object names to be path safe,
* see [Encoding URI Path Parts](https://cloud.google.com/storage/docs/request-
* endpoints#encoding).
* @opt_param string predefinedAcl Apply a predefined set of access controls to
* this object.
* @opt_param string projection Set of properties to return. Defaults to noAcl,
* unless the object resource specifies the acl property, when it defaults to
* full.
* @opt_param string userProject The project to be billed for this request.
* Required for Requester Pays buckets.
* @return StorageObject
* @throws \Google\Service\Exception
*/
public function insert($bucket, StorageObject $postBody, $optParams = [])
{
$params = ['bucket' => $bucket, 'postBody' => $postBody];
$params = array_merge($params, $optParams);
return $this->call('insert', [$params], StorageObject::class);
}
/**
* Retrieves a list of objects matching the criteria. (objects.listObjects)
*
* @param string $bucket Name of the bucket in which to look for objects.
* @param array $optParams Optional parameters.
*
* @opt_param string delimiter Returns results in a directory-like mode. items
* will contain only objects whose names, aside from the prefix, do not contain
* delimiter. Objects whose names, aside from the prefix, contain delimiter will
* have their name, truncated after the delimiter, returned in prefixes.
* Duplicate prefixes are omitted.
* @opt_param string endOffset Filter results to objects whose names are
* lexicographically before endOffset. If startOffset is also set, the objects
* listed will have names between startOffset (inclusive) and endOffset
* (exclusive).
* @opt_param string filter Filter the returned objects. Currently only
* supported for the contexts field. If delimiter is set, the returned prefixes
* are exempt from this filter.
* @opt_param bool includeFoldersAsPrefixes Only applicable if delimiter is set
* to '/'. If true, will also include folders and managed folders (besides
* objects) in the returned prefixes.
* @opt_param bool includeTrailingDelimiter If true, objects that end in exactly
* one instance of delimiter will have their metadata included in items in
* addition to prefixes.
* @opt_param string matchGlob Filter results to objects and prefixes that match
* this glob pattern.
* @opt_param string maxResults Maximum number of items plus prefixes to return
* in a single page of responses. As duplicate prefixes are omitted, fewer total
* results may be returned than requested. The service will use this parameter
* or 1,000 items, whichever is smaller.
* @opt_param string pageToken A previously-returned page token representing
* part of the larger set of results to view.
* @opt_param string prefix Filter results to objects whose names begin with
* this prefix.
* @opt_param string projection Set of properties to return. Defaults to noAcl.
* @opt_param bool softDeleted If true, only soft-deleted object versions will
* be listed. The default is false. For more information, see [Soft
* Delete](https://cloud.google.com/storage/docs/soft-delete).
* @opt_param string startOffset Filter results to objects whose names are
* lexicographically equal to or after startOffset. If endOffset is also set,
* the objects listed will have names between startOffset (inclusive) and
* endOffset (exclusive).
* @opt_param string userProject The project to be billed for this request.
* Required for Requester Pays buckets.
* @opt_param bool versions If true, lists all versions of an object as distinct
* results. The default is false. For more information, see [Object
* Versioning](https://cloud.google.com/storage/docs/object-versioning).
* @return ObjectsModel
* @throws \Google\Service\Exception
*/
public function listObjects($bucket, $optParams = [])
{
$params = ['bucket' => $bucket];
$params = array_merge($params, $optParams);
return $this->call('list', [$params], ObjectsModel::class);
}
/**
* Moves the source object to the destination object in the same bucket.
* (objects.move)
*
* @param string $bucket Name of the bucket in which the object resides.
* @param string $sourceObject Name of the source object. For information about
* how to URL encode object names to be path safe, see [Encoding URI Path
* Parts](https://cloud.google.com/storage/docs/request-endpoints#encoding).
* @param string $destinationObject Name of the destination object. For
* information about how to URL encode object names to be path safe, see
* [Encoding URI Path Parts](https://cloud.google.com/storage/docs/request-
* endpoints#encoding).
* @param array $optParams Optional parameters.
*
* @opt_param string ifGenerationMatch Makes the operation conditional on
* whether the destination object's current generation matches the given value.
* Setting to 0 makes the operation succeed only if there are no live versions
* of the object. `ifGenerationMatch` and `ifGenerationNotMatch` conditions are
* mutually exclusive: it's an error for both of them to be set in the request.
* @opt_param string ifGenerationNotMatch Makes the operation conditional on
* whether the destination object's current generation does not match the given
* value. If no live object exists, the precondition fails. Setting to 0 makes
* the operation succeed only if there is a live version of the
* object.`ifGenerationMatch` and `ifGenerationNotMatch` conditions are mutually
* exclusive: it's an error for both of them to be set in the request.
* @opt_param string ifMetagenerationMatch Makes the operation conditional on
* whether the destination object's current metageneration matches the given
* value. `ifMetagenerationMatch` and `ifMetagenerationNotMatch` conditions are
* mutually exclusive: it's an error for both of them to be set in the request.
* @opt_param string ifMetagenerationNotMatch Makes the operation conditional on
* whether the destination object's current metageneration does not match the
* given value. `ifMetagenerationMatch` and `ifMetagenerationNotMatch`
* conditions are mutually exclusive: it's an error for both of them to be set
* in the request.
* @opt_param string ifSourceGenerationMatch Makes the operation conditional on
* whether the source object's current generation matches the given value.
* `ifSourceGenerationMatch` and `ifSourceGenerationNotMatch` conditions are
* mutually exclusive: it's an error for both of them to be set in the request.
* @opt_param string ifSourceGenerationNotMatch Makes the operation conditional
* on whether the source object's current generation does not match the given
* value. `ifSourceGenerationMatch` and `ifSourceGenerationNotMatch` conditions
* are mutually exclusive: it's an error for both of them to be set in the
* request.
* @opt_param string ifSourceMetagenerationMatch Makes the operation conditional
* on whether the source object's current metageneration matches the given
* value. `ifSourceMetagenerationMatch` and `ifSourceMetagenerationNotMatch`
* conditions are mutually exclusive: it's an error for both of them to be set
* in the request.
* @opt_param string ifSourceMetagenerationNotMatch Makes the operation
* conditional on whether the source object's current metageneration does not
* match the given value. `ifSourceMetagenerationMatch` and
* `ifSourceMetagenerationNotMatch` conditions are mutually exclusive: it's an
* error for both of them to be set in the request.
* @opt_param string projection Set of properties to return. Defaults to noAcl.
* @opt_param string userProject The project to be billed for this request.
* Required for Requester Pays buckets.
* @return StorageObject
* @throws \Google\Service\Exception
*/
public function move($bucket, $sourceObject, $destinationObject, $optParams = [])
{
$params = ['bucket' => $bucket, 'sourceObject' => $sourceObject, 'destinationObject' => $destinationObject];
$params = array_merge($params, $optParams);
return $this->call('move', [$params], StorageObject::class);
}
/**
* Patches an object's metadata. (objects.patch)
*
* @param string $bucket Name of the bucket in which the object resides.
* @param string $object Name of the object. For information about how to URL
* encode object names to be path safe, see [Encoding URI Path
* Parts](https://cloud.google.com/storage/docs/request-endpoints#encoding).
* @param StorageObject $postBody
* @param array $optParams Optional parameters.
*
* @opt_param string generation If present, selects a specific revision of this
* object (as opposed to the latest version, the default).
* @opt_param string ifGenerationMatch Makes the operation conditional on
* whether the object's current generation matches the given value. Setting to 0
* makes the operation succeed only if there are no live versions of the object.
* @opt_param string ifGenerationNotMatch Makes the operation conditional on
* whether the object's current generation does not match the given value. If no
* live object exists, the precondition fails. Setting to 0 makes the operation
* succeed only if there is a live version of the object.
* @opt_param string ifMetagenerationMatch Makes the operation conditional on
* whether the object's current metageneration matches the given value.
* @opt_param string ifMetagenerationNotMatch Makes the operation conditional on
* whether the object's current metageneration does not match the given value.
* @opt_param bool overrideUnlockedRetention Must be true to remove the
* retention configuration, reduce its unlocked retention period, or change its
* mode from unlocked to locked.
* @opt_param string predefinedAcl Apply a predefined set of access controls to
* this object.
* @opt_param string projection Set of properties to return. Defaults to full.
* @opt_param string userProject The project to be billed for this request, for
* Requester Pays buckets.
* @return StorageObject
* @throws \Google\Service\Exception
*/
public function patch($bucket, $object, StorageObject $postBody, $optParams = [])
{
$params = ['bucket' => $bucket, 'object' => $object, 'postBody' => $postBody];
$params = array_merge($params, $optParams);
return $this->call('patch', [$params], StorageObject::class);
}
/**
* Restores a soft-deleted object. (objects.restore)
*
* @param string $bucket Name of the bucket in which the object resides.
* @param string $object Name of the object. For information about how to URL
* encode object names to be path safe, see [Encoding URI Path
* Parts](https://cloud.google.com/storage/docs/request-endpoints#encoding).
* @param string $generation Selects a specific revision of this object.
* @param array $optParams Optional parameters.
*
* @opt_param bool copySourceAcl If true, copies the source object's ACL;
* otherwise, uses the bucket's default object ACL. The default is false.
* @opt_param string ifGenerationMatch Makes the operation conditional on
* whether the object's one live generation matches the given value. Setting to
* 0 makes the operation succeed only if there are no live versions of the
* object.
* @opt_param string ifGenerationNotMatch Makes the operation conditional on
* whether none of the object's live generations match the given value. If no
* live object exists, the precondition fails. Setting to 0 makes the operation
* succeed only if there is a live version of the object.
* @opt_param string ifMetagenerationMatch Makes the operation conditional on
* whether the object's one live metageneration matches the given value.
* @opt_param string ifMetagenerationNotMatch Makes the operation conditional on
* whether none of the object's live metagenerations match the given value.
* @opt_param string projection Set of properties to return. Defaults to full.
* @opt_param string restoreToken Restore token used to differentiate sof-
* deleted objects with the same name and generation. Only applicable for
* hierarchical namespace buckets. This parameter is optional, and is only
* required in the rare case when there are multiple soft-deleted objects with
* the same name and generation.
* @opt_param string userProject The project to be billed for this request.
* Required for Requester Pays buckets.
* @return StorageObject
* @throws \Google\Service\Exception
*/
public function restore($bucket, $object, $generation, $optParams = [])
{
$params = ['bucket' => $bucket, 'object' => $object, 'generation' => $generation];
$params = array_merge($params, $optParams);
return $this->call('restore', [$params], StorageObject::class);
}
/**
* Rewrites a source object to a destination object. Optionally overrides
* metadata. (objects.rewrite)
*
* @param string $sourceBucket Name of the bucket in which to find the source
* object.
* @param string $sourceObject Name of the source object. For information about
* how to URL encode object names to be path safe, see [Encoding URI Path
* Parts](https://cloud.google.com/storage/docs/request-endpoints#encoding).
* @param string $destinationBucket Name of the bucket in which to store the new
* object. Overrides the provided object metadata's bucket value, if any.
* @param string $destinationObject Name of the new object. Required when the
* object metadata is not otherwise provided. Overrides the object metadata's
* name value, if any. For information about how to URL encode object names to
* be path safe, see [Encoding URI Path
* Parts](https://cloud.google.com/storage/docs/request-endpoints#encoding).
* @param StorageObject $postBody
* @param array $optParams Optional parameters.
*
* @opt_param string destinationKmsKeyName Resource name of the Cloud KMS key,
* of the form projects/my-project/locations/global/keyRings/my-
* kr/cryptoKeys/my-key, that will be used to encrypt the object. Overrides the
* object metadata's kms_key_name value, if any.
* @opt_param string destinationPredefinedAcl Apply a predefined set of access
* controls to the destination object.
* @opt_param string dropContextGroups Specifies which groups of Object Contexts
* from the source object should be dropped from the destination object.
* @opt_param string ifGenerationMatch Makes the operation conditional on
* whether the object's current generation matches the given value. Setting to 0
* makes the operation succeed only if there are no live versions of the object.
* @opt_param string ifGenerationNotMatch Makes the operation conditional on
* whether the object's current generation does not match the given value. If no
* live object exists, the precondition fails. Setting to 0 makes the operation
* succeed only if there is a live version of the object.
* @opt_param string ifMetagenerationMatch Makes the operation conditional on
* whether the destination object's current metageneration matches the given
* value.
* @opt_param string ifMetagenerationNotMatch Makes the operation conditional on
* whether the destination object's current metageneration does not match the
* given value.
* @opt_param string ifSourceGenerationMatch Makes the operation conditional on
* whether the source object's current generation matches the given value.
* @opt_param string ifSourceGenerationNotMatch Makes the operation conditional
* on whether the source object's current generation does not match the given
* value.
* @opt_param string ifSourceMetagenerationMatch Makes the operation conditional
* on whether the source object's current metageneration matches the given
* value.
* @opt_param string ifSourceMetagenerationNotMatch Makes the operation
* conditional on whether the source object's current metageneration does not
* match the given value.
* @opt_param string maxBytesRewrittenPerCall The maximum number of bytes that
* will be rewritten per rewrite request. Most callers shouldn't need to specify
* this parameter - it is primarily in place to support testing. If specified
* the value must be an integral multiple of 1 MiB (1048576). Also, this only
* applies to requests where the source and destination span locations and/or
* storage classes. Finally, this value must not change across rewrite calls
* else you'll get an error that the rewriteToken is invalid.
* @opt_param string projection Set of properties to return. Defaults to noAcl,
* unless the object resource specifies the acl property, when it defaults to
* full.
* @opt_param string rewriteToken Include this field (from the previous rewrite
* response) on each rewrite request after the first one, until the rewrite
* response 'done' flag is true. Calls that provide a rewriteToken can omit all
* other request fields, but if included those fields must match the values
* provided in the first rewrite request.
* @opt_param string sourceGeneration If present, selects a specific revision of
* the source object (as opposed to the latest version, the default).
* @opt_param string userProject The project to be billed for this request.
* Required for Requester Pays buckets.
* @return RewriteResponse
* @throws \Google\Service\Exception
*/
public function rewrite($sourceBucket, $sourceObject, $destinationBucket, $destinationObject, StorageObject $postBody, $optParams = [])
{
$params = ['sourceBucket' => $sourceBucket, 'sourceObject' => $sourceObject, 'destinationBucket' => $destinationBucket, 'destinationObject' => $destinationObject, 'postBody' => $postBody];
$params = array_merge($params, $optParams);
return $this->call('rewrite', [$params], RewriteResponse::class);
}
/**
* Updates an IAM policy for the specified object. (objects.setIamPolicy)
*
* @param string $bucket Name of the bucket in which the object resides.
* @param string $object Name of the object. For information about how to URL
* encode object names to be path safe, see [Encoding URI Path
* Parts](https://cloud.google.com/storage/docs/request-endpoints#encoding).
* @param Policy $postBody
* @param array $optParams Optional parameters.
*
* @opt_param string generation If present, selects a specific revision of this
* object (as opposed to the latest version, the default).
* @opt_param string userProject The project to be billed for this request.
* Required for Requester Pays buckets.
* @return Policy
* @throws \Google\Service\Exception
*/
public function setIamPolicy($bucket, $object, Policy $postBody, $optParams = [])
{
$params = ['bucket' => $bucket, 'object' => $object, 'postBody' => $postBody];
$params = array_merge($params, $optParams);
return $this->call('setIamPolicy', [$params], Policy::class);
}
/**
* Tests a set of permissions on the given object to see which, if any, are held
* by the caller. (objects.testIamPermissions)
*
* @param string $bucket Name of the bucket in which the object resides.
* @param string $object Name of the object. For information about how to URL
* encode object names to be path safe, see [Encoding URI Path
* Parts](https://cloud.google.com/storage/docs/request-endpoints#encoding).
* @param string|array $permissions Permissions to test.
* @param array $optParams Optional parameters.
*
* @opt_param string generation If present, selects a specific revision of this
* object (as opposed to the latest version, the default).
* @opt_param string userProject The project to be billed for this request.
* Required for Requester Pays buckets.
* @return TestIamPermissionsResponse
* @throws \Google\Service\Exception
*/
public function testIamPermissions($bucket, $object, $permissions, $optParams = [])
{
$params = ['bucket' => $bucket, 'object' => $object, 'permissions' => $permissions];
$params = array_merge($params, $optParams);
return $this->call('testIamPermissions', [$params], TestIamPermissionsResponse::class);
}
/**
* Updates an object's metadata. (objects.update)
*
* @param string $bucket Name of the bucket in which the object resides.
* @param string $object Name of the object. For information about how to URL
* encode object names to be path safe, see [Encoding URI Path
* Parts](https://cloud.google.com/storage/docs/request-endpoints#encoding).
* @param StorageObject $postBody
* @param array $optParams Optional parameters.
*
* @opt_param string generation If present, selects a specific revision of this
* object (as opposed to the latest version, the default).
* @opt_param string ifGenerationMatch Makes the operation conditional on
* whether the object's current generation matches the given value. Setting to 0
* makes the operation succeed only if there are no live versions of the object.
* @opt_param string ifGenerationNotMatch Makes the operation conditional on
* whether the object's current generation does not match the given value. If no
* live object exists, the precondition fails. Setting to 0 makes the operation
* succeed only if there is a live version of the object.
* @opt_param string ifMetagenerationMatch Makes the operation conditional on
* whether the object's current metageneration matches the given value.
* @opt_param string ifMetagenerationNotMatch Makes the operation conditional on
* whether the object's current metageneration does not match the given value.
* @opt_param bool overrideUnlockedRetention Must be true to remove the
* retention configuration, reduce its unlocked retention period, or change its
* mode from unlocked to locked.
* @opt_param string predefinedAcl Apply a predefined set of access controls to
* this object.
* @opt_param string projection Set of properties to return. Defaults to full.
* @opt_param string userProject The project to be billed for this request.
* Required for Requester Pays buckets.
* @return StorageObject
* @throws \Google\Service\Exception
*/
public function update($bucket, $object, StorageObject $postBody, $optParams = [])
{
$params = ['bucket' => $bucket, 'object' => $object, 'postBody' => $postBody];
$params = array_merge($params, $optParams);
return $this->call('update', [$params], StorageObject::class);
}
/**
* Watch for changes on all objects in a bucket. (objects.watchAll)
*
* @param string $bucket Name of the bucket in which to look for objects.
* @param Channel $postBody
* @param array $optParams Optional parameters.
*
* @opt_param string delimiter Returns results in a directory-like mode. items
* will contain only objects whose names, aside from the prefix, do not contain
* delimiter. Objects whose names, aside from the prefix, contain delimiter will
* have their name, truncated after the delimiter, returned in prefixes.
* Duplicate prefixes are omitted.
* @opt_param string endOffset Filter results to objects whose names are
* lexicographically before endOffset. If startOffset is also set, the objects
* listed will have names between startOffset (inclusive) and endOffset
* (exclusive).
* @opt_param bool includeTrailingDelimiter If true, objects that end in exactly
* one instance of delimiter will have their metadata included in items in
* addition to prefixes.
* @opt_param string maxResults Maximum number of items plus prefixes to return
* in a single page of responses. As duplicate prefixes are omitted, fewer total
* results may be returned than requested. The service will use this parameter
* or 1,000 items, whichever is smaller.
* @opt_param string pageToken A previously-returned page token representing
* part of the larger set of results to view.
* @opt_param string prefix Filter results to objects whose names begin with
* this prefix.
* @opt_param string projection Set of properties to return. Defaults to noAcl.
* @opt_param string startOffset Filter results to objects whose names are
* lexicographically equal to or after startOffset. If endOffset is also set,
* the objects listed will have names between startOffset (inclusive) and
* endOffset (exclusive).
* @opt_param string userProject The project to be billed for this request.
* Required for Requester Pays buckets.
* @opt_param bool versions If true, lists all versions of an object as distinct
* results. The default is false. For more information, see [Object
* Versioning](https://cloud.google.com/storage/docs/object-versioning).
* @return Channel
* @throws \Google\Service\Exception
*/
public function watchAll($bucket, Channel $postBody, $optParams = [])
{
$params = ['bucket' => $bucket, 'postBody' => $postBody];
$params = array_merge($params, $optParams);
return $this->call('watchAll', [$params], Channel::class);
}
}
// Adding a class alias for backwards compatibility with the previous class name.
class_alias(Objects::class, 'Google_Service_Storage_Resource_Objects');
@@ -0,0 +1,111 @@
<?php
/*
* Copyright 2014 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*/
namespace Google\Service\Storage\Resource;
use Google\Service\Storage\AdvanceRelocateBucketOperationRequest;
use Google\Service\Storage\GoogleLongrunningListOperationsResponse;
use Google\Service\Storage\GoogleLongrunningOperation;
/**
* The "operations" collection of methods.
* Typical usage is:
* <code>
* $storageService = new Google\Service\Storage(...);
* $operations = $storageService->operations;
* </code>
*/
class Operations extends \Google\Service\Resource
{
/**
* Starts asynchronous advancement of the relocate bucket operation in the case
* of required write downtime, to allow it to lock the bucket at the source
* location, and proceed with the bucket location swap. The server makes a best
* effort to advance the relocate bucket operation, but success is not
* guaranteed. (operations.advanceRelocateBucket)
*
* @param string $bucket Name of the bucket to advance the relocate for.
* @param string $operationId ID of the operation resource.
* @param AdvanceRelocateBucketOperationRequest $postBody
* @param array $optParams Optional parameters.
* @throws \Google\Service\Exception
*/
public function advanceRelocateBucket($bucket, $operationId, AdvanceRelocateBucketOperationRequest $postBody, $optParams = [])
{
$params = ['bucket' => $bucket, 'operationId' => $operationId, 'postBody' => $postBody];
$params = array_merge($params, $optParams);
return $this->call('advanceRelocateBucket', [$params]);
}
/**
* Starts asynchronous cancellation on a long-running operation. The server
* makes a best effort to cancel the operation, but success is not guaranteed.
* (operations.cancel)
*
* @param string $bucket The parent bucket of the operation resource.
* @param string $operationId The ID of the operation resource.
* @param array $optParams Optional parameters.
* @throws \Google\Service\Exception
*/
public function cancel($bucket, $operationId, $optParams = [])
{
$params = ['bucket' => $bucket, 'operationId' => $operationId];
$params = array_merge($params, $optParams);
return $this->call('cancel', [$params]);
}
/**
* Gets the latest state of a long-running operation. (operations.get)
*
* @param string $bucket The parent bucket of the operation resource.
* @param string $operationId The ID of the operation resource.
* @param array $optParams Optional parameters.
* @return GoogleLongrunningOperation
* @throws \Google\Service\Exception
*/
public function get($bucket, $operationId, $optParams = [])
{
$params = ['bucket' => $bucket, 'operationId' => $operationId];
$params = array_merge($params, $optParams);
return $this->call('get', [$params], GoogleLongrunningOperation::class);
}
/**
* Lists operations that match the specified filter in the request.
* (operations.listOperations)
*
* @param string $bucket Name of the bucket in which to look for operations.
* @param array $optParams Optional parameters.
*
* @opt_param string filter A filter to narrow down results to a preferred
* subset. The filtering language is documented in more detail in
* [AIP-160](https://google.aip.dev/160).
* @opt_param int pageSize Maximum number of items to return in a single page of
* responses. Fewer total results may be returned than requested. The service
* uses this parameter or 100 items, whichever is smaller.
* @opt_param string pageToken A previously-returned page token representing
* part of the larger set of results to view.
* @return GoogleLongrunningListOperationsResponse
* @throws \Google\Service\Exception
*/
public function listOperations($bucket, $optParams = [])
{
$params = ['bucket' => $bucket];
$params = array_merge($params, $optParams);
return $this->call('list', [$params], GoogleLongrunningListOperationsResponse::class);
}
}
// Adding a class alias for backwards compatibility with the previous class name.
class_alias(Operations::class, 'Google_Service_Storage_Resource_Operations');
@@ -0,0 +1,33 @@
<?php
/*
* Copyright 2014 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*/
namespace Google\Service\Storage\Resource;
/**
* The "projects" collection of methods.
* Typical usage is:
* <code>
* $storageService = new Google\Service\Storage(...);
* $projects = $storageService->projects;
* </code>
*/
class Projects extends \Google\Service\Resource
{
}
// Adding a class alias for backwards compatibility with the previous class name.
class_alias(Projects::class, 'Google_Service_Storage_Resource_Projects');
@@ -0,0 +1,138 @@
<?php
/*
* Copyright 2014 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*/
namespace Google\Service\Storage\Resource;
use Google\Service\Storage\HmacKey;
use Google\Service\Storage\HmacKeyMetadata;
use Google\Service\Storage\HmacKeysMetadata;
/**
* The "hmacKeys" collection of methods.
* Typical usage is:
* <code>
* $storageService = new Google\Service\Storage(...);
* $hmacKeys = $storageService->projects_hmacKeys;
* </code>
*/
class ProjectsHmacKeys extends \Google\Service\Resource
{
/**
* Creates a new HMAC key for the specified service account. (hmacKeys.create)
*
* @param string $projectId Project ID owning the service account.
* @param string $serviceAccountEmail Email address of the service account.
* @param array $optParams Optional parameters.
*
* @opt_param string userProject The project to be billed for this request.
* @return HmacKey
* @throws \Google\Service\Exception
*/
public function create($projectId, $serviceAccountEmail, $optParams = [])
{
$params = ['projectId' => $projectId, 'serviceAccountEmail' => $serviceAccountEmail];
$params = array_merge($params, $optParams);
return $this->call('create', [$params], HmacKey::class);
}
/**
* Deletes an HMAC key. (hmacKeys.delete)
*
* @param string $projectId Project ID owning the requested key
* @param string $accessId Name of the HMAC key to be deleted.
* @param array $optParams Optional parameters.
*
* @opt_param string userProject The project to be billed for this request.
* @throws \Google\Service\Exception
*/
public function delete($projectId, $accessId, $optParams = [])
{
$params = ['projectId' => $projectId, 'accessId' => $accessId];
$params = array_merge($params, $optParams);
return $this->call('delete', [$params]);
}
/**
* Retrieves an HMAC key's metadata (hmacKeys.get)
*
* @param string $projectId Project ID owning the service account of the
* requested key.
* @param string $accessId Name of the HMAC key.
* @param array $optParams Optional parameters.
*
* @opt_param string userProject The project to be billed for this request.
* @return HmacKeyMetadata
* @throws \Google\Service\Exception
*/
public function get($projectId, $accessId, $optParams = [])
{
$params = ['projectId' => $projectId, 'accessId' => $accessId];
$params = array_merge($params, $optParams);
return $this->call('get', [$params], HmacKeyMetadata::class);
}
/**
* Retrieves a list of HMAC keys matching the criteria.
* (hmacKeys.listProjectsHmacKeys)
*
* @param string $projectId Name of the project in which to look for HMAC keys.
* @param array $optParams Optional parameters.
*
* @opt_param string maxResults Maximum number of items to return in a single
* page of responses. The service uses this parameter or 250 items, whichever is
* smaller. The max number of items per page will also be limited by the number
* of distinct service accounts in the response. If the number of service
* accounts in a single response is too high, the page will truncated and a next
* page token will be returned.
* @opt_param string pageToken A previously-returned page token representing
* part of the larger set of results to view.
* @opt_param string serviceAccountEmail If present, only keys for the given
* service account are returned.
* @opt_param bool showDeletedKeys Whether or not to show keys in the DELETED
* state.
* @opt_param string userProject The project to be billed for this request.
* @return HmacKeysMetadata
* @throws \Google\Service\Exception
*/
public function listProjectsHmacKeys($projectId, $optParams = [])
{
$params = ['projectId' => $projectId];
$params = array_merge($params, $optParams);
return $this->call('list', [$params], HmacKeysMetadata::class);
}
/**
* Updates the state of an HMAC key. See the [HMAC Key resource descriptor](http
* s://cloud.google.com/storage/docs/json_api/v1/projects/hmacKeys/update#reques
* t-body) for valid states. (hmacKeys.update)
*
* @param string $projectId Project ID owning the service account of the updated
* key.
* @param string $accessId Name of the HMAC key being updated.
* @param HmacKeyMetadata $postBody
* @param array $optParams Optional parameters.
*
* @opt_param string userProject The project to be billed for this request.
* @return HmacKeyMetadata
* @throws \Google\Service\Exception
*/
public function update($projectId, $accessId, HmacKeyMetadata $postBody, $optParams = [])
{
$params = ['projectId' => $projectId, 'accessId' => $accessId, 'postBody' => $postBody];
$params = array_merge($params, $optParams);
return $this->call('update', [$params], HmacKeyMetadata::class);
}
}
// Adding a class alias for backwards compatibility with the previous class name.
class_alias(ProjectsHmacKeys::class, 'Google_Service_Storage_Resource_ProjectsHmacKeys');
@@ -0,0 +1,52 @@
<?php
/*
* Copyright 2014 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*/
namespace Google\Service\Storage\Resource;
use Google\Service\Storage\ServiceAccount;
/**
* The "serviceAccount" collection of methods.
* Typical usage is:
* <code>
* $storageService = new Google\Service\Storage(...);
* $serviceAccount = $storageService->projects_serviceAccount;
* </code>
*/
class ProjectsServiceAccount extends \Google\Service\Resource
{
/**
* Get the email address of this project's Google Cloud Storage service account.
* (serviceAccount.get)
*
* @param string $projectId Project ID
* @param array $optParams Optional parameters.
*
* @opt_param string userProject The project to be billed for this request.
* @return ServiceAccount
* @throws \Google\Service\Exception
*/
public function get($projectId, $optParams = [])
{
$params = ['projectId' => $projectId];
$params = array_merge($params, $optParams);
return $this->call('get', [$params], ServiceAccount::class);
}
}
// Adding a class alias for backwards compatibility with the previous class name.
class_alias(ProjectsServiceAccount::class, 'Google_Service_Storage_Resource_ProjectsServiceAccount');