com.google.cloud.datacatalog.v1beta1.stub.GrpcDataCatalogStub Maven / Gradle / Ivy
Show all versions of google-cloud-datacatalog Show documentation
/*
* Copyright 2021 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.datacatalog.v1beta1.stub;
import static com.google.cloud.datacatalog.v1beta1.DataCatalogClient.ListEntriesPagedResponse;
import static com.google.cloud.datacatalog.v1beta1.DataCatalogClient.ListEntryGroupsPagedResponse;
import static com.google.cloud.datacatalog.v1beta1.DataCatalogClient.ListTagsPagedResponse;
import static com.google.cloud.datacatalog.v1beta1.DataCatalogClient.SearchCatalogPagedResponse;
import com.google.api.core.BetaApi;
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.RequestParamsExtractor;
import com.google.api.gax.rpc.UnaryCallable;
import com.google.cloud.datacatalog.v1beta1.CreateEntryGroupRequest;
import com.google.cloud.datacatalog.v1beta1.CreateEntryRequest;
import com.google.cloud.datacatalog.v1beta1.CreateTagRequest;
import com.google.cloud.datacatalog.v1beta1.CreateTagTemplateFieldRequest;
import com.google.cloud.datacatalog.v1beta1.CreateTagTemplateRequest;
import com.google.cloud.datacatalog.v1beta1.DeleteEntryGroupRequest;
import com.google.cloud.datacatalog.v1beta1.DeleteEntryRequest;
import com.google.cloud.datacatalog.v1beta1.DeleteTagRequest;
import com.google.cloud.datacatalog.v1beta1.DeleteTagTemplateFieldRequest;
import com.google.cloud.datacatalog.v1beta1.DeleteTagTemplateRequest;
import com.google.cloud.datacatalog.v1beta1.Entry;
import com.google.cloud.datacatalog.v1beta1.EntryGroup;
import com.google.cloud.datacatalog.v1beta1.GetEntryGroupRequest;
import com.google.cloud.datacatalog.v1beta1.GetEntryRequest;
import com.google.cloud.datacatalog.v1beta1.GetTagTemplateRequest;
import com.google.cloud.datacatalog.v1beta1.ListEntriesRequest;
import com.google.cloud.datacatalog.v1beta1.ListEntriesResponse;
import com.google.cloud.datacatalog.v1beta1.ListEntryGroupsRequest;
import com.google.cloud.datacatalog.v1beta1.ListEntryGroupsResponse;
import com.google.cloud.datacatalog.v1beta1.ListTagsRequest;
import com.google.cloud.datacatalog.v1beta1.ListTagsResponse;
import com.google.cloud.datacatalog.v1beta1.LookupEntryRequest;
import com.google.cloud.datacatalog.v1beta1.RenameTagTemplateFieldRequest;
import com.google.cloud.datacatalog.v1beta1.SearchCatalogRequest;
import com.google.cloud.datacatalog.v1beta1.SearchCatalogResponse;
import com.google.cloud.datacatalog.v1beta1.Tag;
import com.google.cloud.datacatalog.v1beta1.TagTemplate;
import com.google.cloud.datacatalog.v1beta1.TagTemplateField;
import com.google.cloud.datacatalog.v1beta1.UpdateEntryGroupRequest;
import com.google.cloud.datacatalog.v1beta1.UpdateEntryRequest;
import com.google.cloud.datacatalog.v1beta1.UpdateTagRequest;
import com.google.cloud.datacatalog.v1beta1.UpdateTagTemplateFieldRequest;
import com.google.cloud.datacatalog.v1beta1.UpdateTagTemplateRequest;
import com.google.common.collect.ImmutableMap;
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.Map;
import java.util.concurrent.TimeUnit;
import javax.annotation.Generated;
// AUTO-GENERATED DOCUMENTATION AND CLASS.
/**
* gRPC stub implementation for the DataCatalog service API.
*
* This class is for advanced usage and reflects the underlying API directly.
*/
@BetaApi
@Generated("by gapic-generator-java")
public class GrpcDataCatalogStub extends DataCatalogStub {
private static final MethodDescriptor
searchCatalogMethodDescriptor =
MethodDescriptor.newBuilder()
.setType(MethodDescriptor.MethodType.UNARY)
.setFullMethodName("google.cloud.datacatalog.v1beta1.DataCatalog/SearchCatalog")
.setRequestMarshaller(
ProtoUtils.marshaller(SearchCatalogRequest.getDefaultInstance()))
.setResponseMarshaller(
ProtoUtils.marshaller(SearchCatalogResponse.getDefaultInstance()))
.build();
private static final MethodDescriptor
createEntryGroupMethodDescriptor =
MethodDescriptor.newBuilder()
.setType(MethodDescriptor.MethodType.UNARY)
.setFullMethodName("google.cloud.datacatalog.v1beta1.DataCatalog/CreateEntryGroup")
.setRequestMarshaller(
ProtoUtils.marshaller(CreateEntryGroupRequest.getDefaultInstance()))
.setResponseMarshaller(ProtoUtils.marshaller(EntryGroup.getDefaultInstance()))
.build();
private static final MethodDescriptor
updateEntryGroupMethodDescriptor =
MethodDescriptor.newBuilder()
.setType(MethodDescriptor.MethodType.UNARY)
.setFullMethodName("google.cloud.datacatalog.v1beta1.DataCatalog/UpdateEntryGroup")
.setRequestMarshaller(
ProtoUtils.marshaller(UpdateEntryGroupRequest.getDefaultInstance()))
.setResponseMarshaller(ProtoUtils.marshaller(EntryGroup.getDefaultInstance()))
.build();
private static final MethodDescriptor
getEntryGroupMethodDescriptor =
MethodDescriptor.newBuilder()
.setType(MethodDescriptor.MethodType.UNARY)
.setFullMethodName("google.cloud.datacatalog.v1beta1.DataCatalog/GetEntryGroup")
.setRequestMarshaller(
ProtoUtils.marshaller(GetEntryGroupRequest.getDefaultInstance()))
.setResponseMarshaller(ProtoUtils.marshaller(EntryGroup.getDefaultInstance()))
.build();
private static final MethodDescriptor
deleteEntryGroupMethodDescriptor =
MethodDescriptor.newBuilder()
.setType(MethodDescriptor.MethodType.UNARY)
.setFullMethodName("google.cloud.datacatalog.v1beta1.DataCatalog/DeleteEntryGroup")
.setRequestMarshaller(
ProtoUtils.marshaller(DeleteEntryGroupRequest.getDefaultInstance()))
.setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance()))
.build();
private static final MethodDescriptor
listEntryGroupsMethodDescriptor =
MethodDescriptor.newBuilder()
.setType(MethodDescriptor.MethodType.UNARY)
.setFullMethodName("google.cloud.datacatalog.v1beta1.DataCatalog/ListEntryGroups")
.setRequestMarshaller(
ProtoUtils.marshaller(ListEntryGroupsRequest.getDefaultInstance()))
.setResponseMarshaller(
ProtoUtils.marshaller(ListEntryGroupsResponse.getDefaultInstance()))
.build();
private static final MethodDescriptor createEntryMethodDescriptor =
MethodDescriptor.newBuilder()
.setType(MethodDescriptor.MethodType.UNARY)
.setFullMethodName("google.cloud.datacatalog.v1beta1.DataCatalog/CreateEntry")
.setRequestMarshaller(ProtoUtils.marshaller(CreateEntryRequest.getDefaultInstance()))
.setResponseMarshaller(ProtoUtils.marshaller(Entry.getDefaultInstance()))
.build();
private static final MethodDescriptor updateEntryMethodDescriptor =
MethodDescriptor.newBuilder()
.setType(MethodDescriptor.MethodType.UNARY)
.setFullMethodName("google.cloud.datacatalog.v1beta1.DataCatalog/UpdateEntry")
.setRequestMarshaller(ProtoUtils.marshaller(UpdateEntryRequest.getDefaultInstance()))
.setResponseMarshaller(ProtoUtils.marshaller(Entry.getDefaultInstance()))
.build();
private static final MethodDescriptor deleteEntryMethodDescriptor =
MethodDescriptor.newBuilder()
.setType(MethodDescriptor.MethodType.UNARY)
.setFullMethodName("google.cloud.datacatalog.v1beta1.DataCatalog/DeleteEntry")
.setRequestMarshaller(ProtoUtils.marshaller(DeleteEntryRequest.getDefaultInstance()))
.setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance()))
.build();
private static final MethodDescriptor getEntryMethodDescriptor =
MethodDescriptor.newBuilder()
.setType(MethodDescriptor.MethodType.UNARY)
.setFullMethodName("google.cloud.datacatalog.v1beta1.DataCatalog/GetEntry")
.setRequestMarshaller(ProtoUtils.marshaller(GetEntryRequest.getDefaultInstance()))
.setResponseMarshaller(ProtoUtils.marshaller(Entry.getDefaultInstance()))
.build();
private static final MethodDescriptor lookupEntryMethodDescriptor =
MethodDescriptor.newBuilder()
.setType(MethodDescriptor.MethodType.UNARY)
.setFullMethodName("google.cloud.datacatalog.v1beta1.DataCatalog/LookupEntry")
.setRequestMarshaller(ProtoUtils.marshaller(LookupEntryRequest.getDefaultInstance()))
.setResponseMarshaller(ProtoUtils.marshaller(Entry.getDefaultInstance()))
.build();
private static final MethodDescriptor
listEntriesMethodDescriptor =
MethodDescriptor.newBuilder()
.setType(MethodDescriptor.MethodType.UNARY)
.setFullMethodName("google.cloud.datacatalog.v1beta1.DataCatalog/ListEntries")
.setRequestMarshaller(ProtoUtils.marshaller(ListEntriesRequest.getDefaultInstance()))
.setResponseMarshaller(
ProtoUtils.marshaller(ListEntriesResponse.getDefaultInstance()))
.build();
private static final MethodDescriptor
createTagTemplateMethodDescriptor =
MethodDescriptor.newBuilder()
.setType(MethodDescriptor.MethodType.UNARY)
.setFullMethodName("google.cloud.datacatalog.v1beta1.DataCatalog/CreateTagTemplate")
.setRequestMarshaller(
ProtoUtils.marshaller(CreateTagTemplateRequest.getDefaultInstance()))
.setResponseMarshaller(ProtoUtils.marshaller(TagTemplate.getDefaultInstance()))
.build();
private static final MethodDescriptor
getTagTemplateMethodDescriptor =
MethodDescriptor.newBuilder()
.setType(MethodDescriptor.MethodType.UNARY)
.setFullMethodName("google.cloud.datacatalog.v1beta1.DataCatalog/GetTagTemplate")
.setRequestMarshaller(
ProtoUtils.marshaller(GetTagTemplateRequest.getDefaultInstance()))
.setResponseMarshaller(ProtoUtils.marshaller(TagTemplate.getDefaultInstance()))
.build();
private static final MethodDescriptor
updateTagTemplateMethodDescriptor =
MethodDescriptor.newBuilder()
.setType(MethodDescriptor.MethodType.UNARY)
.setFullMethodName("google.cloud.datacatalog.v1beta1.DataCatalog/UpdateTagTemplate")
.setRequestMarshaller(
ProtoUtils.marshaller(UpdateTagTemplateRequest.getDefaultInstance()))
.setResponseMarshaller(ProtoUtils.marshaller(TagTemplate.getDefaultInstance()))
.build();
private static final MethodDescriptor
deleteTagTemplateMethodDescriptor =
MethodDescriptor.newBuilder()
.setType(MethodDescriptor.MethodType.UNARY)
.setFullMethodName("google.cloud.datacatalog.v1beta1.DataCatalog/DeleteTagTemplate")
.setRequestMarshaller(
ProtoUtils.marshaller(DeleteTagTemplateRequest.getDefaultInstance()))
.setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance()))
.build();
private static final MethodDescriptor
createTagTemplateFieldMethodDescriptor =
MethodDescriptor.newBuilder()
.setType(MethodDescriptor.MethodType.UNARY)
.setFullMethodName(
"google.cloud.datacatalog.v1beta1.DataCatalog/CreateTagTemplateField")
.setRequestMarshaller(
ProtoUtils.marshaller(CreateTagTemplateFieldRequest.getDefaultInstance()))
.setResponseMarshaller(ProtoUtils.marshaller(TagTemplateField.getDefaultInstance()))
.build();
private static final MethodDescriptor
updateTagTemplateFieldMethodDescriptor =
MethodDescriptor.newBuilder()
.setType(MethodDescriptor.MethodType.UNARY)
.setFullMethodName(
"google.cloud.datacatalog.v1beta1.DataCatalog/UpdateTagTemplateField")
.setRequestMarshaller(
ProtoUtils.marshaller(UpdateTagTemplateFieldRequest.getDefaultInstance()))
.setResponseMarshaller(ProtoUtils.marshaller(TagTemplateField.getDefaultInstance()))
.build();
private static final MethodDescriptor
renameTagTemplateFieldMethodDescriptor =
MethodDescriptor.newBuilder()
.setType(MethodDescriptor.MethodType.UNARY)
.setFullMethodName(
"google.cloud.datacatalog.v1beta1.DataCatalog/RenameTagTemplateField")
.setRequestMarshaller(
ProtoUtils.marshaller(RenameTagTemplateFieldRequest.getDefaultInstance()))
.setResponseMarshaller(ProtoUtils.marshaller(TagTemplateField.getDefaultInstance()))
.build();
private static final MethodDescriptor
deleteTagTemplateFieldMethodDescriptor =
MethodDescriptor.newBuilder()
.setType(MethodDescriptor.MethodType.UNARY)
.setFullMethodName(
"google.cloud.datacatalog.v1beta1.DataCatalog/DeleteTagTemplateField")
.setRequestMarshaller(
ProtoUtils.marshaller(DeleteTagTemplateFieldRequest.getDefaultInstance()))
.setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance()))
.build();
private static final MethodDescriptor createTagMethodDescriptor =
MethodDescriptor.newBuilder()
.setType(MethodDescriptor.MethodType.UNARY)
.setFullMethodName("google.cloud.datacatalog.v1beta1.DataCatalog/CreateTag")
.setRequestMarshaller(ProtoUtils.marshaller(CreateTagRequest.getDefaultInstance()))
.setResponseMarshaller(ProtoUtils.marshaller(Tag.getDefaultInstance()))
.build();
private static final MethodDescriptor updateTagMethodDescriptor =
MethodDescriptor.newBuilder()
.setType(MethodDescriptor.MethodType.UNARY)
.setFullMethodName("google.cloud.datacatalog.v1beta1.DataCatalog/UpdateTag")
.setRequestMarshaller(ProtoUtils.marshaller(UpdateTagRequest.getDefaultInstance()))
.setResponseMarshaller(ProtoUtils.marshaller(Tag.getDefaultInstance()))
.build();
private static final MethodDescriptor deleteTagMethodDescriptor =
MethodDescriptor.newBuilder()
.setType(MethodDescriptor.MethodType.UNARY)
.setFullMethodName("google.cloud.datacatalog.v1beta1.DataCatalog/DeleteTag")
.setRequestMarshaller(ProtoUtils.marshaller(DeleteTagRequest.getDefaultInstance()))
.setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance()))
.build();
private static final MethodDescriptor
listTagsMethodDescriptor =
MethodDescriptor.newBuilder()
.setType(MethodDescriptor.MethodType.UNARY)
.setFullMethodName("google.cloud.datacatalog.v1beta1.DataCatalog/ListTags")
.setRequestMarshaller(ProtoUtils.marshaller(ListTagsRequest.getDefaultInstance()))
.setResponseMarshaller(ProtoUtils.marshaller(ListTagsResponse.getDefaultInstance()))
.build();
private static final MethodDescriptor setIamPolicyMethodDescriptor =
MethodDescriptor.newBuilder()
.setType(MethodDescriptor.MethodType.UNARY)
.setFullMethodName("google.cloud.datacatalog.v1beta1.DataCatalog/SetIamPolicy")
.setRequestMarshaller(ProtoUtils.marshaller(SetIamPolicyRequest.getDefaultInstance()))
.setResponseMarshaller(ProtoUtils.marshaller(Policy.getDefaultInstance()))
.build();
private static final MethodDescriptor getIamPolicyMethodDescriptor =
MethodDescriptor.newBuilder()
.setType(MethodDescriptor.MethodType.UNARY)
.setFullMethodName("google.cloud.datacatalog.v1beta1.DataCatalog/GetIamPolicy")
.setRequestMarshaller(ProtoUtils.marshaller(GetIamPolicyRequest.getDefaultInstance()))
.setResponseMarshaller(ProtoUtils.marshaller(Policy.getDefaultInstance()))
.build();
private static final MethodDescriptor
testIamPermissionsMethodDescriptor =
MethodDescriptor.newBuilder()
.setType(MethodDescriptor.MethodType.UNARY)
.setFullMethodName("google.cloud.datacatalog.v1beta1.DataCatalog/TestIamPermissions")
.setRequestMarshaller(
ProtoUtils.marshaller(TestIamPermissionsRequest.getDefaultInstance()))
.setResponseMarshaller(
ProtoUtils.marshaller(TestIamPermissionsResponse.getDefaultInstance()))
.build();
private final UnaryCallable searchCatalogCallable;
private final UnaryCallable
searchCatalogPagedCallable;
private final UnaryCallable createEntryGroupCallable;
private final UnaryCallable updateEntryGroupCallable;
private final UnaryCallable getEntryGroupCallable;
private final UnaryCallable deleteEntryGroupCallable;
private final UnaryCallable
listEntryGroupsCallable;
private final UnaryCallable
listEntryGroupsPagedCallable;
private final UnaryCallable createEntryCallable;
private final UnaryCallable updateEntryCallable;
private final UnaryCallable deleteEntryCallable;
private final UnaryCallable getEntryCallable;
private final UnaryCallable lookupEntryCallable;
private final UnaryCallable listEntriesCallable;
private final UnaryCallable
listEntriesPagedCallable;
private final UnaryCallable createTagTemplateCallable;
private final UnaryCallable getTagTemplateCallable;
private final UnaryCallable updateTagTemplateCallable;
private final UnaryCallable deleteTagTemplateCallable;
private final UnaryCallable
createTagTemplateFieldCallable;
private final UnaryCallable
updateTagTemplateFieldCallable;
private final UnaryCallable
renameTagTemplateFieldCallable;
private final UnaryCallable deleteTagTemplateFieldCallable;
private final UnaryCallable createTagCallable;
private final UnaryCallable updateTagCallable;
private final UnaryCallable deleteTagCallable;
private final UnaryCallable listTagsCallable;
private final UnaryCallable listTagsPagedCallable;
private final UnaryCallable setIamPolicyCallable;
private final UnaryCallable getIamPolicyCallable;
private final UnaryCallable
testIamPermissionsCallable;
private final BackgroundResource backgroundResources;
private final GrpcOperationsStub operationsStub;
private final GrpcStubCallableFactory callableFactory;
public static final GrpcDataCatalogStub create(DataCatalogStubSettings settings)
throws IOException {
return new GrpcDataCatalogStub(settings, ClientContext.create(settings));
}
public static final GrpcDataCatalogStub create(ClientContext clientContext) throws IOException {
return new GrpcDataCatalogStub(DataCatalogStubSettings.newBuilder().build(), clientContext);
}
public static final GrpcDataCatalogStub create(
ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException {
return new GrpcDataCatalogStub(
DataCatalogStubSettings.newBuilder().build(), clientContext, callableFactory);
}
/**
* Constructs an instance of GrpcDataCatalogStub, 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 GrpcDataCatalogStub(DataCatalogStubSettings settings, ClientContext clientContext)
throws IOException {
this(settings, clientContext, new GrpcDataCatalogCallableFactory());
}
/**
* Constructs an instance of GrpcDataCatalogStub, 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 GrpcDataCatalogStub(
DataCatalogStubSettings settings,
ClientContext clientContext,
GrpcStubCallableFactory callableFactory)
throws IOException {
this.callableFactory = callableFactory;
this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory);
GrpcCallSettings searchCatalogTransportSettings =
GrpcCallSettings.newBuilder()
.setMethodDescriptor(searchCatalogMethodDescriptor)
.build();
GrpcCallSettings createEntryGroupTransportSettings =
GrpcCallSettings.newBuilder()
.setMethodDescriptor(createEntryGroupMethodDescriptor)
.setParamsExtractor(
new RequestParamsExtractor() {
@Override
public Map extract(CreateEntryGroupRequest request) {
ImmutableMap.Builder params = ImmutableMap.builder();
params.put("parent", String.valueOf(request.getParent()));
return params.build();
}
})
.build();
GrpcCallSettings updateEntryGroupTransportSettings =
GrpcCallSettings.newBuilder()
.setMethodDescriptor(updateEntryGroupMethodDescriptor)
.setParamsExtractor(
new RequestParamsExtractor() {
@Override
public Map extract(UpdateEntryGroupRequest request) {
ImmutableMap.Builder params = ImmutableMap.builder();
params.put(
"entry_group.name", String.valueOf(request.getEntryGroup().getName()));
return params.build();
}
})
.build();
GrpcCallSettings getEntryGroupTransportSettings =
GrpcCallSettings.newBuilder()
.setMethodDescriptor(getEntryGroupMethodDescriptor)
.setParamsExtractor(
new RequestParamsExtractor() {
@Override
public Map extract(GetEntryGroupRequest request) {
ImmutableMap.Builder params = ImmutableMap.builder();
params.put("name", String.valueOf(request.getName()));
return params.build();
}
})
.build();
GrpcCallSettings deleteEntryGroupTransportSettings =
GrpcCallSettings.newBuilder()
.setMethodDescriptor(deleteEntryGroupMethodDescriptor)
.setParamsExtractor(
new RequestParamsExtractor() {
@Override
public Map extract(DeleteEntryGroupRequest request) {
ImmutableMap.Builder params = ImmutableMap.builder();
params.put("name", String.valueOf(request.getName()));
return params.build();
}
})
.build();
GrpcCallSettings
listEntryGroupsTransportSettings =
GrpcCallSettings.newBuilder()
.setMethodDescriptor(listEntryGroupsMethodDescriptor)
.setParamsExtractor(
new RequestParamsExtractor() {
@Override
public Map extract(ListEntryGroupsRequest request) {
ImmutableMap.Builder params = ImmutableMap.builder();
params.put("parent", String.valueOf(request.getParent()));
return params.build();
}
})
.build();
GrpcCallSettings createEntryTransportSettings =
GrpcCallSettings.newBuilder()
.setMethodDescriptor(createEntryMethodDescriptor)
.setParamsExtractor(
new RequestParamsExtractor() {
@Override
public Map extract(CreateEntryRequest request) {
ImmutableMap.Builder params = ImmutableMap.builder();
params.put("parent", String.valueOf(request.getParent()));
return params.build();
}
})
.build();
GrpcCallSettings updateEntryTransportSettings =
GrpcCallSettings.newBuilder()
.setMethodDescriptor(updateEntryMethodDescriptor)
.setParamsExtractor(
new RequestParamsExtractor() {
@Override
public Map extract(UpdateEntryRequest request) {
ImmutableMap.Builder params = ImmutableMap.builder();
params.put("entry.name", String.valueOf(request.getEntry().getName()));
return params.build();
}
})
.build();
GrpcCallSettings deleteEntryTransportSettings =
GrpcCallSettings.newBuilder()
.setMethodDescriptor(deleteEntryMethodDescriptor)
.setParamsExtractor(
new RequestParamsExtractor() {
@Override
public Map extract(DeleteEntryRequest request) {
ImmutableMap.Builder params = ImmutableMap.builder();
params.put("name", String.valueOf(request.getName()));
return params.build();
}
})
.build();
GrpcCallSettings getEntryTransportSettings =
GrpcCallSettings.newBuilder()
.setMethodDescriptor(getEntryMethodDescriptor)
.setParamsExtractor(
new RequestParamsExtractor() {
@Override
public Map extract(GetEntryRequest request) {
ImmutableMap.Builder params = ImmutableMap.builder();
params.put("name", String.valueOf(request.getName()));
return params.build();
}
})
.build();
GrpcCallSettings lookupEntryTransportSettings =
GrpcCallSettings.newBuilder()
.setMethodDescriptor(lookupEntryMethodDescriptor)
.build();
GrpcCallSettings listEntriesTransportSettings =
GrpcCallSettings.newBuilder()
.setMethodDescriptor(listEntriesMethodDescriptor)
.setParamsExtractor(
new RequestParamsExtractor() {
@Override
public Map extract(ListEntriesRequest request) {
ImmutableMap.Builder params = ImmutableMap.builder();
params.put("parent", String.valueOf(request.getParent()));
return params.build();
}
})
.build();
GrpcCallSettings createTagTemplateTransportSettings =
GrpcCallSettings.newBuilder()
.setMethodDescriptor(createTagTemplateMethodDescriptor)
.setParamsExtractor(
new RequestParamsExtractor() {
@Override
public Map extract(CreateTagTemplateRequest request) {
ImmutableMap.Builder params = ImmutableMap.builder();
params.put("parent", String.valueOf(request.getParent()));
return params.build();
}
})
.build();
GrpcCallSettings getTagTemplateTransportSettings =
GrpcCallSettings.newBuilder()
.setMethodDescriptor(getTagTemplateMethodDescriptor)
.setParamsExtractor(
new RequestParamsExtractor() {
@Override
public Map extract(GetTagTemplateRequest request) {
ImmutableMap.Builder params = ImmutableMap.builder();
params.put("name", String.valueOf(request.getName()));
return params.build();
}
})
.build();
GrpcCallSettings updateTagTemplateTransportSettings =
GrpcCallSettings.newBuilder()
.setMethodDescriptor(updateTagTemplateMethodDescriptor)
.setParamsExtractor(
new RequestParamsExtractor() {
@Override
public Map extract(UpdateTagTemplateRequest request) {
ImmutableMap.Builder params = ImmutableMap.builder();
params.put(
"tag_template.name", String.valueOf(request.getTagTemplate().getName()));
return params.build();
}
})
.build();
GrpcCallSettings deleteTagTemplateTransportSettings =
GrpcCallSettings.newBuilder()
.setMethodDescriptor(deleteTagTemplateMethodDescriptor)
.setParamsExtractor(
new RequestParamsExtractor() {
@Override
public Map extract(DeleteTagTemplateRequest request) {
ImmutableMap.Builder params = ImmutableMap.builder();
params.put("name", String.valueOf(request.getName()));
return params.build();
}
})
.build();
GrpcCallSettings
createTagTemplateFieldTransportSettings =
GrpcCallSettings.newBuilder()
.setMethodDescriptor(createTagTemplateFieldMethodDescriptor)
.setParamsExtractor(
new RequestParamsExtractor() {
@Override
public Map extract(CreateTagTemplateFieldRequest request) {
ImmutableMap.Builder params = ImmutableMap.builder();
params.put("parent", String.valueOf(request.getParent()));
return params.build();
}
})
.build();
GrpcCallSettings
updateTagTemplateFieldTransportSettings =
GrpcCallSettings.newBuilder()
.setMethodDescriptor(updateTagTemplateFieldMethodDescriptor)
.setParamsExtractor(
new RequestParamsExtractor() {
@Override
public Map extract(UpdateTagTemplateFieldRequest request) {
ImmutableMap.Builder params = ImmutableMap.builder();
params.put("name", String.valueOf(request.getName()));
return params.build();
}
})
.build();
GrpcCallSettings
renameTagTemplateFieldTransportSettings =
GrpcCallSettings.newBuilder()
.setMethodDescriptor(renameTagTemplateFieldMethodDescriptor)
.setParamsExtractor(
new RequestParamsExtractor() {
@Override
public Map extract(RenameTagTemplateFieldRequest request) {
ImmutableMap.Builder params = ImmutableMap.builder();
params.put("name", String.valueOf(request.getName()));
return params.build();
}
})
.build();
GrpcCallSettings deleteTagTemplateFieldTransportSettings =
GrpcCallSettings.newBuilder()
.setMethodDescriptor(deleteTagTemplateFieldMethodDescriptor)
.setParamsExtractor(
new RequestParamsExtractor() {
@Override
public Map extract(DeleteTagTemplateFieldRequest request) {
ImmutableMap.Builder params = ImmutableMap.builder();
params.put("name", String.valueOf(request.getName()));
return params.build();
}
})
.build();
GrpcCallSettings createTagTransportSettings =
GrpcCallSettings.newBuilder()
.setMethodDescriptor(createTagMethodDescriptor)
.setParamsExtractor(
new RequestParamsExtractor() {
@Override
public Map extract(CreateTagRequest request) {
ImmutableMap.Builder params = ImmutableMap.builder();
params.put("parent", String.valueOf(request.getParent()));
return params.build();
}
})
.build();
GrpcCallSettings updateTagTransportSettings =
GrpcCallSettings.newBuilder()
.setMethodDescriptor(updateTagMethodDescriptor)
.setParamsExtractor(
new RequestParamsExtractor() {
@Override
public Map extract(UpdateTagRequest request) {
ImmutableMap.Builder params = ImmutableMap.builder();
params.put("tag.name", String.valueOf(request.getTag().getName()));
return params.build();
}
})
.build();
GrpcCallSettings deleteTagTransportSettings =
GrpcCallSettings.newBuilder()
.setMethodDescriptor(deleteTagMethodDescriptor)
.setParamsExtractor(
new RequestParamsExtractor() {
@Override
public Map extract(DeleteTagRequest request) {
ImmutableMap.Builder params = ImmutableMap.builder();
params.put("name", String.valueOf(request.getName()));
return params.build();
}
})
.build();
GrpcCallSettings listTagsTransportSettings =
GrpcCallSettings.newBuilder()
.setMethodDescriptor(listTagsMethodDescriptor)
.setParamsExtractor(
new RequestParamsExtractor() {
@Override
public Map extract(ListTagsRequest request) {
ImmutableMap.Builder params = ImmutableMap.builder();
params.put("parent", String.valueOf(request.getParent()));
return params.build();
}
})
.build();
GrpcCallSettings setIamPolicyTransportSettings =
GrpcCallSettings.newBuilder()
.setMethodDescriptor(setIamPolicyMethodDescriptor)
.setParamsExtractor(
new RequestParamsExtractor() {
@Override
public Map extract(SetIamPolicyRequest request) {
ImmutableMap.Builder params = ImmutableMap.builder();
params.put("resource", String.valueOf(request.getResource()));
return params.build();
}
})
.build();
GrpcCallSettings getIamPolicyTransportSettings =
GrpcCallSettings.newBuilder()
.setMethodDescriptor(getIamPolicyMethodDescriptor)
.setParamsExtractor(
new RequestParamsExtractor() {
@Override
public Map extract(GetIamPolicyRequest request) {
ImmutableMap.Builder params = ImmutableMap.builder();
params.put("resource", String.valueOf(request.getResource()));
return params.build();
}
})
.build();
GrpcCallSettings
testIamPermissionsTransportSettings =
GrpcCallSettings.newBuilder()
.setMethodDescriptor(testIamPermissionsMethodDescriptor)
.setParamsExtractor(
new RequestParamsExtractor() {
@Override
public Map extract(TestIamPermissionsRequest request) {
ImmutableMap.Builder params = ImmutableMap.builder();
params.put("resource", String.valueOf(request.getResource()));
return params.build();
}
})
.build();
this.searchCatalogCallable =
callableFactory.createUnaryCallable(
searchCatalogTransportSettings, settings.searchCatalogSettings(), clientContext);
this.searchCatalogPagedCallable =
callableFactory.createPagedCallable(
searchCatalogTransportSettings, settings.searchCatalogSettings(), clientContext);
this.createEntryGroupCallable =
callableFactory.createUnaryCallable(
createEntryGroupTransportSettings, settings.createEntryGroupSettings(), clientContext);
this.updateEntryGroupCallable =
callableFactory.createUnaryCallable(
updateEntryGroupTransportSettings, settings.updateEntryGroupSettings(), clientContext);
this.getEntryGroupCallable =
callableFactory.createUnaryCallable(
getEntryGroupTransportSettings, settings.getEntryGroupSettings(), clientContext);
this.deleteEntryGroupCallable =
callableFactory.createUnaryCallable(
deleteEntryGroupTransportSettings, settings.deleteEntryGroupSettings(), clientContext);
this.listEntryGroupsCallable =
callableFactory.createUnaryCallable(
listEntryGroupsTransportSettings, settings.listEntryGroupsSettings(), clientContext);
this.listEntryGroupsPagedCallable =
callableFactory.createPagedCallable(
listEntryGroupsTransportSettings, settings.listEntryGroupsSettings(), clientContext);
this.createEntryCallable =
callableFactory.createUnaryCallable(
createEntryTransportSettings, settings.createEntrySettings(), clientContext);
this.updateEntryCallable =
callableFactory.createUnaryCallable(
updateEntryTransportSettings, settings.updateEntrySettings(), clientContext);
this.deleteEntryCallable =
callableFactory.createUnaryCallable(
deleteEntryTransportSettings, settings.deleteEntrySettings(), clientContext);
this.getEntryCallable =
callableFactory.createUnaryCallable(
getEntryTransportSettings, settings.getEntrySettings(), clientContext);
this.lookupEntryCallable =
callableFactory.createUnaryCallable(
lookupEntryTransportSettings, settings.lookupEntrySettings(), clientContext);
this.listEntriesCallable =
callableFactory.createUnaryCallable(
listEntriesTransportSettings, settings.listEntriesSettings(), clientContext);
this.listEntriesPagedCallable =
callableFactory.createPagedCallable(
listEntriesTransportSettings, settings.listEntriesSettings(), clientContext);
this.createTagTemplateCallable =
callableFactory.createUnaryCallable(
createTagTemplateTransportSettings,
settings.createTagTemplateSettings(),
clientContext);
this.getTagTemplateCallable =
callableFactory.createUnaryCallable(
getTagTemplateTransportSettings, settings.getTagTemplateSettings(), clientContext);
this.updateTagTemplateCallable =
callableFactory.createUnaryCallable(
updateTagTemplateTransportSettings,
settings.updateTagTemplateSettings(),
clientContext);
this.deleteTagTemplateCallable =
callableFactory.createUnaryCallable(
deleteTagTemplateTransportSettings,
settings.deleteTagTemplateSettings(),
clientContext);
this.createTagTemplateFieldCallable =
callableFactory.createUnaryCallable(
createTagTemplateFieldTransportSettings,
settings.createTagTemplateFieldSettings(),
clientContext);
this.updateTagTemplateFieldCallable =
callableFactory.createUnaryCallable(
updateTagTemplateFieldTransportSettings,
settings.updateTagTemplateFieldSettings(),
clientContext);
this.renameTagTemplateFieldCallable =
callableFactory.createUnaryCallable(
renameTagTemplateFieldTransportSettings,
settings.renameTagTemplateFieldSettings(),
clientContext);
this.deleteTagTemplateFieldCallable =
callableFactory.createUnaryCallable(
deleteTagTemplateFieldTransportSettings,
settings.deleteTagTemplateFieldSettings(),
clientContext);
this.createTagCallable =
callableFactory.createUnaryCallable(
createTagTransportSettings, settings.createTagSettings(), clientContext);
this.updateTagCallable =
callableFactory.createUnaryCallable(
updateTagTransportSettings, settings.updateTagSettings(), clientContext);
this.deleteTagCallable =
callableFactory.createUnaryCallable(
deleteTagTransportSettings, settings.deleteTagSettings(), clientContext);
this.listTagsCallable =
callableFactory.createUnaryCallable(
listTagsTransportSettings, settings.listTagsSettings(), clientContext);
this.listTagsPagedCallable =
callableFactory.createPagedCallable(
listTagsTransportSettings, settings.listTagsSettings(), clientContext);
this.setIamPolicyCallable =
callableFactory.createUnaryCallable(
setIamPolicyTransportSettings, settings.setIamPolicySettings(), clientContext);
this.getIamPolicyCallable =
callableFactory.createUnaryCallable(
getIamPolicyTransportSettings, settings.getIamPolicySettings(), clientContext);
this.testIamPermissionsCallable =
callableFactory.createUnaryCallable(
testIamPermissionsTransportSettings,
settings.testIamPermissionsSettings(),
clientContext);
this.backgroundResources =
new BackgroundResourceAggregation(clientContext.getBackgroundResources());
}
public GrpcOperationsStub getOperationsStub() {
return operationsStub;
}
@Override
public UnaryCallable searchCatalogCallable() {
return searchCatalogCallable;
}
@Override
public UnaryCallable
searchCatalogPagedCallable() {
return searchCatalogPagedCallable;
}
@Override
public UnaryCallable createEntryGroupCallable() {
return createEntryGroupCallable;
}
@Override
public UnaryCallable updateEntryGroupCallable() {
return updateEntryGroupCallable;
}
@Override
public UnaryCallable getEntryGroupCallable() {
return getEntryGroupCallable;
}
@Override
public UnaryCallable deleteEntryGroupCallable() {
return deleteEntryGroupCallable;
}
@Override
public UnaryCallable listEntryGroupsCallable() {
return listEntryGroupsCallable;
}
@Override
public UnaryCallable
listEntryGroupsPagedCallable() {
return listEntryGroupsPagedCallable;
}
@Override
public UnaryCallable createEntryCallable() {
return createEntryCallable;
}
@Override
public UnaryCallable updateEntryCallable() {
return updateEntryCallable;
}
@Override
public UnaryCallable deleteEntryCallable() {
return deleteEntryCallable;
}
@Override
public UnaryCallable getEntryCallable() {
return getEntryCallable;
}
@Override
public UnaryCallable lookupEntryCallable() {
return lookupEntryCallable;
}
@Override
public UnaryCallable listEntriesCallable() {
return listEntriesCallable;
}
@Override
public UnaryCallable listEntriesPagedCallable() {
return listEntriesPagedCallable;
}
@Override
public UnaryCallable createTagTemplateCallable() {
return createTagTemplateCallable;
}
@Override
public UnaryCallable getTagTemplateCallable() {
return getTagTemplateCallable;
}
@Override
public UnaryCallable updateTagTemplateCallable() {
return updateTagTemplateCallable;
}
@Override
public UnaryCallable deleteTagTemplateCallable() {
return deleteTagTemplateCallable;
}
@Override
public UnaryCallable
createTagTemplateFieldCallable() {
return createTagTemplateFieldCallable;
}
@Override
public UnaryCallable
updateTagTemplateFieldCallable() {
return updateTagTemplateFieldCallable;
}
@Override
public UnaryCallable
renameTagTemplateFieldCallable() {
return renameTagTemplateFieldCallable;
}
@Override
public UnaryCallable deleteTagTemplateFieldCallable() {
return deleteTagTemplateFieldCallable;
}
@Override
public UnaryCallable createTagCallable() {
return createTagCallable;
}
@Override
public UnaryCallable updateTagCallable() {
return updateTagCallable;
}
@Override
public UnaryCallable deleteTagCallable() {
return deleteTagCallable;
}
@Override
public UnaryCallable listTagsCallable() {
return listTagsCallable;
}
@Override
public UnaryCallable listTagsPagedCallable() {
return listTagsPagedCallable;
}
@Override
public UnaryCallable setIamPolicyCallable() {
return setIamPolicyCallable;
}
@Override
public UnaryCallable getIamPolicyCallable() {
return getIamPolicyCallable;
}
@Override
public UnaryCallable
testIamPermissionsCallable() {
return testIamPermissionsCallable;
}
@Override
public final void close() {
shutdown();
}
@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);
}
}