Search in sources :

Example 1 with StorageClient

use of com.google.storage.v2.StorageClient in project gapic-generator-java by googleapis.

the class SyncUpdateBucketBucketFieldmask method syncUpdateBucketBucketFieldmask.

public static void syncUpdateBucketBucketFieldmask() throws Exception {
    // It may require modifications to work in your environment.
    try (StorageClient storageClient = StorageClient.create()) {
        Bucket bucket = Bucket.newBuilder().build();
        FieldMask updateMask = FieldMask.newBuilder().build();
        Bucket response = storageClient.updateBucket(bucket, updateMask);
    }
}
Also used : Bucket(com.google.storage.v2.Bucket) StorageClient(com.google.storage.v2.StorageClient) FieldMask(com.google.protobuf.FieldMask)

Example 2 with StorageClient

use of com.google.storage.v2.StorageClient in project gapic-generator-java by googleapis.

the class AsyncUpdateHmacKey method asyncUpdateHmacKey.

public static void asyncUpdateHmacKey() throws Exception {
    // It may require modifications to work in your environment.
    try (StorageClient storageClient = StorageClient.create()) {
        UpdateHmacKeyRequest request = UpdateHmacKeyRequest.newBuilder().setHmacKey(HmacKeyMetadata.newBuilder().build()).setCommonRequestParams(CommonRequestParams.newBuilder().build()).setUpdateMask(FieldMask.newBuilder().build()).build();
        ApiFuture<HmacKeyMetadata> future = storageClient.updateHmacKeyCallable().futureCall(request);
        // Do something.
        HmacKeyMetadata response = future.get();
    }
}
Also used : HmacKeyMetadata(com.google.storage.v2.HmacKeyMetadata) StorageClient(com.google.storage.v2.StorageClient) UpdateHmacKeyRequest(com.google.storage.v2.UpdateHmacKeyRequest)

Example 3 with StorageClient

use of com.google.storage.v2.StorageClient in project gapic-generator-java by googleapis.

the class SyncUpdateHmacKeyHmackeymetadataFieldmask method syncUpdateHmacKeyHmackeymetadataFieldmask.

public static void syncUpdateHmacKeyHmackeymetadataFieldmask() throws Exception {
    // It may require modifications to work in your environment.
    try (StorageClient storageClient = StorageClient.create()) {
        HmacKeyMetadata hmacKey = HmacKeyMetadata.newBuilder().build();
        FieldMask updateMask = FieldMask.newBuilder().build();
        HmacKeyMetadata response = storageClient.updateHmacKey(hmacKey, updateMask);
    }
}
Also used : HmacKeyMetadata(com.google.storage.v2.HmacKeyMetadata) StorageClient(com.google.storage.v2.StorageClient) FieldMask(com.google.protobuf.FieldMask)

Example 4 with StorageClient

use of com.google.storage.v2.StorageClient in project gapic-generator-java by googleapis.

the class SyncUpdateObject method syncUpdateObject.

public static void syncUpdateObject() throws Exception {
    // It may require modifications to work in your environment.
    try (StorageClient storageClient = StorageClient.create()) {
        UpdateObjectRequest request = UpdateObjectRequest.newBuilder().setObject(Object.newBuilder().build()).setIfGenerationMatch(-1086241088).setIfGenerationNotMatch(1475720404).setIfMetagenerationMatch(1043427781).setIfMetagenerationNotMatch(1025430873).setPredefinedAcl(PredefinedObjectAcl.forNumber(0)).setUpdateMask(FieldMask.newBuilder().build()).setCommonObjectRequestParams(CommonObjectRequestParams.newBuilder().build()).setCommonRequestParams(CommonRequestParams.newBuilder().build()).build();
        Object response = storageClient.updateObject(request);
    }
}
Also used : UpdateObjectRequest(com.google.storage.v2.UpdateObjectRequest) StorageClient(com.google.storage.v2.StorageClient) Object(com.google.storage.v2.Object)

Example 5 with StorageClient

use of com.google.storage.v2.StorageClient in project gapic-generator-java by googleapis.

the class SyncUpdateObjectObjectFieldmask method syncUpdateObjectObjectFieldmask.

public static void syncUpdateObjectObjectFieldmask() throws Exception {
    // It may require modifications to work in your environment.
    try (StorageClient storageClient = StorageClient.create()) {
        Object object = Object.newBuilder().build();
        FieldMask updateMask = FieldMask.newBuilder().build();
        Object response = storageClient.updateObject(object, updateMask);
    }
}
Also used : StorageClient(com.google.storage.v2.StorageClient) Object(com.google.storage.v2.Object) FieldMask(com.google.protobuf.FieldMask)

Aggregations

StorageClient (com.google.storage.v2.StorageClient)93 Bucket (com.google.storage.v2.Bucket)17 Object (com.google.storage.v2.Object)11 Notification (com.google.storage.v2.Notification)10 HmacKeyMetadata (com.google.storage.v2.HmacKeyMetadata)9 Policy (com.google.iam.v1.Policy)8 ProjectName (com.google.storage.v2.ProjectName)6 ArrayList (java.util.ArrayList)6 TestIamPermissionsResponse (com.google.iam.v1.TestIamPermissionsResponse)4 Empty (com.google.protobuf.Empty)4 BucketName (com.google.storage.v2.BucketName)4 CreateHmacKeyResponse (com.google.storage.v2.CreateHmacKeyResponse)4 ServiceAccount (com.google.storage.v2.ServiceAccount)4 ResourceName (com.google.api.resourcenames.ResourceName)3 FieldMask (com.google.protobuf.FieldMask)3 QueryWriteStatusResponse (com.google.storage.v2.QueryWriteStatusResponse)3 GetIamPolicyRequest (com.google.iam.v1.GetIamPolicyRequest)2 SetIamPolicyRequest (com.google.iam.v1.SetIamPolicyRequest)2 TestIamPermissionsRequest (com.google.iam.v1.TestIamPermissionsRequest)2 ComposeObjectRequest (com.google.storage.v2.ComposeObjectRequest)2