use of com.google.storage.v2.Object in project act-platform by mnemonic-no.
the class TraverseGraphHandlerTest method testTraverseGraphReturnVertices.
@Test
public void testTraverseGraphReturnVertices() throws Exception {
ObjectRecord source = mockObjectRecord(mockObjectType(), "someValue");
ObjectRecord destination = mockObjectRecord(mockObjectType(), "someOther");
mockFact(source, destination);
ResultSet<?> resultSet = handler.traverse(set(source.getId()), "g.out()", TraverseParams.builder().build());
List<?> result = ListUtils.list(resultSet.iterator());
assertEquals(1, result.size());
assertTrue(result.get(0) instanceof Object);
assertEquals(destination.getId(), ((Object) result.get(0)).getId());
}
use of com.google.storage.v2.Object in project act-platform by mnemonic-no.
the class TraverseGraphDelegateTest method testTraverseGraphReturnVertices.
private void testTraverseGraphReturnVertices(TestMethod method) throws Exception {
ObjectRecord startObject = mockFullTraversal();
List<?> result = ListUtils.list(method.execute(startObject, "g.out()").iterator());
assertEquals(1, result.size());
assertTrue(result.get(0) instanceof Object);
}
use of com.google.storage.v2.Object in project gapic-generator-java by googleapis.
the class AsyncComposeObject method asyncComposeObject.
public static void asyncComposeObject() throws Exception {
// It may require modifications to work in your environment.
try (StorageClient storageClient = StorageClient.create()) {
ComposeObjectRequest request = ComposeObjectRequest.newBuilder().setDestination(Object.newBuilder().build()).addAllSourceObjects(new ArrayList<ComposeObjectRequest.SourceObject>()).setDestinationPredefinedAcl(PredefinedObjectAcl.forNumber(0)).setIfGenerationMatch(-1086241088).setIfMetagenerationMatch(1043427781).setKmsKey(CryptoKeyName.of("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]").toString()).setCommonObjectRequestParams(CommonObjectRequestParams.newBuilder().build()).setCommonRequestParams(CommonRequestParams.newBuilder().build()).build();
ApiFuture<Object> future = storageClient.composeObjectCallable().futureCall(request);
// Do something.
Object response = future.get();
}
}
use of com.google.storage.v2.Object in project gapic-generator-java by googleapis.
the class SyncDeleteObject method syncDeleteObject.
public static void syncDeleteObject() throws Exception {
// It may require modifications to work in your environment.
try (StorageClient storageClient = StorageClient.create()) {
DeleteObjectRequest request = DeleteObjectRequest.newBuilder().setBucket("bucket-1378203158").setObject("object-1023368385").setUploadId("uploadId1563990780").setGeneration(305703192).setIfGenerationMatch(-1086241088).setIfGenerationNotMatch(1475720404).setIfMetagenerationMatch(1043427781).setIfMetagenerationNotMatch(1025430873).setCommonObjectRequestParams(CommonObjectRequestParams.newBuilder().build()).setCommonRequestParams(CommonRequestParams.newBuilder().build()).build();
storageClient.deleteObject(request);
}
}
use of com.google.storage.v2.Object in project gapic-generator-java by googleapis.
the class SyncDeleteObjectStringString method syncDeleteObjectStringString.
public static void syncDeleteObjectStringString() throws Exception {
// It may require modifications to work in your environment.
try (StorageClient storageClient = StorageClient.create()) {
String bucket = "bucket-1378203158";
String object = "object-1023368385";
storageClient.deleteObject(bucket, object);
}
}
Aggregations