Search in sources :

Example 1 with CreateHmacKeyResponse

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

the class SyncCreateHmacKey method syncCreateHmacKey.

public static void syncCreateHmacKey() throws Exception {
    // It may require modifications to work in your environment.
    try (StorageClient storageClient = StorageClient.create()) {
        CreateHmacKeyRequest request = CreateHmacKeyRequest.newBuilder().setProject(ProjectName.of("[PROJECT]").toString()).setServiceAccountEmail("serviceAccountEmail1825953988").setCommonRequestParams(CommonRequestParams.newBuilder().build()).build();
        CreateHmacKeyResponse response = storageClient.createHmacKey(request);
    }
}
Also used : CreateHmacKeyResponse(com.google.storage.v2.CreateHmacKeyResponse) CreateHmacKeyRequest(com.google.storage.v2.CreateHmacKeyRequest) StorageClient(com.google.storage.v2.StorageClient)

Example 2 with CreateHmacKeyResponse

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

the class SyncCreateHmacKeyStringString method syncCreateHmacKeyStringString.

public static void syncCreateHmacKeyStringString() throws Exception {
    // It may require modifications to work in your environment.
    try (StorageClient storageClient = StorageClient.create()) {
        String project = ProjectName.of("[PROJECT]").toString();
        String serviceAccountEmail = "serviceAccountEmail1825953988";
        CreateHmacKeyResponse response = storageClient.createHmacKey(project, serviceAccountEmail);
    }
}
Also used : CreateHmacKeyResponse(com.google.storage.v2.CreateHmacKeyResponse) StorageClient(com.google.storage.v2.StorageClient)

Example 3 with CreateHmacKeyResponse

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

the class AsyncCreateHmacKey method asyncCreateHmacKey.

public static void asyncCreateHmacKey() throws Exception {
    // It may require modifications to work in your environment.
    try (StorageClient storageClient = StorageClient.create()) {
        CreateHmacKeyRequest request = CreateHmacKeyRequest.newBuilder().setProject(ProjectName.of("[PROJECT]").toString()).setServiceAccountEmail("serviceAccountEmail1825953988").setCommonRequestParams(CommonRequestParams.newBuilder().build()).build();
        ApiFuture<CreateHmacKeyResponse> future = storageClient.createHmacKeyCallable().futureCall(request);
        // Do something.
        CreateHmacKeyResponse response = future.get();
    }
}
Also used : CreateHmacKeyResponse(com.google.storage.v2.CreateHmacKeyResponse) CreateHmacKeyRequest(com.google.storage.v2.CreateHmacKeyRequest) StorageClient(com.google.storage.v2.StorageClient)

Example 4 with CreateHmacKeyResponse

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

the class SyncCreateHmacKeyProjectnameString method syncCreateHmacKeyProjectnameString.

public static void syncCreateHmacKeyProjectnameString() throws Exception {
    // It may require modifications to work in your environment.
    try (StorageClient storageClient = StorageClient.create()) {
        ProjectName project = ProjectName.of("[PROJECT]");
        String serviceAccountEmail = "serviceAccountEmail1825953988";
        CreateHmacKeyResponse response = storageClient.createHmacKey(project, serviceAccountEmail);
    }
}
Also used : CreateHmacKeyResponse(com.google.storage.v2.CreateHmacKeyResponse) ProjectName(com.google.storage.v2.ProjectName) StorageClient(com.google.storage.v2.StorageClient)

Aggregations

CreateHmacKeyResponse (com.google.storage.v2.CreateHmacKeyResponse)4 StorageClient (com.google.storage.v2.StorageClient)4 CreateHmacKeyRequest (com.google.storage.v2.CreateHmacKeyRequest)2 ProjectName (com.google.storage.v2.ProjectName)1