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

com.google.cloud.apihub.v1.stub.HttpJsonApiHubStub Maven / Gradle / Ivy

Go to download

API hub API API hub lets you consolidate and organize information about all of the APIs of interest to your organization. API hub lets you capture critical information about APIs that allows developers to discover and evaluate them easily and leverage the work of other teams wherever possible. API platform teams can use API hub to have visibility into and manage their portfolio of APIs.

There is a newer version: 0.8.0
Show 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.apihub.v1.stub;

import static com.google.cloud.apihub.v1.ApiHubClient.ListApiOperationsPagedResponse;
import static com.google.cloud.apihub.v1.ApiHubClient.ListApisPagedResponse;
import static com.google.cloud.apihub.v1.ApiHubClient.ListAttributesPagedResponse;
import static com.google.cloud.apihub.v1.ApiHubClient.ListDeploymentsPagedResponse;
import static com.google.cloud.apihub.v1.ApiHubClient.ListExternalApisPagedResponse;
import static com.google.cloud.apihub.v1.ApiHubClient.ListLocationsPagedResponse;
import static com.google.cloud.apihub.v1.ApiHubClient.ListSpecsPagedResponse;
import static com.google.cloud.apihub.v1.ApiHubClient.ListVersionsPagedResponse;
import static com.google.cloud.apihub.v1.ApiHubClient.SearchResourcesPagedResponse;

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.apihub.v1.Api;
import com.google.cloud.apihub.v1.ApiOperation;
import com.google.cloud.apihub.v1.Attribute;
import com.google.cloud.apihub.v1.CreateApiRequest;
import com.google.cloud.apihub.v1.CreateAttributeRequest;
import com.google.cloud.apihub.v1.CreateDeploymentRequest;
import com.google.cloud.apihub.v1.CreateExternalApiRequest;
import com.google.cloud.apihub.v1.CreateSpecRequest;
import com.google.cloud.apihub.v1.CreateVersionRequest;
import com.google.cloud.apihub.v1.Definition;
import com.google.cloud.apihub.v1.DeleteApiRequest;
import com.google.cloud.apihub.v1.DeleteAttributeRequest;
import com.google.cloud.apihub.v1.DeleteDeploymentRequest;
import com.google.cloud.apihub.v1.DeleteExternalApiRequest;
import com.google.cloud.apihub.v1.DeleteSpecRequest;
import com.google.cloud.apihub.v1.DeleteVersionRequest;
import com.google.cloud.apihub.v1.Deployment;
import com.google.cloud.apihub.v1.ExternalApi;
import com.google.cloud.apihub.v1.GetApiOperationRequest;
import com.google.cloud.apihub.v1.GetApiRequest;
import com.google.cloud.apihub.v1.GetAttributeRequest;
import com.google.cloud.apihub.v1.GetDefinitionRequest;
import com.google.cloud.apihub.v1.GetDeploymentRequest;
import com.google.cloud.apihub.v1.GetExternalApiRequest;
import com.google.cloud.apihub.v1.GetSpecContentsRequest;
import com.google.cloud.apihub.v1.GetSpecRequest;
import com.google.cloud.apihub.v1.GetVersionRequest;
import com.google.cloud.apihub.v1.ListApiOperationsRequest;
import com.google.cloud.apihub.v1.ListApiOperationsResponse;
import com.google.cloud.apihub.v1.ListApisRequest;
import com.google.cloud.apihub.v1.ListApisResponse;
import com.google.cloud.apihub.v1.ListAttributesRequest;
import com.google.cloud.apihub.v1.ListAttributesResponse;
import com.google.cloud.apihub.v1.ListDeploymentsRequest;
import com.google.cloud.apihub.v1.ListDeploymentsResponse;
import com.google.cloud.apihub.v1.ListExternalApisRequest;
import com.google.cloud.apihub.v1.ListExternalApisResponse;
import com.google.cloud.apihub.v1.ListSpecsRequest;
import com.google.cloud.apihub.v1.ListSpecsResponse;
import com.google.cloud.apihub.v1.ListVersionsRequest;
import com.google.cloud.apihub.v1.ListVersionsResponse;
import com.google.cloud.apihub.v1.SearchResourcesRequest;
import com.google.cloud.apihub.v1.SearchResourcesResponse;
import com.google.cloud.apihub.v1.Spec;
import com.google.cloud.apihub.v1.SpecContents;
import com.google.cloud.apihub.v1.UpdateApiRequest;
import com.google.cloud.apihub.v1.UpdateAttributeRequest;
import com.google.cloud.apihub.v1.UpdateDeploymentRequest;
import com.google.cloud.apihub.v1.UpdateExternalApiRequest;
import com.google.cloud.apihub.v1.UpdateSpecRequest;
import com.google.cloud.apihub.v1.UpdateVersionRequest;
import com.google.cloud.apihub.v1.Version;
import com.google.cloud.location.GetLocationRequest;
import com.google.cloud.location.ListLocationsRequest;
import com.google.cloud.location.ListLocationsResponse;
import com.google.cloud.location.Location;
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 ApiHub service API.
 *
 * 

