Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions examples/BucketExists.cc
Original file line number Diff line number Diff line change
Expand Up @@ -33,18 +33,18 @@ int main() {
args.bucket = "my-bucket";

// Call bucket exists.
minio::s3::BucketExistsResponse resp = client.BucketExists(args);
auto resp = client.BucketExists(args);

// Handle response.
if (resp) {
if (resp.exist) {
if (resp->exist) {
std::cout << "my-bucket exists" << std::endl;
} else {
std::cout << "my-bucket does not exist" << std::endl;
}
} else {
std::cout << "unable to do bucket existence check; "
<< resp.Error().String() << std::endl;
<< resp.error().String() << std::endl;
}

return 0;
Expand Down
4 changes: 2 additions & 2 deletions examples/ComposeObject.cc
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,13 @@ int main() {
args.sources = sources;

// Call compose object.
minio::s3::ComposeObjectResponse resp = client.ComposeObject(args);
auto resp = client.ComposeObject(args);

// Handle response.
if (resp) {
std::cout << "my-object is successfully created" << std::endl;
} else {
std::cout << "unable to compose object; " << resp.Error().String()
std::cout << "unable to compose object; " << resp.error().String()
<< std::endl;
}

Expand Down
4 changes: 2 additions & 2 deletions examples/CopyObject.cc
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,14 @@ int main() {
args.source = source;

// Call copy object.
minio::s3::CopyObjectResponse resp = client.CopyObject(args);
auto resp = client.CopyObject(args);

// Handle response.
if (resp) {
std::cout << "my-object is successfully created from "
<< "my-src-bucket/my-src-object" << std::endl;
} else {
std::cout << "unable to do copy object; " << resp.Error().String()
std::cout << "unable to do copy object; " << resp.error().String()
<< std::endl;
}

Expand Down
5 changes: 2 additions & 3 deletions examples/DeleteBucketEncryption.cc
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,14 @@ int main() {
args.bucket = "my-bucket";

// Call delete bucket encryption.
minio::s3::DeleteBucketEncryptionResponse resp =
client.DeleteBucketEncryption(args);
auto resp = client.DeleteBucketEncryption(args);

// Handle response.
if (resp) {
std::cout << "bucket encryption of my-bucket is deleted successfully"
<< std::endl;
} else {
std::cout << "unable to delete bucket encryption; " << resp.Error().String()
std::cout << "unable to delete bucket encryption; " << resp.error().String()
<< std::endl;
}

Expand Down
5 changes: 2 additions & 3 deletions examples/DeleteBucketLifecycle.cc
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,14 @@ int main() {
args.bucket = "my-bucket";

// Call delete bucket lifecycle.
minio::s3::DeleteBucketLifecycleResponse resp =
client.DeleteBucketLifecycle(args);
auto resp = client.DeleteBucketLifecycle(args);

// Handle response.
if (resp) {
std::cout << "bucket lifecycle of my-bucket is deleted successfully"
<< std::endl;
} else {
std::cout << "unable to delete bucket lifecycle; " << resp.Error().String()
std::cout << "unable to delete bucket lifecycle; " << resp.error().String()
<< std::endl;
}

Expand Down
5 changes: 2 additions & 3 deletions examples/DeleteBucketNotification.cc
Original file line number Diff line number Diff line change
Expand Up @@ -33,16 +33,15 @@ int main() {
args.bucket = "my-bucket";

// Call delete bucket notification.
minio::s3::DeleteBucketNotificationResponse resp =
client.DeleteBucketNotification(args);
auto resp = client.DeleteBucketNotification(args);

// Handle response.
if (resp) {
std::cout << "bucket notification of my-bucket is deleted successfully"
<< std::endl;
} else {
std::cout << "unable to delete bucket notification; "
<< resp.Error().String() << std::endl;
<< resp.error().String() << std::endl;
}

return 0;
Expand Down
4 changes: 2 additions & 2 deletions examples/DeleteBucketPolicy.cc
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,14 @@ int main() {
args.bucket = "my-bucket";

// Call delete bucket policy.
minio::s3::DeleteBucketPolicyResponse resp = client.DeleteBucketPolicy(args);
auto resp = client.DeleteBucketPolicy(args);

// Handle response.
if (resp) {
std::cout << "bucket policy of my-bucket is deleted successfully"
<< std::endl;
} else {
std::cout << "unable to delete bucket policy; " << resp.Error().String()
std::cout << "unable to delete bucket policy; " << resp.error().String()
<< std::endl;
}

Expand Down
5 changes: 2 additions & 3 deletions examples/DeleteBucketReplication.cc
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,14 @@ int main() {
args.bucket = "my-bucket";

// Call delete bucket encryption.
minio::s3::DeleteBucketEncryptionResponse resp =
client.DeleteBucketEncryption(args);
auto resp = client.DeleteBucketEncryption(args);

// Handle response.
if (resp) {
std::cout << "bucket encryption of my-bucket is deleted successfully"
<< std::endl;
} else {
std::cout << "unable to delete bucket encryption; " << resp.Error().String()
std::cout << "unable to delete bucket encryption; " << resp.error().String()
<< std::endl;
}

Expand Down
4 changes: 2 additions & 2 deletions examples/DeleteBucketTags.cc
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,14 @@ int main() {
args.bucket = "my-bucket";

// Call delete bucket tags.
minio::s3::DeleteBucketTagsResponse resp = client.DeleteBucketTags(args);
auto resp = client.DeleteBucketTags(args);

// Handle response.
if (resp) {
std::cout << "bucket tags of my-bucket is deleted successfully"
<< std::endl;
} else {
std::cout << "unable to delete bucket tags; " << resp.Error().String()
std::cout << "unable to delete bucket tags; " << resp.error().String()
<< std::endl;
}

Expand Down
5 changes: 2 additions & 3 deletions examples/DeleteObjectLockConfig.cc
Original file line number Diff line number Diff line change
Expand Up @@ -33,16 +33,15 @@ int main() {
args.bucket = "my-bucket";

// Call delete object lock config.
minio::s3::DeleteObjectLockConfigResponse resp =
client.DeleteObjectLockConfig(args);
auto resp = client.DeleteObjectLockConfig(args);

// Handle response.
if (resp) {
std::cout << "Object lock configuration is deleted successfully"
<< std::endl;
} else {
std::cout << "unable to delete object lock configuration; "
<< resp.Error().String() << std::endl;
<< resp.error().String() << std::endl;
}

return 0;
Expand Down
4 changes: 2 additions & 2 deletions examples/DeleteObjectTags.cc
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,14 @@ int main() {
args.object = "my-object";

// Call delete object tags.
minio::s3::DeleteObjectTagsResponse resp = client.DeleteObjectTags(args);
auto resp = client.DeleteObjectTags(args);

// Handle response.
if (resp) {
std::cout << "object tags of my-object is deleted successfully"
<< std::endl;
} else {
std::cout << "unable to delete object tags; " << resp.Error().String()
std::cout << "unable to delete object tags; " << resp.error().String()
<< std::endl;
}

Expand Down
5 changes: 2 additions & 3 deletions examples/DisableObjectLegalHold.cc
Original file line number Diff line number Diff line change
Expand Up @@ -34,16 +34,15 @@ int main() {
args.object = "my-object";

// Call disable object legal hold.
minio::s3::DisableObjectLegalHoldResponse resp =
client.DisableObjectLegalHold(args);
auto resp = client.DisableObjectLegalHold(args);

// Handle response.
if (resp) {
std::cout << "legal hold on my-object is disabled successfully"
<< std::endl;
} else {
std::cout << "unable to disable object legal hold; "
<< resp.Error().String() << std::endl;
<< resp.error().String() << std::endl;
}

return 0;
Expand Down
4 changes: 2 additions & 2 deletions examples/DownloadObject.cc
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,14 @@ int main() {
args.filename = "my-object.csv";

// Call download object.
minio::s3::DownloadObjectResponse resp = client.DownloadObject(args);
auto resp = client.DownloadObject(args);

// Handle response.
if (resp) {
std::cout << "my-object is successfully downloaded to my-object.csv"
<< std::endl;
} else {
std::cout << "unable to download object; " << resp.Error().String()
std::cout << "unable to download object; " << resp.error().String()
<< std::endl;
}

Expand Down
5 changes: 2 additions & 3 deletions examples/EnableObjectLegalHold.cc
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,13 @@ int main() {
args.object = "my-object";

// Call enable object legal hold.
minio::s3::EnableObjectLegalHoldResponse resp =
client.EnableObjectLegalHold(args);
auto resp = client.EnableObjectLegalHold(args);

// Handle response.
if (resp) {
std::cout << "legal hold on my-object is enabled successfully" << std::endl;
} else {
std::cout << "unable to enable object legal hold; " << resp.Error().String()
std::cout << "unable to enable object legal hold; " << resp.error().String()
<< std::endl;
}

Expand Down
9 changes: 4 additions & 5 deletions examples/GetBucketEncryption.cc
Original file line number Diff line number Diff line change
Expand Up @@ -33,16 +33,15 @@ int main() {
args.bucket = "my-bucket";

// Call get bucket encryption.
minio::s3::GetBucketEncryptionResponse resp =
client.GetBucketEncryption(args);
auto resp = client.GetBucketEncryption(args);

// Handle response.
if (resp) {
std::cout << "SSE Algorithm: " << resp.config.sse_algorithm << std::endl;
std::cout << "KMS Master Key ID: " << resp.config.kms_master_key_id
std::cout << "SSE Algorithm: " << resp->config.sse_algorithm << std::endl;
std::cout << "KMS Master Key ID: " << resp->config.kms_master_key_id
<< std::endl;
} else {
std::cout << "unable to get bucket encryption; " << resp.Error().String()
std::cout << "unable to get bucket encryption; " << resp.error().String()
<< std::endl;
}

Expand Down
6 changes: 3 additions & 3 deletions examples/GetBucketLifecycle.cc
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,14 @@ int main() {
args.bucket = "my-bucket";

// Call get bucket lifecycle.
minio::s3::GetBucketLifecycleResponse resp = client.GetBucketLifecycle(args);
auto resp = client.GetBucketLifecycle(args);

// Handle response.
if (resp) {
std::cout << "Lifecycle configuration: " << resp.config.ToXML()
std::cout << "Lifecycle configuration: " << resp->config.ToXML()
<< std::endl;
} else {
std::cout << "unable to get bucket lifecycle; " << resp.Error().String()
std::cout << "unable to get bucket lifecycle; " << resp.error().String()
<< std::endl;
Comment thread
coderabbitai[bot] marked this conversation as resolved.
}

Expand Down
7 changes: 3 additions & 4 deletions examples/GetBucketNotification.cc
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,13 @@ int main() {
args.bucket = "my-bucket";

// Call get bucket notification.
minio::s3::GetBucketNotificationResponse resp =
client.GetBucketNotification(args);
auto resp = client.GetBucketNotification(args);

// Handle response.
if (resp) {
std::cout << "Bucket notification: " << resp.config.ToXML() << std::endl;
std::cout << "Bucket notification: " << resp->config.ToXML() << std::endl;
} else {
std::cout << "unable to get bucket notification; " << resp.Error().String()
std::cout << "unable to get bucket notification; " << resp.error().String()
<< std::endl;
}

Expand Down
6 changes: 3 additions & 3 deletions examples/GetBucketPolicy.cc
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,13 @@ int main() {
args.bucket = "my-bucket";

// Call get bucket policy.
minio::s3::GetBucketPolicyResponse resp = client.GetBucketPolicy(args);
auto resp = client.GetBucketPolicy(args);

// Handle response.
if (resp) {
std::cout << "Bucket policy: " << resp.policy << std::endl;
std::cout << "Bucket policy: " << resp->policy << std::endl;
} else {
std::cout << "unable to get bucket policy; " << resp.Error().String()
std::cout << "unable to get bucket policy; " << resp.error().String()
<< std::endl;
Comment thread
coderabbitai[bot] marked this conversation as resolved.
}

Expand Down
9 changes: 4 additions & 5 deletions examples/GetBucketReplication.cc
Original file line number Diff line number Diff line change
Expand Up @@ -33,16 +33,15 @@ int main() {
args.bucket = "my-bucket";

// Call get bucket encryption.
minio::s3::GetBucketEncryptionResponse resp =
client.GetBucketEncryption(args);
auto resp = client.GetBucketEncryption(args);

// Handle response.
if (resp) {
std::cout << "SSE Algorithm: " << resp.config.sse_algorithm << std::endl;
std::cout << "KMS Master Key ID: " << resp.config.kms_master_key_id
std::cout << "SSE Algorithm: " << resp->config.sse_algorithm << std::endl;
std::cout << "KMS Master Key ID: " << resp->config.kms_master_key_id
<< std::endl;
} else {
std::cout << "unable to get bucket encryption; " << resp.Error().String()
std::cout << "unable to get bucket encryption; " << resp.error().String()
<< std::endl;
}

Expand Down
6 changes: 3 additions & 3 deletions examples/GetBucketTags.cc
Original file line number Diff line number Diff line change
Expand Up @@ -33,16 +33,16 @@ int main() {
args.bucket = "my-bucket";

// Call get bucket tags.
minio::s3::GetBucketTagsResponse resp = client.GetBucketTags(args);
auto resp = client.GetBucketTags(args);

// Handle response.
if (resp) {
std::cout << "Bucket tags: " << std::endl;
for (auto& [key, value] : resp.tags) {
for (auto& [key, value] : resp->tags) {
std::cout << "Key: " << key << ", " << "Value: " << value << std::endl;
}
} else {
std::cout << "unable to get bucket tags; " << resp.Error().String()
std::cout << "unable to get bucket tags; " << resp.error().String()
<< std::endl;
}

Expand Down
9 changes: 4 additions & 5 deletions examples/GetBucketVersioning.cc
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,14 @@ int main() {
args.bucket = "my-bucket";

// Call get bucket versioning.
minio::s3::GetBucketVersioningResponse resp =
client.GetBucketVersioning(args);
auto resp = client.GetBucketVersioning(args);

// Handle response.
if (resp) {
std::cout << "Status: " << resp.Status() << std::endl;
std::cout << "MFA Delete: " << resp.MfaDelete() << std::endl;
std::cout << "Status: " << resp->Status() << std::endl;
std::cout << "MFA Delete: " << resp->MfaDelete() << std::endl;
} else {
std::cout << "unable to get bucket versioning; " << resp.Error().String()
std::cout << "unable to get bucket versioning; " << resp.error().String()
<< std::endl;
}

Expand Down
Loading
Loading