Search in sources :

Example 1 with SignBlobResponse

use of com.google.cloud.iam.credentials.v1.SignBlobResponse in project gapic-generator-java by googleapis.

the class AsyncSignBlob method asyncSignBlob.

public static void asyncSignBlob() throws Exception {
    // It may require modifications to work in your environment.
    try (IamCredentialsClient iamCredentialsClient = IamCredentialsClient.create()) {
        SignBlobRequest request = SignBlobRequest.newBuilder().setName(ServiceAccountName.of("[PROJECT]", "[SERVICE_ACCOUNT]").toString()).addAllDelegates(new ArrayList<String>()).setPayload(ByteString.EMPTY).build();
        ApiFuture<SignBlobResponse> future = iamCredentialsClient.signBlobCallable().futureCall(request);
        // Do something.
        SignBlobResponse response = future.get();
    }
}
Also used : SignBlobRequest(com.google.cloud.iam.credentials.v1.SignBlobRequest) IamCredentialsClient(com.google.cloud.iam.credentials.v1.IamCredentialsClient) ByteString(com.google.protobuf.ByteString) SignBlobResponse(com.google.cloud.iam.credentials.v1.SignBlobResponse)

Example 2 with SignBlobResponse

use of com.google.cloud.iam.credentials.v1.SignBlobResponse in project gapic-generator-java by googleapis.

the class SyncSignBlobServiceaccountnameListstringBytestring method syncSignBlobServiceaccountnameListstringBytestring.

public static void syncSignBlobServiceaccountnameListstringBytestring() throws Exception {
    // It may require modifications to work in your environment.
    try (IamCredentialsClient iamCredentialsClient = IamCredentialsClient.create()) {
        ServiceAccountName name = ServiceAccountName.of("[PROJECT]", "[SERVICE_ACCOUNT]");
        List<String> delegates = new ArrayList<>();
        ByteString payload = ByteString.EMPTY;
        SignBlobResponse response = iamCredentialsClient.signBlob(name, delegates, payload);
    }
}
Also used : ByteString(com.google.protobuf.ByteString) ArrayList(java.util.ArrayList) IamCredentialsClient(com.google.cloud.iam.credentials.v1.IamCredentialsClient) ServiceAccountName(com.google.cloud.iam.credentials.v1.ServiceAccountName) ByteString(com.google.protobuf.ByteString) SignBlobResponse(com.google.cloud.iam.credentials.v1.SignBlobResponse)

Example 3 with SignBlobResponse

use of com.google.cloud.iam.credentials.v1.SignBlobResponse in project gapic-generator-java by googleapis.

the class SyncSignBlobStringListstringBytestring method syncSignBlobStringListstringBytestring.

public static void syncSignBlobStringListstringBytestring() throws Exception {
    // It may require modifications to work in your environment.
    try (IamCredentialsClient iamCredentialsClient = IamCredentialsClient.create()) {
        String name = ServiceAccountName.of("[PROJECT]", "[SERVICE_ACCOUNT]").toString();
        List<String> delegates = new ArrayList<>();
        ByteString payload = ByteString.EMPTY;
        SignBlobResponse response = iamCredentialsClient.signBlob(name, delegates, payload);
    }
}
Also used : ByteString(com.google.protobuf.ByteString) ArrayList(java.util.ArrayList) IamCredentialsClient(com.google.cloud.iam.credentials.v1.IamCredentialsClient) ByteString(com.google.protobuf.ByteString) SignBlobResponse(com.google.cloud.iam.credentials.v1.SignBlobResponse)

Example 4 with SignBlobResponse

use of com.google.cloud.iam.credentials.v1.SignBlobResponse in project gapic-generator-java by googleapis.

the class SyncSignBlob method syncSignBlob.

public static void syncSignBlob() throws Exception {
    // It may require modifications to work in your environment.
    try (IamCredentialsClient iamCredentialsClient = IamCredentialsClient.create()) {
        SignBlobRequest request = SignBlobRequest.newBuilder().setName(ServiceAccountName.of("[PROJECT]", "[SERVICE_ACCOUNT]").toString()).addAllDelegates(new ArrayList<String>()).setPayload(ByteString.EMPTY).build();
        SignBlobResponse response = iamCredentialsClient.signBlob(request);
    }
}
Also used : SignBlobRequest(com.google.cloud.iam.credentials.v1.SignBlobRequest) IamCredentialsClient(com.google.cloud.iam.credentials.v1.IamCredentialsClient) ByteString(com.google.protobuf.ByteString) SignBlobResponse(com.google.cloud.iam.credentials.v1.SignBlobResponse)

Aggregations

IamCredentialsClient (com.google.cloud.iam.credentials.v1.IamCredentialsClient)4 SignBlobResponse (com.google.cloud.iam.credentials.v1.SignBlobResponse)4 ByteString (com.google.protobuf.ByteString)4 SignBlobRequest (com.google.cloud.iam.credentials.v1.SignBlobRequest)2 ArrayList (java.util.ArrayList)2 ServiceAccountName (com.google.cloud.iam.credentials.v1.ServiceAccountName)1