This class is for advanced usage and reflects the underlying API directly. */ @Generated("by gapic-generator-java") public class HttpJsonApiHubStub extends ApiHubStub { private static final TypeRegistry typeRegistry = TypeRegistry.newBuilder().build(); private static final ApiMethodDescriptor createApiMethodDescriptor = ApiMethodDescriptor.newBuilder() .setFullMethodName("google.cloud.apihub.v1.ApiHub/CreateApi") .setHttpMethod("POST") .setType(ApiMethodDescriptor.MethodType.UNARY) .setRequestFormatter( ProtoMessageRequestFormatter.newBuilder() .setPath( "/v1/{parent=projects/*/locations/*}/apis", 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, "apiId", request.getApiId()); serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); return fields; }) .setRequestBodyExtractor( request -> ProtoRestSerializer.create().toBody("api", request.getApi(), true)) .build()) .setResponseParser( ProtoMessageResponseParser.newBuilder() .setDefaultInstance(Api.getDefaultInstance()) .setDefaultTypeRegistry(typeRegistry) .build()) .build(); private static final ApiMethodDescriptor getApiMethodDescriptor = ApiMethodDescriptor.newBuilder() .setFullMethodName("google.cloud.apihub.v1.ApiHub/GetApi") .setHttpMethod("GET") .setType(ApiMethodDescriptor.MethodType.UNARY) .setRequestFormatter( ProtoMessageRequestFormatter.newBuilder() .setPath( "/v1/{name=projects/*/locations/*/apis/*}", 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, "$alt", "json;enum-encoding=int"); return fields; }) .setRequestBodyExtractor(request -> null) .build()) .setResponseParser( ProtoMessageResponseParser.newBuilder() .setDefaultInstance(Api.getDefaultInstance()) .setDefaultTypeRegistry(typeRegistry) .build()) .build(); private static final ApiMethodDescriptor listApisMethodDescriptor = ApiMethodDescriptor.newBuilder() .setFullMethodName("google.cloud.apihub.v1.ApiHub/ListApis") .setHttpMethod("GET") .setType(ApiMethodDescriptor.MethodType.UNARY) .setRequestFormatter( ProtoMessageRequestFormatter.newBuilder() .setPath( "/v1/{parent=projects/*/locations/*}/apis", 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, "filter", request.getFilter()); serializer.putQueryParam(fields, "pageSize", request.getPageSize()); serializer.putQueryParam(fields, "pageToken", request.getPageToken()); serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); return fields; }) .setRequestBodyExtractor(request -> null) .build()) .setResponseParser( ProtoMessageResponseParser.newBuilder() .setDefaultInstance(ListApisResponse.getDefaultInstance()) .setDefaultTypeRegistry(typeRegistry) .build()) .build(); private static final ApiMethodDescriptor updateApiMethodDescriptor = ApiMethodDescriptor.newBuilder() .setFullMethodName("google.cloud.apihub.v1.ApiHub/UpdateApi") .setHttpMethod("PATCH") .setType(ApiMethodDescriptor.MethodType.UNARY) .setRequestFormatter( ProtoMessageRequestFormatter.newBuilder() .setPath( "/v1/{api.name=projects/*/locations/*/apis/*}", request -> { Map fields = new HashMap<>(); ProtoRestSerializer serializer = ProtoRestSerializer.create(); serializer.putPathParam(fields, "api.name", request.getApi().getName()); return fields; }) .setQueryParamsExtractor( request -> { Map> fields = new HashMap<>(); ProtoRestSerializer serializer = ProtoRestSerializer.create(); serializer.putQueryParam(fields, "updateMask", request.getUpdateMask()); serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); return fields; }) .setRequestBodyExtractor( request -> ProtoRestSerializer.create().toBody("api", request.getApi(), true)) .build()) .setResponseParser( ProtoMessageResponseParser.newBuilder() .setDefaultInstance(Api.getDefaultInstance()) .setDefaultTypeRegistry(typeRegistry) .build()) .build(); private static final ApiMethodDescriptor deleteApiMethodDescriptor = ApiMethodDescriptor.newBuilder() .setFullMethodName("google.cloud.apihub.v1.ApiHub/DeleteApi") .setHttpMethod("DELETE") .setType(ApiMethodDescriptor.MethodType.UNARY) .setRequestFormatter( ProtoMessageRequestFormatter.newBuilder() .setPath( "/v1/{name=projects/*/locations/*/apis/*}", 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()); serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); return fields; }) .setRequestBodyExtractor(request -> null) .build()) .setResponseParser( ProtoMessageResponseParser.newBuilder() .setDefaultInstance(Empty.getDefaultInstance()) .setDefaultTypeRegistry(typeRegistry) .build()) .build(); private static final ApiMethodDescriptor createVersionMethodDescriptor = ApiMethodDescriptor.newBuilder() .setFullMethodName("google.cloud.apihub.v1.ApiHub/CreateVersion") .setHttpMethod("POST") .setType(ApiMethodDescriptor.MethodType.UNARY) .setRequestFormatter( ProtoMessageRequestFormatter.newBuilder() .setPath( "/v1/{parent=projects/*/locations/*/apis/*}/versions", 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, "versionId", request.getVersionId()); serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); return fields; }) .setRequestBodyExtractor( request -> ProtoRestSerializer.create() .toBody("version", request.getVersion(), true)) .build()) .setResponseParser( ProtoMessageResponseParser.newBuilder() .setDefaultInstance(Version.getDefaultInstance()) .setDefaultTypeRegistry(typeRegistry) .build()) .build(); private static final ApiMethodDescriptor getVersionMethodDescriptor = ApiMethodDescriptor.newBuilder() .setFullMethodName("google.cloud.apihub.v1.ApiHub/GetVersion") .setHttpMethod("GET") .setType(ApiMethodDescriptor.MethodType.UNARY) .setRequestFormatter( ProtoMessageRequestFormatter.newBuilder() .setPath( "/v1/{name=projects/*/locations/*/apis/*/versions/*}", 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, "$alt", "json;enum-encoding=int"); return fields; }) .setRequestBodyExtractor(request -> null) .build()) .setResponseParser( ProtoMessageResponseParser.newBuilder() .setDefaultInstance(Version.getDefaultInstance()) .setDefaultTypeRegistry(typeRegistry) .build()) .build(); private static final ApiMethodDescriptor listVersionsMethodDescriptor = ApiMethodDescriptor.newBuilder() .setFullMethodName("google.cloud.apihub.v1.ApiHub/ListVersions") .setHttpMethod("GET") .setType(ApiMethodDescriptor.MethodType.UNARY) .setRequestFormatter( ProtoMessageRequestFormatter.newBuilder() .setPath( "/v1/{parent=projects/*/locations/*/apis/*}/versions", 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, "filter", request.getFilter()); serializer.putQueryParam(fields, "pageSize", request.getPageSize()); serializer.putQueryParam(fields, "pageToken", request.getPageToken()); serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); return fields; }) .setRequestBodyExtractor(request -> null) .build()) .setResponseParser( ProtoMessageResponseParser.newBuilder() .setDefaultInstance(ListVersionsResponse.getDefaultInstance()) .setDefaultTypeRegistry(typeRegistry) .build()) .build(); private static final ApiMethodDescriptor updateVersionMethodDescriptor = ApiMethodDescriptor.newBuilder() .setFullMethodName("google.cloud.apihub.v1.ApiHub/UpdateVersion") .setHttpMethod("PATCH") .setType(ApiMethodDescriptor.MethodType.UNARY) .setRequestFormatter( ProtoMessageRequestFormatter.newBuilder() .setPath( "/v1/{version.name=projects/*/locations/*/apis/*/versions/*}", request -> { Map fields = new HashMap<>(); ProtoRestSerializer serializer = ProtoRestSerializer.create(); serializer.putPathParam( fields, "version.name", request.getVersion().getName()); return fields; }) .setQueryParamsExtractor( request -> { Map> fields = new HashMap<>(); ProtoRestSerializer serializer = ProtoRestSerializer.create(); serializer.putQueryParam(fields, "updateMask", request.getUpdateMask()); serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); return fields; }) .setRequestBodyExtractor( request -> ProtoRestSerializer.create() .toBody("version", request.getVersion(), true)) .build()) .setResponseParser( ProtoMessageResponseParser.newBuilder() .setDefaultInstance(Version.getDefaultInstance()) .setDefaultTypeRegistry(typeRegistry) .build()) .build(); private static final ApiMethodDescriptor deleteVersionMethodDescriptor = ApiMethodDescriptor.newBuilder() .setFullMethodName("google.cloud.apihub.v1.ApiHub/DeleteVersion") .setHttpMethod("DELETE") .setType(ApiMethodDescriptor.MethodType.UNARY) .setRequestFormatter( ProtoMessageRequestFormatter.newBuilder() .setPath( "/v1/{name=projects/*/locations/*/apis/*/versions/*}", 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()); serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); return fields; }) .setRequestBodyExtractor(request -> null) .build()) .setResponseParser( ProtoMessageResponseParser.newBuilder() .setDefaultInstance(Empty.getDefaultInstance()) .setDefaultTypeRegistry(typeRegistry) .build()) .build(); private static final ApiMethodDescriptor createSpecMethodDescriptor = ApiMethodDescriptor.newBuilder() .setFullMethodName("google.cloud.apihub.v1.ApiHub/CreateSpec") .setHttpMethod("POST") .setType(ApiMethodDescriptor.MethodType.UNARY) .setRequestFormatter( ProtoMessageRequestFormatter.newBuilder() .setPath( "/v1/{parent=projects/*/locations/*/apis/*/versions/*}/specs", 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, "specId", request.getSpecId()); serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); return fields; }) .setRequestBodyExtractor( request -> ProtoRestSerializer.create().toBody("spec", request.getSpec(), true)) .build()) .setResponseParser( ProtoMessageResponseParser.newBuilder() .setDefaultInstance(Spec.getDefaultInstance()) .setDefaultTypeRegistry(typeRegistry) .build()) .build(); private static final ApiMethodDescriptor getSpecMethodDescriptor = ApiMethodDescriptor.newBuilder() .setFullMethodName("google.cloud.apihub.v1.ApiHub/GetSpec") .setHttpMethod("GET") .setType(ApiMethodDescriptor.MethodType.UNARY) .setRequestFormatter( ProtoMessageRequestFormatter.newBuilder() .setPath( "/v1/{name=projects/*/locations/*/apis/*/versions/*/specs/*}", 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, "$alt", "json;enum-encoding=int"); return fields; }) .setRequestBodyExtractor(request -> null) .build()) .setResponseParser( ProtoMessageResponseParser.newBuilder() .setDefaultInstance(Spec.getDefaultInstance()) .setDefaultTypeRegistry(typeRegistry) .build()) .build(); private static final ApiMethodDescriptor getSpecContentsMethodDescriptor = ApiMethodDescriptor.newBuilder() .setFullMethodName("google.cloud.apihub.v1.ApiHub/GetSpecContents") .setHttpMethod("GET") .setType(ApiMethodDescriptor.MethodType.UNARY) .setRequestFormatter( ProtoMessageRequestFormatter.newBuilder() .setPath( "/v1/{name=projects/*/locations/*/apis/*/versions/*/specs/*}:contents", 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, "$alt", "json;enum-encoding=int"); return fields; }) .setRequestBodyExtractor(request -> null) .build()) .setResponseParser( ProtoMessageResponseParser.newBuilder() .setDefaultInstance(SpecContents.getDefaultInstance()) .setDefaultTypeRegistry(typeRegistry) .build()) .build(); private static final ApiMethodDescriptor listSpecsMethodDescriptor = ApiMethodDescriptor.newBuilder() .setFullMethodName("google.cloud.apihub.v1.ApiHub/ListSpecs") .setHttpMethod("GET") .setType(ApiMethodDescriptor.MethodType.UNARY) .setRequestFormatter( ProtoMessageRequestFormatter.newBuilder() .setPath( "/v1/{parent=projects/*/locations/*/apis/*/versions/*}/specs", 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, "filter", request.getFilter()); serializer.putQueryParam(fields, "pageSize", request.getPageSize()); serializer.putQueryParam(fields, "pageToken", request.getPageToken()); serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); return fields; }) .setRequestBodyExtractor(request -> null) .build()) .setResponseParser( ProtoMessageResponseParser.newBuilder() .setDefaultInstance(ListSpecsResponse.getDefaultInstance()) .setDefaultTypeRegistry(typeRegistry) .build()) .build(); private static final ApiMethodDescriptor updateSpecMethodDescriptor = ApiMethodDescriptor.newBuilder() .setFullMethodName("google.cloud.apihub.v1.ApiHub/UpdateSpec") .setHttpMethod("PATCH") .setType(ApiMethodDescriptor.MethodType.UNARY) .setRequestFormatter( ProtoMessageRequestFormatter.newBuilder() .setPath( "/v1/{spec.name=projects/*/locations/*/apis/*/versions/*/specs/*}", request -> { Map fields = new HashMap<>(); ProtoRestSerializer serializer = ProtoRestSerializer.create(); serializer.putPathParam(fields, "spec.name", request.getSpec().getName()); return fields; }) .setQueryParamsExtractor( request -> { Map> fields = new HashMap<>(); ProtoRestSerializer serializer = ProtoRestSerializer.create(); serializer.putQueryParam(fields, "updateMask", request.getUpdateMask()); serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); return fields; }) .setRequestBodyExtractor( request -> ProtoRestSerializer.create().toBody("spec", request.getSpec(), true)) .build()) .setResponseParser( ProtoMessageResponseParser.newBuilder() .setDefaultInstance(Spec.getDefaultInstance()) .setDefaultTypeRegistry(typeRegistry) .build()) .build(); private static final ApiMethodDescriptor deleteSpecMethodDescriptor = ApiMethodDescriptor.newBuilder() .setFullMethodName("google.cloud.apihub.v1.ApiHub/DeleteSpec") .setHttpMethod("DELETE") .setType(ApiMethodDescriptor.MethodType.UNARY) .setRequestFormatter( ProtoMessageRequestFormatter.newBuilder() .setPath( "/v1/{name=projects/*/locations/*/apis/*/versions/*/specs/*}", 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, "$alt", "json;enum-encoding=int"); return fields; }) .setRequestBodyExtractor(request -> null) .build()) .setResponseParser( ProtoMessageResponseParser.newBuilder() .setDefaultInstance(Empty.getDefaultInstance()) .setDefaultTypeRegistry(typeRegistry) .build()) .build(); private static final ApiMethodDescriptor getApiOperationMethodDescriptor = ApiMethodDescriptor.newBuilder() .setFullMethodName("google.cloud.apihub.v1.ApiHub/GetApiOperation") .setHttpMethod("GET") .setType(ApiMethodDescriptor.MethodType.UNARY) .setRequestFormatter( ProtoMessageRequestFormatter.newBuilder() .setPath( "/v1/{name=projects/*/locations/*/apis/*/versions/*/operations/*}", 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, "$alt", "json;enum-encoding=int"); return fields; }) .setRequestBodyExtractor(request -> null) .build()) .setResponseParser( ProtoMessageResponseParser.newBuilder() .setDefaultInstance(ApiOperation.getDefaultInstance()) .setDefaultTypeRegistry(typeRegistry) .build()) .build(); private static final ApiMethodDescriptor listApiOperationsMethodDescriptor = ApiMethodDescriptor.newBuilder() .setFullMethodName("google.cloud.apihub.v1.ApiHub/ListApiOperations") .setHttpMethod("GET") .setType(ApiMethodDescriptor.MethodType.UNARY) .setRequestFormatter( ProtoMessageRequestFormatter.newBuilder() .setPath( "/v1/{parent=projects/*/locations/*/apis/*/versions/*}/operations", 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, "filter", request.getFilter()); serializer.putQueryParam(fields, "pageSize", request.getPageSize()); serializer.putQueryParam(fields, "pageToken", request.getPageToken()); serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); return fields; }) .setRequestBodyExtractor(request -> null) .build()) .setResponseParser( ProtoMessageResponseParser.newBuilder() .setDefaultInstance(ListApiOperationsResponse.getDefaultInstance()) .setDefaultTypeRegistry(typeRegistry) .build()) .build(); private static final ApiMethodDescriptor getDefinitionMethodDescriptor = ApiMethodDescriptor.newBuilder() .setFullMethodName("google.cloud.apihub.v1.ApiHub/GetDefinition") .setHttpMethod("GET") .setType(ApiMethodDescriptor.MethodType.UNARY) .setRequestFormatter( ProtoMessageRequestFormatter.newBuilder() .setPath( "/v1/{name=projects/*/locations/*/apis/*/versions/*/definitions/*}", 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, "$alt", "json;enum-encoding=int"); return fields; }) .setRequestBodyExtractor(request -> null) .build()) .setResponseParser( ProtoMessageResponseParser.newBuilder() .setDefaultInstance(Definition.getDefaultInstance()) .setDefaultTypeRegistry(typeRegistry) .build()) .build(); private static final ApiMethodDescriptor createDeploymentMethodDescriptor = ApiMethodDescriptor.newBuilder() .setFullMethodName("google.cloud.apihub.v1.ApiHub/CreateDeployment") .setHttpMethod("POST") .setType(ApiMethodDescriptor.MethodType.UNARY) .setRequestFormatter( ProtoMessageRequestFormatter.newBuilder() .setPath( "/v1/{parent=projects/*/locations/*}/deployments", 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, "deploymentId", request.getDeploymentId()); serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); return fields; }) .setRequestBodyExtractor( request -> ProtoRestSerializer.create() .toBody("deployment", request.getDeployment(), true)) .build()) .setResponseParser( ProtoMessageResponseParser.newBuilder() .setDefaultInstance(Deployment.getDefaultInstance()) .setDefaultTypeRegistry(typeRegistry) .build()) .build(); private static final ApiMethodDescriptor getDeploymentMethodDescriptor = ApiMethodDescriptor.newBuilder() .setFullMethodName("google.cloud.apihub.v1.ApiHub/GetDeployment") .setHttpMethod("GET") .setType(ApiMethodDescriptor.MethodType.UNARY) .setRequestFormatter( ProtoMessageRequestFormatter.newBuilder() .setPath( "/v1/{name=projects/*/locations/*/deployments/*}", 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, "$alt", "json;enum-encoding=int"); return fields; }) .setRequestBodyExtractor(request -> null) .build()) .setResponseParser( ProtoMessageResponseParser.newBuilder() .setDefaultInstance(Deployment.getDefaultInstance()) .setDefaultTypeRegistry(typeRegistry) .build()) .build(); private static final ApiMethodDescriptor listDeploymentsMethodDescriptor = ApiMethodDescriptor.newBuilder() .setFullMethodName("google.cloud.apihub.v1.ApiHub/ListDeployments") .setHttpMethod("GET") .setType(ApiMethodDescriptor.MethodType.UNARY) .setRequestFormatter( ProtoMessageRequestFormatter.newBuilder() .setPath( "/v1/{parent=projects/*/locations/*}/deployments", 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, "filter", request.getFilter()); serializer.putQueryParam(fields, "pageSize", request.getPageSize()); serializer.putQueryParam(fields, "pageToken", request.getPageToken()); serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); return fields; }) .setRequestBodyExtractor(request -> null) .build()) .setResponseParser( ProtoMessageResponseParser.newBuilder() .setDefaultInstance(ListDeploymentsResponse.getDefaultInstance()) .setDefaultTypeRegistry(typeRegistry) .build()) .build(); private static final ApiMethodDescriptor updateDeploymentMethodDescriptor = ApiMethodDescriptor.newBuilder() .setFullMethodName("google.cloud.apihub.v1.ApiHub/UpdateDeployment") .setHttpMethod("PATCH") .setType(ApiMethodDescriptor.MethodType.UNARY) .setRequestFormatter( ProtoMessageRequestFormatter.newBuilder() .setPath( "/v1/{deployment.name=projects/*/locations/*/deployments/*}", request -> { Map fields = new HashMap<>(); ProtoRestSerializer serializer = ProtoRestSerializer.create(); serializer.putPathParam( fields, "deployment.name", request.getDeployment().getName()); return fields; }) .setQueryParamsExtractor( request -> { Map> fields = new HashMap<>(); ProtoRestSerializer serializer = ProtoRestSerializer.create(); serializer.putQueryParam(fields, "updateMask", request.getUpdateMask()); serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); return fields; }) .setRequestBodyExtractor( request -> ProtoRestSerializer.create() .toBody("deployment", request.getDeployment(), true)) .build()) .setResponseParser( ProtoMessageResponseParser.newBuilder() .setDefaultInstance(Deployment.getDefaultInstance()) .setDefaultTypeRegistry(typeRegistry) .build()) .build(); private static final ApiMethodDescriptor deleteDeploymentMethodDescriptor = ApiMethodDescriptor.newBuilder() .setFullMethodName("google.cloud.apihub.v1.ApiHub/DeleteDeployment") .setHttpMethod("DELETE") .setType(ApiMethodDescriptor.MethodType.UNARY) .setRequestFormatter( ProtoMessageRequestFormatter.newBuilder() .setPath( "/v1/{name=projects/*/locations/*/deployments/*}", 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, "$alt", "json;enum-encoding=int"); return fields; }) .setRequestBodyExtractor(request -> null) .build()) .setResponseParser( ProtoMessageResponseParser.newBuilder() .setDefaultInstance(Empty.getDefaultInstance()) .setDefaultTypeRegistry(typeRegistry) .build()) .build(); private static final ApiMethodDescriptor createAttributeMethodDescriptor = ApiMethodDescriptor.newBuilder() .setFullMethodName("google.cloud.apihub.v1.ApiHub/CreateAttribute") .setHttpMethod("POST") .setType(ApiMethodDescriptor.MethodType.UNARY) .setRequestFormatter( ProtoMessageRequestFormatter.newBuilder() .setPath( "/v1/{parent=projects/*/locations/*}/attributes", 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, "attributeId", request.getAttributeId()); serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); return fields; }) .setRequestBodyExtractor( request -> ProtoRestSerializer.create() .toBody("attribute", request.getAttribute(), true)) .build()) .setResponseParser( ProtoMessageResponseParser.newBuilder() .setDefaultInstance(Attribute.getDefaultInstance()) .setDefaultTypeRegistry(typeRegistry) .build()) .build(); private static final ApiMethodDescriptor getAttributeMethodDescriptor = ApiMethodDescriptor.newBuilder() .setFullMethodName("google.cloud.apihub.v1.ApiHub/GetAttribute") .setHttpMethod("GET") .setType(ApiMethodDescriptor.MethodType.UNARY) .setRequestFormatter( ProtoMessageRequestFormatter.newBuilder() .setPath( "/v1/{name=projects/*/locations/*/attributes/*}", 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, "$alt", "json;enum-encoding=int"); return fields; }) .setRequestBodyExtractor(request -> null) .build()) .setResponseParser( ProtoMessageResponseParser.newBuilder() .setDefaultInstance(Attribute.getDefaultInstance()) .setDefaultTypeRegistry(typeRegistry) .build()) .build(); private static final ApiMethodDescriptor updateAttributeMethodDescriptor = ApiMethodDescriptor.newBuilder() .setFullMethodName("google.cloud.apihub.v1.ApiHub/UpdateAttribute") .setHttpMethod("PATCH") .setType(ApiMethodDescriptor.MethodType.UNARY) .setRequestFormatter( ProtoMessageRequestFormatter.newBuilder() .setPath( "/v1/{attribute.name=projects/*/locations/*/attributes/*}", request -> { Map fields = new HashMap<>(); ProtoRestSerializer serializer = ProtoRestSerializer.create(); serializer.putPathParam( fields, "attribute.name", request.getAttribute().getName()); return fields; }) .setQueryParamsExtractor( request -> { Map> fields = new HashMap<>(); ProtoRestSerializer serializer = ProtoRestSerializer.create(); serializer.putQueryParam(fields, "updateMask", request.getUpdateMask()); serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); return fields; }) .setRequestBodyExtractor( request -> ProtoRestSerializer.create() .toBody("attribute", request.getAttribute(), true)) .build()) .setResponseParser( ProtoMessageResponseParser.newBuilder() .setDefaultInstance(Attribute.getDefaultInstance()) .setDefaultTypeRegistry(typeRegistry) .build()) .build(); private static final ApiMethodDescriptor deleteAttributeMethodDescriptor = ApiMethodDescriptor.newBuilder() .setFullMethodName("google.cloud.apihub.v1.ApiHub/DeleteAttribute") .setHttpMethod("DELETE") .setType(ApiMethodDescriptor.MethodType.UNARY) .setRequestFormatter( ProtoMessageRequestFormatter.newBuilder() .setPath( "/v1/{name=projects/*/locations/*/attributes/*}", 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, "$alt", "json;enum-encoding=int"); return fields; }) .setRequestBodyExtractor(request -> null) .build()) .setResponseParser( ProtoMessageResponseParser.newBuilder() .setDefaultInstance(Empty.getDefaultInstance()) .setDefaultTypeRegistry(typeRegistry) .build()) .build(); private static final ApiMethodDescriptor listAttributesMethodDescriptor = ApiMethodDescriptor.newBuilder() .setFullMethodName("google.cloud.apihub.v1.ApiHub/ListAttributes") .setHttpMethod("GET") .setType(ApiMethodDescriptor.MethodType.UNARY) .setRequestFormatter( ProtoMessageRequestFormatter.newBuilder() .setPath( "/v1/{parent=projects/*/locations/*}/attributes", 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, "filter", request.getFilter()); serializer.putQueryParam(fields, "pageSize", request.getPageSize()); serializer.putQueryParam(fields, "pageToken", request.getPageToken()); serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); return fields; }) .setRequestBodyExtractor(request -> null) .build()) .setResponseParser( ProtoMessageResponseParser.newBuilder() .setDefaultInstance(ListAttributesResponse.getDefaultInstance()) .setDefaultTypeRegistry(typeRegistry) .build()) .build(); private static final ApiMethodDescriptor searchResourcesMethodDescriptor = ApiMethodDescriptor.newBuilder() .setFullMethodName("google.cloud.apihub.v1.ApiHub/SearchResources") .setHttpMethod("POST") .setType(ApiMethodDescriptor.MethodType.UNARY) .setRequestFormatter( ProtoMessageRequestFormatter.newBuilder() .setPath( "/v1/{location=projects/*/locations/*}:searchResources", request -> { Map fields = new HashMap<>(); ProtoRestSerializer serializer = ProtoRestSerializer.create(); serializer.putPathParam(fields, "location", request.getLocation()); return fields; }) .setQueryParamsExtractor( request -> { Map> fields = new HashMap<>(); ProtoRestSerializer serializer = ProtoRestSerializer.create(); serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); return fields; }) .setRequestBodyExtractor( request -> ProtoRestSerializer.create() .toBody("*", request.toBuilder().clearLocation().build(), true)) .build()) .setResponseParser( ProtoMessageResponseParser.newBuilder() .setDefaultInstance(SearchResourcesResponse.getDefaultInstance()) .setDefaultTypeRegistry(typeRegistry) .build()) .build(); private static final ApiMethodDescriptor createExternalApiMethodDescriptor = ApiMethodDescriptor.newBuilder() .setFullMethodName("google.cloud.apihub.v1.ApiHub/CreateExternalApi") .setHttpMethod("POST") .setType(ApiMethodDescriptor.MethodType.UNARY) .setRequestFormatter( ProtoMessageRequestFormatter.newBuilder() .setPath( "/v1/{parent=projects/*/locations/*}/externalApis", 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, "externalApiId", request.getExternalApiId()); serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); return fields; }) .setRequestBodyExtractor( request -> ProtoRestSerializer.create() .toBody("externalApi", request.getExternalApi(), true)) .build()) .setResponseParser( ProtoMessageResponseParser.newBuilder() .setDefaultInstance(ExternalApi.getDefaultInstance()) .setDefaultTypeRegistry(typeRegistry) .build()) .build(); private static final ApiMethodDescriptor getExternalApiMethodDescriptor = ApiMethodDescriptor.newBuilder() .setFullMethodName("google.cloud.apihub.v1.ApiHub/GetExternalApi") .setHttpMethod("GET") .setType(ApiMethodDescriptor.MethodType.UNARY) .setRequestFormatter( ProtoMessageRequestFormatter.newBuilder() .setPath( "/v1/{name=projects/*/locations/*/externalApis/*}", 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, "$alt", "json;enum-encoding=int"); return fields; }) .setRequestBodyExtractor(request -> null) .build()) .setResponseParser( ProtoMessageResponseParser.newBuilder() .setDefaultInstance(ExternalApi.getDefaultInstance()) .setDefaultTypeRegistry(typeRegistry) .build()) .build(); private static final ApiMethodDescriptor updateExternalApiMethodDescriptor = ApiMethodDescriptor.newBuilder() .setFullMethodName("google.cloud.apihub.v1.ApiHub/UpdateExternalApi") .setHttpMethod("PATCH") .setType(ApiMethodDescriptor.MethodType.UNARY) .setRequestFormatter( ProtoMessageRequestFormatter.newBuilder() .setPath( "/v1/{externalApi.name=projects/*/locations/*/externalApis/*}", request -> { Map fields = new HashMap<>(); ProtoRestSerializer serializer = ProtoRestSerializer.create(); serializer.putPathParam( fields, "externalApi.name", request.getExternalApi().getName()); return fields; }) .setQueryParamsExtractor( request -> { Map> fields = new HashMap<>(); ProtoRestSerializer serializer = ProtoRestSerializer.create(); serializer.putQueryParam(fields, "updateMask", request.getUpdateMask()); serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); return fields; }) .setRequestBodyExtractor( request -> ProtoRestSerializer.create() .toBody("externalApi", request.getExternalApi(), true)) .build()) .setResponseParser( ProtoMessageResponseParser.newBuilder() .setDefaultInstance(ExternalApi.getDefaultInstance()) .setDefaultTypeRegistry(typeRegistry) .build()) .build(); private static final ApiMethodDescriptor deleteExternalApiMethodDescriptor = ApiMethodDescriptor.newBuilder() .setFullMethodName("google.cloud.apihub.v1.ApiHub/DeleteExternalApi") .setHttpMethod("DELETE") .setType(ApiMethodDescriptor.MethodType.UNARY) .setRequestFormatter( ProtoMessageRequestFormatter.newBuilder() .setPath( "/v1/{name=projects/*/locations/*/externalApis/*}", 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, "$alt", "json;enum-encoding=int"); return fields; }) .setRequestBodyExtractor(request -> null) .build()) .setResponseParser( ProtoMessageResponseParser.newBuilder() .setDefaultInstance(Empty.getDefaultInstance()) .setDefaultTypeRegistry(typeRegistry) .build()) .build(); private static final ApiMethodDescriptor listExternalApisMethodDescriptor = ApiMethodDescriptor.newBuilder() .setFullMethodName("google.cloud.apihub.v1.ApiHub/ListExternalApis") .setHttpMethod("GET") .setType(ApiMethodDescriptor.MethodType.UNARY) .setRequestFormatter( ProtoMessageRequestFormatter.newBuilder() .setPath( "/v1/{parent=projects/*/locations/*}/externalApis", 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, "$alt", "json;enum-encoding=int"); return fields; }) .setRequestBodyExtractor(request -> null) .build()) .setResponseParser( ProtoMessageResponseParser.newBuilder() .setDefaultInstance(ListExternalApisResponse.getDefaultInstance()) .setDefaultTypeRegistry(typeRegistry) .build()) .build(); private static final ApiMethodDescriptor listLocationsMethodDescriptor = ApiMethodDescriptor.newBuilder() .setFullMethodName("google.cloud.location.Locations/ListLocations") .setHttpMethod("GET") .setType(ApiMethodDescriptor.MethodType.UNARY) .setRequestFormatter( ProtoMessageRequestFormatter.newBuilder() .setPath( "/v1/{name=projects/*}/locations", 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, "$alt", "json;enum-encoding=int"); return fields; }) .setRequestBodyExtractor(request -> null) .build()) .setResponseParser( ProtoMessageResponseParser.newBuilder() .setDefaultInstance(ListLocationsResponse.getDefaultInstance()) .setDefaultTypeRegistry(typeRegistry) .build()) .build(); private static final ApiMethodDescriptor getLocationMethodDescriptor = ApiMethodDescriptor.newBuilder() .setFullMethodName("google.cloud.location.Locations/GetLocation") .setHttpMethod("GET") .setType(ApiMethodDescriptor.MethodType.UNARY) .setRequestFormatter( ProtoMessageRequestFormatter.newBuilder() .setPath( "/v1/{name=projects/*/locations/*}", 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, "$alt", "json;enum-encoding=int"); return fields; }) .setRequestBodyExtractor(request -> null) .build()) .setResponseParser( ProtoMessageResponseParser.newBuilder() .setDefaultInstance(Location.getDefaultInstance()) .setDefaultTypeRegistry(typeRegistry) .build()) .build(); private final UnaryCallable createApiCallable; private final UnaryCallable getApiCallable; private final UnaryCallable listApisCallable; private final UnaryCallable listApisPagedCallable; private final UnaryCallable updateApiCallable; private final UnaryCallable deleteApiCallable; private final UnaryCallable createVersionCallable; private final UnaryCallable getVersionCallable; private final UnaryCallable listVersionsCallable; private final UnaryCallable listVersionsPagedCallable; private final UnaryCallable updateVersionCallable; private final UnaryCallable deleteVersionCallable; private final UnaryCallable createSpecCallable; private final UnaryCallable getSpecCallable; private final UnaryCallable getSpecContentsCallable; private final UnaryCallable listSpecsCallable; private final UnaryCallable listSpecsPagedCallable; private final UnaryCallable updateSpecCallable; private final UnaryCallable deleteSpecCallable; private final UnaryCallable getApiOperationCallable; private final UnaryCallable listApiOperationsCallable; private final UnaryCallable listApiOperationsPagedCallable; private final UnaryCallable getDefinitionCallable; private final UnaryCallable createDeploymentCallable; private final UnaryCallable getDeploymentCallable; private final UnaryCallable listDeploymentsCallable; private final UnaryCallable listDeploymentsPagedCallable; private final UnaryCallable updateDeploymentCallable; private final UnaryCallable deleteDeploymentCallable; private final UnaryCallable createAttributeCallable; private final UnaryCallable getAttributeCallable; private final UnaryCallable updateAttributeCallable; private final UnaryCallable deleteAttributeCallable; private final UnaryCallable listAttributesCallable; private final UnaryCallable listAttributesPagedCallable; private final UnaryCallable searchResourcesCallable; private final UnaryCallable searchResourcesPagedCallable; private final UnaryCallable createExternalApiCallable; private final UnaryCallable getExternalApiCallable; private final UnaryCallable updateExternalApiCallable; private final UnaryCallable deleteExternalApiCallable; private final UnaryCallable listExternalApisCallable; private final UnaryCallable listExternalApisPagedCallable; private final UnaryCallable listLocationsCallable; private final UnaryCallable listLocationsPagedCallable; private final UnaryCallable getLocationCallable; private final BackgroundResource backgroundResources; private final HttpJsonStubCallableFactory callableFactory; public static final HttpJsonApiHubStub create(ApiHubStubSettings settings) throws IOException { return new HttpJsonApiHubStub(settings, ClientContext.create(settings)); } public static final HttpJsonApiHubStub create(ClientContext clientContext) throws IOException { return new HttpJsonApiHubStub(ApiHubStubSettings.newBuilder().build(), clientContext); } public static final HttpJsonApiHubStub create( ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { return new HttpJsonApiHubStub( ApiHubStubSettings.newBuilder().build(), clientContext, callableFactory); } /** * Constructs an instance of HttpJsonApiHubStub, 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 HttpJsonApiHubStub(ApiHubStubSettings settings, ClientContext clientContext) throws IOException { this(settings, clientContext, new HttpJsonApiHubCallableFactory()); } /** * Constructs an instance of HttpJsonApiHubStub, 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 HttpJsonApiHubStub( ApiHubStubSettings settings, ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { this.callableFactory = callableFactory; HttpJsonCallSettings createApiTransportSettings = HttpJsonCallSettings.newBuilder() .setMethodDescriptor(createApiMethodDescriptor) .setTypeRegistry(typeRegistry) .setParamsExtractor( request -> { RequestParamsBuilder builder = RequestParamsBuilder.create(); builder.add("parent", String.valueOf(request.getParent())); return builder.build(); }) .build(); HttpJsonCallSettings getApiTransportSettings = HttpJsonCallSettings.newBuilder() .setMethodDescriptor(getApiMethodDescriptor) .setTypeRegistry(typeRegistry) .setParamsExtractor( request -> { RequestParamsBuilder builder = RequestParamsBuilder.create(); builder.add("name", String.valueOf(request.getName())); return builder.build(); }) .build(); HttpJsonCallSettings listApisTransportSettings = HttpJsonCallSettings.newBuilder() .setMethodDescriptor(listApisMethodDescriptor) .setTypeRegistry(typeRegistry) .setParamsExtractor( request -> { RequestParamsBuilder builder = RequestParamsBuilder.create(); builder.add("parent", String.valueOf(request.getParent())); return builder.build(); }) .build(); HttpJsonCallSettings updateApiTransportSettings = HttpJsonCallSettings.newBuilder() .setMethodDescriptor(updateApiMethodDescriptor) .setTypeRegistry(typeRegistry) .setParamsExtractor( request -> { RequestParamsBuilder builder = RequestParamsBuilder.create(); builder.add("api.name", String.valueOf(request.getApi().getName())); return builder.build(); }) .build(); HttpJsonCallSettings deleteApiTransportSettings = HttpJsonCallSettings.newBuilder() .setMethodDescriptor(deleteApiMethodDescriptor) .setTypeRegistry(typeRegistry) .setParamsExtractor( request -> { RequestParamsBuilder builder = RequestParamsBuilder.create(); builder.add("name", String.valueOf(request.getName())); return builder.build(); }) .build(); HttpJsonCallSettings createVersionTransportSettings = HttpJsonCallSettings.newBuilder() .setMethodDescriptor(createVersionMethodDescriptor) .setTypeRegistry(typeRegistry) .setParamsExtractor( request -> { RequestParamsBuilder builder = RequestParamsBuilder.create(); builder.add("parent", String.valueOf(request.getParent())); return builder.build(); }) .build(); HttpJsonCallSettings getVersionTransportSettings = HttpJsonCallSettings.newBuilder() .setMethodDescriptor(getVersionMethodDescriptor) .setTypeRegistry(typeRegistry) .setParamsExtractor( request -> { RequestParamsBuilder builder = RequestParamsBuilder.create(); builder.add("name", String.valueOf(request.getName())); return builder.build(); }) .build(); HttpJsonCallSettings listVersionsTransportSettings = HttpJsonCallSettings.newBuilder() .setMethodDescriptor(listVersionsMethodDescriptor) .setTypeRegistry(typeRegistry) .setParamsExtractor( request -> { RequestParamsBuilder builder = RequestParamsBuilder.create(); builder.add("parent", String.valueOf(request.getParent())); return builder.build(); }) .build(); HttpJsonCallSettings updateVersionTransportSettings = HttpJsonCallSettings.newBuilder() .setMethodDescriptor(updateVersionMethodDescriptor) .setTypeRegistry(typeRegistry) .setParamsExtractor( request -> { RequestParamsBuilder builder = RequestParamsBuilder.create(); builder.add("version.name", String.valueOf(request.getVersion().getName())); return builder.build(); }) .build(); HttpJsonCallSettings deleteVersionTransportSettings = HttpJsonCallSettings.newBuilder() .setMethodDescriptor(deleteVersionMethodDescriptor) .setTypeRegistry(typeRegistry) .setParamsExtractor( request -> { RequestParamsBuilder builder = RequestParamsBuilder.create(); builder.add("name", String.valueOf(request.getName())); return builder.build(); }) .build(); HttpJsonCallSettings createSpecTransportSettings = HttpJsonCallSettings.newBuilder() .setMethodDescriptor(createSpecMethodDescriptor) .setTypeRegistry(typeRegistry) .setParamsExtractor( request -> { RequestParamsBuilder builder = RequestParamsBuilder.create(); builder.add("parent", String.valueOf(request.getParent())); return builder.build(); }) .build(); HttpJsonCallSettings getSpecTransportSettings = HttpJsonCallSettings.newBuilder() .setMethodDescriptor(getSpecMethodDescriptor) .setTypeRegistry(typeRegistry) .setParamsExtractor( request -> { RequestParamsBuilder builder = RequestParamsBuilder.create(); builder.add("name", String.valueOf(request.getName())); return builder.build(); }) .build(); HttpJsonCallSettings getSpecContentsTransportSettings = HttpJsonCallSettings.newBuilder() .setMethodDescriptor(getSpecContentsMethodDescriptor) .setTypeRegistry(typeRegistry) .setParamsExtractor( request -> { RequestParamsBuilder builder = RequestParamsBuilder.create(); builder.add("name", String.valueOf(request.getName())); return builder.build(); }) .build(); HttpJsonCallSettings listSpecsTransportSettings = HttpJsonCallSettings.newBuilder() .setMethodDescriptor(listSpecsMethodDescriptor) .setTypeRegistry(typeRegistry) .setParamsExtractor( request -> { RequestParamsBuilder builder = RequestParamsBuilder.create(); builder.add("parent", String.valueOf(request.getParent())); return builder.build(); }) .build(); HttpJsonCallSettings updateSpecTransportSettings = HttpJsonCallSettings.newBuilder() .setMethodDescriptor(updateSpecMethodDescriptor) .setTypeRegistry(typeRegistry) .setParamsExtractor( request -> { RequestParamsBuilder builder = RequestParamsBuilder.create(); builder.add("spec.name", String.valueOf(request.getSpec().getName())); return builder.build(); }) .build(); HttpJsonCallSettings deleteSpecTransportSettings = HttpJsonCallSettings.newBuilder() .setMethodDescriptor(deleteSpecMethodDescriptor) .setTypeRegistry(typeRegistry) .setParamsExtractor( request -> { RequestParamsBuilder builder = RequestParamsBuilder.create(); builder.add("name", String.valueOf(request.getName())); return builder.build(); }) .build(); HttpJsonCallSettings getApiOperationTransportSettings = HttpJsonCallSettings.newBuilder() .setMethodDescriptor(getApiOperationMethodDescriptor) .setTypeRegistry(typeRegistry) .setParamsExtractor( request -> { RequestParamsBuilder builder = RequestParamsBuilder.create(); builder.add("name", String.valueOf(request.getName())); return builder.build(); }) .build(); HttpJsonCallSettings listApiOperationsTransportSettings = HttpJsonCallSettings.newBuilder() .setMethodDescriptor(listApiOperationsMethodDescriptor) .setTypeRegistry(typeRegistry) .setParamsExtractor( request -> { RequestParamsBuilder builder = RequestParamsBuilder.create(); builder.add("parent", String.valueOf(request.getParent())); return builder.build(); }) .build(); HttpJsonCallSettings getDefinitionTransportSettings = HttpJsonCallSettings.newBuilder() .setMethodDescriptor(getDefinitionMethodDescriptor) .setTypeRegistry(typeRegistry) .setParamsExtractor( request -> { RequestParamsBuilder builder = RequestParamsBuilder.create(); builder.add("name", String.valueOf(request.getName())); return builder.build(); }) .build(); HttpJsonCallSettings createDeploymentTransportSettings = HttpJsonCallSettings.newBuilder() .setMethodDescriptor(createDeploymentMethodDescriptor) .setTypeRegistry(typeRegistry) .setParamsExtractor( request -> { RequestParamsBuilder builder = RequestParamsBuilder.create(); builder.add("parent", String.valueOf(request.getParent())); return builder.build(); }) .build(); HttpJsonCallSettings getDeploymentTransportSettings = HttpJsonCallSettings.newBuilder() .setMethodDescriptor(getDeploymentMethodDescriptor) .setTypeRegistry(typeRegistry) .setParamsExtractor( request -> { RequestParamsBuilder builder = RequestParamsBuilder.create(); builder.add("name", String.valueOf(request.getName())); return builder.build(); }) .build(); HttpJsonCallSettings listDeploymentsTransportSettings = HttpJsonCallSettings.newBuilder() .setMethodDescriptor(listDeploymentsMethodDescriptor) .setTypeRegistry(typeRegistry) .setParamsExtractor( request -> { RequestParamsBuilder builder = RequestParamsBuilder.create(); builder.add("parent", String.valueOf(request.getParent())); return builder.build(); }) .build(); HttpJsonCallSettings updateDeploymentTransportSettings = HttpJsonCallSettings.newBuilder() .setMethodDescriptor(updateDeploymentMethodDescriptor) .setTypeRegistry(typeRegistry) .setParamsExtractor( request -> { RequestParamsBuilder builder = RequestParamsBuilder.create(); builder.add("deployment.name", String.valueOf(request.getDeployment().getName())); return builder.build(); }) .build(); HttpJsonCallSettings deleteDeploymentTransportSettings = HttpJsonCallSettings.newBuilder() .setMethodDescriptor(deleteDeploymentMethodDescriptor) .setTypeRegistry(typeRegistry) .setParamsExtractor( request -> { RequestParamsBuilder builder = RequestParamsBuilder.create(); builder.add("name", String.valueOf(request.getName())); return builder.build(); }) .build(); HttpJsonCallSettings createAttributeTransportSettings = HttpJsonCallSettings.newBuilder() .setMethodDescriptor(createAttributeMethodDescriptor) .setTypeRegistry(typeRegistry) .setParamsExtractor( request -> { RequestParamsBuilder builder = RequestParamsBuilder.create(); builder.add("parent", String.valueOf(request.getParent())); return builder.build(); }) .build(); HttpJsonCallSettings getAttributeTransportSettings = HttpJsonCallSettings.newBuilder() .setMethodDescriptor(getAttributeMethodDescriptor) .setTypeRegistry(typeRegistry) .setParamsExtractor( request -> { RequestParamsBuilder builder = RequestParamsBuilder.create(); builder.add("name", String.valueOf(request.getName())); return builder.build(); }) .build(); HttpJsonCallSettings updateAttributeTransportSettings = HttpJsonCallSettings.newBuilder() .setMethodDescriptor(updateAttributeMethodDescriptor) .setTypeRegistry(typeRegistry) .setParamsExtractor( request -> { RequestParamsBuilder builder = RequestParamsBuilder.create(); builder.add("attribute.name", String.valueOf(request.getAttribute().getName())); return builder.build(); }) .build(); HttpJsonCallSettings deleteAttributeTransportSettings = HttpJsonCallSettings.newBuilder() .setMethodDescriptor(deleteAttributeMethodDescriptor) .setTypeRegistry(typeRegistry) .setParamsExtractor( request -> { RequestParamsBuilder builder = RequestParamsBuilder.create(); builder.add("name", String.valueOf(request.getName())); return builder.build(); }) .build(); HttpJsonCallSettings listAttributesTransportSettings = HttpJsonCallSettings.newBuilder() .setMethodDescriptor(listAttributesMethodDescriptor) .setTypeRegistry(typeRegistry) .setParamsExtractor( request -> { RequestParamsBuilder builder = RequestParamsBuilder.create(); builder.add("parent", String.valueOf(request.getParent())); return builder.build(); }) .build(); HttpJsonCallSettings searchResourcesTransportSettings = HttpJsonCallSettings.newBuilder() .setMethodDescriptor(searchResourcesMethodDescriptor) .setTypeRegistry(typeRegistry) .setParamsExtractor( request -> { RequestParamsBuilder builder = RequestParamsBuilder.create(); builder.add("location", String.valueOf(request.getLocation())); return builder.build(); }) .build(); HttpJsonCallSettings createExternalApiTransportSettings = HttpJsonCallSettings.newBuilder() .setMethodDescriptor(createExternalApiMethodDescriptor) .setTypeRegistry(typeRegistry) .setParamsExtractor( request -> { RequestParamsBuilder builder = RequestParamsBuilder.create(); builder.add("parent", String.valueOf(request.getParent())); return builder.build(); }) .build(); HttpJsonCallSettings getExternalApiTransportSettings = HttpJsonCallSettings.newBuilder() .setMethodDescriptor(getExternalApiMethodDescriptor) .setTypeRegistry(typeRegistry) .setParamsExtractor( request -> { RequestParamsBuilder builder = RequestParamsBuilder.create(); builder.add("name", String.valueOf(request.getName())); return builder.build(); }) .build(); HttpJsonCallSettings updateExternalApiTransportSettings = HttpJsonCallSettings.newBuilder() .setMethodDescriptor(updateExternalApiMethodDescriptor) .setTypeRegistry(typeRegistry) .setParamsExtractor( request -> { RequestParamsBuilder builder = RequestParamsBuilder.create(); builder.add( "external_api.name", String.valueOf(request.getExternalApi().getName())); return builder.build(); }) .build(); HttpJsonCallSettings deleteExternalApiTransportSettings = HttpJsonCallSettings.newBuilder() .setMethodDescriptor(deleteExternalApiMethodDescriptor) .setTypeRegistry(typeRegistry) .setParamsExtractor( request -> { RequestParamsBuilder builder = RequestParamsBuilder.create(); builder.add("name", String.valueOf(request.getName())); return builder.build(); }) .build(); HttpJsonCallSettings listExternalApisTransportSettings = HttpJsonCallSettings.newBuilder() .setMethodDescriptor(listExternalApisMethodDescriptor) .setTypeRegistry(typeRegistry) .setParamsExtractor( request -> { RequestParamsBuilder builder = RequestParamsBuilder.create(); builder.add("parent", String.valueOf(request.getParent())); return builder.build(); }) .build(); HttpJsonCallSettings listLocationsTransportSettings = HttpJsonCallSettings.newBuilder() .setMethodDescriptor(listLocationsMethodDescriptor) .setTypeRegistry(typeRegistry) .setParamsExtractor( request -> { RequestParamsBuilder builder = RequestParamsBuilder.create(); builder.add("name", String.valueOf(request.getName())); return builder.build(); }) .build(); HttpJsonCallSettings getLocationTransportSettings = HttpJsonCallSettings.newBuilder() .setMethodDescriptor(getLocationMethodDescriptor) .setTypeRegistry(typeRegistry) .setParamsExtractor( request -> { RequestParamsBuilder builder = RequestParamsBuilder.create(); builder.add("name", String.valueOf(request.getName())); return builder.build(); }) .build(); this.createApiCallable = callableFactory.createUnaryCallable( createApiTransportSettings, settings.createApiSettings(), clientContext); this.getApiCallable = callableFactory.createUnaryCallable( getApiTransportSettings, settings.getApiSettings(), clientContext); this.listApisCallable = callableFactory.createUnaryCallable( listApisTransportSettings, settings.listApisSettings(), clientContext); this.listApisPagedCallable = callableFactory.createPagedCallable( listApisTransportSettings, settings.listApisSettings(), clientContext); this.updateApiCallable = callableFactory.createUnaryCallable( updateApiTransportSettings, settings.updateApiSettings(), clientContext); this.deleteApiCallable = callableFactory.createUnaryCallable( deleteApiTransportSettings, settings.deleteApiSettings(), clientContext); this.createVersionCallable = callableFactory.createUnaryCallable( createVersionTransportSettings, settings.createVersionSettings(), clientContext); this.getVersionCallable = callableFactory.createUnaryCallable( getVersionTransportSettings, settings.getVersionSettings(), clientContext); this.listVersionsCallable = callableFactory.createUnaryCallable( listVersionsTransportSettings, settings.listVersionsSettings(), clientContext); this.listVersionsPagedCallable = callableFactory.createPagedCallable( listVersionsTransportSettings, settings.listVersionsSettings(), clientContext); this.updateVersionCallable = callableFactory.createUnaryCallable( updateVersionTransportSettings, settings.updateVersionSettings(), clientContext); this.deleteVersionCallable = callableFactory.createUnaryCallable( deleteVersionTransportSettings, settings.deleteVersionSettings(), clientContext); this.createSpecCallable = callableFactory.createUnaryCallable( createSpecTransportSettings, settings.createSpecSettings(), clientContext); this.getSpecCallable = callableFactory.createUnaryCallable( getSpecTransportSettings, settings.getSpecSettings(), clientContext); this.getSpecContentsCallable = callableFactory.createUnaryCallable( getSpecContentsTransportSettings, settings.getSpecContentsSettings(), clientContext); this.listSpecsCallable = callableFactory.createUnaryCallable( listSpecsTransportSettings, settings.listSpecsSettings(), clientContext); this.listSpecsPagedCallable = callableFactory.createPagedCallable( listSpecsTransportSettings, settings.listSpecsSettings(), clientContext); this.updateSpecCallable = callableFactory.createUnaryCallable( updateSpecTransportSettings, settings.updateSpecSettings(), clientContext); this.deleteSpecCallable = callableFactory.createUnaryCallable( deleteSpecTransportSettings, settings.deleteSpecSettings(), clientContext); this.getApiOperationCallable = callableFactory.createUnaryCallable( getApiOperationTransportSettings, settings.getApiOperationSettings(), clientContext); this.listApiOperationsCallable = callableFactory.createUnaryCallable( listApiOperationsTransportSettings, settings.listApiOperationsSettings(), clientContext); this.listApiOperationsPagedCallable = callableFactory.createPagedCallable( listApiOperationsTransportSettings, settings.listApiOperationsSettings(), clientContext); this.getDefinitionCallable = callableFactory.createUnaryCallable( getDefinitionTransportSettings, settings.getDefinitionSettings(), clientContext); this.createDeploymentCallable = callableFactory.createUnaryCallable( createDeploymentTransportSettings, settings.createDeploymentSettings(), clientContext); this.getDeploymentCallable = callableFactory.createUnaryCallable( getDeploymentTransportSettings, settings.getDeploymentSettings(), clientContext); this.listDeploymentsCallable = callableFactory.createUnaryCallable( listDeploymentsTransportSettings, settings.listDeploymentsSettings(), clientContext); this.listDeploymentsPagedCallable = callableFactory.createPagedCallable( listDeploymentsTransportSettings, settings.listDeploymentsSettings(), clientContext); this.updateDeploymentCallable = callableFactory.createUnaryCallable( updateDeploymentTransportSettings, settings.updateDeploymentSettings(), clientContext); this.deleteDeploymentCallable = callableFactory.createUnaryCallable( deleteDeploymentTransportSettings, settings.deleteDeploymentSettings(), clientContext); this.createAttributeCallable = callableFactory.createUnaryCallable( createAttributeTransportSettings, settings.createAttributeSettings(), clientContext); this.getAttributeCallable = callableFactory.createUnaryCallable( getAttributeTransportSettings, settings.getAttributeSettings(), clientContext); this.updateAttributeCallable = callableFactory.createUnaryCallable( updateAttributeTransportSettings, settings.updateAttributeSettings(), clientContext); this.deleteAttributeCallable = callableFactory.createUnaryCallable( deleteAttributeTransportSettings, settings.deleteAttributeSettings(), clientContext); this.listAttributesCallable = callableFactory.createUnaryCallable( listAttributesTransportSettings, settings.listAttributesSettings(), clientContext); this.listAttributesPagedCallable = callableFactory.createPagedCallable( listAttributesTransportSettings, settings.listAttributesSettings(), clientContext); this.searchResourcesCallable = callableFactory.createUnaryCallable( searchResourcesTransportSettings, settings.searchResourcesSettings(), clientContext); this.searchResourcesPagedCallable = callableFactory.createPagedCallable( searchResourcesTransportSettings, settings.searchResourcesSettings(), clientContext); this.createExternalApiCallable = callableFactory.createUnaryCallable( createExternalApiTransportSettings, settings.createExternalApiSettings(), clientContext); this.getExternalApiCallable = callableFactory.createUnaryCallable( getExternalApiTransportSettings, settings.getExternalApiSettings(), clientContext); this.updateExternalApiCallable = callableFactory.createUnaryCallable( updateExternalApiTransportSettings, settings.updateExternalApiSettings(), clientContext); this.deleteExternalApiCallable = callableFactory.createUnaryCallable( deleteExternalApiTransportSettings, settings.deleteExternalApiSettings(), clientContext); this.listExternalApisCallable = callableFactory.createUnaryCallable( listExternalApisTransportSettings, settings.listExternalApisSettings(), clientContext); this.listExternalApisPagedCallable = callableFactory.createPagedCallable( listExternalApisTransportSettings, settings.listExternalApisSettings(), clientContext); this.listLocationsCallable = callableFactory.createUnaryCallable( listLocationsTransportSettings, settings.listLocationsSettings(), clientContext); this.listLocationsPagedCallable = callableFactory.createPagedCallable( listLocationsTransportSettings, settings.listLocationsSettings(), clientContext); this.getLocationCallable = callableFactory.createUnaryCallable( getLocationTransportSettings, settings.getLocationSettings(), clientContext); this.backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources()); } @InternalApi public static List getMethodDescriptors() { List methodDescriptors = new ArrayList<>(); methodDescriptors.add(createApiMethodDescriptor); methodDescriptors.add(getApiMethodDescriptor); methodDescriptors.add(listApisMethodDescriptor); methodDescriptors.add(updateApiMethodDescriptor); methodDescriptors.add(deleteApiMethodDescriptor); methodDescriptors.add(createVersionMethodDescriptor); methodDescriptors.add(getVersionMethodDescriptor); methodDescriptors.add(listVersionsMethodDescriptor); methodDescriptors.add(updateVersionMethodDescriptor); methodDescriptors.add(deleteVersionMethodDescriptor); methodDescriptors.add(createSpecMethodDescriptor); methodDescriptors.add(getSpecMethodDescriptor); methodDescriptors.add(getSpecContentsMethodDescriptor); methodDescriptors.add(listSpecsMethodDescriptor); methodDescriptors.add(updateSpecMethodDescriptor); methodDescriptors.add(deleteSpecMethodDescriptor); methodDescriptors.add(getApiOperationMethodDescriptor); methodDescriptors.add(listApiOperationsMethodDescriptor); methodDescriptors.add(getDefinitionMethodDescriptor); methodDescriptors.add(createDeploymentMethodDescriptor); methodDescriptors.add(getDeploymentMethodDescriptor); methodDescriptors.add(listDeploymentsMethodDescriptor); methodDescriptors.add(updateDeploymentMethodDescriptor); methodDescriptors.add(deleteDeploymentMethodDescriptor); methodDescriptors.add(createAttributeMethodDescriptor); methodDescriptors.add(getAttributeMethodDescriptor); methodDescriptors.add(updateAttributeMethodDescriptor); methodDescriptors.add(deleteAttributeMethodDescriptor); methodDescriptors.add(listAttributesMethodDescriptor); methodDescriptors.add(searchResourcesMethodDescriptor); methodDescriptors.add(createExternalApiMethodDescriptor); methodDescriptors.add(getExternalApiMethodDescriptor); methodDescriptors.add(updateExternalApiMethodDescriptor); methodDescriptors.add(deleteExternalApiMethodDescriptor); methodDescriptors.add(listExternalApisMethodDescriptor); methodDescriptors.add(listLocationsMethodDescriptor); methodDescriptors.add(getLocationMethodDescriptor); return methodDescriptors; } @Override public UnaryCallable createApiCallable() { return createApiCallable; } @Override public UnaryCallable getApiCallable() { return getApiCallable; } @Override public UnaryCallable listApisCallable() { return listApisCallable; } @Override public UnaryCallable listApisPagedCallable() { return listApisPagedCallable; } @Override public UnaryCallable updateApiCallable() { return updateApiCallable; } @Override public UnaryCallable deleteApiCallable() { return deleteApiCallable; } @Override public UnaryCallable createVersionCallable() { return createVersionCallable; } @Override public UnaryCallable getVersionCallable() { return getVersionCallable; } @Override public UnaryCallable listVersionsCallable() { return listVersionsCallable; } @Override public UnaryCallable listVersionsPagedCallable() { return listVersionsPagedCallable; } @Override public UnaryCallable updateVersionCallable() { return updateVersionCallable; } @Override public UnaryCallable deleteVersionCallable() { return deleteVersionCallable; } @Override public UnaryCallable createSpecCallable() { return createSpecCallable; } @Override public UnaryCallable getSpecCallable() { return getSpecCallable; } @Override public UnaryCallable getSpecContentsCallable() { return getSpecContentsCallable; } @Override public UnaryCallable listSpecsCallable() { return listSpecsCallable; } @Override public UnaryCallable listSpecsPagedCallable() { return listSpecsPagedCallable; } @Override public UnaryCallable updateSpecCallable() { return updateSpecCallable; } @Override public UnaryCallable deleteSpecCallable() { return deleteSpecCallable; } @Override public UnaryCallable getApiOperationCallable() { return getApiOperationCallable; } @Override public UnaryCallable listApiOperationsCallable() { return listApiOperationsCallable; } @Override public UnaryCallable listApiOperationsPagedCallable() { return listApiOperationsPagedCallable; } @Override public UnaryCallable getDefinitionCallable() { return getDefinitionCallable; } @Override public UnaryCallable createDeploymentCallable() { return createDeploymentCallable; } @Override public UnaryCallable getDeploymentCallable() { return getDeploymentCallable; } @Override public UnaryCallable listDeploymentsCallable() { return listDeploymentsCallable; } @Override public UnaryCallable listDeploymentsPagedCallable() { return listDeploymentsPagedCallable; } @Override public UnaryCallable updateDeploymentCallable() { return updateDeploymentCallable; } @Override public UnaryCallable deleteDeploymentCallable() { return deleteDeploymentCallable; } @Override public UnaryCallable createAttributeCallable() { return createAttributeCallable; } @Override public UnaryCallable getAttributeCallable() { return getAttributeCallable; } @Override public UnaryCallable updateAttributeCallable() { return updateAttributeCallable; } @Override public UnaryCallable deleteAttributeCallable() { return deleteAttributeCallable; } @Override public UnaryCallable listAttributesCallable() { return listAttributesCallable; } @Override public UnaryCallable listAttributesPagedCallable() { return listAttributesPagedCallable; } @Override public UnaryCallable searchResourcesCallable() { return searchResourcesCallable; } @Override public UnaryCallable searchResourcesPagedCallable() { return searchResourcesPagedCallable; } @Override public UnaryCallable createExternalApiCallable() { return createExternalApiCallable; } @Override public UnaryCallable getExternalApiCallable() { return getExternalApiCallable; } @Override public UnaryCallable updateExternalApiCallable() { return updateExternalApiCallable; } @Override public UnaryCallable deleteExternalApiCallable() { return deleteExternalApiCallable; } @Override public UnaryCallable listExternalApisCallable() { return listExternalApisCallable; } @Override public UnaryCallable listExternalApisPagedCallable() { return listExternalApisPagedCallable; } @Override public UnaryCallable listLocationsCallable() { return listLocationsCallable; } @Override public UnaryCallable listLocationsPagedCallable() { return listLocationsPagedCallable; } @Override public UnaryCallable getLocationCallable() { return getLocationCallable; } @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 - 2024 Weber Informatics LLC | Privacy Policy