com.google.cloud.iam.admin.v1.stub.GrpcIAMStub Maven / Gradle / Ivy
Show all versions of google-iam-admin Show documentation
/*
* Copyright 2024 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.google.cloud.iam.admin.v1.stub;
import static com.google.cloud.iam.admin.v1.IAMClient.ListRolesPagedResponse;
import static com.google.cloud.iam.admin.v1.IAMClient.ListServiceAccountsPagedResponse;
import static com.google.cloud.iam.admin.v1.IAMClient.QueryGrantableRolesPagedResponse;
import static com.google.cloud.iam.admin.v1.IAMClient.QueryTestablePermissionsPagedResponse;
import com.google.api.gax.core.BackgroundResource;
import com.google.api.gax.core.BackgroundResourceAggregation;
import com.google.api.gax.grpc.GrpcCallSettings;
import com.google.api.gax.grpc.GrpcStubCallableFactory;
import com.google.api.gax.rpc.ClientContext;
import com.google.api.gax.rpc.RequestParamsBuilder;
import com.google.api.gax.rpc.UnaryCallable;
import com.google.iam.admin.v1.CreateRoleRequest;
import com.google.iam.admin.v1.CreateServiceAccountKeyRequest;
import com.google.iam.admin.v1.CreateServiceAccountRequest;
import com.google.iam.admin.v1.DeleteRoleRequest;
import com.google.iam.admin.v1.DeleteServiceAccountKeyRequest;
import com.google.iam.admin.v1.DeleteServiceAccountRequest;
import com.google.iam.admin.v1.DisableServiceAccountKeyRequest;
import com.google.iam.admin.v1.DisableServiceAccountRequest;
import com.google.iam.admin.v1.EnableServiceAccountKeyRequest;
import com.google.iam.admin.v1.EnableServiceAccountRequest;
import com.google.iam.admin.v1.GetRoleRequest;
import com.google.iam.admin.v1.GetServiceAccountKeyRequest;
import com.google.iam.admin.v1.GetServiceAccountRequest;
import com.google.iam.admin.v1.LintPolicyRequest;
import com.google.iam.admin.v1.LintPolicyResponse;
import com.google.iam.admin.v1.ListRolesRequest;
import com.google.iam.admin.v1.ListRolesResponse;
import com.google.iam.admin.v1.ListServiceAccountKeysRequest;
import com.google.iam.admin.v1.ListServiceAccountKeysResponse;
import com.google.iam.admin.v1.ListServiceAccountsRequest;
import com.google.iam.admin.v1.ListServiceAccountsResponse;
import com.google.iam.admin.v1.PatchServiceAccountRequest;
import com.google.iam.admin.v1.QueryAuditableServicesRequest;
import com.google.iam.admin.v1.QueryAuditableServicesResponse;
import com.google.iam.admin.v1.QueryGrantableRolesRequest;
import com.google.iam.admin.v1.QueryGrantableRolesResponse;
import com.google.iam.admin.v1.QueryTestablePermissionsRequest;
import com.google.iam.admin.v1.QueryTestablePermissionsResponse;
import com.google.iam.admin.v1.Role;
import com.google.iam.admin.v1.ServiceAccount;
import com.google.iam.admin.v1.ServiceAccountKey;
import com.google.iam.admin.v1.SignBlobRequest;
import com.google.iam.admin.v1.SignBlobResponse;
import com.google.iam.admin.v1.SignJwtRequest;
import com.google.iam.admin.v1.SignJwtResponse;
import com.google.iam.admin.v1.UndeleteRoleRequest;
import com.google.iam.admin.v1.UndeleteServiceAccountRequest;
import com.google.iam.admin.v1.UndeleteServiceAccountResponse;
import com.google.iam.admin.v1.UpdateRoleRequest;
import com.google.iam.admin.v1.UploadServiceAccountKeyRequest;
import com.google.iam.v1.GetIamPolicyRequest;
import com.google.iam.v1.Policy;
import com.google.iam.v1.SetIamPolicyRequest;
import com.google.iam.v1.TestIamPermissionsRequest;
import com.google.iam.v1.TestIamPermissionsResponse;
import com.google.longrunning.stub.GrpcOperationsStub;
import com.google.protobuf.Empty;
import io.grpc.MethodDescriptor;
import io.grpc.protobuf.ProtoUtils;
import java.io.IOException;
import java.util.concurrent.TimeUnit;
import javax.annotation.Generated;
// AUTO-GENERATED DOCUMENTATION AND CLASS.
/**
* gRPC stub implementation for the IAM service API.
*
* This class is for advanced usage and reflects the underlying API directly.
*/
@Generated("by gapic-generator-java")
public class GrpcIAMStub extends IAMStub {
private static final MethodDescriptor
listServiceAccountsMethodDescriptor =
MethodDescriptor.newBuilder()
.setType(MethodDescriptor.MethodType.UNARY)
.setFullMethodName("google.iam.admin.v1.IAM/ListServiceAccounts")
.setRequestMarshaller(
ProtoUtils.marshaller(ListServiceAccountsRequest.getDefaultInstance()))
.setResponseMarshaller(
ProtoUtils.marshaller(ListServiceAccountsResponse.getDefaultInstance()))
.build();
private static final MethodDescriptor
getServiceAccountMethodDescriptor =
MethodDescriptor.newBuilder()
.setType(MethodDescriptor.MethodType.UNARY)
.setFullMethodName("google.iam.admin.v1.IAM/GetServiceAccount")
.setRequestMarshaller(
ProtoUtils.marshaller(GetServiceAccountRequest.getDefaultInstance()))
.setResponseMarshaller(ProtoUtils.marshaller(ServiceAccount.getDefaultInstance()))
.build();
private static final MethodDescriptor
createServiceAccountMethodDescriptor =
MethodDescriptor.newBuilder()
.setType(MethodDescriptor.MethodType.UNARY)
.setFullMethodName("google.iam.admin.v1.IAM/CreateServiceAccount")
.setRequestMarshaller(
ProtoUtils.marshaller(CreateServiceAccountRequest.getDefaultInstance()))
.setResponseMarshaller(ProtoUtils.marshaller(ServiceAccount.getDefaultInstance()))
.build();
private static final MethodDescriptor
updateServiceAccountMethodDescriptor =
MethodDescriptor.newBuilder()
.setType(MethodDescriptor.MethodType.UNARY)
.setFullMethodName("google.iam.admin.v1.IAM/UpdateServiceAccount")
.setRequestMarshaller(ProtoUtils.marshaller(ServiceAccount.getDefaultInstance()))
.setResponseMarshaller(ProtoUtils.marshaller(ServiceAccount.getDefaultInstance()))
.build();
private static final MethodDescriptor
patchServiceAccountMethodDescriptor =
MethodDescriptor.newBuilder()
.setType(MethodDescriptor.MethodType.UNARY)
.setFullMethodName("google.iam.admin.v1.IAM/PatchServiceAccount")
.setRequestMarshaller(
ProtoUtils.marshaller(PatchServiceAccountRequest.getDefaultInstance()))
.setResponseMarshaller(ProtoUtils.marshaller(ServiceAccount.getDefaultInstance()))
.build();
private static final MethodDescriptor
deleteServiceAccountMethodDescriptor =
MethodDescriptor.newBuilder()
.setType(MethodDescriptor.MethodType.UNARY)
.setFullMethodName("google.iam.admin.v1.IAM/DeleteServiceAccount")
.setRequestMarshaller(
ProtoUtils.marshaller(DeleteServiceAccountRequest.getDefaultInstance()))
.setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance()))
.build();
private static final MethodDescriptor<
UndeleteServiceAccountRequest, UndeleteServiceAccountResponse>
undeleteServiceAccountMethodDescriptor =
MethodDescriptor
.newBuilder()
.setType(MethodDescriptor.MethodType.UNARY)
.setFullMethodName("google.iam.admin.v1.IAM/UndeleteServiceAccount")
.setRequestMarshaller(
ProtoUtils.marshaller(UndeleteServiceAccountRequest.getDefaultInstance()))
.setResponseMarshaller(
ProtoUtils.marshaller(UndeleteServiceAccountResponse.getDefaultInstance()))
.build();
private static final MethodDescriptor
enableServiceAccountMethodDescriptor =
MethodDescriptor.newBuilder()
.setType(MethodDescriptor.MethodType.UNARY)
.setFullMethodName("google.iam.admin.v1.IAM/EnableServiceAccount")
.setRequestMarshaller(
ProtoUtils.marshaller(EnableServiceAccountRequest.getDefaultInstance()))
.setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance()))
.build();
private static final MethodDescriptor
disableServiceAccountMethodDescriptor =
MethodDescriptor.newBuilder()
.setType(MethodDescriptor.MethodType.UNARY)
.setFullMethodName("google.iam.admin.v1.IAM/DisableServiceAccount")
.setRequestMarshaller(
ProtoUtils.marshaller(DisableServiceAccountRequest.getDefaultInstance()))
.setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance()))
.build();
private static final MethodDescriptor<
ListServiceAccountKeysRequest, ListServiceAccountKeysResponse>
listServiceAccountKeysMethodDescriptor =
MethodDescriptor
.newBuilder()
.setType(MethodDescriptor.MethodType.UNARY)
.setFullMethodName("google.iam.admin.v1.IAM/ListServiceAccountKeys")
.setRequestMarshaller(
ProtoUtils.marshaller(ListServiceAccountKeysRequest.getDefaultInstance()))
.setResponseMarshaller(
ProtoUtils.marshaller(ListServiceAccountKeysResponse.getDefaultInstance()))
.build();
private static final MethodDescriptor
getServiceAccountKeyMethodDescriptor =
MethodDescriptor.newBuilder()
.setType(MethodDescriptor.MethodType.UNARY)
.setFullMethodName("google.iam.admin.v1.IAM/GetServiceAccountKey")
.setRequestMarshaller(
ProtoUtils.marshaller(GetServiceAccountKeyRequest.getDefaultInstance()))
.setResponseMarshaller(ProtoUtils.marshaller(ServiceAccountKey.getDefaultInstance()))
.build();
private static final MethodDescriptor
createServiceAccountKeyMethodDescriptor =
MethodDescriptor.newBuilder()
.setType(MethodDescriptor.MethodType.UNARY)
.setFullMethodName("google.iam.admin.v1.IAM/CreateServiceAccountKey")
.setRequestMarshaller(
ProtoUtils.marshaller(CreateServiceAccountKeyRequest.getDefaultInstance()))
.setResponseMarshaller(ProtoUtils.marshaller(ServiceAccountKey.getDefaultInstance()))
.build();
private static final MethodDescriptor
uploadServiceAccountKeyMethodDescriptor =
MethodDescriptor.newBuilder()
.setType(MethodDescriptor.MethodType.UNARY)
.setFullMethodName("google.iam.admin.v1.IAM/UploadServiceAccountKey")
.setRequestMarshaller(
ProtoUtils.marshaller(UploadServiceAccountKeyRequest.getDefaultInstance()))
.setResponseMarshaller(ProtoUtils.marshaller(ServiceAccountKey.getDefaultInstance()))
.build();
private static final MethodDescriptor
deleteServiceAccountKeyMethodDescriptor =
MethodDescriptor.newBuilder()
.setType(MethodDescriptor.MethodType.UNARY)
.setFullMethodName("google.iam.admin.v1.IAM/DeleteServiceAccountKey")
.setRequestMarshaller(
ProtoUtils.marshaller(DeleteServiceAccountKeyRequest.getDefaultInstance()))
.setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance()))
.build();
private static final MethodDescriptor
disableServiceAccountKeyMethodDescriptor =
MethodDescriptor.newBuilder()
.setType(MethodDescriptor.MethodType.UNARY)
.setFullMethodName("google.iam.admin.v1.IAM/DisableServiceAccountKey")
.setRequestMarshaller(
ProtoUtils.marshaller(DisableServiceAccountKeyRequest.getDefaultInstance()))
.setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance()))
.build();
private static final MethodDescriptor
enableServiceAccountKeyMethodDescriptor =
MethodDescriptor.newBuilder()
.setType(MethodDescriptor.MethodType.UNARY)
.setFullMethodName("google.iam.admin.v1.IAM/EnableServiceAccountKey")
.setRequestMarshaller(
ProtoUtils.marshaller(EnableServiceAccountKeyRequest.getDefaultInstance()))
.setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance()))
.build();
private static final MethodDescriptor
signBlobMethodDescriptor =
MethodDescriptor.newBuilder()
.setType(MethodDescriptor.MethodType.UNARY)
.setFullMethodName("google.iam.admin.v1.IAM/SignBlob")
.setRequestMarshaller(ProtoUtils.marshaller(SignBlobRequest.getDefaultInstance()))
.setResponseMarshaller(ProtoUtils.marshaller(SignBlobResponse.getDefaultInstance()))
.build();
private static final MethodDescriptor signJwtMethodDescriptor =
MethodDescriptor.newBuilder()
.setType(MethodDescriptor.MethodType.UNARY)
.setFullMethodName("google.iam.admin.v1.IAM/SignJwt")
.setRequestMarshaller(ProtoUtils.marshaller(SignJwtRequest.getDefaultInstance()))
.setResponseMarshaller(ProtoUtils.marshaller(SignJwtResponse.getDefaultInstance()))
.build();
private static final MethodDescriptor getIamPolicyMethodDescriptor =
MethodDescriptor.newBuilder()
.setType(MethodDescriptor.MethodType.UNARY)
.setFullMethodName("google.iam.admin.v1.IAM/GetIamPolicy")
.setRequestMarshaller(ProtoUtils.marshaller(GetIamPolicyRequest.getDefaultInstance()))
.setResponseMarshaller(ProtoUtils.marshaller(Policy.getDefaultInstance()))
.build();
private static final MethodDescriptor setIamPolicyMethodDescriptor =
MethodDescriptor.newBuilder()
.setType(MethodDescriptor.MethodType.UNARY)
.setFullMethodName("google.iam.admin.v1.IAM/SetIamPolicy")
.setRequestMarshaller(ProtoUtils.marshaller(SetIamPolicyRequest.getDefaultInstance()))
.setResponseMarshaller(ProtoUtils.marshaller(Policy.getDefaultInstance()))
.build();
private static final MethodDescriptor
testIamPermissionsMethodDescriptor =
MethodDescriptor.newBuilder()
.setType(MethodDescriptor.MethodType.UNARY)
.setFullMethodName("google.iam.admin.v1.IAM/TestIamPermissions")
.setRequestMarshaller(
ProtoUtils.marshaller(TestIamPermissionsRequest.getDefaultInstance()))
.setResponseMarshaller(
ProtoUtils.marshaller(TestIamPermissionsResponse.getDefaultInstance()))
.build();
private static final MethodDescriptor
queryGrantableRolesMethodDescriptor =
MethodDescriptor.newBuilder()
.setType(MethodDescriptor.MethodType.UNARY)
.setFullMethodName("google.iam.admin.v1.IAM/QueryGrantableRoles")
.setRequestMarshaller(
ProtoUtils.marshaller(QueryGrantableRolesRequest.getDefaultInstance()))
.setResponseMarshaller(
ProtoUtils.marshaller(QueryGrantableRolesResponse.getDefaultInstance()))
.build();
private static final MethodDescriptor
listRolesMethodDescriptor =
MethodDescriptor.newBuilder()
.setType(MethodDescriptor.MethodType.UNARY)
.setFullMethodName("google.iam.admin.v1.IAM/ListRoles")
.setRequestMarshaller(ProtoUtils.marshaller(ListRolesRequest.getDefaultInstance()))
.setResponseMarshaller(ProtoUtils.marshaller(ListRolesResponse.getDefaultInstance()))
.build();
private static final MethodDescriptor getRoleMethodDescriptor =
MethodDescriptor.newBuilder()
.setType(MethodDescriptor.MethodType.UNARY)
.setFullMethodName("google.iam.admin.v1.IAM/GetRole")
.setRequestMarshaller(ProtoUtils.marshaller(GetRoleRequest.getDefaultInstance()))
.setResponseMarshaller(ProtoUtils.marshaller(Role.getDefaultInstance()))
.build();
private static final MethodDescriptor createRoleMethodDescriptor =
MethodDescriptor.newBuilder()
.setType(MethodDescriptor.MethodType.UNARY)
.setFullMethodName("google.iam.admin.v1.IAM/CreateRole")
.setRequestMarshaller(ProtoUtils.marshaller(CreateRoleRequest.getDefaultInstance()))
.setResponseMarshaller(ProtoUtils.marshaller(Role.getDefaultInstance()))
.build();
private static final MethodDescriptor updateRoleMethodDescriptor =
MethodDescriptor.newBuilder()
.setType(MethodDescriptor.MethodType.UNARY)
.setFullMethodName("google.iam.admin.v1.IAM/UpdateRole")
.setRequestMarshaller(ProtoUtils.marshaller(UpdateRoleRequest.getDefaultInstance()))
.setResponseMarshaller(ProtoUtils.marshaller(Role.getDefaultInstance()))
.build();
private static final MethodDescriptor deleteRoleMethodDescriptor =
MethodDescriptor.newBuilder()
.setType(MethodDescriptor.MethodType.UNARY)
.setFullMethodName("google.iam.admin.v1.IAM/DeleteRole")
.setRequestMarshaller(ProtoUtils.marshaller(DeleteRoleRequest.getDefaultInstance()))
.setResponseMarshaller(ProtoUtils.marshaller(Role.getDefaultInstance()))
.build();
private static final MethodDescriptor undeleteRoleMethodDescriptor =
MethodDescriptor.newBuilder()
.setType(MethodDescriptor.MethodType.UNARY)
.setFullMethodName("google.iam.admin.v1.IAM/UndeleteRole")
.setRequestMarshaller(ProtoUtils.marshaller(UndeleteRoleRequest.getDefaultInstance()))
.setResponseMarshaller(ProtoUtils.marshaller(Role.getDefaultInstance()))
.build();
private static final MethodDescriptor<
QueryTestablePermissionsRequest, QueryTestablePermissionsResponse>
queryTestablePermissionsMethodDescriptor =
MethodDescriptor
.newBuilder()
.setType(MethodDescriptor.MethodType.UNARY)
.setFullMethodName("google.iam.admin.v1.IAM/QueryTestablePermissions")
.setRequestMarshaller(
ProtoUtils.marshaller(QueryTestablePermissionsRequest.getDefaultInstance()))
.setResponseMarshaller(
ProtoUtils.marshaller(QueryTestablePermissionsResponse.getDefaultInstance()))
.build();
private static final MethodDescriptor<
QueryAuditableServicesRequest, QueryAuditableServicesResponse>
queryAuditableServicesMethodDescriptor =
MethodDescriptor
.newBuilder()
.setType(MethodDescriptor.MethodType.UNARY)
.setFullMethodName("google.iam.admin.v1.IAM/QueryAuditableServices")
.setRequestMarshaller(
ProtoUtils.marshaller(QueryAuditableServicesRequest.getDefaultInstance()))
.setResponseMarshaller(
ProtoUtils.marshaller(QueryAuditableServicesResponse.getDefaultInstance()))
.build();
private static final MethodDescriptor
lintPolicyMethodDescriptor =
MethodDescriptor.newBuilder()
.setType(MethodDescriptor.MethodType.UNARY)
.setFullMethodName("google.iam.admin.v1.IAM/LintPolicy")
.setRequestMarshaller(ProtoUtils.marshaller(LintPolicyRequest.getDefaultInstance()))
.setResponseMarshaller(ProtoUtils.marshaller(LintPolicyResponse.getDefaultInstance()))
.build();
private final UnaryCallable
listServiceAccountsCallable;
private final UnaryCallable
listServiceAccountsPagedCallable;
private final UnaryCallable getServiceAccountCallable;
private final UnaryCallable
createServiceAccountCallable;
private final UnaryCallable updateServiceAccountCallable;
private final UnaryCallable
patchServiceAccountCallable;
private final UnaryCallable deleteServiceAccountCallable;
private final UnaryCallable
undeleteServiceAccountCallable;
private final UnaryCallable enableServiceAccountCallable;
private final UnaryCallable disableServiceAccountCallable;
private final UnaryCallable
listServiceAccountKeysCallable;
private final UnaryCallable
getServiceAccountKeyCallable;
private final UnaryCallable
createServiceAccountKeyCallable;
private final UnaryCallable
uploadServiceAccountKeyCallable;
private final UnaryCallable
deleteServiceAccountKeyCallable;
private final UnaryCallable
disableServiceAccountKeyCallable;
private final UnaryCallable
enableServiceAccountKeyCallable;
private final UnaryCallable signBlobCallable;
private final UnaryCallable signJwtCallable;
private final UnaryCallable getIamPolicyCallable;
private final UnaryCallable setIamPolicyCallable;
private final UnaryCallable
testIamPermissionsCallable;
private final UnaryCallable
queryGrantableRolesCallable;
private final UnaryCallable
queryGrantableRolesPagedCallable;
private final UnaryCallable listRolesCallable;
private final UnaryCallable listRolesPagedCallable;
private final UnaryCallable getRoleCallable;
private final UnaryCallable createRoleCallable;
private final UnaryCallable updateRoleCallable;
private final UnaryCallable deleteRoleCallable;
private final UnaryCallable undeleteRoleCallable;
private final UnaryCallable
queryTestablePermissionsCallable;
private final UnaryCallable<
QueryTestablePermissionsRequest, QueryTestablePermissionsPagedResponse>
queryTestablePermissionsPagedCallable;
private final UnaryCallable
queryAuditableServicesCallable;
private final UnaryCallable lintPolicyCallable;
private final BackgroundResource backgroundResources;
private final GrpcOperationsStub operationsStub;
private final GrpcStubCallableFactory callableFactory;
public static final GrpcIAMStub create(IAMStubSettings settings) throws IOException {
return new GrpcIAMStub(settings, ClientContext.create(settings));
}
public static final GrpcIAMStub create(ClientContext clientContext) throws IOException {
return new GrpcIAMStub(IAMStubSettings.newBuilder().build(), clientContext);
}
public static final GrpcIAMStub create(
ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException {
return new GrpcIAMStub(IAMStubSettings.newBuilder().build(), clientContext, callableFactory);
}
/**
* Constructs an instance of GrpcIAMStub, using the given settings. This is protected so that it
* is easy to make a subclass, but otherwise, the static factory methods should be preferred.
*/
protected GrpcIAMStub(IAMStubSettings settings, ClientContext clientContext) throws IOException {
this(settings, clientContext, new GrpcIAMCallableFactory());
}
/**
* Constructs an instance of GrpcIAMStub, using the given settings. This is protected so that it
* is easy to make a subclass, but otherwise, the static factory methods should be preferred.
*/
protected GrpcIAMStub(
IAMStubSettings settings,
ClientContext clientContext,
GrpcStubCallableFactory callableFactory)
throws IOException {
this.callableFactory = callableFactory;
this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory);
GrpcCallSettings
listServiceAccountsTransportSettings =
GrpcCallSettings.newBuilder()
.setMethodDescriptor(listServiceAccountsMethodDescriptor)
.setParamsExtractor(
request -> {
RequestParamsBuilder builder = RequestParamsBuilder.create();
builder.add("name", String.valueOf(request.getName()));
return builder.build();
})
.build();
GrpcCallSettings getServiceAccountTransportSettings =
GrpcCallSettings.newBuilder()
.setMethodDescriptor(getServiceAccountMethodDescriptor)
.setParamsExtractor(
request -> {
RequestParamsBuilder builder = RequestParamsBuilder.create();
builder.add("name", String.valueOf(request.getName()));
return builder.build();
})
.build();
GrpcCallSettings
createServiceAccountTransportSettings =
GrpcCallSettings.newBuilder()
.setMethodDescriptor(createServiceAccountMethodDescriptor)
.setParamsExtractor(
request -> {
RequestParamsBuilder builder = RequestParamsBuilder.create();
builder.add("name", String.valueOf(request.getName()));
return builder.build();
})
.build();
GrpcCallSettings updateServiceAccountTransportSettings =
GrpcCallSettings.newBuilder()
.setMethodDescriptor(updateServiceAccountMethodDescriptor)
.setParamsExtractor(
request -> {
RequestParamsBuilder builder = RequestParamsBuilder.create();
builder.add("name", String.valueOf(request.getName()));
return builder.build();
})
.build();
GrpcCallSettings
patchServiceAccountTransportSettings =
GrpcCallSettings.newBuilder()
.setMethodDescriptor(patchServiceAccountMethodDescriptor)
.setParamsExtractor(
request -> {
RequestParamsBuilder builder = RequestParamsBuilder.create();
builder.add(
"service_account.name",
String.valueOf(request.getServiceAccount().getName()));
return builder.build();
})
.build();
GrpcCallSettings deleteServiceAccountTransportSettings =
GrpcCallSettings.newBuilder()
.setMethodDescriptor(deleteServiceAccountMethodDescriptor)
.setParamsExtractor(
request -> {
RequestParamsBuilder builder = RequestParamsBuilder.create();
builder.add("name", String.valueOf(request.getName()));
return builder.build();
})
.build();
GrpcCallSettings
undeleteServiceAccountTransportSettings =
GrpcCallSettings
.newBuilder()
.setMethodDescriptor(undeleteServiceAccountMethodDescriptor)
.setParamsExtractor(
request -> {
RequestParamsBuilder builder = RequestParamsBuilder.create();
builder.add("name", String.valueOf(request.getName()));
return builder.build();
})
.build();
GrpcCallSettings enableServiceAccountTransportSettings =
GrpcCallSettings.newBuilder()
.setMethodDescriptor(enableServiceAccountMethodDescriptor)
.setParamsExtractor(
request -> {
RequestParamsBuilder builder = RequestParamsBuilder.create();
builder.add("name", String.valueOf(request.getName()));
return builder.build();
})
.build();
GrpcCallSettings disableServiceAccountTransportSettings =
GrpcCallSettings.newBuilder()
.setMethodDescriptor(disableServiceAccountMethodDescriptor)
.setParamsExtractor(
request -> {
RequestParamsBuilder builder = RequestParamsBuilder.create();
builder.add("name", String.valueOf(request.getName()));
return builder.build();
})
.build();
GrpcCallSettings
listServiceAccountKeysTransportSettings =
GrpcCallSettings
.newBuilder()
.setMethodDescriptor(listServiceAccountKeysMethodDescriptor)
.setParamsExtractor(
request -> {
RequestParamsBuilder builder = RequestParamsBuilder.create();
builder.add("name", String.valueOf(request.getName()));
return builder.build();
})
.build();
GrpcCallSettings
getServiceAccountKeyTransportSettings =
GrpcCallSettings.newBuilder()
.setMethodDescriptor(getServiceAccountKeyMethodDescriptor)
.setParamsExtractor(
request -> {
RequestParamsBuilder builder = RequestParamsBuilder.create();
builder.add("name", String.valueOf(request.getName()));
return builder.build();
})
.build();
GrpcCallSettings
createServiceAccountKeyTransportSettings =
GrpcCallSettings.newBuilder()
.setMethodDescriptor(createServiceAccountKeyMethodDescriptor)
.setParamsExtractor(
request -> {
RequestParamsBuilder builder = RequestParamsBuilder.create();
builder.add("name", String.valueOf(request.getName()));
return builder.build();
})
.build();
GrpcCallSettings
uploadServiceAccountKeyTransportSettings =
GrpcCallSettings.newBuilder()
.setMethodDescriptor(uploadServiceAccountKeyMethodDescriptor)
.setParamsExtractor(
request -> {
RequestParamsBuilder builder = RequestParamsBuilder.create();
builder.add("name", String.valueOf(request.getName()));
return builder.build();
})
.build();
GrpcCallSettings
deleteServiceAccountKeyTransportSettings =
GrpcCallSettings.newBuilder()
.setMethodDescriptor(deleteServiceAccountKeyMethodDescriptor)
.setParamsExtractor(
request -> {
RequestParamsBuilder builder = RequestParamsBuilder.create();
builder.add("name", String.valueOf(request.getName()));
return builder.build();
})
.build();
GrpcCallSettings
disableServiceAccountKeyTransportSettings =
GrpcCallSettings.newBuilder()
.setMethodDescriptor(disableServiceAccountKeyMethodDescriptor)
.setParamsExtractor(
request -> {
RequestParamsBuilder builder = RequestParamsBuilder.create();
builder.add("name", String.valueOf(request.getName()));
return builder.build();
})
.build();
GrpcCallSettings
enableServiceAccountKeyTransportSettings =
GrpcCallSettings.newBuilder()
.setMethodDescriptor(enableServiceAccountKeyMethodDescriptor)
.setParamsExtractor(
request -> {
RequestParamsBuilder builder = RequestParamsBuilder.create();
builder.add("name", String.valueOf(request.getName()));
return builder.build();
})
.build();
GrpcCallSettings signBlobTransportSettings =
GrpcCallSettings.newBuilder()
.setMethodDescriptor(signBlobMethodDescriptor)
.setParamsExtractor(
request -> {
RequestParamsBuilder builder = RequestParamsBuilder.create();
builder.add("name", String.valueOf(request.getName()));
return builder.build();
})
.build();
GrpcCallSettings signJwtTransportSettings =
GrpcCallSettings.newBuilder()
.setMethodDescriptor(signJwtMethodDescriptor)
.setParamsExtractor(
request -> {
RequestParamsBuilder builder = RequestParamsBuilder.create();
builder.add("name", String.valueOf(request.getName()));
return builder.build();
})
.build();
GrpcCallSettings getIamPolicyTransportSettings =
GrpcCallSettings.newBuilder()
.setMethodDescriptor(getIamPolicyMethodDescriptor)
.setParamsExtractor(
request -> {
RequestParamsBuilder builder = RequestParamsBuilder.create();
builder.add("resource", String.valueOf(request.getResource()));
return builder.build();
})
.build();
GrpcCallSettings setIamPolicyTransportSettings =
GrpcCallSettings.newBuilder()
.setMethodDescriptor(setIamPolicyMethodDescriptor)
.setParamsExtractor(
request -> {
RequestParamsBuilder builder = RequestParamsBuilder.create();
builder.add("resource", String.valueOf(request.getResource()));
return builder.build();
})
.build();
GrpcCallSettings
testIamPermissionsTransportSettings =
GrpcCallSettings.newBuilder()
.setMethodDescriptor(testIamPermissionsMethodDescriptor)
.setParamsExtractor(
request -> {
RequestParamsBuilder builder = RequestParamsBuilder.create();
builder.add("resource", String.valueOf(request.getResource()));
return builder.build();
})
.build();
GrpcCallSettings
queryGrantableRolesTransportSettings =
GrpcCallSettings.newBuilder()
.setMethodDescriptor(queryGrantableRolesMethodDescriptor)
.build();
GrpcCallSettings listRolesTransportSettings =
GrpcCallSettings.newBuilder()
.setMethodDescriptor(listRolesMethodDescriptor)
.setParamsExtractor(
request -> {
RequestParamsBuilder builder = RequestParamsBuilder.create();
builder.add("parent", String.valueOf(request.getParent()));
return builder.build();
})
.build();
GrpcCallSettings getRoleTransportSettings =
GrpcCallSettings.newBuilder()
.setMethodDescriptor(getRoleMethodDescriptor)
.setParamsExtractor(
request -> {
RequestParamsBuilder builder = RequestParamsBuilder.create();
builder.add("name", String.valueOf(request.getName()));
return builder.build();
})
.build();
GrpcCallSettings createRoleTransportSettings =
GrpcCallSettings.newBuilder()
.setMethodDescriptor(createRoleMethodDescriptor)
.setParamsExtractor(
request -> {
RequestParamsBuilder builder = RequestParamsBuilder.create();
builder.add("parent", String.valueOf(request.getParent()));
return builder.build();
})
.build();
GrpcCallSettings updateRoleTransportSettings =
GrpcCallSettings.newBuilder()
.setMethodDescriptor(updateRoleMethodDescriptor)
.setParamsExtractor(
request -> {
RequestParamsBuilder builder = RequestParamsBuilder.create();
builder.add("name", String.valueOf(request.getName()));
return builder.build();
})
.build();
GrpcCallSettings deleteRoleTransportSettings =
GrpcCallSettings.newBuilder()
.setMethodDescriptor(deleteRoleMethodDescriptor)
.setParamsExtractor(
request -> {
RequestParamsBuilder builder = RequestParamsBuilder.create();
builder.add("name", String.valueOf(request.getName()));
return builder.build();
})
.build();
GrpcCallSettings undeleteRoleTransportSettings =
GrpcCallSettings.newBuilder()
.setMethodDescriptor(undeleteRoleMethodDescriptor)
.setParamsExtractor(
request -> {
RequestParamsBuilder builder = RequestParamsBuilder.create();
builder.add("name", String.valueOf(request.getName()));
return builder.build();
})
.build();
GrpcCallSettings
queryTestablePermissionsTransportSettings =
GrpcCallSettings
.newBuilder()
.setMethodDescriptor(queryTestablePermissionsMethodDescriptor)
.build();
GrpcCallSettings
queryAuditableServicesTransportSettings =
GrpcCallSettings
.newBuilder()
.setMethodDescriptor(queryAuditableServicesMethodDescriptor)
.build();
GrpcCallSettings lintPolicyTransportSettings =
GrpcCallSettings.newBuilder()
.setMethodDescriptor(lintPolicyMethodDescriptor)
.build();
this.listServiceAccountsCallable =
callableFactory.createUnaryCallable(
listServiceAccountsTransportSettings,
settings.listServiceAccountsSettings(),
clientContext);
this.listServiceAccountsPagedCallable =
callableFactory.createPagedCallable(
listServiceAccountsTransportSettings,
settings.listServiceAccountsSettings(),
clientContext);
this.getServiceAccountCallable =
callableFactory.createUnaryCallable(
getServiceAccountTransportSettings,
settings.getServiceAccountSettings(),
clientContext);
this.createServiceAccountCallable =
callableFactory.createUnaryCallable(
createServiceAccountTransportSettings,
settings.createServiceAccountSettings(),
clientContext);
this.updateServiceAccountCallable =
callableFactory.createUnaryCallable(
updateServiceAccountTransportSettings,
settings.updateServiceAccountSettings(),
clientContext);
this.patchServiceAccountCallable =
callableFactory.createUnaryCallable(
patchServiceAccountTransportSettings,
settings.patchServiceAccountSettings(),
clientContext);
this.deleteServiceAccountCallable =
callableFactory.createUnaryCallable(
deleteServiceAccountTransportSettings,
settings.deleteServiceAccountSettings(),
clientContext);
this.undeleteServiceAccountCallable =
callableFactory.createUnaryCallable(
undeleteServiceAccountTransportSettings,
settings.undeleteServiceAccountSettings(),
clientContext);
this.enableServiceAccountCallable =
callableFactory.createUnaryCallable(
enableServiceAccountTransportSettings,
settings.enableServiceAccountSettings(),
clientContext);
this.disableServiceAccountCallable =
callableFactory.createUnaryCallable(
disableServiceAccountTransportSettings,
settings.disableServiceAccountSettings(),
clientContext);
this.listServiceAccountKeysCallable =
callableFactory.createUnaryCallable(
listServiceAccountKeysTransportSettings,
settings.listServiceAccountKeysSettings(),
clientContext);
this.getServiceAccountKeyCallable =
callableFactory.createUnaryCallable(
getServiceAccountKeyTransportSettings,
settings.getServiceAccountKeySettings(),
clientContext);
this.createServiceAccountKeyCallable =
callableFactory.createUnaryCallable(
createServiceAccountKeyTransportSettings,
settings.createServiceAccountKeySettings(),
clientContext);
this.uploadServiceAccountKeyCallable =
callableFactory.createUnaryCallable(
uploadServiceAccountKeyTransportSettings,
settings.uploadServiceAccountKeySettings(),
clientContext);
this.deleteServiceAccountKeyCallable =
callableFactory.createUnaryCallable(
deleteServiceAccountKeyTransportSettings,
settings.deleteServiceAccountKeySettings(),
clientContext);
this.disableServiceAccountKeyCallable =
callableFactory.createUnaryCallable(
disableServiceAccountKeyTransportSettings,
settings.disableServiceAccountKeySettings(),
clientContext);
this.enableServiceAccountKeyCallable =
callableFactory.createUnaryCallable(
enableServiceAccountKeyTransportSettings,
settings.enableServiceAccountKeySettings(),
clientContext);
this.signBlobCallable =
callableFactory.createUnaryCallable(
signBlobTransportSettings, settings.signBlobSettings(), clientContext);
this.signJwtCallable =
callableFactory.createUnaryCallable(
signJwtTransportSettings, settings.signJwtSettings(), clientContext);
this.getIamPolicyCallable =
callableFactory.createUnaryCallable(
getIamPolicyTransportSettings, settings.getIamPolicySettings(), clientContext);
this.setIamPolicyCallable =
callableFactory.createUnaryCallable(
setIamPolicyTransportSettings, settings.setIamPolicySettings(), clientContext);
this.testIamPermissionsCallable =
callableFactory.createUnaryCallable(
testIamPermissionsTransportSettings,
settings.testIamPermissionsSettings(),
clientContext);
this.queryGrantableRolesCallable =
callableFactory.createUnaryCallable(
queryGrantableRolesTransportSettings,
settings.queryGrantableRolesSettings(),
clientContext);
this.queryGrantableRolesPagedCallable =
callableFactory.createPagedCallable(
queryGrantableRolesTransportSettings,
settings.queryGrantableRolesSettings(),
clientContext);
this.listRolesCallable =
callableFactory.createUnaryCallable(
listRolesTransportSettings, settings.listRolesSettings(), clientContext);
this.listRolesPagedCallable =
callableFactory.createPagedCallable(
listRolesTransportSettings, settings.listRolesSettings(), clientContext);
this.getRoleCallable =
callableFactory.createUnaryCallable(
getRoleTransportSettings, settings.getRoleSettings(), clientContext);
this.createRoleCallable =
callableFactory.createUnaryCallable(
createRoleTransportSettings, settings.createRoleSettings(), clientContext);
this.updateRoleCallable =
callableFactory.createUnaryCallable(
updateRoleTransportSettings, settings.updateRoleSettings(), clientContext);
this.deleteRoleCallable =
callableFactory.createUnaryCallable(
deleteRoleTransportSettings, settings.deleteRoleSettings(), clientContext);
this.undeleteRoleCallable =
callableFactory.createUnaryCallable(
undeleteRoleTransportSettings, settings.undeleteRoleSettings(), clientContext);
this.queryTestablePermissionsCallable =
callableFactory.createUnaryCallable(
queryTestablePermissionsTransportSettings,
settings.queryTestablePermissionsSettings(),
clientContext);
this.queryTestablePermissionsPagedCallable =
callableFactory.createPagedCallable(
queryTestablePermissionsTransportSettings,
settings.queryTestablePermissionsSettings(),
clientContext);
this.queryAuditableServicesCallable =
callableFactory.createUnaryCallable(
queryAuditableServicesTransportSettings,
settings.queryAuditableServicesSettings(),
clientContext);
this.lintPolicyCallable =
callableFactory.createUnaryCallable(
lintPolicyTransportSettings, settings.lintPolicySettings(), clientContext);
this.backgroundResources =
new BackgroundResourceAggregation(clientContext.getBackgroundResources());
}
public GrpcOperationsStub getOperationsStub() {
return operationsStub;
}
@Override
public UnaryCallable
listServiceAccountsCallable() {
return listServiceAccountsCallable;
}
@Override
public UnaryCallable
listServiceAccountsPagedCallable() {
return listServiceAccountsPagedCallable;
}
@Override
public UnaryCallable getServiceAccountCallable() {
return getServiceAccountCallable;
}
@Override
public UnaryCallable createServiceAccountCallable() {
return createServiceAccountCallable;
}
@Override
public UnaryCallable updateServiceAccountCallable() {
return updateServiceAccountCallable;
}
@Override
public UnaryCallable patchServiceAccountCallable() {
return patchServiceAccountCallable;
}
@Override
public UnaryCallable deleteServiceAccountCallable() {
return deleteServiceAccountCallable;
}
@Override
public UnaryCallable
undeleteServiceAccountCallable() {
return undeleteServiceAccountCallable;
}
@Override
public UnaryCallable enableServiceAccountCallable() {
return enableServiceAccountCallable;
}
@Override
public UnaryCallable disableServiceAccountCallable() {
return disableServiceAccountCallable;
}
@Override
public UnaryCallable
listServiceAccountKeysCallable() {
return listServiceAccountKeysCallable;
}
@Override
public UnaryCallable
getServiceAccountKeyCallable() {
return getServiceAccountKeyCallable;
}
@Override
public UnaryCallable
createServiceAccountKeyCallable() {
return createServiceAccountKeyCallable;
}
@Override
public UnaryCallable
uploadServiceAccountKeyCallable() {
return uploadServiceAccountKeyCallable;
}
@Override
public UnaryCallable deleteServiceAccountKeyCallable() {
return deleteServiceAccountKeyCallable;
}
@Override
public UnaryCallable disableServiceAccountKeyCallable() {
return disableServiceAccountKeyCallable;
}
@Override
public UnaryCallable enableServiceAccountKeyCallable() {
return enableServiceAccountKeyCallable;
}
@Override
public UnaryCallable signBlobCallable() {
return signBlobCallable;
}
@Override
public UnaryCallable signJwtCallable() {
return signJwtCallable;
}
@Override
public UnaryCallable getIamPolicyCallable() {
return getIamPolicyCallable;
}
@Override
public UnaryCallable setIamPolicyCallable() {
return setIamPolicyCallable;
}
@Override
public UnaryCallable
testIamPermissionsCallable() {
return testIamPermissionsCallable;
}
@Override
public UnaryCallable
queryGrantableRolesCallable() {
return queryGrantableRolesCallable;
}
@Override
public UnaryCallable
queryGrantableRolesPagedCallable() {
return queryGrantableRolesPagedCallable;
}
@Override
public UnaryCallable listRolesCallable() {
return listRolesCallable;
}
@Override
public UnaryCallable listRolesPagedCallable() {
return listRolesPagedCallable;
}
@Override
public UnaryCallable getRoleCallable() {
return getRoleCallable;
}
@Override
public UnaryCallable createRoleCallable() {
return createRoleCallable;
}
@Override
public UnaryCallable updateRoleCallable() {
return updateRoleCallable;
}
@Override
public UnaryCallable deleteRoleCallable() {
return deleteRoleCallable;
}
@Override
public UnaryCallable undeleteRoleCallable() {
return undeleteRoleCallable;
}
@Override
public UnaryCallable
queryTestablePermissionsCallable() {
return queryTestablePermissionsCallable;
}
@Override
public UnaryCallable
queryTestablePermissionsPagedCallable() {
return queryTestablePermissionsPagedCallable;
}
@Override
public UnaryCallable
queryAuditableServicesCallable() {
return queryAuditableServicesCallable;
}
@Override
public UnaryCallable lintPolicyCallable() {
return lintPolicyCallable;
}
@Override
public final void close() {
try {
backgroundResources.close();
} catch (RuntimeException e) {
throw e;
} catch (Exception e) {
throw new IllegalStateException("Failed to close resource", e);
}
}
@Override
public void shutdown() {
backgroundResources.shutdown();
}
@Override
public boolean isShutdown() {
return backgroundResources.isShutdown();
}
@Override
public boolean isTerminated() {
return backgroundResources.isTerminated();
}
@Override
public void shutdownNow() {
backgroundResources.shutdownNow();
}
@Override
public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException {
return backgroundResources.awaitTermination(duration, unit);
}
}