use of com.google.api.services.iam.v1.model.CreateServiceAccountKeyRequest in project google-cloud-intellij by GoogleCloudPlatform.
the class CloudApiManager method createServiceAccountKey.
/**
* Using the supplied {@link ServiceAccount}, this creates and returns a new {@link
* ServiceAccountKey}.
*/
private static ServiceAccountKey createServiceAccountKey(CredentialedUser user, ServiceAccount serviceAccount) throws IOException {
Iam iam = GoogleApiClientFactory.getInstance().getIamClient(user.getCredential());
CreateServiceAccountKeyRequest keyRequest = new CreateServiceAccountKeyRequest();
return iam.projects().serviceAccounts().keys().create(serviceAccount.getName(), keyRequest).execute();
}
Aggregations