use of com.google.storage.v2.StorageClient in project gapic-generator-java by googleapis.
the class SyncGetObject method syncGetObject.
public static void syncGetObject() throws Exception {
// It may require modifications to work in your environment.
try (StorageClient storageClient = StorageClient.create()) {
GetObjectRequest request = GetObjectRequest.newBuilder().setBucket("bucket-1378203158").setObject("object-1023368385").setGeneration(305703192).setIfGenerationMatch(-1086241088).setIfGenerationNotMatch(1475720404).setIfMetagenerationMatch(1043427781).setIfMetagenerationNotMatch(1025430873).setCommonObjectRequestParams(CommonObjectRequestParams.newBuilder().build()).setCommonRequestParams(CommonRequestParams.newBuilder().build()).setReadMask(FieldMask.newBuilder().build()).build();
Object response = storageClient.getObject(request);
}
}
use of com.google.storage.v2.StorageClient in project gapic-generator-java by googleapis.
the class SyncGetObjectStringString method syncGetObjectStringString.
public static void syncGetObjectStringString() throws Exception {
// It may require modifications to work in your environment.
try (StorageClient storageClient = StorageClient.create()) {
String bucket = "bucket-1378203158";
String object = "object-1023368385";
Object response = storageClient.getObject(bucket, object);
}
}
use of com.google.storage.v2.StorageClient in project gapic-generator-java by googleapis.
the class SyncGetServiceAccountString method syncGetServiceAccountString.
public static void syncGetServiceAccountString() throws Exception {
// It may require modifications to work in your environment.
try (StorageClient storageClient = StorageClient.create()) {
String project = ProjectName.of("[PROJECT]").toString();
ServiceAccount response = storageClient.getServiceAccount(project);
}
}
Aggregations