All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.google.cloud.datacatalog.v1beta1.stub.HttpJsonDataCatalogStub Maven / Gradle / Ivy

The newest version!
/*
 * 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.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.core.InternalApi;
import com.google.api.gax.core.BackgroundResource;
import com.google.api.gax.core.BackgroundResourceAggregation;
import com.google.api.gax.httpjson.ApiMethodDescriptor;
import com.google.api.gax.httpjson.HttpJsonCallSettings;
import com.google.api.gax.httpjson.HttpJsonStubCallableFactory;
import com.google.api.gax.httpjson.ProtoMessageRequestFormatter;
import com.google.api.gax.httpjson.ProtoMessageResponseParser;
import com.google.api.gax.httpjson.ProtoRestSerializer;
import com.google.api.gax.rpc.ClientContext;
import com.google.api.gax.rpc.RequestParamsBuilder;
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.RenameTagTemplateFieldEnumValueRequest;
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.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.protobuf.Empty;
import com.google.protobuf.TypeRegistry;
import java.io.IOException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.concurrent.TimeUnit;
import javax.annotation.Generated;

// AUTO-GENERATED DOCUMENTATION AND CLASS.
/**
 * REST 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 HttpJsonDataCatalogStub extends DataCatalogStub { private static final TypeRegistry typeRegistry = TypeRegistry.newBuilder().build(); private static final ApiMethodDescriptor searchCatalogMethodDescriptor = ApiMethodDescriptor.newBuilder() .setFullMethodName("google.cloud.datacatalog.v1beta1.DataCatalog/SearchCatalog") .setHttpMethod("POST") .setType(ApiMethodDescriptor.MethodType.UNARY) .setRequestFormatter( ProtoMessageRequestFormatter.newBuilder() .setPath( "/v1beta1/catalog:search", request -> { Map fields = new HashMap<>(); ProtoRestSerializer serializer = ProtoRestSerializer.create(); return fields; }) .setQueryParamsExtractor( request -> { Map> fields = new HashMap<>(); ProtoRestSerializer serializer = ProtoRestSerializer.create(); return fields; }) .setRequestBodyExtractor( request -> ProtoRestSerializer.create() .toBody("*", request.toBuilder().build(), false)) .build()) .setResponseParser( ProtoMessageResponseParser.newBuilder() .setDefaultInstance(SearchCatalogResponse.getDefaultInstance()) .setDefaultTypeRegistry(typeRegistry) .build()) .build(); private static final ApiMethodDescriptor createEntryGroupMethodDescriptor = ApiMethodDescriptor.newBuilder() .setFullMethodName("google.cloud.datacatalog.v1beta1.DataCatalog/CreateEntryGroup") .setHttpMethod("POST") .setType(ApiMethodDescriptor.MethodType.UNARY) .setRequestFormatter( ProtoMessageRequestFormatter.newBuilder() .setPath( "/v1beta1/{parent=projects/*/locations/*}/entryGroups", request -> { Map fields = new HashMap<>(); ProtoRestSerializer serializer = ProtoRestSerializer.create(); serializer.putPathParam(fields, "parent", request.getParent()); return fields; }) .setQueryParamsExtractor( request -> { Map> fields = new HashMap<>(); ProtoRestSerializer serializer = ProtoRestSerializer.create(); serializer.putQueryParam( fields, "entryGroupId", request.getEntryGroupId()); return fields; }) .setRequestBodyExtractor( request -> ProtoRestSerializer.create() .toBody("entryGroup", request.getEntryGroup(), false)) .build()) .setResponseParser( ProtoMessageResponseParser.newBuilder() .setDefaultInstance(EntryGroup.getDefaultInstance()) .setDefaultTypeRegistry(typeRegistry) .build()) .build(); private static final ApiMethodDescriptor updateEntryGroupMethodDescriptor = ApiMethodDescriptor.newBuilder() .setFullMethodName("google.cloud.datacatalog.v1beta1.DataCatalog/UpdateEntryGroup") .setHttpMethod("PATCH") .setType(ApiMethodDescriptor.MethodType.UNARY) .setRequestFormatter( ProtoMessageRequestFormatter.newBuilder() .setPath( "/v1beta1/{entryGroup.name=projects/*/locations/*/entryGroups/*}", request -> { Map fields = new HashMap<>(); ProtoRestSerializer serializer = ProtoRestSerializer.create(); serializer.putPathParam( fields, "entryGroup.name", request.getEntryGroup().getName()); return fields; }) .setQueryParamsExtractor( request -> { Map> fields = new HashMap<>(); ProtoRestSerializer serializer = ProtoRestSerializer.create(); serializer.putQueryParam(fields, "updateMask", request.getUpdateMask()); return fields; }) .setRequestBodyExtractor( request -> ProtoRestSerializer.create() .toBody("entryGroup", request.getEntryGroup(), false)) .build()) .setResponseParser( ProtoMessageResponseParser.newBuilder() .setDefaultInstance(EntryGroup.getDefaultInstance()) .setDefaultTypeRegistry(typeRegistry) .build()) .build(); private static final ApiMethodDescriptor getEntryGroupMethodDescriptor = ApiMethodDescriptor.newBuilder() .setFullMethodName("google.cloud.datacatalog.v1beta1.DataCatalog/GetEntryGroup") .setHttpMethod("GET") .setType(ApiMethodDescriptor.MethodType.UNARY) .setRequestFormatter( ProtoMessageRequestFormatter.newBuilder() .setPath( "/v1beta1/{name=projects/*/locations/*/entryGroups/*}", request -> { Map fields = new HashMap<>(); ProtoRestSerializer serializer = ProtoRestSerializer.create(); serializer.putPathParam(fields, "name", request.getName()); return fields; }) .setQueryParamsExtractor( request -> { Map> fields = new HashMap<>(); ProtoRestSerializer serializer = ProtoRestSerializer.create(); serializer.putQueryParam(fields, "readMask", request.getReadMask()); return fields; }) .setRequestBodyExtractor(request -> null) .build()) .setResponseParser( ProtoMessageResponseParser.newBuilder() .setDefaultInstance(EntryGroup.getDefaultInstance()) .setDefaultTypeRegistry(typeRegistry) .build()) .build(); private static final ApiMethodDescriptor deleteEntryGroupMethodDescriptor = ApiMethodDescriptor.newBuilder() .setFullMethodName("google.cloud.datacatalog.v1beta1.DataCatalog/DeleteEntryGroup") .setHttpMethod("DELETE") .setType(ApiMethodDescriptor.MethodType.UNARY) .setRequestFormatter( ProtoMessageRequestFormatter.newBuilder() .setPath( "/v1beta1/{name=projects/*/locations/*/entryGroups/*}", request -> { Map fields = new HashMap<>(); ProtoRestSerializer serializer = ProtoRestSerializer.create(); serializer.putPathParam(fields, "name", request.getName()); return fields; }) .setQueryParamsExtractor( request -> { Map> fields = new HashMap<>(); ProtoRestSerializer serializer = ProtoRestSerializer.create(); serializer.putQueryParam(fields, "force", request.getForce()); return fields; }) .setRequestBodyExtractor(request -> null) .build()) .setResponseParser( ProtoMessageResponseParser.newBuilder() .setDefaultInstance(Empty.getDefaultInstance()) .setDefaultTypeRegistry(typeRegistry) .build()) .build(); private static final ApiMethodDescriptor listEntryGroupsMethodDescriptor = ApiMethodDescriptor.newBuilder() .setFullMethodName("google.cloud.datacatalog.v1beta1.DataCatalog/ListEntryGroups") .setHttpMethod("GET") .setType(ApiMethodDescriptor.MethodType.UNARY) .setRequestFormatter( ProtoMessageRequestFormatter.newBuilder() .setPath( "/v1beta1/{parent=projects/*/locations/*}/entryGroups", request -> { Map fields = new HashMap<>(); ProtoRestSerializer serializer = ProtoRestSerializer.create(); serializer.putPathParam(fields, "parent", request.getParent()); return fields; }) .setQueryParamsExtractor( request -> { Map> fields = new HashMap<>(); ProtoRestSerializer serializer = ProtoRestSerializer.create(); serializer.putQueryParam(fields, "pageSize", request.getPageSize()); serializer.putQueryParam(fields, "pageToken", request.getPageToken()); return fields; }) .setRequestBodyExtractor(request -> null) .build()) .setResponseParser( ProtoMessageResponseParser.newBuilder() .setDefaultInstance(ListEntryGroupsResponse.getDefaultInstance()) .setDefaultTypeRegistry(typeRegistry) .build()) .build(); private static final ApiMethodDescriptor createEntryMethodDescriptor = ApiMethodDescriptor.newBuilder() .setFullMethodName("google.cloud.datacatalog.v1beta1.DataCatalog/CreateEntry") .setHttpMethod("POST") .setType(ApiMethodDescriptor.MethodType.UNARY) .setRequestFormatter( ProtoMessageRequestFormatter.newBuilder() .setPath( "/v1beta1/{parent=projects/*/locations/*/entryGroups/*}/entries", request -> { Map fields = new HashMap<>(); ProtoRestSerializer serializer = ProtoRestSerializer.create(); serializer.putPathParam(fields, "parent", request.getParent()); return fields; }) .setQueryParamsExtractor( request -> { Map> fields = new HashMap<>(); ProtoRestSerializer serializer = ProtoRestSerializer.create(); serializer.putQueryParam(fields, "entryId", request.getEntryId()); return fields; }) .setRequestBodyExtractor( request -> ProtoRestSerializer.create().toBody("entry", request.getEntry(), false)) .build()) .setResponseParser( ProtoMessageResponseParser.newBuilder() .setDefaultInstance(Entry.getDefaultInstance()) .setDefaultTypeRegistry(typeRegistry) .build()) .build(); private static final ApiMethodDescriptor updateEntryMethodDescriptor = ApiMethodDescriptor.newBuilder() .setFullMethodName("google.cloud.datacatalog.v1beta1.DataCatalog/UpdateEntry") .setHttpMethod("PATCH") .setType(ApiMethodDescriptor.MethodType.UNARY) .setRequestFormatter( ProtoMessageRequestFormatter.newBuilder() .setPath( "/v1beta1/{entry.name=projects/*/locations/*/entryGroups/*/entries/*}", request -> { Map fields = new HashMap<>(); ProtoRestSerializer serializer = ProtoRestSerializer.create(); serializer.putPathParam(fields, "entry.name", request.getEntry().getName()); return fields; }) .setQueryParamsExtractor( request -> { Map> fields = new HashMap<>(); ProtoRestSerializer serializer = ProtoRestSerializer.create(); serializer.putQueryParam(fields, "updateMask", request.getUpdateMask()); return fields; }) .setRequestBodyExtractor( request -> ProtoRestSerializer.create().toBody("entry", request.getEntry(), false)) .build()) .setResponseParser( ProtoMessageResponseParser.newBuilder() .setDefaultInstance(Entry.getDefaultInstance()) .setDefaultTypeRegistry(typeRegistry) .build()) .build(); private static final ApiMethodDescriptor deleteEntryMethodDescriptor = ApiMethodDescriptor.newBuilder() .setFullMethodName("google.cloud.datacatalog.v1beta1.DataCatalog/DeleteEntry") .setHttpMethod("DELETE") .setType(ApiMethodDescriptor.MethodType.UNARY) .setRequestFormatter( ProtoMessageRequestFormatter.newBuilder() .setPath( "/v1beta1/{name=projects/*/locations/*/entryGroups/*/entries/*}", request -> { Map fields = new HashMap<>(); ProtoRestSerializer serializer = ProtoRestSerializer.create(); serializer.putPathParam(fields, "name", request.getName()); return fields; }) .setQueryParamsExtractor( request -> { Map> fields = new HashMap<>(); ProtoRestSerializer serializer = ProtoRestSerializer.create(); return fields; }) .setRequestBodyExtractor(request -> null) .build()) .setResponseParser( ProtoMessageResponseParser.newBuilder() .setDefaultInstance(Empty.getDefaultInstance()) .setDefaultTypeRegistry(typeRegistry) .build()) .build(); private static final ApiMethodDescriptor getEntryMethodDescriptor = ApiMethodDescriptor.newBuilder() .setFullMethodName("google.cloud.datacatalog.v1beta1.DataCatalog/GetEntry") .setHttpMethod("GET") .setType(ApiMethodDescriptor.MethodType.UNARY) .setRequestFormatter( ProtoMessageRequestFormatter.newBuilder() .setPath( "/v1beta1/{name=projects/*/locations/*/entryGroups/*/entries/*}", request -> { Map fields = new HashMap<>(); ProtoRestSerializer serializer = ProtoRestSerializer.create(); serializer.putPathParam(fields, "name", request.getName()); return fields; }) .setQueryParamsExtractor( request -> { Map> fields = new HashMap<>(); ProtoRestSerializer serializer = ProtoRestSerializer.create(); return fields; }) .setRequestBodyExtractor(request -> null) .build()) .setResponseParser( ProtoMessageResponseParser.newBuilder() .setDefaultInstance(Entry.getDefaultInstance()) .setDefaultTypeRegistry(typeRegistry) .build()) .build(); private static final ApiMethodDescriptor lookupEntryMethodDescriptor = ApiMethodDescriptor.newBuilder() .setFullMethodName("google.cloud.datacatalog.v1beta1.DataCatalog/LookupEntry") .setHttpMethod("GET") .setType(ApiMethodDescriptor.MethodType.UNARY) .setRequestFormatter( ProtoMessageRequestFormatter.newBuilder() .setPath( "/v1beta1/entries:lookup", request -> { Map fields = new HashMap<>(); ProtoRestSerializer serializer = ProtoRestSerializer.create(); return fields; }) .setQueryParamsExtractor( request -> { Map> fields = new HashMap<>(); ProtoRestSerializer serializer = ProtoRestSerializer.create(); serializer.putQueryParam( fields, "linkedResource", request.getLinkedResource()); serializer.putQueryParam(fields, "sqlResource", request.getSqlResource()); return fields; }) .setRequestBodyExtractor(request -> null) .build()) .setResponseParser( ProtoMessageResponseParser.newBuilder() .setDefaultInstance(Entry.getDefaultInstance()) .setDefaultTypeRegistry(typeRegistry) .build()) .build(); private static final ApiMethodDescriptor listEntriesMethodDescriptor = ApiMethodDescriptor.newBuilder() .setFullMethodName("google.cloud.datacatalog.v1beta1.DataCatalog/ListEntries") .setHttpMethod("GET") .setType(ApiMethodDescriptor.MethodType.UNARY) .setRequestFormatter( ProtoMessageRequestFormatter.newBuilder() .setPath( "/v1beta1/{parent=projects/*/locations/*/entryGroups/*}/entries", request -> { Map fields = new HashMap<>(); ProtoRestSerializer serializer = ProtoRestSerializer.create(); serializer.putPathParam(fields, "parent", request.getParent()); return fields; }) .setQueryParamsExtractor( request -> { Map> fields = new HashMap<>(); ProtoRestSerializer serializer = ProtoRestSerializer.create(); serializer.putQueryParam(fields, "pageSize", request.getPageSize()); serializer.putQueryParam(fields, "pageToken", request.getPageToken()); serializer.putQueryParam(fields, "readMask", request.getReadMask()); return fields; }) .setRequestBodyExtractor(request -> null) .build()) .setResponseParser( ProtoMessageResponseParser.newBuilder() .setDefaultInstance(ListEntriesResponse.getDefaultInstance()) .setDefaultTypeRegistry(typeRegistry) .build()) .build(); private static final ApiMethodDescriptor createTagTemplateMethodDescriptor = ApiMethodDescriptor.newBuilder() .setFullMethodName("google.cloud.datacatalog.v1beta1.DataCatalog/CreateTagTemplate") .setHttpMethod("POST") .setType(ApiMethodDescriptor.MethodType.UNARY) .setRequestFormatter( ProtoMessageRequestFormatter.newBuilder() .setPath( "/v1beta1/{parent=projects/*/locations/*}/tagTemplates", request -> { Map fields = new HashMap<>(); ProtoRestSerializer serializer = ProtoRestSerializer.create(); serializer.putPathParam(fields, "parent", request.getParent()); return fields; }) .setQueryParamsExtractor( request -> { Map> fields = new HashMap<>(); ProtoRestSerializer serializer = ProtoRestSerializer.create(); serializer.putQueryParam( fields, "tagTemplateId", request.getTagTemplateId()); return fields; }) .setRequestBodyExtractor( request -> ProtoRestSerializer.create() .toBody("tagTemplate", request.getTagTemplate(), false)) .build()) .setResponseParser( ProtoMessageResponseParser.newBuilder() .setDefaultInstance(TagTemplate.getDefaultInstance()) .setDefaultTypeRegistry(typeRegistry) .build()) .build(); private static final ApiMethodDescriptor getTagTemplateMethodDescriptor = ApiMethodDescriptor.newBuilder() .setFullMethodName("google.cloud.datacatalog.v1beta1.DataCatalog/GetTagTemplate") .setHttpMethod("GET") .setType(ApiMethodDescriptor.MethodType.UNARY) .setRequestFormatter( ProtoMessageRequestFormatter.newBuilder() .setPath( "/v1beta1/{name=projects/*/locations/*/tagTemplates/*}", request -> { Map fields = new HashMap<>(); ProtoRestSerializer serializer = ProtoRestSerializer.create(); serializer.putPathParam(fields, "name", request.getName()); return fields; }) .setQueryParamsExtractor( request -> { Map> fields = new HashMap<>(); ProtoRestSerializer serializer = ProtoRestSerializer.create(); return fields; }) .setRequestBodyExtractor(request -> null) .build()) .setResponseParser( ProtoMessageResponseParser.newBuilder() .setDefaultInstance(TagTemplate.getDefaultInstance()) .setDefaultTypeRegistry(typeRegistry) .build()) .build(); private static final ApiMethodDescriptor updateTagTemplateMethodDescriptor = ApiMethodDescriptor.newBuilder() .setFullMethodName("google.cloud.datacatalog.v1beta1.DataCatalog/UpdateTagTemplate") .setHttpMethod("PATCH") .setType(ApiMethodDescriptor.MethodType.UNARY) .setRequestFormatter( ProtoMessageRequestFormatter.newBuilder() .setPath( "/v1beta1/{tagTemplate.name=projects/*/locations/*/tagTemplates/*}", request -> { Map fields = new HashMap<>(); ProtoRestSerializer serializer = ProtoRestSerializer.create(); serializer.putPathParam( fields, "tagTemplate.name", request.getTagTemplate().getName()); return fields; }) .setQueryParamsExtractor( request -> { Map> fields = new HashMap<>(); ProtoRestSerializer serializer = ProtoRestSerializer.create(); serializer.putQueryParam(fields, "updateMask", request.getUpdateMask()); return fields; }) .setRequestBodyExtractor( request -> ProtoRestSerializer.create() .toBody("tagTemplate", request.getTagTemplate(), false)) .build()) .setResponseParser( ProtoMessageResponseParser.newBuilder() .setDefaultInstance(TagTemplate.getDefaultInstance()) .setDefaultTypeRegistry(typeRegistry) .build()) .build(); private static final ApiMethodDescriptor deleteTagTemplateMethodDescriptor = ApiMethodDescriptor.newBuilder() .setFullMethodName("google.cloud.datacatalog.v1beta1.DataCatalog/DeleteTagTemplate") .setHttpMethod("DELETE") .setType(ApiMethodDescriptor.MethodType.UNARY) .setRequestFormatter( ProtoMessageRequestFormatter.newBuilder() .setPath( "/v1beta1/{name=projects/*/locations/*/tagTemplates/*}", request -> { Map fields = new HashMap<>(); ProtoRestSerializer serializer = ProtoRestSerializer.create(); serializer.putPathParam(fields, "name", request.getName()); return fields; }) .setQueryParamsExtractor( request -> { Map> fields = new HashMap<>(); ProtoRestSerializer serializer = ProtoRestSerializer.create(); serializer.putQueryParam(fields, "force", request.getForce()); return fields; }) .setRequestBodyExtractor(request -> null) .build()) .setResponseParser( ProtoMessageResponseParser.newBuilder() .setDefaultInstance(Empty.getDefaultInstance()) .setDefaultTypeRegistry(typeRegistry) .build()) .build(); private static final ApiMethodDescriptor createTagTemplateFieldMethodDescriptor = ApiMethodDescriptor.newBuilder() .setFullMethodName( "google.cloud.datacatalog.v1beta1.DataCatalog/CreateTagTemplateField") .setHttpMethod("POST") .setType(ApiMethodDescriptor.MethodType.UNARY) .setRequestFormatter( ProtoMessageRequestFormatter.newBuilder() .setPath( "/v1beta1/{parent=projects/*/locations/*/tagTemplates/*}/fields", request -> { Map fields = new HashMap<>(); ProtoRestSerializer serializer = ProtoRestSerializer.create(); serializer.putPathParam(fields, "parent", request.getParent()); return fields; }) .setQueryParamsExtractor( request -> { Map> fields = new HashMap<>(); ProtoRestSerializer serializer = ProtoRestSerializer.create(); serializer.putQueryParam( fields, "tagTemplateFieldId", request.getTagTemplateFieldId()); return fields; }) .setRequestBodyExtractor( request -> ProtoRestSerializer.create() .toBody("tagTemplateField", request.getTagTemplateField(), false)) .build()) .setResponseParser( ProtoMessageResponseParser.newBuilder() .setDefaultInstance(TagTemplateField.getDefaultInstance()) .setDefaultTypeRegistry(typeRegistry) .build()) .build(); private static final ApiMethodDescriptor updateTagTemplateFieldMethodDescriptor = ApiMethodDescriptor.newBuilder() .setFullMethodName( "google.cloud.datacatalog.v1beta1.DataCatalog/UpdateTagTemplateField") .setHttpMethod("PATCH") .setType(ApiMethodDescriptor.MethodType.UNARY) .setRequestFormatter( ProtoMessageRequestFormatter.newBuilder() .setPath( "/v1beta1/{name=projects/*/locations/*/tagTemplates/*/fields/*}", request -> { Map fields = new HashMap<>(); ProtoRestSerializer serializer = ProtoRestSerializer.create(); serializer.putPathParam(fields, "name", request.getName()); return fields; }) .setQueryParamsExtractor( request -> { Map> fields = new HashMap<>(); ProtoRestSerializer serializer = ProtoRestSerializer.create(); serializer.putQueryParam(fields, "updateMask", request.getUpdateMask()); return fields; }) .setRequestBodyExtractor( request -> ProtoRestSerializer.create() .toBody("tagTemplateField", request.getTagTemplateField(), false)) .build()) .setResponseParser( ProtoMessageResponseParser.newBuilder() .setDefaultInstance(TagTemplateField.getDefaultInstance()) .setDefaultTypeRegistry(typeRegistry) .build()) .build(); private static final ApiMethodDescriptor renameTagTemplateFieldMethodDescriptor = ApiMethodDescriptor.newBuilder() .setFullMethodName( "google.cloud.datacatalog.v1beta1.DataCatalog/RenameTagTemplateField") .setHttpMethod("POST") .setType(ApiMethodDescriptor.MethodType.UNARY) .setRequestFormatter( ProtoMessageRequestFormatter.newBuilder() .setPath( "/v1beta1/{name=projects/*/locations/*/tagTemplates/*/fields/*}:rename", request -> { Map fields = new HashMap<>(); ProtoRestSerializer serializer = ProtoRestSerializer.create(); serializer.putPathParam(fields, "name", request.getName()); return fields; }) .setQueryParamsExtractor( request -> { Map> fields = new HashMap<>(); ProtoRestSerializer serializer = ProtoRestSerializer.create(); return fields; }) .setRequestBodyExtractor( request -> ProtoRestSerializer.create() .toBody("*", request.toBuilder().clearName().build(), false)) .build()) .setResponseParser( ProtoMessageResponseParser.newBuilder() .setDefaultInstance(TagTemplateField.getDefaultInstance()) .setDefaultTypeRegistry(typeRegistry) .build()) .build(); private static final ApiMethodDescriptor renameTagTemplateFieldEnumValueMethodDescriptor = ApiMethodDescriptor.newBuilder() .setFullMethodName( "google.cloud.datacatalog.v1beta1.DataCatalog/RenameTagTemplateFieldEnumValue") .setHttpMethod("POST") .setType(ApiMethodDescriptor.MethodType.UNARY) .setRequestFormatter( ProtoMessageRequestFormatter.newBuilder() .setPath( "/v1beta1/{name=projects/*/locations/*/tagTemplates/*/fields/*/enumValues/*}:rename", request -> { Map fields = new HashMap<>(); ProtoRestSerializer serializer = ProtoRestSerializer.create(); serializer.putPathParam(fields, "name", request.getName()); return fields; }) .setQueryParamsExtractor( request -> { Map> fields = new HashMap<>(); ProtoRestSerializer serializer = ProtoRestSerializer.create(); return fields; }) .setRequestBodyExtractor( request -> ProtoRestSerializer.create() .toBody("*", request.toBuilder().clearName().build(), false)) .build()) .setResponseParser( ProtoMessageResponseParser.newBuilder() .setDefaultInstance(TagTemplateField.getDefaultInstance()) .setDefaultTypeRegistry(typeRegistry) .build()) .build(); private static final ApiMethodDescriptor deleteTagTemplateFieldMethodDescriptor = ApiMethodDescriptor.newBuilder() .setFullMethodName( "google.cloud.datacatalog.v1beta1.DataCatalog/DeleteTagTemplateField") .setHttpMethod("DELETE") .setType(ApiMethodDescriptor.MethodType.UNARY) .setRequestFormatter( ProtoMessageRequestFormatter.newBuilder() .setPath( "/v1beta1/{name=projects/*/locations/*/tagTemplates/*/fields/*}", request -> { Map fields = new HashMap<>(); ProtoRestSerializer serializer = ProtoRestSerializer.create(); serializer.putPathParam(fields, "name", request.getName()); return fields; }) .setQueryParamsExtractor( request -> { Map> fields = new HashMap<>(); ProtoRestSerializer serializer = ProtoRestSerializer.create(); serializer.putQueryParam(fields, "force", request.getForce()); return fields; }) .setRequestBodyExtractor(request -> null) .build()) .setResponseParser( ProtoMessageResponseParser.newBuilder() .setDefaultInstance(Empty.getDefaultInstance()) .setDefaultTypeRegistry(typeRegistry) .build()) .build(); private static final ApiMethodDescriptor createTagMethodDescriptor = ApiMethodDescriptor.newBuilder() .setFullMethodName("google.cloud.datacatalog.v1beta1.DataCatalog/CreateTag") .setHttpMethod("POST") .setType(ApiMethodDescriptor.MethodType.UNARY) .setRequestFormatter( ProtoMessageRequestFormatter.newBuilder() .setPath( "/v1beta1/{parent=projects/*/locations/*/entryGroups/*/entries/*}/tags", request -> { Map fields = new HashMap<>(); ProtoRestSerializer serializer = ProtoRestSerializer.create(); serializer.putPathParam(fields, "parent", request.getParent()); return fields; }) .setAdditionalPaths("/v1beta1/{parent=projects/*/locations/*/entryGroups/*}/tags") .setQueryParamsExtractor( request -> { Map> fields = new HashMap<>(); ProtoRestSerializer serializer = ProtoRestSerializer.create(); return fields; }) .setRequestBodyExtractor( request -> ProtoRestSerializer.create().toBody("tag", request.getTag(), false)) .build()) .setResponseParser( ProtoMessageResponseParser.newBuilder() .setDefaultInstance(Tag.getDefaultInstance()) .setDefaultTypeRegistry(typeRegistry) .build()) .build(); private static final ApiMethodDescriptor updateTagMethodDescriptor = ApiMethodDescriptor.newBuilder() .setFullMethodName("google.cloud.datacatalog.v1beta1.DataCatalog/UpdateTag") .setHttpMethod("PATCH") .setType(ApiMethodDescriptor.MethodType.UNARY) .setRequestFormatter( ProtoMessageRequestFormatter.newBuilder() .setPath( "/v1beta1/{tag.name=projects/*/locations/*/entryGroups/*/entries/*/tags/*}", request -> { Map fields = new HashMap<>(); ProtoRestSerializer serializer = ProtoRestSerializer.create(); serializer.putPathParam(fields, "tag.name", request.getTag().getName()); return fields; }) .setAdditionalPaths( "/v1beta1/{tag.name=projects/*/locations/*/entryGroups/*/tags/*}") .setQueryParamsExtractor( request -> { Map> fields = new HashMap<>(); ProtoRestSerializer serializer = ProtoRestSerializer.create(); serializer.putQueryParam(fields, "updateMask", request.getUpdateMask()); return fields; }) .setRequestBodyExtractor( request -> ProtoRestSerializer.create().toBody("tag", request.getTag(), false)) .build()) .setResponseParser( ProtoMessageResponseParser.newBuilder() .setDefaultInstance(Tag.getDefaultInstance()) .setDefaultTypeRegistry(typeRegistry) .build()) .build(); private static final ApiMethodDescriptor deleteTagMethodDescriptor = ApiMethodDescriptor.newBuilder() .setFullMethodName("google.cloud.datacatalog.v1beta1.DataCatalog/DeleteTag") .setHttpMethod("DELETE") .setType(ApiMethodDescriptor.MethodType.UNARY) .setRequestFormatter( ProtoMessageRequestFormatter.newBuilder() .setPath( "/v1beta1/{name=projects/*/locations/*/entryGroups/*/entries/*/tags/*}", request -> { Map fields = new HashMap<>(); ProtoRestSerializer serializer = ProtoRestSerializer.create(); serializer.putPathParam(fields, "name", request.getName()); return fields; }) .setAdditionalPaths("/v1beta1/{name=projects/*/locations/*/entryGroups/*/tags/*}") .setQueryParamsExtractor( request -> { Map> fields = new HashMap<>(); ProtoRestSerializer serializer = ProtoRestSerializer.create(); return fields; }) .setRequestBodyExtractor(request -> null) .build()) .setResponseParser( ProtoMessageResponseParser.newBuilder() .setDefaultInstance(Empty.getDefaultInstance()) .setDefaultTypeRegistry(typeRegistry) .build()) .build(); private static final ApiMethodDescriptor listTagsMethodDescriptor = ApiMethodDescriptor.newBuilder() .setFullMethodName("google.cloud.datacatalog.v1beta1.DataCatalog/ListTags") .setHttpMethod("GET") .setType(ApiMethodDescriptor.MethodType.UNARY) .setRequestFormatter( ProtoMessageRequestFormatter.newBuilder() .setPath( "/v1beta1/{parent=projects/*/locations/*/entryGroups/*/entries/*}/tags", request -> { Map fields = new HashMap<>(); ProtoRestSerializer serializer = ProtoRestSerializer.create(); serializer.putPathParam(fields, "parent", request.getParent()); return fields; }) .setAdditionalPaths( "/v1beta1/{parent=projects/*/locations/*/entryGroups/*}/tags") .setQueryParamsExtractor( request -> { Map> fields = new HashMap<>(); ProtoRestSerializer serializer = ProtoRestSerializer.create(); serializer.putQueryParam(fields, "pageSize", request.getPageSize()); serializer.putQueryParam(fields, "pageToken", request.getPageToken()); return fields; }) .setRequestBodyExtractor(request -> null) .build()) .setResponseParser( ProtoMessageResponseParser.newBuilder() .setDefaultInstance(ListTagsResponse.getDefaultInstance()) .setDefaultTypeRegistry(typeRegistry) .build()) .build(); private static final ApiMethodDescriptor setIamPolicyMethodDescriptor = ApiMethodDescriptor.newBuilder() .setFullMethodName("google.cloud.datacatalog.v1beta1.DataCatalog/SetIamPolicy") .setHttpMethod("POST") .setType(ApiMethodDescriptor.MethodType.UNARY) .setRequestFormatter( ProtoMessageRequestFormatter.newBuilder() .setPath( "/v1beta1/{resource=projects/*/locations/*/tagTemplates/*}:setIamPolicy", request -> { Map fields = new HashMap<>(); ProtoRestSerializer serializer = ProtoRestSerializer.create(); serializer.putPathParam(fields, "resource", request.getResource()); return fields; }) .setAdditionalPaths( "/v1beta1/{resource=projects/*/locations/*/entryGroups/*}:setIamPolicy") .setQueryParamsExtractor( request -> { Map> fields = new HashMap<>(); ProtoRestSerializer serializer = ProtoRestSerializer.create(); return fields; }) .setRequestBodyExtractor( request -> ProtoRestSerializer.create() .toBody("*", request.toBuilder().clearResource().build(), false)) .build()) .setResponseParser( ProtoMessageResponseParser.newBuilder() .setDefaultInstance(Policy.getDefaultInstance()) .setDefaultTypeRegistry(typeRegistry) .build()) .build(); private static final ApiMethodDescriptor getIamPolicyMethodDescriptor = ApiMethodDescriptor.newBuilder() .setFullMethodName("google.cloud.datacatalog.v1beta1.DataCatalog/GetIamPolicy") .setHttpMethod("POST") .setType(ApiMethodDescriptor.MethodType.UNARY) .setRequestFormatter( ProtoMessageRequestFormatter.newBuilder() .setPath( "/v1beta1/{resource=projects/*/locations/*/tagTemplates/*}:getIamPolicy", request -> { Map fields = new HashMap<>(); ProtoRestSerializer serializer = ProtoRestSerializer.create(); serializer.putPathParam(fields, "resource", request.getResource()); return fields; }) .setAdditionalPaths( "/v1beta1/{resource=projects/*/locations/*/entryGroups/*}:getIamPolicy", "/v1beta1/{resource=projects/*/locations/*/entryGroups/*/entries/*}:getIamPolicy") .setQueryParamsExtractor( request -> { Map> fields = new HashMap<>(); ProtoRestSerializer serializer = ProtoRestSerializer.create(); return fields; }) .setRequestBodyExtractor( request -> ProtoRestSerializer.create() .toBody("*", request.toBuilder().clearResource().build(), false)) .build()) .setResponseParser( ProtoMessageResponseParser.newBuilder() .setDefaultInstance(Policy.getDefaultInstance()) .setDefaultTypeRegistry(typeRegistry) .build()) .build(); private static final ApiMethodDescriptor testIamPermissionsMethodDescriptor = ApiMethodDescriptor.newBuilder() .setFullMethodName("google.cloud.datacatalog.v1beta1.DataCatalog/TestIamPermissions") .setHttpMethod("POST") .setType(ApiMethodDescriptor.MethodType.UNARY) .setRequestFormatter( ProtoMessageRequestFormatter.newBuilder() .setPath( "/v1beta1/{resource=projects/*/locations/*/tagTemplates/*}:testIamPermissions", request -> { Map fields = new HashMap<>(); ProtoRestSerializer serializer = ProtoRestSerializer.create(); serializer.putPathParam(fields, "resource", request.getResource()); return fields; }) .setAdditionalPaths( "/v1beta1/{resource=projects/*/locations/*/entryGroups/*}:testIamPermissions", "/v1beta1/{resource=projects/*/locations/*/entryGroups/*/entries/*}:testIamPermissions") .setQueryParamsExtractor( request -> { Map> fields = new HashMap<>(); ProtoRestSerializer serializer = ProtoRestSerializer.create(); return fields; }) .setRequestBodyExtractor( request -> ProtoRestSerializer.create() .toBody("*", request.toBuilder().clearResource().build(), false)) .build()) .setResponseParser( ProtoMessageResponseParser.newBuilder() .setDefaultInstance(TestIamPermissionsResponse.getDefaultInstance()) .setDefaultTypeRegistry(typeRegistry) .build()) .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 renameTagTemplateFieldEnumValueCallable; 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 HttpJsonStubCallableFactory callableFactory; public static final HttpJsonDataCatalogStub create(DataCatalogStubSettings settings) throws IOException { return new HttpJsonDataCatalogStub(settings, ClientContext.create(settings)); } public static final HttpJsonDataCatalogStub create(ClientContext clientContext) throws IOException { return new HttpJsonDataCatalogStub( DataCatalogStubSettings.newHttpJsonBuilder().build(), clientContext); } public static final HttpJsonDataCatalogStub create( ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { return new HttpJsonDataCatalogStub( DataCatalogStubSettings.newHttpJsonBuilder().build(), clientContext, callableFactory); } /** * Constructs an instance of HttpJsonDataCatalogStub, 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 HttpJsonDataCatalogStub(DataCatalogStubSettings settings, ClientContext clientContext) throws IOException { this(settings, clientContext, new HttpJsonDataCatalogCallableFactory()); } /** * Constructs an instance of HttpJsonDataCatalogStub, 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 HttpJsonDataCatalogStub( DataCatalogStubSettings settings, ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { this.callableFactory = callableFactory; HttpJsonCallSettings searchCatalogTransportSettings = HttpJsonCallSettings.newBuilder() .setMethodDescriptor(searchCatalogMethodDescriptor) .setTypeRegistry(typeRegistry) .build(); HttpJsonCallSettings createEntryGroupTransportSettings = HttpJsonCallSettings.newBuilder() .setMethodDescriptor(createEntryGroupMethodDescriptor) .setTypeRegistry(typeRegistry) .setParamsExtractor( request -> { RequestParamsBuilder builder = RequestParamsBuilder.create(); builder.add("parent", String.valueOf(request.getParent())); return builder.build(); }) .build(); HttpJsonCallSettings updateEntryGroupTransportSettings = HttpJsonCallSettings.newBuilder() .setMethodDescriptor(updateEntryGroupMethodDescriptor) .setTypeRegistry(typeRegistry) .setParamsExtractor( request -> { RequestParamsBuilder builder = RequestParamsBuilder.create(); builder.add( "entry_group.name", String.valueOf(request.getEntryGroup().getName())); return builder.build(); }) .build(); HttpJsonCallSettings getEntryGroupTransportSettings = HttpJsonCallSettings.newBuilder() .setMethodDescriptor(getEntryGroupMethodDescriptor) .setTypeRegistry(typeRegistry) .setParamsExtractor( request -> { RequestParamsBuilder builder = RequestParamsBuilder.create(); builder.add("name", String.valueOf(request.getName())); return builder.build(); }) .build(); HttpJsonCallSettings deleteEntryGroupTransportSettings = HttpJsonCallSettings.newBuilder() .setMethodDescriptor(deleteEntryGroupMethodDescriptor) .setTypeRegistry(typeRegistry) .setParamsExtractor( request -> { RequestParamsBuilder builder = RequestParamsBuilder.create(); builder.add("name", String.valueOf(request.getName())); return builder.build(); }) .build(); HttpJsonCallSettings listEntryGroupsTransportSettings = HttpJsonCallSettings.newBuilder() .setMethodDescriptor(listEntryGroupsMethodDescriptor) .setTypeRegistry(typeRegistry) .setParamsExtractor( request -> { RequestParamsBuilder builder = RequestParamsBuilder.create(); builder.add("parent", String.valueOf(request.getParent())); return builder.build(); }) .build(); HttpJsonCallSettings createEntryTransportSettings = HttpJsonCallSettings.newBuilder() .setMethodDescriptor(createEntryMethodDescriptor) .setTypeRegistry(typeRegistry) .setParamsExtractor( request -> { RequestParamsBuilder builder = RequestParamsBuilder.create(); builder.add("parent", String.valueOf(request.getParent())); return builder.build(); }) .build(); HttpJsonCallSettings updateEntryTransportSettings = HttpJsonCallSettings.newBuilder() .setMethodDescriptor(updateEntryMethodDescriptor) .setTypeRegistry(typeRegistry) .setParamsExtractor( request -> { RequestParamsBuilder builder = RequestParamsBuilder.create(); builder.add("entry.name", String.valueOf(request.getEntry().getName())); return builder.build(); }) .build(); HttpJsonCallSettings deleteEntryTransportSettings = HttpJsonCallSettings.newBuilder() .setMethodDescriptor(deleteEntryMethodDescriptor) .setTypeRegistry(typeRegistry) .setParamsExtractor( request -> { RequestParamsBuilder builder = RequestParamsBuilder.create(); builder.add("name", String.valueOf(request.getName())); return builder.build(); }) .build(); HttpJsonCallSettings getEntryTransportSettings = HttpJsonCallSettings.newBuilder() .setMethodDescriptor(getEntryMethodDescriptor) .setTypeRegistry(typeRegistry) .setParamsExtractor( request -> { RequestParamsBuilder builder = RequestParamsBuilder.create(); builder.add("name", String.valueOf(request.getName())); return builder.build(); }) .build(); HttpJsonCallSettings lookupEntryTransportSettings = HttpJsonCallSettings.newBuilder() .setMethodDescriptor(lookupEntryMethodDescriptor) .setTypeRegistry(typeRegistry) .build(); HttpJsonCallSettings listEntriesTransportSettings = HttpJsonCallSettings.newBuilder() .setMethodDescriptor(listEntriesMethodDescriptor) .setTypeRegistry(typeRegistry) .setParamsExtractor( request -> { RequestParamsBuilder builder = RequestParamsBuilder.create(); builder.add("parent", String.valueOf(request.getParent())); return builder.build(); }) .build(); HttpJsonCallSettings createTagTemplateTransportSettings = HttpJsonCallSettings.newBuilder() .setMethodDescriptor(createTagTemplateMethodDescriptor) .setTypeRegistry(typeRegistry) .setParamsExtractor( request -> { RequestParamsBuilder builder = RequestParamsBuilder.create(); builder.add("parent", String.valueOf(request.getParent())); return builder.build(); }) .build(); HttpJsonCallSettings getTagTemplateTransportSettings = HttpJsonCallSettings.newBuilder() .setMethodDescriptor(getTagTemplateMethodDescriptor) .setTypeRegistry(typeRegistry) .setParamsExtractor( request -> { RequestParamsBuilder builder = RequestParamsBuilder.create(); builder.add("name", String.valueOf(request.getName())); return builder.build(); }) .build(); HttpJsonCallSettings updateTagTemplateTransportSettings = HttpJsonCallSettings.newBuilder() .setMethodDescriptor(updateTagTemplateMethodDescriptor) .setTypeRegistry(typeRegistry) .setParamsExtractor( request -> { RequestParamsBuilder builder = RequestParamsBuilder.create(); builder.add( "tag_template.name", String.valueOf(request.getTagTemplate().getName())); return builder.build(); }) .build(); HttpJsonCallSettings deleteTagTemplateTransportSettings = HttpJsonCallSettings.newBuilder() .setMethodDescriptor(deleteTagTemplateMethodDescriptor) .setTypeRegistry(typeRegistry) .setParamsExtractor( request -> { RequestParamsBuilder builder = RequestParamsBuilder.create(); builder.add("name", String.valueOf(request.getName())); return builder.build(); }) .build(); HttpJsonCallSettings createTagTemplateFieldTransportSettings = HttpJsonCallSettings.newBuilder() .setMethodDescriptor(createTagTemplateFieldMethodDescriptor) .setTypeRegistry(typeRegistry) .setParamsExtractor( request -> { RequestParamsBuilder builder = RequestParamsBuilder.create(); builder.add("parent", String.valueOf(request.getParent())); return builder.build(); }) .build(); HttpJsonCallSettings updateTagTemplateFieldTransportSettings = HttpJsonCallSettings.newBuilder() .setMethodDescriptor(updateTagTemplateFieldMethodDescriptor) .setTypeRegistry(typeRegistry) .setParamsExtractor( request -> { RequestParamsBuilder builder = RequestParamsBuilder.create(); builder.add("name", String.valueOf(request.getName())); return builder.build(); }) .build(); HttpJsonCallSettings renameTagTemplateFieldTransportSettings = HttpJsonCallSettings.newBuilder() .setMethodDescriptor(renameTagTemplateFieldMethodDescriptor) .setTypeRegistry(typeRegistry) .setParamsExtractor( request -> { RequestParamsBuilder builder = RequestParamsBuilder.create(); builder.add("name", String.valueOf(request.getName())); return builder.build(); }) .build(); HttpJsonCallSettings renameTagTemplateFieldEnumValueTransportSettings = HttpJsonCallSettings .newBuilder() .setMethodDescriptor(renameTagTemplateFieldEnumValueMethodDescriptor) .setTypeRegistry(typeRegistry) .setParamsExtractor( request -> { RequestParamsBuilder builder = RequestParamsBuilder.create(); builder.add("name", String.valueOf(request.getName())); return builder.build(); }) .build(); HttpJsonCallSettings deleteTagTemplateFieldTransportSettings = HttpJsonCallSettings.newBuilder() .setMethodDescriptor(deleteTagTemplateFieldMethodDescriptor) .setTypeRegistry(typeRegistry) .setParamsExtractor( request -> { RequestParamsBuilder builder = RequestParamsBuilder.create(); builder.add("name", String.valueOf(request.getName())); return builder.build(); }) .build(); HttpJsonCallSettings createTagTransportSettings = HttpJsonCallSettings.newBuilder() .setMethodDescriptor(createTagMethodDescriptor) .setTypeRegistry(typeRegistry) .setParamsExtractor( request -> { RequestParamsBuilder builder = RequestParamsBuilder.create(); builder.add("parent", String.valueOf(request.getParent())); return builder.build(); }) .build(); HttpJsonCallSettings updateTagTransportSettings = HttpJsonCallSettings.newBuilder() .setMethodDescriptor(updateTagMethodDescriptor) .setTypeRegistry(typeRegistry) .setParamsExtractor( request -> { RequestParamsBuilder builder = RequestParamsBuilder.create(); builder.add("tag.name", String.valueOf(request.getTag().getName())); return builder.build(); }) .build(); HttpJsonCallSettings deleteTagTransportSettings = HttpJsonCallSettings.newBuilder() .setMethodDescriptor(deleteTagMethodDescriptor) .setTypeRegistry(typeRegistry) .setParamsExtractor( request -> { RequestParamsBuilder builder = RequestParamsBuilder.create(); builder.add("name", String.valueOf(request.getName())); return builder.build(); }) .build(); HttpJsonCallSettings listTagsTransportSettings = HttpJsonCallSettings.newBuilder() .setMethodDescriptor(listTagsMethodDescriptor) .setTypeRegistry(typeRegistry) .setParamsExtractor( request -> { RequestParamsBuilder builder = RequestParamsBuilder.create(); builder.add("parent", String.valueOf(request.getParent())); return builder.build(); }) .build(); HttpJsonCallSettings setIamPolicyTransportSettings = HttpJsonCallSettings.newBuilder() .setMethodDescriptor(setIamPolicyMethodDescriptor) .setTypeRegistry(typeRegistry) .setParamsExtractor( request -> { RequestParamsBuilder builder = RequestParamsBuilder.create(); builder.add("resource", String.valueOf(request.getResource())); return builder.build(); }) .build(); HttpJsonCallSettings getIamPolicyTransportSettings = HttpJsonCallSettings.newBuilder() .setMethodDescriptor(getIamPolicyMethodDescriptor) .setTypeRegistry(typeRegistry) .setParamsExtractor( request -> { RequestParamsBuilder builder = RequestParamsBuilder.create(); builder.add("resource", String.valueOf(request.getResource())); return builder.build(); }) .build(); HttpJsonCallSettings testIamPermissionsTransportSettings = HttpJsonCallSettings.newBuilder() .setMethodDescriptor(testIamPermissionsMethodDescriptor) .setTypeRegistry(typeRegistry) .setParamsExtractor( request -> { RequestParamsBuilder builder = RequestParamsBuilder.create(); builder.add("resource", String.valueOf(request.getResource())); return builder.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.renameTagTemplateFieldEnumValueCallable = callableFactory.createUnaryCallable( renameTagTemplateFieldEnumValueTransportSettings, settings.renameTagTemplateFieldEnumValueSettings(), 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()); } @InternalApi public static List getMethodDescriptors() { List methodDescriptors = new ArrayList<>(); methodDescriptors.add(searchCatalogMethodDescriptor); methodDescriptors.add(createEntryGroupMethodDescriptor); methodDescriptors.add(updateEntryGroupMethodDescriptor); methodDescriptors.add(getEntryGroupMethodDescriptor); methodDescriptors.add(deleteEntryGroupMethodDescriptor); methodDescriptors.add(listEntryGroupsMethodDescriptor); methodDescriptors.add(createEntryMethodDescriptor); methodDescriptors.add(updateEntryMethodDescriptor); methodDescriptors.add(deleteEntryMethodDescriptor); methodDescriptors.add(getEntryMethodDescriptor); methodDescriptors.add(lookupEntryMethodDescriptor); methodDescriptors.add(listEntriesMethodDescriptor); methodDescriptors.add(createTagTemplateMethodDescriptor); methodDescriptors.add(getTagTemplateMethodDescriptor); methodDescriptors.add(updateTagTemplateMethodDescriptor); methodDescriptors.add(deleteTagTemplateMethodDescriptor); methodDescriptors.add(createTagTemplateFieldMethodDescriptor); methodDescriptors.add(updateTagTemplateFieldMethodDescriptor); methodDescriptors.add(renameTagTemplateFieldMethodDescriptor); methodDescriptors.add(renameTagTemplateFieldEnumValueMethodDescriptor); methodDescriptors.add(deleteTagTemplateFieldMethodDescriptor); methodDescriptors.add(createTagMethodDescriptor); methodDescriptors.add(updateTagMethodDescriptor); methodDescriptors.add(deleteTagMethodDescriptor); methodDescriptors.add(listTagsMethodDescriptor); methodDescriptors.add(setIamPolicyMethodDescriptor); methodDescriptors.add(getIamPolicyMethodDescriptor); methodDescriptors.add(testIamPermissionsMethodDescriptor); return methodDescriptors; } @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 renameTagTemplateFieldEnumValueCallable() { return renameTagTemplateFieldEnumValueCallable; } @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() { 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); } }





© 2015 - 2025 Weber Informatics LLC | Privacy Policy