From 1075f1ce1516062070c1fef428d123519531175f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Uli=20K=C3=B6hler?= Date: Mon, 21 Aug 2023 17:10:04 +0200 Subject: [PATCH] Fix README example not compiling --- README.md | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index 4dee3fac..f0ffc669 100644 --- a/README.md +++ b/README.md @@ -32,8 +32,7 @@ $ cmake --build ./build --config Debug int main(int argc, char* argv[]) { // Create S3 base URL. - minio::http::BaseUrl base_url; - base_url.SetHost("play.min.io"); + minio::s3::BaseUrl base_url("play.min.io"); // Create credential provider. minio::creds::StaticProvider provider( @@ -41,33 +40,32 @@ int main(int argc, char* argv[]) { // Create S3 client. minio::s3::Client client(base_url, &provider); - std::string bucket_name = "asiatrip"; // Check 'asiatrip' bucket exist or not. bool exist; { minio::s3::BucketExistsArgs args; - args.bucket_ = bucket_name; + args.bucket = bucket_name; minio::s3::BucketExistsResponse resp = client.BucketExists(args); if (!resp) { - std::cout << "unable to do bucket existence check; " << resp.GetError() + std::cout << "unable to do bucket existence check; " << resp.Error() << std::endl; return EXIT_FAILURE; } - exist = resp.exist_; + exist = resp.exist; } // Make 'asiatrip' bucket if not exist. if (!exist) { minio::s3::MakeBucketArgs args; - args.bucket_ = bucket_name; + args.bucket = bucket_name; minio::s3::MakeBucketResponse resp = client.MakeBucket(args); if (!resp) { - std::cout << "unable to create bucket; " << resp.GetError() << std::endl; + std::cout << "unable to create bucket; " << resp.Error() << std::endl; return EXIT_FAILURE; } } @@ -75,13 +73,13 @@ int main(int argc, char* argv[]) { // Upload '/home/user/Photos/asiaphotos.zip' as object name // 'asiaphotos-2015.zip' to bucket 'asiatrip'. minio::s3::UploadObjectArgs args; - args.bucket_ = bucket_name; - args.object_ = "asiaphotos-2015.zip"; - args.filename_ = "/home/user/Photos/asiaphotos.zip"; + args.bucket = bucket_name; + args.object = "asiaphotos-2015.zip"; + args.filename = "/home/user/Photos/asiaphotos.zip"; minio::s3::UploadObjectResponse resp = client.UploadObject(args); if (!resp) { - std::cout << "unable to upload object; " << resp.GetError() << std::endl; + std::cout << "unable to upload object; " << resp.Error() << std::endl; return EXIT_FAILURE; }