use of com.google.storage.v2.StorageClient in project gapic-generator-java by googleapis.
the class SyncCreateSetEndpoint method syncCreateSetEndpoint.
public static void syncCreateSetEndpoint() throws Exception {
// This snippet has been automatically generated for illustrative purposes only.
// It may require modifications to work in your environment.
StorageSettings storageSettings = StorageSettings.newBuilder().setEndpoint(myEndpoint).build();
StorageClient storageClient = StorageClient.create(storageSettings);
}
use of com.google.storage.v2.StorageClient in project gapic-generator-java by googleapis.
the class AsyncCreateBucket method asyncCreateBucket.
public static void asyncCreateBucket() throws Exception {
// It may require modifications to work in your environment.
try (StorageClient storageClient = StorageClient.create()) {
CreateBucketRequest request = CreateBucketRequest.newBuilder().setParent(ProjectName.of("[PROJECT]").toString()).setBucket(Bucket.newBuilder().build()).setBucketId("bucketId-1603305307").setPredefinedAcl(PredefinedBucketAcl.forNumber(0)).setPredefinedDefaultObjectAcl(PredefinedObjectAcl.forNumber(0)).build();
ApiFuture<Bucket> future = storageClient.createBucketCallable().futureCall(request);
// Do something.
Bucket response = future.get();
}
}
use of com.google.storage.v2.StorageClient in project gapic-generator-java by googleapis.
the class SyncCreateBucket method syncCreateBucket.
public static void syncCreateBucket() throws Exception {
// It may require modifications to work in your environment.
try (StorageClient storageClient = StorageClient.create()) {
CreateBucketRequest request = CreateBucketRequest.newBuilder().setParent(ProjectName.of("[PROJECT]").toString()).setBucket(Bucket.newBuilder().build()).setBucketId("bucketId-1603305307").setPredefinedAcl(PredefinedBucketAcl.forNumber(0)).setPredefinedDefaultObjectAcl(PredefinedObjectAcl.forNumber(0)).build();
Bucket response = storageClient.createBucket(request);
}
}
use of com.google.storage.v2.StorageClient in project gapic-generator-java by googleapis.
the class SyncCreateBucketProjectnameBucketString method syncCreateBucketProjectnameBucketString.
public static void syncCreateBucketProjectnameBucketString() throws Exception {
// It may require modifications to work in your environment.
try (StorageClient storageClient = StorageClient.create()) {
ProjectName parent = ProjectName.of("[PROJECT]");
Bucket bucket = Bucket.newBuilder().build();
String bucketId = "bucketId-1603305307";
Bucket response = storageClient.createBucket(parent, bucket, bucketId);
}
}
use of com.google.storage.v2.StorageClient in project gapic-generator-java by googleapis.
the class SyncCreateBucketStringBucketString method syncCreateBucketStringBucketString.
public static void syncCreateBucketStringBucketString() throws Exception {
// It may require modifications to work in your environment.
try (StorageClient storageClient = StorageClient.create()) {
String parent = ProjectName.of("[PROJECT]").toString();
Bucket bucket = Bucket.newBuilder().build();
String bucketId = "bucketId-1603305307";
Bucket response = storageClient.createBucket(parent, bucket, bucketId);
}
}
Aggregations