Google Cloud Storage C++ Client  1.25.0
A C++ Client Library for Google Cloud Storage
client.h
Go to the documentation of this file.
1 // Copyright 2018 Google LLC
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 //
7 // http://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
14 
15 #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_STORAGE_CLIENT_H
16 #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_STORAGE_CLIENT_H
17 
19 #include "google/cloud/storage/internal/logging_client.h"
20 #include "google/cloud/storage/internal/parameter_pack_validation.h"
21 #include "google/cloud/storage/internal/policy_document_request.h"
22 #include "google/cloud/storage/internal/retry_client.h"
23 #include "google/cloud/storage/internal/signed_url_requests.h"
24 #include "google/cloud/storage/internal/tuple_filter.h"
37 #include "google/cloud/internal/throw_delegate.h"
38 #include "google/cloud/status.h"
39 #include "google/cloud/status_or.h"
40 #include "absl/meta/type_traits.h"
41 #include <type_traits>
42 
43 namespace google {
44 namespace cloud {
45 namespace storage {
46 namespace testing {
47 class ClientTester;
48 } // namespace testing
49 inline namespace STORAGE_CLIENT_NS {
50 namespace internal {
51 class NonResumableParallelUploadState;
52 class ResumableParallelUploadState;
53 } // namespace internal
187 class Client {
188  public:
205  template <typename... Policies>
206  explicit Client(ClientOptions options, Policies&&... policies)
207  : Client(CreateDefaultInternalClient(std::move(options)),
208  std::forward<Policies>(policies)...) {}
209 
225  template <typename... Policies>
226  explicit Client(std::shared_ptr<oauth2::Credentials> credentials,
227  Policies&&... policies)
228  : Client(ClientOptions(std::move(credentials)),
229  std::forward<Policies>(policies)...) {}
230 
233  template <typename... Policies>
234  explicit Client(std::shared_ptr<internal::RawClient> client,
235  Policies&&... policies)
236  : raw_client_(
237  Decorate(std::move(client), std::forward<Policies>(policies)...)) {}
238 
240  struct NoDecorations {};
241 
243  explicit Client(std::shared_ptr<internal::RawClient> client, NoDecorations)
244  : raw_client_(std::move(client)) {}
245 
247  static StatusOr<Client> CreateDefaultClient();
248 
250  std::shared_ptr<internal::RawClient> raw_client() const {
251  return raw_client_;
252  }
253 
255 
280  template <typename... Options>
281  ListBucketsReader ListBucketsForProject(std::string const& project_id,
282  Options&&... options) {
283  internal::ListBucketsRequest request(project_id);
284  request.set_multiple_options(std::forward<Options>(options)...);
285  auto client = raw_client_;
286  return google::cloud::internal::MakePaginationRange<ListBucketsReader>(
287  request,
288  [client](internal::ListBucketsRequest const& r) {
289  return client->ListBuckets(r);
290  },
291  [](internal::ListBucketsResponse r) { return std::move(r.items); });
292  }
293 
314  template <typename... Options>
315  ListBucketsReader ListBuckets(Options&&... options) {
316  auto const& project_id = raw_client_->client_options().project_id();
317  return ListBucketsForProject(project_id, std::forward<Options>(options)...);
318  }
319 
347  template <typename... Options>
348  StatusOr<BucketMetadata> CreateBucket(std::string bucket_name,
349  BucketMetadata metadata,
350  Options&&... options) {
351  auto const& project_id = raw_client_->client_options().project_id();
352  return CreateBucketForProject(std::move(bucket_name), project_id,
353  std::move(metadata),
354  std::forward<Options>(options)...);
355  }
356 
383  template <typename... Options>
384  StatusOr<BucketMetadata> CreateBucketForProject(std::string bucket_name,
385  std::string project_id,
386  BucketMetadata metadata,
387  Options&&... options) {
388  metadata.set_name(std::move(bucket_name));
389  internal::CreateBucketRequest request(std::move(project_id),
390  std::move(metadata));
391  request.set_multiple_options(std::forward<Options>(options)...);
392  return raw_client_->CreateBucket(request);
393  }
394 
409  template <typename... Options>
410  StatusOr<BucketMetadata> GetBucketMetadata(std::string const& bucket_name,
411  Options&&... options) {
412  internal::GetBucketMetadataRequest request(bucket_name);
413  request.set_multiple_options(std::forward<Options>(options)...);
414  return raw_client_->GetBucketMetadata(request);
415  }
416 
432  template <typename... Options>
433  Status DeleteBucket(std::string const& bucket_name, Options&&... options) {
434  internal::DeleteBucketRequest request(bucket_name);
435  request.set_multiple_options(std::forward<Options>(options)...);
436  return raw_client_->DeleteBucket(request).status();
437  }
438 
472  template <typename... Options>
473  StatusOr<BucketMetadata> UpdateBucket(std::string bucket_name,
474  BucketMetadata metadata,
475  Options&&... options) {
476  metadata.set_name(std::move(bucket_name));
477  internal::UpdateBucketRequest request(std::move(metadata));
478  request.set_multiple_options(std::forward<Options>(options)...);
479  return raw_client_->UpdateBucket(request);
480  }
481 
519  template <typename... Options>
520  StatusOr<BucketMetadata> PatchBucket(std::string bucket_name,
521  BucketMetadata const& original,
522  BucketMetadata const& updated,
523  Options&&... options) {
524  internal::PatchBucketRequest request(std::move(bucket_name), original,
525  updated);
526  request.set_multiple_options(std::forward<Options>(options)...);
527  return raw_client_->PatchBucket(request);
528  }
529 
562  template <typename... Options>
563  StatusOr<BucketMetadata> PatchBucket(
564  std::string bucket_name, BucketMetadataPatchBuilder const& builder,
565  Options&&... options) {
566  internal::PatchBucketRequest request(std::move(bucket_name), builder);
567  request.set_multiple_options(std::forward<Options>(options)...);
568  return raw_client_->PatchBucket(request);
569  }
570 
606  template <typename... Options>
607  GOOGLE_CLOUD_CPP_STORAGE_IAM_DEPRECATED("GetNativeBucketIamPolicy")
608  StatusOr<IamPolicy> GetBucketIamPolicy(std::string const& bucket_name,
609  Options&&... options) {
610  internal::GetBucketIamPolicyRequest request(bucket_name);
611  request.set_multiple_options(std::forward<Options>(options)...);
612  return raw_client_->GetBucketIamPolicy(request);
613  }
614 
647  template <typename... Options>
648  StatusOr<NativeIamPolicy> GetNativeBucketIamPolicy(
649  std::string const& bucket_name, Options&&... options) {
650  internal::GetBucketIamPolicyRequest request(bucket_name);
651  request.set_multiple_options(std::forward<Options>(options)...);
652  return raw_client_->GetNativeBucketIamPolicy(request);
653  }
654 
700  template <typename... Options>
701  GOOGLE_CLOUD_CPP_STORAGE_IAM_DEPRECATED("SetNativeBucketIamPolicy")
702  StatusOr<IamPolicy> SetBucketIamPolicy(std::string const& bucket_name,
703  IamPolicy const& iam_policy,
704  Options&&... options) {
705  internal::SetBucketIamPolicyRequest request(bucket_name, iam_policy);
706  request.set_multiple_options(std::forward<Options>(options)...);
707  return raw_client_->SetBucketIamPolicy(request);
708  }
709 
755  template <typename... Options>
756  StatusOr<NativeIamPolicy> SetNativeBucketIamPolicy(
757  std::string const& bucket_name, NativeIamPolicy const& iam_policy,
758  Options&&... options) {
759  internal::SetNativeBucketIamPolicyRequest request(bucket_name, iam_policy);
760  request.set_multiple_options(std::forward<Options>(options)...);
761  return raw_client_->SetNativeBucketIamPolicy(request);
762  }
763 
791  template <typename... Options>
792  StatusOr<std::vector<std::string>> TestBucketIamPermissions(
793  std::string bucket_name, std::vector<std::string> permissions,
794  Options&&... options) {
795  internal::TestBucketIamPermissionsRequest request(std::move(bucket_name),
796  std::move(permissions));
797  request.set_multiple_options(std::forward<Options>(options)...);
798  auto result = raw_client_->TestBucketIamPermissions(request);
799  if (!result) {
800  return std::move(result).status();
801  }
802  return std::move(result.value().permissions);
803  }
804 
851  template <typename... Options>
852  StatusOr<BucketMetadata> LockBucketRetentionPolicy(
853  std::string const& bucket_name, std::uint64_t metageneration,
854  Options&&... options) {
855  internal::LockBucketRetentionPolicyRequest request(bucket_name,
856  metageneration);
857  request.set_multiple_options(std::forward<Options>(options)...);
858  return raw_client_->LockBucketRetentionPolicy(request);
859  }
861 
863 
899  template <typename... Options>
900  StatusOr<ObjectMetadata> InsertObject(std::string const& bucket_name,
901  std::string const& object_name,
902  std::string contents,
903  Options&&... options) {
904  internal::InsertObjectMediaRequest request(bucket_name, object_name,
905  std::move(contents));
906  request.set_multiple_options(std::forward<Options>(options)...);
907  return raw_client_->InsertObjectMedia(request);
908  }
909 
950  template <typename... Options>
951  StatusOr<ObjectMetadata> CopyObject(std::string source_bucket_name,
952  std::string source_object_name,
953  std::string destination_bucket_name,
954  std::string destination_object_name,
955  Options&&... options) {
956  internal::CopyObjectRequest request(
957  std::move(source_bucket_name), std::move(source_object_name),
958  std::move(destination_bucket_name), std::move(destination_object_name));
959  request.set_multiple_options(std::forward<Options>(options)...);
960  return raw_client_->CopyObject(request);
961  }
962 
979  template <typename... Options>
980  StatusOr<ObjectMetadata> GetObjectMetadata(std::string const& bucket_name,
981  std::string const& object_name,
982  Options&&... options) {
983  internal::GetObjectMetadataRequest request(bucket_name, object_name);
984  request.set_multiple_options(std::forward<Options>(options)...);
985  return raw_client_->GetObjectMetadata(request);
986  }
987 
1004  template <typename... Options>
1005  ListObjectsReader ListObjects(std::string const& bucket_name,
1006  Options&&... options) {
1007  internal::ListObjectsRequest request(bucket_name);
1008  request.set_multiple_options(std::forward<Options>(options)...);
1009  auto client = raw_client_;
1010  return google::cloud::internal::MakePaginationRange<ListObjectsReader>(
1011  request,
1012  [client](internal::ListObjectsRequest const& r) {
1013  return client->ListObjects(r);
1014  },
1015  [](internal::ListObjectsResponse r) { return std::move(r.items); });
1016  }
1017 
1034  template <typename... Options>
1036  std::string const& bucket_name, Options&&... options) {
1037  internal::ListObjectsRequest request(bucket_name);
1038  request.set_multiple_options(std::forward<Options>(options)...);
1039  auto client = raw_client_;
1040  return google::cloud::internal::MakePaginationRange<
1042  request,
1043  [client](internal::ListObjectsRequest const& r) {
1044  return client->ListObjects(r);
1045  },
1046  [](internal::ListObjectsResponse r) {
1047  std::vector<ObjectOrPrefix> result;
1048  for (auto& item : r.items) {
1049  result.emplace_back(std::move(item));
1050  }
1051  for (auto& prefix : r.prefixes) {
1052  result.emplace_back(std::move(prefix));
1053  }
1054  internal::SortObjectsAndPrefixes(result);
1055  return result;
1056  });
1057  }
1058 
1091  template <typename... Options>
1092  ObjectReadStream ReadObject(std::string const& bucket_name,
1093  std::string const& object_name,
1094  Options&&... options) {
1095  struct HasReadRange
1096  : public absl::disjunction<std::is_same<ReadRange, Options>...> {};
1097  struct HasReadFromOffset
1098  : public absl::disjunction<std::is_same<ReadFromOffset, Options>...> {};
1099  struct HasReadLast
1100  : public absl::disjunction<std::is_same<ReadLast, Options>...> {};
1101 
1102  struct HasIncompatibleRangeOptions
1103  : public std::integral_constant<bool, HasReadLast::value &&
1104  (HasReadFromOffset::value ||
1105  HasReadRange::value)> {};
1106 
1107  static_assert(!HasIncompatibleRangeOptions::value,
1108  "Cannot set ReadLast option with either ReadFromOffset or "
1109  "ReadRange.");
1110 
1111  internal::ReadObjectRangeRequest request(bucket_name, object_name);
1112  request.set_multiple_options(std::forward<Options>(options)...);
1113  return ReadObjectImpl(request);
1114  }
1115 
1198  template <typename... Options>
1199  ObjectWriteStream WriteObject(std::string const& bucket_name,
1200  std::string const& object_name,
1201  Options&&... options) {
1202  internal::ResumableUploadRequest request(bucket_name, object_name);
1203  request.set_multiple_options(std::forward<Options>(options)...);
1204  return WriteObjectImpl(request);
1205  }
1206 
1237  template <typename... Options>
1238  StatusOr<ObjectMetadata> UploadFile(std::string const& file_name,
1239  std::string const& bucket_name,
1240  std::string const& object_name,
1241  Options&&... options) {
1242  // Determine, at compile time, which version of UploadFileImpl we should
1243  // call. This needs to be done at compile time because ObjectInsertMedia
1244  // does not support (nor should it support) the UseResumableUploadSession
1245  // option.
1246  using HasUseResumableUpload =
1247  absl::disjunction<std::is_same<UseResumableUploadSession, Options>...>;
1248  return UploadFileImpl(file_name, bucket_name, object_name,
1249  HasUseResumableUpload{},
1250  std::forward<Options>(options)...);
1251  }
1252 
1265  template <typename... Options>
1266  Status DeleteResumableUpload(std::string const& upload_session_url,
1267  Options&&... options) {
1268  internal::DeleteResumableUploadRequest request(upload_session_url);
1269  request.set_multiple_options(std::forward<Options>(options)...);
1270  return raw_client_->DeleteResumableUpload(request).status();
1271  }
1272 
1292  template <typename... Options>
1293  Status DownloadToFile(std::string const& bucket_name,
1294  std::string const& object_name,
1295  std::string const& file_name, Options&&... options) {
1296  internal::ReadObjectRangeRequest request(bucket_name, object_name);
1297  request.set_multiple_options(std::forward<Options>(options)...);
1298  return DownloadFileImpl(request, file_name);
1299  }
1300 
1319  template <typename... Options>
1320  Status DeleteObject(std::string const& bucket_name,
1321  std::string const& object_name, Options&&... options) {
1322  internal::DeleteObjectRequest request(bucket_name, object_name);
1323  request.set_multiple_options(std::forward<Options>(options)...);
1324  return raw_client_->DeleteObject(request).status();
1325  }
1326 
1349  template <typename... Options>
1350  StatusOr<ObjectMetadata> UpdateObject(std::string bucket_name,
1351  std::string object_name,
1352  ObjectMetadata metadata,
1353  Options&&... options) {
1354  internal::UpdateObjectRequest request(
1355  std::move(bucket_name), std::move(object_name), std::move(metadata));
1356  request.set_multiple_options(std::forward<Options>(options)...);
1357  return raw_client_->UpdateObject(request);
1358  }
1359 
1386  template <typename... Options>
1387  StatusOr<ObjectMetadata> PatchObject(std::string bucket_name,
1388  std::string object_name,
1389  ObjectMetadata const& original,
1390  ObjectMetadata const& updated,
1391  Options&&... options) {
1392  internal::PatchObjectRequest request(
1393  std::move(bucket_name), std::move(object_name), original, updated);
1394  request.set_multiple_options(std::forward<Options>(options)...);
1395  return raw_client_->PatchObject(request);
1396  }
1397 
1422  template <typename... Options>
1423  StatusOr<ObjectMetadata> PatchObject(
1424  std::string bucket_name, std::string object_name,
1425  ObjectMetadataPatchBuilder const& builder, Options&&... options) {
1426  internal::PatchObjectRequest request(std::move(bucket_name),
1427  std::move(object_name), builder);
1428  request.set_multiple_options(std::forward<Options>(options)...);
1429  return raw_client_->PatchObject(request);
1430  }
1431 
1455  template <typename... Options>
1456  StatusOr<ObjectMetadata> ComposeObject(
1457  std::string bucket_name, std::vector<ComposeSourceObject> source_objects,
1458  std::string destination_object_name, Options&&... options) {
1459  internal::ComposeObjectRequest request(std::move(bucket_name),
1460  std::move(source_objects),
1461  std::move(destination_object_name));
1462  request.set_multiple_options(std::forward<Options>(options)...);
1463  return raw_client_->ComposeObject(request);
1464  }
1465 
1504  template <typename... Options>
1505  ObjectRewriter RewriteObject(std::string source_bucket_name,
1506  std::string source_object_name,
1507  std::string destination_bucket_name,
1508  std::string destination_object_name,
1509  Options&&... options) {
1510  return ResumeRewriteObject(
1511  std::move(source_bucket_name), std::move(source_object_name),
1512  std::move(destination_bucket_name), std::move(destination_object_name),
1513  std::string{}, std::forward<Options>(options)...);
1514  }
1515 
1556  template <typename... Options>
1557  ObjectRewriter ResumeRewriteObject(std::string source_bucket_name,
1558  std::string source_object_name,
1559  std::string destination_bucket_name,
1560  std::string destination_object_name,
1561  std::string rewrite_token,
1562  Options&&... options) {
1563  internal::RewriteObjectRequest request(
1564  std::move(source_bucket_name), std::move(source_object_name),
1565  std::move(destination_bucket_name), std::move(destination_object_name),
1566  std::move(rewrite_token));
1567  request.set_multiple_options(std::forward<Options>(options)...);
1568  return ObjectRewriter(raw_client_, std::move(request));
1569  }
1570 
1614  template <typename... Options>
1615  StatusOr<ObjectMetadata> RewriteObjectBlocking(
1616  std::string source_bucket_name, std::string source_object_name,
1617  std::string destination_bucket_name, std::string destination_object_name,
1618  Options&&... options) {
1619  return ResumeRewriteObject(std::move(source_bucket_name),
1620  std::move(source_object_name),
1621  std::move(destination_bucket_name),
1622  std::move(destination_object_name),
1623  std::string{}, std::forward<Options>(options)...)
1624  .Result();
1625  }
1627 
1629 
1672  template <typename... Options>
1673  StatusOr<std::vector<BucketAccessControl>> ListBucketAcl(
1674  std::string const& bucket_name, Options&&... options) {
1675  internal::ListBucketAclRequest request(bucket_name);
1676  request.set_multiple_options(std::forward<Options>(options)...);
1677  auto items = raw_client_->ListBucketAcl(request);
1678  if (!items) {
1679  return std::move(items).status();
1680  }
1681  return std::move(items.value().items);
1682  }
1683 
1705  template <typename... Options>
1706  StatusOr<BucketAccessControl> CreateBucketAcl(std::string const& bucket_name,
1707  std::string const& entity,
1708  std::string const& role,
1709  Options&&... options) {
1710  internal::CreateBucketAclRequest request(bucket_name, entity, role);
1711  request.set_multiple_options(std::forward<Options>(options)...);
1712  return raw_client_->CreateBucketAcl(request);
1713  }
1714 
1733  template <typename... Options>
1734  Status DeleteBucketAcl(std::string const& bucket_name,
1735  std::string const& entity, Options&&... options) {
1736  internal::DeleteBucketAclRequest request(bucket_name, entity);
1737  request.set_multiple_options(std::forward<Options>(options)...);
1738  return raw_client_->DeleteBucketAcl(request).status();
1739  }
1740 
1758  template <typename... Options>
1759  StatusOr<BucketAccessControl> GetBucketAcl(std::string const& bucket_name,
1760  std::string const& entity,
1761  Options&&... options) {
1762  internal::GetBucketAclRequest request(bucket_name, entity);
1763  request.set_multiple_options(std::forward<Options>(options)...);
1764  return raw_client_->GetBucketAcl(request);
1765  }
1766 
1797  template <typename... Options>
1798  StatusOr<BucketAccessControl> UpdateBucketAcl(std::string const& bucket_name,
1799  BucketAccessControl const& acl,
1800  Options&&... options) {
1801  internal::UpdateBucketAclRequest request(bucket_name, acl.entity(),
1802  acl.role());
1803  request.set_multiple_options(std::forward<Options>(options)...);
1804  return raw_client_->UpdateBucketAcl(request);
1805  }
1806 
1842  template <typename... Options>
1843  StatusOr<BucketAccessControl> PatchBucketAcl(
1844  std::string const& bucket_name, std::string const& entity,
1845  BucketAccessControl const& original_acl,
1846  BucketAccessControl const& new_acl, Options&&... options) {
1847  internal::PatchBucketAclRequest request(bucket_name, entity, original_acl,
1848  new_acl);
1849  request.set_multiple_options(std::forward<Options>(options)...);
1850  return raw_client_->PatchBucketAcl(request);
1851  }
1852 
1886  template <typename... Options>
1887  StatusOr<BucketAccessControl> PatchBucketAcl(
1888  std::string const& bucket_name, std::string const& entity,
1889  BucketAccessControlPatchBuilder const& builder, Options&&... options) {
1890  internal::PatchBucketAclRequest request(bucket_name, entity, builder);
1891  request.set_multiple_options(std::forward<Options>(options)...);
1892  return raw_client_->PatchBucketAcl(request);
1893  }
1895 
1897 
1934  template <typename... Options>
1935  StatusOr<std::vector<ObjectAccessControl>> ListObjectAcl(
1936  std::string const& bucket_name, std::string const& object_name,
1937  Options&&... options) {
1938  internal::ListObjectAclRequest request(bucket_name, object_name);
1939  request.set_multiple_options(std::forward<Options>(options)...);
1940  auto result = raw_client_->ListObjectAcl(request);
1941  if (!result) {
1942  return std::move(result).status();
1943  }
1944  return std::move(result.value().items);
1945  }
1946 
1969  template <typename... Options>
1970  StatusOr<ObjectAccessControl> CreateObjectAcl(std::string const& bucket_name,
1971  std::string const& object_name,
1972  std::string const& entity,
1973  std::string const& role,
1974  Options&&... options) {
1975  internal::CreateObjectAclRequest request(bucket_name, object_name, entity,
1976  role);
1977  request.set_multiple_options(std::forward<Options>(options)...);
1978  return raw_client_->CreateObjectAcl(request);
1979  }
1980 
2001  template <typename... Options>
2002  Status DeleteObjectAcl(std::string const& bucket_name,
2003  std::string const& object_name,
2004  std::string const& entity, Options&&... options) {
2005  internal::DeleteObjectAclRequest request(bucket_name, object_name, entity);
2006  request.set_multiple_options(std::forward<Options>(options)...);
2007  return raw_client_->DeleteObjectAcl(request).status();
2008  }
2009 
2028  template <typename... Options>
2029  StatusOr<ObjectAccessControl> GetObjectAcl(std::string const& bucket_name,
2030  std::string const& object_name,
2031  std::string const& entity,
2032  Options&&... options) {
2033  internal::GetObjectAclRequest request(bucket_name, object_name, entity);
2034  request.set_multiple_options(std::forward<Options>(options)...);
2035  return raw_client_->GetObjectAcl(request);
2036  }
2037 
2067  template <typename... Options>
2068  StatusOr<ObjectAccessControl> UpdateObjectAcl(std::string const& bucket_name,
2069  std::string const& object_name,
2070  ObjectAccessControl const& acl,
2071  Options&&... options) {
2072  internal::UpdateObjectAclRequest request(bucket_name, object_name,
2073  acl.entity(), acl.role());
2074  request.set_multiple_options(std::forward<Options>(options)...);
2075  return raw_client_->UpdateObjectAcl(request);
2076  }
2077 
2114  template <typename... Options>
2115  StatusOr<ObjectAccessControl> PatchObjectAcl(
2116  std::string const& bucket_name, std::string const& object_name,
2117  std::string const& entity, ObjectAccessControl const& original_acl,
2118  ObjectAccessControl const& new_acl, Options&&... options) {
2119  internal::PatchObjectAclRequest request(bucket_name, object_name, entity,
2120  original_acl, new_acl);
2121  request.set_multiple_options(std::forward<Options>(options)...);
2122  return raw_client_->PatchObjectAcl(request);
2123  }
2124 
2159  template <typename... Options>
2160  StatusOr<ObjectAccessControl> PatchObjectAcl(
2161  std::string const& bucket_name, std::string const& object_name,
2162  std::string const& entity, ObjectAccessControlPatchBuilder const& builder,
2163  Options&&... options) {
2164  internal::PatchObjectAclRequest request(bucket_name, object_name, entity,
2165  builder);
2166  request.set_multiple_options(std::forward<Options>(options)...);
2167  return raw_client_->PatchObjectAcl(request);
2168  }
2170 
2172 
2208  template <typename... Options>
2209  StatusOr<std::vector<ObjectAccessControl>> ListDefaultObjectAcl(
2210  std::string const& bucket_name, Options&&... options) {
2211  internal::ListDefaultObjectAclRequest request(bucket_name);
2212  request.set_multiple_options(std::forward<Options>(options)...);
2213  auto response = raw_client_->ListDefaultObjectAcl(request);
2214  if (!response) {
2215  return std::move(response).status();
2216  }
2217  return std::move(response.value().items);
2218  }
2219 
2246  template <typename... Options>
2247  StatusOr<ObjectAccessControl> CreateDefaultObjectAcl(
2248  std::string const& bucket_name, std::string const& entity,
2249  std::string const& role, Options&&... options) {
2250  internal::CreateDefaultObjectAclRequest request(bucket_name, entity, role);
2251  request.set_multiple_options(std::forward<Options>(options)...);
2252  return raw_client_->CreateDefaultObjectAcl(request);
2253  }
2254 
2278  template <typename... Options>
2279  Status DeleteDefaultObjectAcl(std::string const& bucket_name,
2280  std::string const& entity,
2281  Options&&... options) {
2282  internal::DeleteDefaultObjectAclRequest request(bucket_name, entity);
2283  request.set_multiple_options(std::forward<Options>(options)...);
2284  return raw_client_->DeleteDefaultObjectAcl(request).status();
2285  }
2286 
2309  template <typename... Options>
2310  StatusOr<ObjectAccessControl> GetDefaultObjectAcl(
2311  std::string const& bucket_name, std::string const& entity,
2312  Options&&... options) {
2313  internal::GetDefaultObjectAclRequest request(bucket_name, entity);
2314  request.set_multiple_options(std::forward<Options>(options)...);
2315  return raw_client_->GetDefaultObjectAcl(request);
2316  }
2317 
2351  template <typename... Options>
2352  StatusOr<ObjectAccessControl> UpdateDefaultObjectAcl(
2353  std::string const& bucket_name, ObjectAccessControl const& acl,
2354  Options&&... options) {
2355  internal::UpdateDefaultObjectAclRequest request(bucket_name, acl.entity(),
2356  acl.role());
2357  request.set_multiple_options(std::forward<Options>(options)...);
2358  return raw_client_->UpdateDefaultObjectAcl(request);
2359  }
2360 
2399  template <typename... Options>
2400  StatusOr<ObjectAccessControl> PatchDefaultObjectAcl(
2401  std::string const& bucket_name, std::string const& entity,
2402  ObjectAccessControl const& original_acl,
2403  ObjectAccessControl const& new_acl, Options&&... options) {
2404  internal::PatchDefaultObjectAclRequest request(bucket_name, entity,
2405  original_acl, new_acl);
2406  request.set_multiple_options(std::forward<Options>(options)...);
2407  return raw_client_->PatchDefaultObjectAcl(request);
2408  }
2409 
2447  template <typename... Options>
2448  StatusOr<ObjectAccessControl> PatchDefaultObjectAcl(
2449  std::string const& bucket_name, std::string const& entity,
2450  ObjectAccessControlPatchBuilder const& builder, Options&&... options) {
2451  internal::PatchDefaultObjectAclRequest request(bucket_name, entity,
2452  builder);
2453  request.set_multiple_options(std::forward<Options>(options)...);
2454  return raw_client_->PatchDefaultObjectAcl(request);
2455  }
2457 
2459 
2491  template <typename... Options>
2492  StatusOr<ServiceAccount> GetServiceAccountForProject(
2493  std::string const& project_id, Options&&... options) {
2494  internal::GetProjectServiceAccountRequest request(project_id);
2495  request.set_multiple_options(std::forward<Options>(options)...);
2496  return raw_client_->GetServiceAccount(request);
2497  }
2498 
2526  template <typename... Options>
2527  StatusOr<ServiceAccount> GetServiceAccount(Options&&... options) {
2528  auto const& project_id = raw_client_->client_options().project_id();
2529  return GetServiceAccountForProject(project_id,
2530  std::forward<Options>(options)...);
2531  }
2532 
2562  template <typename... Options>
2563  ListHmacKeysReader ListHmacKeys(Options&&... options) {
2564  auto const& project_id = raw_client_->client_options().project_id();
2565  internal::ListHmacKeysRequest request(project_id);
2566  request.set_multiple_options(std::forward<Options>(options)...);
2567  auto client = raw_client_;
2568  return google::cloud::internal::MakePaginationRange<ListHmacKeysReader>(
2569  request,
2570  [client](internal::ListHmacKeysRequest const& r) {
2571  return client->ListHmacKeys(r);
2572  },
2573  [](internal::ListHmacKeysResponse r) { return std::move(r.items); });
2574  }
2575 
2609  template <typename... Options>
2610  StatusOr<std::pair<HmacKeyMetadata, std::string>> CreateHmacKey(
2611  std::string service_account, Options&&... options) {
2612  auto const& project_id = raw_client_->client_options().project_id();
2613  internal::CreateHmacKeyRequest request(project_id,
2614  std::move(service_account));
2615  request.set_multiple_options(std::forward<Options>(options)...);
2616  auto result = raw_client_->CreateHmacKey(request);
2617  if (!result) {
2618  return result.status();
2619  }
2620  return std::make_pair(std::move(result->metadata),
2621  std::move(result->secret));
2622  }
2623 
2652  template <typename... Options>
2653  Status DeleteHmacKey(std::string access_id, Options&&... options) {
2654  auto const& project_id = raw_client_->client_options().project_id();
2655  internal::DeleteHmacKeyRequest request(project_id, std::move(access_id));
2656  request.set_multiple_options(std::forward<Options>(options)...);
2657  return raw_client_->DeleteHmacKey(request).status();
2658  }
2659 
2687  template <typename... Options>
2688  StatusOr<HmacKeyMetadata> GetHmacKey(std::string access_id,
2689  Options&&... options) {
2690  auto const& project_id = raw_client_->client_options().project_id();
2691  internal::GetHmacKeyRequest request(project_id, std::move(access_id));
2692  request.set_multiple_options(std::forward<Options>(options)...);
2693  return raw_client_->GetHmacKey(request);
2694  }
2695 
2727  template <typename... Options>
2728  StatusOr<HmacKeyMetadata> UpdateHmacKey(std::string access_id,
2729  HmacKeyMetadata resource,
2730  Options&&... options) {
2731  auto const& project_id = raw_client_->client_options().project_id();
2732  internal::UpdateHmacKeyRequest request(project_id, std::move(access_id),
2733  std::move(resource));
2734  request.set_multiple_options(std::forward<Options>(options)...);
2735  return raw_client_->UpdateHmacKey(request);
2736  }
2738 
2740 
2793  template <typename... Options>
2794  StatusOr<std::string> CreateV2SignedUrl(std::string verb,
2795  std::string bucket_name,
2796  std::string object_name,
2797  Options&&... options) {
2798  internal::V2SignUrlRequest request(std::move(verb), std::move(bucket_name),
2799  std::move(object_name));
2800  request.set_multiple_options(std::forward<Options>(options)...);
2801  return SignUrlV2(request);
2802  }
2803 
2856  template <typename... Options>
2857  StatusOr<std::string> CreateV4SignedUrl(std::string verb,
2858  std::string bucket_name,
2859  std::string object_name,
2860  Options&&... options) {
2861  internal::V4SignUrlRequest request(std::move(verb), std::move(bucket_name),
2862  std::move(object_name));
2863  request.set_multiple_options(std::forward<Options>(options)...);
2864  return SignUrlV4(std::move(request));
2865  }
2867 
2900  template <typename... Options>
2901  StatusOr<PolicyDocumentResult> CreateSignedPolicyDocument(
2902  PolicyDocument document, Options&&... options) {
2903  internal::PolicyDocumentRequest request(std::move(document));
2904  request.set_multiple_options(std::forward<Options>(options)...);
2905  return SignPolicyDocument(request);
2906  }
2907 
2941  template <typename... Options>
2942  StatusOr<PolicyDocumentV4Result> GenerateSignedPostPolicyV4(
2943  PolicyDocumentV4 document, Options&&... options) {
2944  internal::PolicyDocumentV4Request request(std::move(document));
2945  request.set_multiple_options(std::forward<Options>(options)...);
2946  return SignPolicyDocumentV4(std::move(request));
2947  }
2948 
2950 
2976  template <typename... Options>
2977  StatusOr<std::vector<NotificationMetadata>> ListNotifications(
2978  std::string const& bucket_name, Options&&... options) {
2979  internal::ListNotificationsRequest request(bucket_name);
2980  request.set_multiple_options(std::forward<Options>(options)...);
2981  auto result = raw_client_->ListNotifications(request);
2982  if (!result) {
2983  return std::move(result).status();
2984  }
2985  return std::move(result).value().items;
2986  }
2987 
3021  template <typename... Options>
3022  StatusOr<NotificationMetadata> CreateNotification(
3023  std::string const& bucket_name, std::string const& topic_name,
3024  std::string const& payload_format, NotificationMetadata metadata,
3025  Options&&... options) {
3026  metadata.set_topic(topic_name).set_payload_format(payload_format);
3027  internal::CreateNotificationRequest request(bucket_name, metadata);
3028  request.set_multiple_options(std::forward<Options>(options)...);
3029  return raw_client_->CreateNotification(request);
3030  }
3031 
3057  template <typename... Options>
3058  StatusOr<NotificationMetadata> GetNotification(
3059  std::string const& bucket_name, std::string const& notification_id,
3060  Options&&... options) {
3061  internal::GetNotificationRequest request(bucket_name, notification_id);
3062  request.set_multiple_options(std::forward<Options>(options)...);
3063  return raw_client_->GetNotification(request);
3064  }
3065 
3093  template <typename... Options>
3094  Status DeleteNotification(std::string const& bucket_name,
3095  std::string const& notification_id,
3096  Options&&... options) {
3097  internal::DeleteNotificationRequest request(bucket_name, notification_id);
3098  request.set_multiple_options(std::forward<Options>(options)...);
3099  return std::move(raw_client_->DeleteNotification(request)).status();
3100  }
3102 
3103  private:
3104  Client() = default;
3105  static std::shared_ptr<internal::RawClient> CreateDefaultInternalClient(
3106  ClientOptions options);
3107 
3108  template <typename... Policies>
3109  std::shared_ptr<internal::RawClient> Decorate(
3110  std::shared_ptr<internal::RawClient> client, Policies&&... policies) {
3111  if (client->client_options().enable_raw_client_tracing()) {
3112  client = std::make_shared<internal::LoggingClient>(std::move(client));
3113  }
3114  auto retry = std::make_shared<internal::RetryClient>(
3115  std::move(client), std::forward<Policies>(policies)...);
3116  return retry;
3117  }
3118 
3119  ObjectReadStream ReadObjectImpl(
3120  internal::ReadObjectRangeRequest const& request);
3121 
3122  ObjectWriteStream WriteObjectImpl(
3123  internal::ResumableUploadRequest const& request);
3124 
3125  // The version of UploadFile() where UseResumableUploadSession is one of the
3126  // options. Note how this does not use InsertObjectMedia at all.
3127  template <typename... Options>
3128  StatusOr<ObjectMetadata> UploadFileImpl(std::string const& file_name,
3129  std::string const& bucket_name,
3130  std::string const& object_name,
3131  std::true_type,
3132  Options&&... options) {
3133  internal::ResumableUploadRequest request(bucket_name, object_name);
3134  request.set_multiple_options(std::forward<Options>(options)...);
3135  return UploadFileResumable(file_name, std::move(request));
3136  }
3137 
3138  // The version of UploadFile() where UseResumableUploadSession is *not* one of
3139  // the options. In this case we can use InsertObjectMediaRequest because it
3140  // is safe.
3141  template <typename... Options>
3142  StatusOr<ObjectMetadata> UploadFileImpl(std::string const& file_name,
3143  std::string const& bucket_name,
3144  std::string const& object_name,
3145  std::false_type,
3146  Options&&... options) {
3147  std::size_t file_size = 0;
3148  if (UseSimpleUpload(file_name, file_size)) {
3149  internal::InsertObjectMediaRequest request(bucket_name, object_name,
3150  std::string{});
3151  request.set_multiple_options(std::forward<Options>(options)...);
3152  return UploadFileSimple(file_name, file_size, request);
3153  }
3154  internal::ResumableUploadRequest request(bucket_name, object_name);
3155  request.set_multiple_options(std::forward<Options>(options)...);
3156  return UploadFileResumable(file_name, std::move(request));
3157  }
3158 
3159  bool UseSimpleUpload(std::string const& file_name, std::size_t& size) const;
3160 
3161  StatusOr<ObjectMetadata> UploadFileSimple(
3162  std::string const& file_name, std::size_t file_size,
3163  internal::InsertObjectMediaRequest request);
3164 
3165  StatusOr<ObjectMetadata> UploadFileResumable(
3166  std::string const& file_name, internal::ResumableUploadRequest request);
3167 
3168  StatusOr<ObjectMetadata> UploadStreamResumable(
3169  std::istream& source, internal::ResumableUploadRequest const& request);
3170 
3171  Status DownloadFileImpl(internal::ReadObjectRangeRequest const& request,
3172  std::string const& file_name);
3173 
3175  std::string SigningEmail(SigningAccount const& signing_account);
3176 
3179  struct SignBlobResponseRaw {
3180  std::string key_id;
3181  std::vector<std::uint8_t> signed_blob;
3182  };
3183 
3185  StatusOr<SignBlobResponseRaw> SignBlobImpl(
3186  SigningAccount const& signing_account, std::string const& string_to_sign);
3187 
3188  StatusOr<std::string> SignUrlV2(internal::V2SignUrlRequest const& request);
3189  StatusOr<std::string> SignUrlV4(internal::V4SignUrlRequest request);
3190 
3191  StatusOr<PolicyDocumentResult> SignPolicyDocument(
3192  internal::PolicyDocumentRequest const& request);
3193  StatusOr<PolicyDocumentV4Result> SignPolicyDocumentV4(
3194  internal::PolicyDocumentV4Request request);
3195 
3196  std::shared_ptr<internal::RawClient> raw_client_;
3197 
3198  friend class internal::NonResumableParallelUploadState;
3199  friend class internal::ResumableParallelUploadState;
3200  friend class testing::ClientTester;
3201 };
3202 
3219 std::string CreateRandomPrefixName(std::string const& prefix = "");
3220 
3221 namespace internal {
3222 
3223 // Just a wrapper to allow for using in `google::cloud::internal::apply`.
3224 struct DeleteApplyHelper {
3225  template <typename... Options>
3226  Status operator()(Options... options) const {
3227  return client.DeleteObject(bucket_name, object_name, std::move(options)...);
3228  }
3229 
3230  Client& client;
3231  std::string bucket_name;
3232  std::string object_name;
3233 };
3234 
3235 // Just a wrapper to allow for using in `google::cloud::internal::apply`.
3236 struct InsertObjectApplyHelper {
3237  template <typename... Options>
3238  StatusOr<ObjectMetadata> operator()(Options... options) const {
3239  return client.InsertObject(bucket_name, object_name, std::move(contents),
3240  std::move(options)...);
3241  }
3242 
3243  Client& client;
3244  std::string const& bucket_name;
3245  std::string const& object_name;
3246  std::string contents;
3247 };
3248 
3262 template <typename... Options>
3263 StatusOr<ObjectMetadata> LockPrefix(Client& client,
3264  std::string const& bucket_name,
3265  std::string const& prefix,
3266  Options&&... options) {
3267  return google::cloud::internal::apply(
3268  internal::InsertObjectApplyHelper{client, bucket_name, prefix, ""},
3269  std::tuple_cat(
3270  std::make_tuple(IfGenerationMatch(0)),
3271  internal::StaticTupleFilter<
3272  internal::Among<EncryptionKey, KmsKeyName, PredefinedAcl,
3273  Projection, UserProject>::TPred>(
3274  std::forward_as_tuple(std::forward<Options>(options)...))));
3275 }
3276 
3277 } // namespace internal
3278 
3289 template <typename... Options>
3290 Status DeleteByPrefix(Client& client, std::string const& bucket_name,
3291  std::string const& prefix, Options&&... options) {
3292  using internal::NotAmong;
3293  using internal::StaticTupleFilter;
3294 
3295  auto all_options = std::tie(options...);
3296 
3297  static_assert(
3298  std::tuple_size<decltype(
3299  StaticTupleFilter<
3300  NotAmong<QuotaUser, UserIp, UserProject, Versions>::TPred>(
3301  all_options))>::value == 0,
3302  "This functions accepts only options of type QuotaUser, UserIp, "
3303  "UserProject or Versions.");
3304  for (auto const& object :
3305  client.ListObjects(bucket_name, Projection::NoAcl(), Prefix(prefix),
3306  std::forward<Options>(options)...)) {
3307  if (!object) {
3308  return object.status();
3309  }
3310 
3311  auto deletion_status = google::cloud::internal::apply(
3312  internal::DeleteApplyHelper{client, bucket_name, object->name()},
3313  std::tuple_cat(
3314  std::make_tuple(IfGenerationMatch(object->generation())),
3315  StaticTupleFilter<NotAmong<Versions>::TPred>(all_options)));
3316 
3317  if (!deletion_status.ok()) {
3318  return deletion_status;
3319  }
3320  }
3321  return Status();
3322 }
3323 
3324 namespace internal {
3325 
3326 // Just a wrapper to allow for use in `google::cloud::internal::apply`.
3327 struct ComposeApplyHelper {
3328  template <typename... Options>
3329  StatusOr<ObjectMetadata> operator()(Options... options) const {
3330  return client.ComposeObject(
3331  std::move(bucket_name), std::move(source_objects),
3332  std::move(destination_object_name), std::move(options)...);
3333  }
3334 
3335  Client& client;
3336  std::string bucket_name;
3337  std::vector<ComposeSourceObject> source_objects;
3338  std::string destination_object_name;
3339 };
3340 
3341 // A helper to defer deletion of temporary GCS objects.
3342 class ScopedDeleter {
3343  public:
3344  // The actual deletion depends on local's types in a very non-trivial way,
3345  // so we abstract this away by providing the function to delete one object.
3346  // NOLINTNEXTLINE(google-explicit-constructor)
3347  ScopedDeleter(std::function<Status(std::string, std::int64_t)> delete_fun);
3348  ScopedDeleter(ScopedDeleter const&) = delete;
3349  ScopedDeleter& operator=(ScopedDeleter const&) = delete;
3350  ~ScopedDeleter();
3351 
3353  void Add(ObjectMetadata const& object);
3354 
3356  void Add(std::string object_name, std::int64_t generation);
3357 
3359  Status ExecuteDelete();
3360 
3361  void Enable(bool enable) { enabled_ = enable; }
3362 
3363  private:
3364  bool enabled_;
3365  std::function<Status(std::string, std::int64_t)> delete_fun_;
3366  std::vector<std::pair<std::string, std::int64_t>> object_list_;
3367 };
3368 
3369 } // namespace internal
3370 
3414 template <typename... Options>
3415 StatusOr<ObjectMetadata> ComposeMany(
3416  Client& client, std::string const& bucket_name,
3417  std::vector<ComposeSourceObject> source_objects, std::string const& prefix,
3418  std::string destination_object_name, bool ignore_cleanup_failures,
3419  Options&&... options) {
3420  using internal::Among;
3421  using internal::NotAmong;
3422  using internal::StaticTupleFilter;
3423  std::size_t const max_num_objects = 32;
3424 
3425  if (source_objects.empty()) {
3426  return Status(StatusCode::kInvalidArgument,
3427  "ComposeMany requires at least one source object.");
3428  }
3429 
3430  auto all_options = std::make_tuple(options...);
3431 
3432  // TODO(#3247): this list of type should somehow be generated
3433  static_assert(
3434  std::tuple_size<decltype(
3435  StaticTupleFilter<NotAmong<
3438  UserProject, WithObjectMetadata>::TPred>(
3439  all_options))>::value == 0,
3440  "This functions accepts only options of type DestinationPredefinedAcl, "
3441  "EncryptionKey, IfGenerationMatch, IfMetagenerationMatch, KmsKeyName, "
3442  "QuotaUser, UserIp, UserProject or WithObjectMetadata.");
3443 
3444  internal::ScopedDeleter deleter(
3445  [&](std::string const& object_name, std::int64_t generation) {
3446  return google::cloud::internal::apply(
3447  internal::DeleteApplyHelper{client, bucket_name, object_name},
3448  std::tuple_cat(
3449  std::make_tuple(IfGenerationMatch(generation)),
3450  StaticTupleFilter<Among<QuotaUser, UserProject, UserIp>::TPred>(
3451  all_options)));
3452  });
3453 
3454  auto lock = internal::LockPrefix(client, bucket_name, prefix, "",
3455  std::make_tuple(options...));
3456  if (!lock) {
3457  return Status(
3458  lock.status().code(),
3459  "Failed to lock prefix for ComposeMany: " + lock.status().message());
3460  }
3461  deleter.Add(*lock);
3462 
3463  std::size_t num_tmp_objects = 0;
3464  auto tmpobject_name_gen = [&num_tmp_objects, &prefix] {
3465  return prefix + ".compose-tmp-" + std::to_string(num_tmp_objects++);
3466  };
3467 
3468  auto to_source_objects = [](std::vector<ObjectMetadata> objects) {
3469  std::vector<ComposeSourceObject> sources(objects.size());
3470  std::transform(objects.begin(), objects.end(), sources.begin(),
3471  [](ObjectMetadata const& m) {
3472  return ComposeSourceObject{m.name(), m.generation(), {}};
3473  });
3474  return sources;
3475  };
3476 
3477  auto composer = [&](std::vector<ComposeSourceObject> compose_range,
3478  bool is_final) -> StatusOr<ObjectMetadata> {
3479  if (is_final) {
3480  return google::cloud::internal::apply(
3481  internal::ComposeApplyHelper{client, bucket_name,
3482  std::move(compose_range),
3483  std::move(destination_object_name)},
3484  std::tuple_cat(std::make_tuple(IfGenerationMatch(0)), all_options));
3485  }
3486  return google::cloud::internal::apply(
3487  internal::ComposeApplyHelper{client, bucket_name,
3488  std::move(compose_range),
3489  tmpobject_name_gen()},
3490  StaticTupleFilter<
3491  NotAmong<IfGenerationMatch, IfMetagenerationMatch>::TPred>(
3492  all_options));
3493  };
3494 
3495  auto reduce = [&](std::vector<ComposeSourceObject> source_objects)
3496  -> StatusOr<std::vector<ObjectMetadata>> {
3497  std::vector<ObjectMetadata> objects;
3498  for (auto range_begin = source_objects.begin();
3499  range_begin != source_objects.end();) {
3500  std::size_t range_size = std::min<std::size_t>(
3501  std::distance(range_begin, source_objects.end()), max_num_objects);
3502  auto range_end = std::next(range_begin, range_size);
3503  std::vector<ComposeSourceObject> compose_range(range_size);
3504  std::move(range_begin, range_end, compose_range.begin());
3505 
3506  bool const is_final_composition =
3507  source_objects.size() <= max_num_objects;
3508  auto object = composer(std::move(compose_range), is_final_composition);
3509  if (!object) {
3510  return std::move(object).status();
3511  }
3512  objects.push_back(*std::move(object));
3513  if (!is_final_composition) {
3514  deleter.Add(objects.back());
3515  }
3516  range_begin = range_end;
3517  }
3518  return objects;
3519  };
3520 
3521  StatusOr<ObjectMetadata> result;
3522  do {
3523  StatusOr<std::vector<ObjectMetadata>> objects = reduce(source_objects);
3524  if (!objects) {
3525  return objects.status();
3526  }
3527  if (objects->size() == 1) {
3528  if (!ignore_cleanup_failures) {
3529  auto delete_status = deleter.ExecuteDelete();
3530  if (!delete_status.ok()) {
3531  return delete_status;
3532  }
3533  }
3534  result = std::move((*objects)[0]);
3535  break;
3536  }
3537  source_objects = to_source_objects(*std::move(objects));
3538  } while (source_objects.size() > 1);
3539  return result;
3540 }
3541 
3542 } // namespace STORAGE_CLIENT_NS
3543 } // namespace storage
3544 } // namespace cloud
3545 } // namespace google
3546 
3547 #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_STORAGE_CLIENT_H
google::cloud::storage::v1::ObjectMetadata
Represents the metadata for a Google Cloud Storage Object.
Definition: object_metadata.h:88
google::cloud::storage::v1::ObjectReadStream
Defines a std::basic_istream<char> to read from a GCS Object.
Definition: object_stream.h:51
google::cloud::storage::v1::Client::ListObjectsAndPrefixes
ListObjectsAndPrefixesReader ListObjectsAndPrefixes(std::string const &bucket_name, Options &&... options)
Lists the objects and prefixes in a bucket.
Definition: client.h:1035
status.h
google::cloud::storage::v1::IfGenerationMatch
A pre-condition: the request succeeds only if the object generation matches.
Definition: well_known_parameters.h:157
google::cloud::storage::v1::Client::GetNativeBucketIamPolicy
StatusOr< NativeIamPolicy > GetNativeBucketIamPolicy(std::string const &bucket_name, Options &&... options)
Fetches the native IAM policy for a Bucket.
Definition: client.h:648
google::cloud::storage::v1::Client::ListBucketAcl
StatusOr< std::vector< BucketAccessControl > > ListBucketAcl(std::string const &bucket_name, Options &&... options)
Retrieves the list of BucketAccessControl items for a bucket.
Definition: client.h:1673
google::cloud::storage::v1::Client::CreateObjectAcl
StatusOr< ObjectAccessControl > CreateObjectAcl(std::string const &bucket_name, std::string const &object_name, std::string const &entity, std::string const &role, Options &&... options)
Creates a new entry in the object ACL.
Definition: client.h:1970
google::cloud::storage::v1::Client::GetBucketMetadata
StatusOr< BucketMetadata > GetBucketMetadata(std::string const &bucket_name, Options &&... options)
Fetches the bucket metadata.
Definition: client.h:410
google::cloud::storage::v1::ObjectWriteStream
Defines a std::basic_ostream<char> to write to a GCS Object.
Definition: object_stream.h:164
google::cloud::storage::v1::Client::CreateDefaultObjectAcl
StatusOr< ObjectAccessControl > CreateDefaultObjectAcl(std::string const &bucket_name, std::string const &entity, std::string const &role, Options &&... options)
Creates a new entry in the default object ACL for a bucket.
Definition: client.h:2247
google::cloud::storage::v1::UserProject
Set the project used for billing in "requester pays" Buckets.
Definition: well_known_parameters.h:573
status_or.h
google::cloud::storage::v1::Client::DeleteNotification
Status DeleteNotification(std::string const &bucket_name, std::string const &notification_id, Options &&... options)
Delete an existing notification config in a given Bucket.
Definition: client.h:3094
upload_options.h
google::cloud::storage::v1::Client::CreateSignedPolicyDocument
StatusOr< PolicyDocumentResult > CreateSignedPolicyDocument(PolicyDocument document, Options &&... options)
Create a signed policy document.
Definition: client.h:2901
object_rewriter.h
GOOGLE_CLOUD_CPP_STORAGE_IAM_DEPRECATED
#define GOOGLE_CLOUD_CPP_STORAGE_IAM_DEPRECATED(alternative)
Definition: version.h:23
google::cloud::storage::v1::Client
The Google Cloud Storage (GCS) Client.
Definition: client.h:187
google::cloud::storage::v1::Client::DeleteResumableUpload
Status DeleteResumableUpload(std::string const &upload_session_url, Options &&... options)
Cancel a resumable upload.
Definition: client.h:1266
google::cloud::storage::v1::Client::CreateV2SignedUrl
StatusOr< std::string > CreateV2SignedUrl(std::string verb, std::string bucket_name, std::string object_name, Options &&... options)
Create a V2 signed URL for the given parameters.
Definition: client.h:2794
google::cloud::storage::v1::NotificationMetadata::set_payload_format
NotificationMetadata & set_payload_format(std::string v)
Definition: notification_metadata.h:131
google::cloud::storage::v1::Client::PatchBucket
StatusOr< BucketMetadata > PatchBucket(std::string bucket_name, BucketMetadataPatchBuilder const &builder, Options &&... options)
Patches the metadata in a Google Cloud Storage Bucket given a desired set changes.
Definition: client.h:563
google::cloud::storage::v1::Client::GetServiceAccountForProject
StatusOr< ServiceAccount > GetServiceAccountForProject(std::string const &project_id, Options &&... options)
Gets the GCS service account for a given project.
Definition: client.h:2492
google::cloud::storage::v1::Client::ListObjects
ListObjectsReader ListObjects(std::string const &bucket_name, Options &&... options)
Lists the objects in a bucket.
Definition: client.h:1005
google::cloud::storage::v1::PolicyDocumentV4
Define a policy document V4.
Definition: policy_document.h:147
google::cloud::storage::v1::Client::TestBucketIamPermissions
StatusOr< std::vector< std::string > > TestBucketIamPermissions(std::string bucket_name, std::vector< std::string > permissions, Options &&... options)
Tests the IAM permissions of the caller against a Bucket.
Definition: client.h:792
google::cloud::storage::v1::Client::PatchObjectAcl
StatusOr< ObjectAccessControl > PatchObjectAcl(std::string const &bucket_name, std::string const &object_name, std::string const &entity, ObjectAccessControlPatchBuilder const &builder, Options &&... options)
Patches the value of an existing object ACL.
Definition: client.h:2160
google::cloud::storage::v1::CreateRandomPrefixName
std::string CreateRandomPrefixName(std::string const &prefix)
Create a random prefix for object names.
Definition: client.cc:436
google::cloud::storage::v1::Client::UpdateHmacKey
StatusOr< HmacKeyMetadata > UpdateHmacKey(std::string access_id, HmacKeyMetadata resource, Options &&... options)
Update an existing HMAC key in a given project.
Definition: client.h:2728
google::cloud::storage::v1::HmacKeyMetadata
Represents the metadata for a Google Cloud Storage HmacKeyResource.
Definition: hmac_key_metadata.h:48
google::cloud::storage::v1::Client::GetServiceAccount
StatusOr< ServiceAccount > GetServiceAccount(Options &&... options)
Gets the GCS service account for the default project.
Definition: client.h:2527
google::cloud::storage::v1::EncryptionKey
An optional parameter to set the Customer-Supplied Encryption key.
Definition: well_known_headers.h:183
google::cloud::storage::v1::ClientOptions
Describes the configuration for a storage::Client object.
Definition: client_options.h:74
google::cloud::storage::v1::Client::ListBuckets
ListBucketsReader ListBuckets(Options &&... options)
Fetches the list of buckets for the default project.
Definition: client.h:315
google::cloud::storage::v1::Client::GetObjectAcl
StatusOr< ObjectAccessControl > GetObjectAcl(std::string const &bucket_name, std::string const &object_name, std::string const &entity, Options &&... options)
Gets the value of an existing object ACL.
Definition: client.h:2029
google::cloud::storage::v1::Client::CreateV4SignedUrl
StatusOr< std::string > CreateV4SignedUrl(std::string verb, std::string bucket_name, std::string object_name, Options &&... options)
Create a V4 signed URL for the given parameters.
Definition: client.h:2857
google::cloud::storage::v1::Client::PatchObjectAcl
StatusOr< ObjectAccessControl > PatchObjectAcl(std::string const &bucket_name, std::string const &object_name, std::string const &entity, ObjectAccessControl const &original_acl, ObjectAccessControl const &new_acl, Options &&... options)
Patches the value of an existing object ACL.
Definition: client.h:2115
google::cloud::storage::v1::WithObjectMetadata
A request option to define the object metadata attributes.
Definition: object_metadata.h:351
google::cloud::storage::v1::Client::Client
Client(std::shared_ptr< internal::RawClient > client, Policies &&... policies)
Builds a client and maybe override the retry, idempotency, and/or backoff policies.
Definition: client.h:234
google::cloud::storage::v1::Client::PatchBucketAcl
StatusOr< BucketAccessControl > PatchBucketAcl(std::string const &bucket_name, std::string const &entity, BucketAccessControlPatchBuilder const &builder, Options &&... options)
Patches the value of an existing bucket ACL.
Definition: client.h:1887
google::cloud::storage::v1::BucketAccessControlPatchBuilder
Prepares a patch for a BucketAccessControl resource.
Definition: bucket_access_control.h:103
google::cloud::storage::v1::Client::Client
Client(std::shared_ptr< internal::RawClient > client, NoDecorations)
Builds a client with a specific RawClient, without decorations.
Definition: client.h:243
google::cloud::storage::v1::ObjectRewriter
Complete long running object rewrite operations.
Definition: object_rewriter.h:48
google::cloud::storage::v1::Client::CopyObject
StatusOr< ObjectMetadata > CopyObject(std::string source_bucket_name, std::string source_object_name, std::string destination_bucket_name, std::string destination_object_name, Options &&... options)
Copies an existing object.
Definition: client.h:951
google::cloud::storage::v1::Client::GenerateSignedPostPolicyV4
StatusOr< PolicyDocumentV4Result > GenerateSignedPostPolicyV4(PolicyDocumentV4 document, Options &&... options)
Create a signed V4 policy document.
Definition: client.h:2942
list_buckets_reader.h
google::cloud::storage::v1::Client::ReadObject
ObjectReadStream ReadObject(std::string const &bucket_name, std::string const &object_name, Options &&... options)
Reads the contents of an object.
Definition: client.h:1092
retry_policy.h
google::cloud::storage::v1::Client::GetNotification
StatusOr< NotificationMetadata > GetNotification(std::string const &bucket_name, std::string const &notification_id, Options &&... options)
Gets the details about a notification config in a given Bucket.
Definition: client.h:3058
google::cloud::storage::v1::Client::DeleteObject
Status DeleteObject(std::string const &bucket_name, std::string const &object_name, Options &&... options)
Deletes an object.
Definition: client.h:1320
version.h
google::cloud::storage::v1::Client::RewriteObject
ObjectRewriter RewriteObject(std::string source_bucket_name, std::string source_object_name, std::string destination_bucket_name, std::string destination_object_name, Options &&... options)
Creates an ObjectRewriter to copy the source object.
Definition: client.h:1505
google::cloud::storage::v1::Client::LockBucketRetentionPolicy
StatusOr< BucketMetadata > LockBucketRetentionPolicy(std::string const &bucket_name, std::uint64_t metageneration, Options &&... options)
Locks the retention policy for a bucket.
Definition: client.h:852
google::cloud::storage::v1::Client::DeleteBucketAcl
Status DeleteBucketAcl(std::string const &bucket_name, std::string const &entity, Options &&... options)
Deletes an entry from a bucket ACL.
Definition: client.h:1734
google::cloud::storage::v1::Client::ListObjectAcl
StatusOr< std::vector< ObjectAccessControl > > ListObjectAcl(std::string const &bucket_name, std::string const &object_name, Options &&... options)
Retrieves the list of ObjectAccessControl items for an object.
Definition: client.h:1935
google::cloud::storage::v1::ObjectMetadataPatchBuilder
Prepares a patch for the Bucket resource.
Definition: object_metadata.h:295
notification_event_type.h
google::cloud::storage::v1::NotificationMetadata::set_topic
NotificationMetadata & set_topic(std::string v)
Definition: notification_metadata.h:139
google::cloud::storage::v1::ListObjectsAndPrefixesReader
google::cloud::internal::PaginationRange< ObjectOrPrefix > ListObjectsAndPrefixesReader
Definition: list_objects_and_prefixes_reader.h:31
google::cloud::storage::v1::Client::SetNativeBucketIamPolicy
StatusOr< NativeIamPolicy > SetNativeBucketIamPolicy(std::string const &bucket_name, NativeIamPolicy const &iam_policy, Options &&... options)
Sets the native IAM Policy for a Bucket.
Definition: client.h:756
google::cloud::storage::v1::Client::UpdateBucketAcl
StatusOr< BucketAccessControl > UpdateBucketAcl(std::string const &bucket_name, BucketAccessControl const &acl, Options &&... options)
Updates the value of an existing bucket ACL.
Definition: client.h:1798
google::cloud::storage::v1::NativeIamPolicy
Represent the result of a GetIamPolicy or SetIamPolicy request.
Definition: iam_policy.h:143
google::cloud::storage::v1::Client::UpdateDefaultObjectAcl
StatusOr< ObjectAccessControl > UpdateDefaultObjectAcl(std::string const &bucket_name, ObjectAccessControl const &acl, Options &&... options)
Updates the value of an existing default object ACL.
Definition: client.h:2352
google::cloud::storage::v1::Client::CreateHmacKey
StatusOr< std::pair< HmacKeyMetadata, std::string > > CreateHmacKey(std::string service_account, Options &&... options)
Create a new HMAC key.
Definition: client.h:2610
google::cloud::storage::v1::Client::CreateBucketAcl
StatusOr< BucketAccessControl > CreateBucketAcl(std::string const &bucket_name, std::string const &entity, std::string const &role, Options &&... options)
Creates a new entry in a bucket ACL.
Definition: client.h:1706
google::cloud::storage::v1::Client::ComposeObject
StatusOr< ObjectMetadata > ComposeObject(std::string bucket_name, std::vector< ComposeSourceObject > source_objects, std::string destination_object_name, Options &&... options)
Composes existing objects into a new object in the same bucket.
Definition: client.h:1456
google::cloud::storage::v1::DestinationPredefinedAcl
Set the ACL to a predefined value when copying Objects.
Definition: well_known_parameters.h:357
google::cloud::storage::v1::Client::PatchBucketAcl
StatusOr< BucketAccessControl > PatchBucketAcl(std::string const &bucket_name, std::string const &entity, BucketAccessControl const &original_acl, BucketAccessControl const &new_acl, Options &&... options)
Patches the value of an existing bucket ACL.
Definition: client.h:1843
hmac_key_metadata.h
google::cloud::storage::v1::Client::ListDefaultObjectAcl
StatusOr< std::vector< ObjectAccessControl > > ListDefaultObjectAcl(std::string const &bucket_name, Options &&... options)
Retrieves the default object ACL for a bucket as a vector of ObjectAccessControl items.
Definition: client.h:2209
google::cloud::storage::v1::Prefix
Restrict list operations to entries starting with this value.
Definition: well_known_parameters.h:436
google::cloud::storage::v1::BucketMetadata
Represents a Google Cloud Storage Bucket Metadata object.
Definition: bucket_metadata.h:502
google::cloud::storage::v1::Client::GetBucketAcl
StatusOr< BucketAccessControl > GetBucketAcl(std::string const &bucket_name, std::string const &entity, Options &&... options)
Gets the value of an existing bucket ACL.
Definition: client.h:1759
google::cloud::storage::v1::DeleteByPrefix
Status DeleteByPrefix(Client &client, std::string const &bucket_name, std::string const &prefix, Options &&... options)
Delete objects whose names match a given prefix.
Definition: client.h:3290
google::cloud::storage::v1::Client::CreateBucketForProject
StatusOr< BucketMetadata > CreateBucketForProject(std::string bucket_name, std::string project_id, BucketMetadata metadata, Options &&... options)
Creates a new Google Cloud Storage Bucket in a given project.
Definition: client.h:384
google::cloud::storage::v1::BucketMetadataPatchBuilder
Prepares a patch for the Bucket resource.
Definition: bucket_metadata.h:894
google::cloud::storage::v1::Client::ResumeRewriteObject
ObjectRewriter ResumeRewriteObject(std::string source_bucket_name, std::string source_object_name, std::string destination_bucket_name, std::string destination_object_name, std::string rewrite_token, Options &&... options)
Creates an ObjectRewriter to resume a previously created rewrite.
Definition: client.h:1557
google::cloud::storage::v1::NotificationMetadata
Represents the metadata for a Google Cloud Storage Notification resource.
Definition: notification_metadata.h:43
google::cloud::storage::v1::Client::WriteObject
ObjectWriteStream WriteObject(std::string const &bucket_name, std::string const &object_name, Options &&... options)
Writes contents into an object.
Definition: client.h:1199
google::cloud::storage::v1::Client::Client
Client(ClientOptions options, Policies &&... policies)
Creates the default client type given the options.
Definition: client.h:206
google::cloud::storage::v1::Client::DeleteHmacKey
Status DeleteHmacKey(std::string access_id, Options &&... options)
Delete a HMAC key in a given project.
Definition: client.h:2653
google::cloud::storage::v1::Client::UpdateBucket
StatusOr< BucketMetadata > UpdateBucket(std::string bucket_name, BucketMetadata metadata, Options &&... options)
Updates the metadata in a Google Cloud Storage Bucket.
Definition: client.h:473
notification_payload_format.h
list_hmac_keys_reader.h
google::cloud::storage::v1::ListHmacKeysReader
google::cloud::internal::PaginationRange< HmacKeyMetadata > ListHmacKeysReader
A range to paginate over the HmacKeys for a project.
Definition: list_hmac_keys_reader.h:34
google::cloud::storage::v1::Client::DownloadToFile
Status DownloadToFile(std::string const &bucket_name, std::string const &object_name, std::string const &file_name, Options &&... options)
Downloads a Cloud Storage object to a file.
Definition: client.h:1293
google::cloud::storage::v1::IfMetagenerationMatch
A pre-condition: the request succeeds if the metadata generation matches.
Definition: well_known_parameters.h:181
google::cloud::storage::v1::Client::GetObjectMetadata
StatusOr< ObjectMetadata > GetObjectMetadata(std::string const &bucket_name, std::string const &object_name, Options &&... options)
Fetches the object metadata.
Definition: client.h:980
list_objects_reader.h
google::cloud::storage::v1::Client::PatchBucket
StatusOr< BucketMetadata > PatchBucket(std::string bucket_name, BucketMetadata const &original, BucketMetadata const &updated, Options &&... options)
Computes the difference between two BucketMetadata objects and patches a bucket based on that differe...
Definition: client.h:520
list_objects_and_prefixes_reader.h
google::cloud::storage::v1::Client::ListBucketsForProject
ListBucketsReader ListBucketsForProject(std::string const &project_id, Options &&... options)
Fetches the list of buckets for a given project.
Definition: client.h:281
google::cloud::storage::v1::Client::DeleteObjectAcl
Status DeleteObjectAcl(std::string const &bucket_name, std::string const &object_name, std::string const &entity, Options &&... options)
Deletes one access control entry in one object.
Definition: client.h:2002
google::cloud::storage::v1::Client::UpdateObjectAcl
StatusOr< ObjectAccessControl > UpdateObjectAcl(std::string const &bucket_name, std::string const &object_name, ObjectAccessControl const &acl, Options &&... options)
Updates the value of an existing object ACL.
Definition: client.h:2068
google::cloud::storage::v1::Client::ListNotifications
StatusOr< std::vector< NotificationMetadata > > ListNotifications(std::string const &bucket_name, Options &&... options)
Retrieves the list of Notifications for a Bucket.
Definition: client.h:2977
google::cloud::storage::v1::Client::PatchObject
StatusOr< ObjectMetadata > PatchObject(std::string bucket_name, std::string object_name, ObjectMetadata const &original, ObjectMetadata const &updated, Options &&... options)
Patches the metadata in a Google Cloud Storage Object.
Definition: client.h:1387
google::cloud::storage::v1::Client::UpdateObject
StatusOr< ObjectMetadata > UpdateObject(std::string bucket_name, std::string object_name, ObjectMetadata metadata, Options &&... options)
Updates the metadata in a Google Cloud Storage Object.
Definition: client.h:1350
google::cloud::storage::v1::ListBucketsReader
google::cloud::internal::PaginationRange< BucketMetadata > ListBucketsReader
Definition: list_buckets_reader.h:29
STORAGE_CLIENT_NS
#define STORAGE_CLIENT_NS
Definition: version.h:30
google::cloud::storage::v1::Client::RewriteObjectBlocking
StatusOr< ObjectMetadata > RewriteObjectBlocking(std::string source_bucket_name, std::string source_object_name, std::string destination_bucket_name, std::string destination_object_name, Options &&... options)
Rewrites the object, blocking until the rewrite completes, and returns the resulting ObjectMetadata.
Definition: client.h:1615
google::cloud::storage::v1::Client::PatchObject
StatusOr< ObjectMetadata > PatchObject(std::string bucket_name, std::string object_name, ObjectMetadataPatchBuilder const &builder, Options &&... options)
Patches the metadata in a Google Cloud Storage Object.
Definition: client.h:1423
google::cloud::storage::v1::QuotaUser
Sets the user for this operation for quota enforcement purposes.
Definition: well_known_parameters.h:524
google::cloud::storage::v1::Client::PatchDefaultObjectAcl
StatusOr< ObjectAccessControl > PatchDefaultObjectAcl(std::string const &bucket_name, std::string const &entity, ObjectAccessControlPatchBuilder const &builder, Options &&... options)
Patches the value of an existing default object ACL.
Definition: client.h:2448
google::cloud::storage::v1::Client::DeleteBucket
Status DeleteBucket(std::string const &bucket_name, Options &&... options)
Deletes a Google Cloud Storage Bucket.
Definition: client.h:433
google::cloud::storage::v1::ComposeMany
StatusOr< ObjectMetadata > ComposeMany(Client &client, std::string const &bucket_name, std::vector< ComposeSourceObject > source_objects, std::string const &prefix, std::string destination_object_name, bool ignore_cleanup_failures, Options &&... options)
Compose existing objects into a new object in the same bucket.
Definition: client.h:3415
google::cloud::storage::v1::PolicyDocument
Define a policy document.
Definition: policy_document.h:130
google::cloud::storage::v1::Client::CreateBucket
StatusOr< BucketMetadata > CreateBucket(std::string bucket_name, BucketMetadata metadata, Options &&... options)
Creates a new Google Cloud Storage bucket using the default project.
Definition: client.h:348
google::cloud::storage::v1::Client::NoDecorations
Define a tag to disable automatic decorations of the RawClient.
Definition: client.h:240
google::cloud::storage::v1::KmsKeyName
Configure the Customer-Managed Encryption Key (CMEK) for an upload.
Definition: well_known_parameters.h:274
google::cloud::storage::v1::Client::ListHmacKeys
ListHmacKeysReader ListHmacKeys(Options &&... options)
List the available HMAC keys.
Definition: client.h:2563
google::cloud::storage::v1::Client::Client
Client(std::shared_ptr< oauth2::Credentials > credentials, Policies &&... policies)
Creates the default client type given the credentials and policies.
Definition: client.h:226
google::cloud::storage::v1::BucketMetadata::set_name
BucketMetadata & set_name(std::string v)
Definition: bucket_metadata.h:756
google_credentials.h
google::cloud::storage::v1::ObjectAccessControl
Wraps the objectAccessControl resource in Google Cloud Storage.
Definition: object_access_control.h:43
google::cloud::storage::v1::Client::CreateNotification
StatusOr< NotificationMetadata > CreateNotification(std::string const &bucket_name, std::string const &topic_name, std::string const &payload_format, NotificationMetadata metadata, Options &&... options)
Creates a new notification config for a Bucket.
Definition: client.h:3022
google::cloud::storage::v1::Client::GetHmacKey
StatusOr< HmacKeyMetadata > GetHmacKey(std::string access_id, Options &&... options)
Get an existing HMAC key in a given project.
Definition: client.h:2688
google::cloud::storage::v1::BucketAccessControl
Wraps the bucketAccessControl resource in Google Cloud Storage.
Definition: bucket_access_control.h:41
google::cloud::storage::v1::Client::UploadFile
StatusOr< ObjectMetadata > UploadFile(std::string const &file_name, std::string const &bucket_name, std::string const &object_name, Options &&... options)
Uploads a file to an object.
Definition: client.h:1238
google::cloud::storage::v1::ObjectAccessControlPatchBuilder
Prepares a patch for an ObjectAccessControl resource.
Definition: object_access_control.h:113
google::cloud::storage::v1::Client::raw_client
std::shared_ptr< internal::RawClient > raw_client() const
Access the underlying RawClient.
Definition: client.h:250
google::cloud::storage::v1::Client::GetDefaultObjectAcl
StatusOr< ObjectAccessControl > GetDefaultObjectAcl(std::string const &bucket_name, std::string const &entity, Options &&... options)
Gets the value of a default object ACL in a bucket.
Definition: client.h:2310
object_stream.h
google::cloud::storage::v1::ListObjectsReader
google::cloud::internal::PaginationRange< ObjectMetadata > ListObjectsReader
Definition: list_objects_reader.h:31
google::cloud::storage::v1::Client::PatchDefaultObjectAcl
StatusOr< ObjectAccessControl > PatchDefaultObjectAcl(std::string const &bucket_name, std::string const &entity, ObjectAccessControl const &original_acl, ObjectAccessControl const &new_acl, Options &&... options)
Patches the value of an existing default object ACL.
Definition: client.h:2400
google
google::cloud::storage::v1::Client::InsertObject
StatusOr< ObjectMetadata > InsertObject(std::string const &bucket_name, std::string const &object_name, std::string contents, Options &&... options)
Creates an object given its name and contents.
Definition: client.h:900
google::cloud::storage::v1::Client::DeleteDefaultObjectAcl
Status DeleteDefaultObjectAcl(std::string const &bucket_name, std::string const &entity, Options &&... options)
Deletes an entry from the default object ACL in a bucket.
Definition: client.h:2279