com.google.cloud.apihub.v1.stub.ApiHubStubSettings Maven / Gradle / Ivy
Show all versions of google-cloud-apihub Show documentation
/*
* Copyright 2024 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.google.cloud.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.ApiFunction;
import com.google.api.core.ApiFuture;
import com.google.api.core.ObsoleteApi;
import com.google.api.gax.core.GaxProperties;
import com.google.api.gax.core.GoogleCredentialsProvider;
import com.google.api.gax.core.InstantiatingExecutorProvider;
import com.google.api.gax.httpjson.GaxHttpJsonProperties;
import com.google.api.gax.httpjson.HttpJsonTransportChannel;
import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider;
import com.google.api.gax.retrying.RetrySettings;
import com.google.api.gax.rpc.ApiCallContext;
import com.google.api.gax.rpc.ApiClientHeaderProvider;
import com.google.api.gax.rpc.ClientContext;
import com.google.api.gax.rpc.PageContext;
import com.google.api.gax.rpc.PagedCallSettings;
import com.google.api.gax.rpc.PagedListDescriptor;
import com.google.api.gax.rpc.PagedListResponseFactory;
import com.google.api.gax.rpc.StatusCode;
import com.google.api.gax.rpc.StubSettings;
import com.google.api.gax.rpc.TransportChannelProvider;
import com.google.api.gax.rpc.UnaryCallSettings;
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.SearchResult;
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.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.ImmutableSet;
import com.google.common.collect.Lists;
import com.google.protobuf.Empty;
import java.io.IOException;
import java.util.List;
import javax.annotation.Generated;
import org.threeten.bp.Duration;
// AUTO-GENERATED DOCUMENTATION AND CLASS.
/**
* Settings class to configure an instance of {@link ApiHubStub}.
*
* The default instance has everything set to sensible defaults:
*
*
* - The default service address (apihub.googleapis.com) and default port (443) are used.
*
- Credentials are acquired automatically through Application Default Credentials.
*
- Retries are configured for idempotent methods but not for non-idempotent methods.
*
*
* The builder of this class is recursive, so contained classes are themselves builders. When
* build() is called, the tree of builders is called to create the complete settings object.
*
*
For example, to set the
* [RetrySettings](https://cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.retrying.RetrySettings)
* of createApi:
*
*
{@code
* // This snippet has been automatically generated and should be regarded as a code template only.
* // It will require modifications to work:
* // - It may require correct/in-range values for request initialization.
* // - It may require specifying regional endpoints when creating the service client as shown in
* // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
* ApiHubStubSettings.Builder apiHubSettingsBuilder = ApiHubStubSettings.newBuilder();
* apiHubSettingsBuilder
* .createApiSettings()
* .setRetrySettings(
* apiHubSettingsBuilder
* .createApiSettings()
* .getRetrySettings()
* .toBuilder()
* .setInitialRetryDelayDuration(Duration.ofSeconds(1))
* .setInitialRpcTimeoutDuration(Duration.ofSeconds(5))
* .setMaxAttempts(5)
* .setMaxRetryDelayDuration(Duration.ofSeconds(30))
* .setMaxRpcTimeoutDuration(Duration.ofSeconds(60))
* .setRetryDelayMultiplier(1.3)
* .setRpcTimeoutMultiplier(1.5)
* .setTotalTimeoutDuration(Duration.ofSeconds(300))
* .build());
* ApiHubStubSettings apiHubSettings = apiHubSettingsBuilder.build();
* }
*
* Please refer to the [Client Side Retry
* Guide](https://github.com/googleapis/google-cloud-java/blob/main/docs/client_retries.md) for
* additional support in setting retries.
*/
@Generated("by gapic-generator-java")
public class ApiHubStubSettings extends StubSettings {
/** The default scopes of the service. */
private static final ImmutableList DEFAULT_SERVICE_SCOPES =
ImmutableList.builder().add("https://www.googleapis.com/auth/cloud-platform").build();
private final UnaryCallSettings createApiSettings;
private final UnaryCallSettings getApiSettings;
private final PagedCallSettings
listApisSettings;
private final UnaryCallSettings updateApiSettings;
private final UnaryCallSettings deleteApiSettings;
private final UnaryCallSettings createVersionSettings;
private final UnaryCallSettings getVersionSettings;
private final PagedCallSettings<
ListVersionsRequest, ListVersionsResponse, ListVersionsPagedResponse>
listVersionsSettings;
private final UnaryCallSettings updateVersionSettings;
private final UnaryCallSettings deleteVersionSettings;
private final UnaryCallSettings createSpecSettings;
private final UnaryCallSettings getSpecSettings;
private final UnaryCallSettings getSpecContentsSettings;
private final PagedCallSettings
listSpecsSettings;
private final UnaryCallSettings updateSpecSettings;
private final UnaryCallSettings deleteSpecSettings;
private final UnaryCallSettings getApiOperationSettings;
private final PagedCallSettings<
ListApiOperationsRequest, ListApiOperationsResponse, ListApiOperationsPagedResponse>
listApiOperationsSettings;
private final UnaryCallSettings getDefinitionSettings;
private final UnaryCallSettings createDeploymentSettings;
private final UnaryCallSettings getDeploymentSettings;
private final PagedCallSettings<
ListDeploymentsRequest, ListDeploymentsResponse, ListDeploymentsPagedResponse>
listDeploymentsSettings;
private final UnaryCallSettings updateDeploymentSettings;
private final UnaryCallSettings deleteDeploymentSettings;
private final UnaryCallSettings createAttributeSettings;
private final UnaryCallSettings getAttributeSettings;
private final UnaryCallSettings updateAttributeSettings;
private final UnaryCallSettings deleteAttributeSettings;
private final PagedCallSettings<
ListAttributesRequest, ListAttributesResponse, ListAttributesPagedResponse>
listAttributesSettings;
private final PagedCallSettings<
SearchResourcesRequest, SearchResourcesResponse, SearchResourcesPagedResponse>
searchResourcesSettings;
private final UnaryCallSettings createExternalApiSettings;
private final UnaryCallSettings getExternalApiSettings;
private final UnaryCallSettings updateExternalApiSettings;
private final UnaryCallSettings deleteExternalApiSettings;
private final PagedCallSettings<
ListExternalApisRequest, ListExternalApisResponse, ListExternalApisPagedResponse>
listExternalApisSettings;
private final PagedCallSettings<
ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse>
listLocationsSettings;
private final UnaryCallSettings getLocationSettings;
private static final PagedListDescriptor
LIST_APIS_PAGE_STR_DESC =
new PagedListDescriptor() {
@Override
public String emptyToken() {
return "";
}
@Override
public ListApisRequest injectToken(ListApisRequest payload, String token) {
return ListApisRequest.newBuilder(payload).setPageToken(token).build();
}
@Override
public ListApisRequest injectPageSize(ListApisRequest payload, int pageSize) {
return ListApisRequest.newBuilder(payload).setPageSize(pageSize).build();
}
@Override
public Integer extractPageSize(ListApisRequest payload) {
return payload.getPageSize();
}
@Override
public String extractNextToken(ListApisResponse payload) {
return payload.getNextPageToken();
}
@Override
public Iterable extractResources(ListApisResponse payload) {
return payload.getApisList();
}
};
private static final PagedListDescriptor
LIST_VERSIONS_PAGE_STR_DESC =
new PagedListDescriptor() {
@Override
public String emptyToken() {
return "";
}
@Override
public ListVersionsRequest injectToken(ListVersionsRequest payload, String token) {
return ListVersionsRequest.newBuilder(payload).setPageToken(token).build();
}
@Override
public ListVersionsRequest injectPageSize(ListVersionsRequest payload, int pageSize) {
return ListVersionsRequest.newBuilder(payload).setPageSize(pageSize).build();
}
@Override
public Integer extractPageSize(ListVersionsRequest payload) {
return payload.getPageSize();
}
@Override
public String extractNextToken(ListVersionsResponse payload) {
return payload.getNextPageToken();
}
@Override
public Iterable extractResources(ListVersionsResponse payload) {
return payload.getVersionsList();
}
};
private static final PagedListDescriptor
LIST_SPECS_PAGE_STR_DESC =
new PagedListDescriptor() {
@Override
public String emptyToken() {
return "";
}
@Override
public ListSpecsRequest injectToken(ListSpecsRequest payload, String token) {
return ListSpecsRequest.newBuilder(payload).setPageToken(token).build();
}
@Override
public ListSpecsRequest injectPageSize(ListSpecsRequest payload, int pageSize) {
return ListSpecsRequest.newBuilder(payload).setPageSize(pageSize).build();
}
@Override
public Integer extractPageSize(ListSpecsRequest payload) {
return payload.getPageSize();
}
@Override
public String extractNextToken(ListSpecsResponse payload) {
return payload.getNextPageToken();
}
@Override
public Iterable extractResources(ListSpecsResponse payload) {
return payload.getSpecsList();
}
};
private static final PagedListDescriptor<
ListApiOperationsRequest, ListApiOperationsResponse, ApiOperation>
LIST_API_OPERATIONS_PAGE_STR_DESC =
new PagedListDescriptor<
ListApiOperationsRequest, ListApiOperationsResponse, ApiOperation>() {
@Override
public String emptyToken() {
return "";
}
@Override
public ListApiOperationsRequest injectToken(
ListApiOperationsRequest payload, String token) {
return ListApiOperationsRequest.newBuilder(payload).setPageToken(token).build();
}
@Override
public ListApiOperationsRequest injectPageSize(
ListApiOperationsRequest payload, int pageSize) {
return ListApiOperationsRequest.newBuilder(payload).setPageSize(pageSize).build();
}
@Override
public Integer extractPageSize(ListApiOperationsRequest payload) {
return payload.getPageSize();
}
@Override
public String extractNextToken(ListApiOperationsResponse payload) {
return payload.getNextPageToken();
}
@Override
public Iterable extractResources(ListApiOperationsResponse payload) {
return payload.getApiOperationsList();
}
};
private static final PagedListDescriptor<
ListDeploymentsRequest, ListDeploymentsResponse, Deployment>
LIST_DEPLOYMENTS_PAGE_STR_DESC =
new PagedListDescriptor() {
@Override
public String emptyToken() {
return "";
}
@Override
public ListDeploymentsRequest injectToken(
ListDeploymentsRequest payload, String token) {
return ListDeploymentsRequest.newBuilder(payload).setPageToken(token).build();
}
@Override
public ListDeploymentsRequest injectPageSize(
ListDeploymentsRequest payload, int pageSize) {
return ListDeploymentsRequest.newBuilder(payload).setPageSize(pageSize).build();
}
@Override
public Integer extractPageSize(ListDeploymentsRequest payload) {
return payload.getPageSize();
}
@Override
public String extractNextToken(ListDeploymentsResponse payload) {
return payload.getNextPageToken();
}
@Override
public Iterable extractResources(ListDeploymentsResponse payload) {
return payload.getDeploymentsList();
}
};
private static final PagedListDescriptor
LIST_ATTRIBUTES_PAGE_STR_DESC =
new PagedListDescriptor() {
@Override
public String emptyToken() {
return "";
}
@Override
public ListAttributesRequest injectToken(ListAttributesRequest payload, String token) {
return ListAttributesRequest.newBuilder(payload).setPageToken(token).build();
}
@Override
public ListAttributesRequest injectPageSize(
ListAttributesRequest payload, int pageSize) {
return ListAttributesRequest.newBuilder(payload).setPageSize(pageSize).build();
}
@Override
public Integer extractPageSize(ListAttributesRequest payload) {
return payload.getPageSize();
}
@Override
public String extractNextToken(ListAttributesResponse payload) {
return payload.getNextPageToken();
}
@Override
public Iterable extractResources(ListAttributesResponse payload) {
return payload.getAttributesList();
}
};
private static final PagedListDescriptor<
SearchResourcesRequest, SearchResourcesResponse, SearchResult>
SEARCH_RESOURCES_PAGE_STR_DESC =
new PagedListDescriptor() {
@Override
public String emptyToken() {
return "";
}
@Override
public SearchResourcesRequest injectToken(
SearchResourcesRequest payload, String token) {
return SearchResourcesRequest.newBuilder(payload).setPageToken(token).build();
}
@Override
public SearchResourcesRequest injectPageSize(
SearchResourcesRequest payload, int pageSize) {
return SearchResourcesRequest.newBuilder(payload).setPageSize(pageSize).build();
}
@Override
public Integer extractPageSize(SearchResourcesRequest payload) {
return payload.getPageSize();
}
@Override
public String extractNextToken(SearchResourcesResponse payload) {
return payload.getNextPageToken();
}
@Override
public Iterable extractResources(SearchResourcesResponse payload) {
return payload.getSearchResultsList();
}
};
private static final PagedListDescriptor<
ListExternalApisRequest, ListExternalApisResponse, ExternalApi>
LIST_EXTERNAL_APIS_PAGE_STR_DESC =
new PagedListDescriptor<
ListExternalApisRequest, ListExternalApisResponse, ExternalApi>() {
@Override
public String emptyToken() {
return "";
}
@Override
public ListExternalApisRequest injectToken(
ListExternalApisRequest payload, String token) {
return ListExternalApisRequest.newBuilder(payload).setPageToken(token).build();
}
@Override
public ListExternalApisRequest injectPageSize(
ListExternalApisRequest payload, int pageSize) {
return ListExternalApisRequest.newBuilder(payload).setPageSize(pageSize).build();
}
@Override
public Integer extractPageSize(ListExternalApisRequest payload) {
return payload.getPageSize();
}
@Override
public String extractNextToken(ListExternalApisResponse payload) {
return payload.getNextPageToken();
}
@Override
public Iterable extractResources(ListExternalApisResponse payload) {
return payload.getExternalApisList();
}
};
private static final PagedListDescriptor
LIST_LOCATIONS_PAGE_STR_DESC =
new PagedListDescriptor() {
@Override
public String emptyToken() {
return "";
}
@Override
public ListLocationsRequest injectToken(ListLocationsRequest payload, String token) {
return ListLocationsRequest.newBuilder(payload).setPageToken(token).build();
}
@Override
public ListLocationsRequest injectPageSize(ListLocationsRequest payload, int pageSize) {
return ListLocationsRequest.newBuilder(payload).setPageSize(pageSize).build();
}
@Override
public Integer extractPageSize(ListLocationsRequest payload) {
return payload.getPageSize();
}
@Override
public String extractNextToken(ListLocationsResponse payload) {
return payload.getNextPageToken();
}
@Override
public Iterable extractResources(ListLocationsResponse payload) {
return payload.getLocationsList();
}
};
private static final PagedListResponseFactory<
ListApisRequest, ListApisResponse, ListApisPagedResponse>
LIST_APIS_PAGE_STR_FACT =
new PagedListResponseFactory() {
@Override
public ApiFuture getFuturePagedResponse(
UnaryCallable callable,
ListApisRequest request,
ApiCallContext context,
ApiFuture futureResponse) {
PageContext pageContext =
PageContext.create(callable, LIST_APIS_PAGE_STR_DESC, request, context);
return ListApisPagedResponse.createAsync(pageContext, futureResponse);
}
};
private static final PagedListResponseFactory<
ListVersionsRequest, ListVersionsResponse, ListVersionsPagedResponse>
LIST_VERSIONS_PAGE_STR_FACT =
new PagedListResponseFactory<
ListVersionsRequest, ListVersionsResponse, ListVersionsPagedResponse>() {
@Override
public ApiFuture getFuturePagedResponse(
UnaryCallable callable,
ListVersionsRequest request,
ApiCallContext context,
ApiFuture futureResponse) {
PageContext pageContext =
PageContext.create(callable, LIST_VERSIONS_PAGE_STR_DESC, request, context);
return ListVersionsPagedResponse.createAsync(pageContext, futureResponse);
}
};
private static final PagedListResponseFactory<
ListSpecsRequest, ListSpecsResponse, ListSpecsPagedResponse>
LIST_SPECS_PAGE_STR_FACT =
new PagedListResponseFactory<
ListSpecsRequest, ListSpecsResponse, ListSpecsPagedResponse>() {
@Override
public ApiFuture getFuturePagedResponse(
UnaryCallable callable,
ListSpecsRequest request,
ApiCallContext context,
ApiFuture futureResponse) {
PageContext pageContext =
PageContext.create(callable, LIST_SPECS_PAGE_STR_DESC, request, context);
return ListSpecsPagedResponse.createAsync(pageContext, futureResponse);
}
};
private static final PagedListResponseFactory<
ListApiOperationsRequest, ListApiOperationsResponse, ListApiOperationsPagedResponse>
LIST_API_OPERATIONS_PAGE_STR_FACT =
new PagedListResponseFactory<
ListApiOperationsRequest,
ListApiOperationsResponse,
ListApiOperationsPagedResponse>() {
@Override
public ApiFuture getFuturePagedResponse(
UnaryCallable callable,
ListApiOperationsRequest request,
ApiCallContext context,
ApiFuture futureResponse) {
PageContext
pageContext =
PageContext.create(
callable, LIST_API_OPERATIONS_PAGE_STR_DESC, request, context);
return ListApiOperationsPagedResponse.createAsync(pageContext, futureResponse);
}
};
private static final PagedListResponseFactory<
ListDeploymentsRequest, ListDeploymentsResponse, ListDeploymentsPagedResponse>
LIST_DEPLOYMENTS_PAGE_STR_FACT =
new PagedListResponseFactory<
ListDeploymentsRequest, ListDeploymentsResponse, ListDeploymentsPagedResponse>() {
@Override
public ApiFuture getFuturePagedResponse(
UnaryCallable callable,
ListDeploymentsRequest request,
ApiCallContext context,
ApiFuture futureResponse) {
PageContext pageContext =
PageContext.create(callable, LIST_DEPLOYMENTS_PAGE_STR_DESC, request, context);
return ListDeploymentsPagedResponse.createAsync(pageContext, futureResponse);
}
};
private static final PagedListResponseFactory<
ListAttributesRequest, ListAttributesResponse, ListAttributesPagedResponse>
LIST_ATTRIBUTES_PAGE_STR_FACT =
new PagedListResponseFactory<
ListAttributesRequest, ListAttributesResponse, ListAttributesPagedResponse>() {
@Override
public ApiFuture getFuturePagedResponse(
UnaryCallable callable,
ListAttributesRequest request,
ApiCallContext context,
ApiFuture futureResponse) {
PageContext pageContext =
PageContext.create(callable, LIST_ATTRIBUTES_PAGE_STR_DESC, request, context);
return ListAttributesPagedResponse.createAsync(pageContext, futureResponse);
}
};
private static final PagedListResponseFactory<
SearchResourcesRequest, SearchResourcesResponse, SearchResourcesPagedResponse>
SEARCH_RESOURCES_PAGE_STR_FACT =
new PagedListResponseFactory<
SearchResourcesRequest, SearchResourcesResponse, SearchResourcesPagedResponse>() {
@Override
public ApiFuture getFuturePagedResponse(
UnaryCallable callable,
SearchResourcesRequest request,
ApiCallContext context,
ApiFuture futureResponse) {
PageContext
pageContext =
PageContext.create(
callable, SEARCH_RESOURCES_PAGE_STR_DESC, request, context);
return SearchResourcesPagedResponse.createAsync(pageContext, futureResponse);
}
};
private static final PagedListResponseFactory<
ListExternalApisRequest, ListExternalApisResponse, ListExternalApisPagedResponse>
LIST_EXTERNAL_APIS_PAGE_STR_FACT =
new PagedListResponseFactory<
ListExternalApisRequest, ListExternalApisResponse, ListExternalApisPagedResponse>() {
@Override
public ApiFuture getFuturePagedResponse(
UnaryCallable callable,
ListExternalApisRequest request,
ApiCallContext context,
ApiFuture futureResponse) {
PageContext
pageContext =
PageContext.create(
callable, LIST_EXTERNAL_APIS_PAGE_STR_DESC, request, context);
return ListExternalApisPagedResponse.createAsync(pageContext, futureResponse);
}
};
private static final PagedListResponseFactory<
ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse>
LIST_LOCATIONS_PAGE_STR_FACT =
new PagedListResponseFactory<
ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse>() {
@Override
public ApiFuture getFuturePagedResponse(
UnaryCallable callable,
ListLocationsRequest request,
ApiCallContext context,
ApiFuture futureResponse) {
PageContext pageContext =
PageContext.create(callable, LIST_LOCATIONS_PAGE_STR_DESC, request, context);
return ListLocationsPagedResponse.createAsync(pageContext, futureResponse);
}
};
/** Returns the object with the settings used for calls to createApi. */
public UnaryCallSettings createApiSettings() {
return createApiSettings;
}
/** Returns the object with the settings used for calls to getApi. */
public UnaryCallSettings getApiSettings() {
return getApiSettings;
}
/** Returns the object with the settings used for calls to listApis. */
public PagedCallSettings
listApisSettings() {
return listApisSettings;
}
/** Returns the object with the settings used for calls to updateApi. */
public UnaryCallSettings updateApiSettings() {
return updateApiSettings;
}
/** Returns the object with the settings used for calls to deleteApi. */
public UnaryCallSettings deleteApiSettings() {
return deleteApiSettings;
}
/** Returns the object with the settings used for calls to createVersion. */
public UnaryCallSettings createVersionSettings() {
return createVersionSettings;
}
/** Returns the object with the settings used for calls to getVersion. */
public UnaryCallSettings getVersionSettings() {
return getVersionSettings;
}
/** Returns the object with the settings used for calls to listVersions. */
public PagedCallSettings
listVersionsSettings() {
return listVersionsSettings;
}
/** Returns the object with the settings used for calls to updateVersion. */
public UnaryCallSettings updateVersionSettings() {
return updateVersionSettings;
}
/** Returns the object with the settings used for calls to deleteVersion. */
public UnaryCallSettings deleteVersionSettings() {
return deleteVersionSettings;
}
/** Returns the object with the settings used for calls to createSpec. */
public UnaryCallSettings createSpecSettings() {
return createSpecSettings;
}
/** Returns the object with the settings used for calls to getSpec. */
public UnaryCallSettings getSpecSettings() {
return getSpecSettings;
}
/** Returns the object with the settings used for calls to getSpecContents. */
public UnaryCallSettings getSpecContentsSettings() {
return getSpecContentsSettings;
}
/** Returns the object with the settings used for calls to listSpecs. */
public PagedCallSettings
listSpecsSettings() {
return listSpecsSettings;
}
/** Returns the object with the settings used for calls to updateSpec. */
public UnaryCallSettings updateSpecSettings() {
return updateSpecSettings;
}
/** Returns the object with the settings used for calls to deleteSpec. */
public UnaryCallSettings deleteSpecSettings() {
return deleteSpecSettings;
}
/** Returns the object with the settings used for calls to getApi. */
public UnaryCallSettings getApiOperationSettings() {
return getApiOperationSettings;
}
/** Returns the object with the settings used for calls to listApiOperations. */
public PagedCallSettings<
ListApiOperationsRequest, ListApiOperationsResponse, ListApiOperationsPagedResponse>
listApiOperationsSettings() {
return listApiOperationsSettings;
}
/** Returns the object with the settings used for calls to getDefinition. */
public UnaryCallSettings getDefinitionSettings() {
return getDefinitionSettings;
}
/** Returns the object with the settings used for calls to createDeployment. */
public UnaryCallSettings createDeploymentSettings() {
return createDeploymentSettings;
}
/** Returns the object with the settings used for calls to getDeployment. */
public UnaryCallSettings getDeploymentSettings() {
return getDeploymentSettings;
}
/** Returns the object with the settings used for calls to listDeployments. */
public PagedCallSettings<
ListDeploymentsRequest, ListDeploymentsResponse, ListDeploymentsPagedResponse>
listDeploymentsSettings() {
return listDeploymentsSettings;
}
/** Returns the object with the settings used for calls to updateDeployment. */
public UnaryCallSettings updateDeploymentSettings() {
return updateDeploymentSettings;
}
/** Returns the object with the settings used for calls to deleteDeployment. */
public UnaryCallSettings deleteDeploymentSettings() {
return deleteDeploymentSettings;
}
/** Returns the object with the settings used for calls to createAttribute. */
public UnaryCallSettings createAttributeSettings() {
return createAttributeSettings;
}
/** Returns the object with the settings used for calls to getAttribute. */
public UnaryCallSettings getAttributeSettings() {
return getAttributeSettings;
}
/** Returns the object with the settings used for calls to updateAttribute. */
public UnaryCallSettings updateAttributeSettings() {
return updateAttributeSettings;
}
/** Returns the object with the settings used for calls to deleteAttribute. */
public UnaryCallSettings deleteAttributeSettings() {
return deleteAttributeSettings;
}
/** Returns the object with the settings used for calls to listAttributes. */
public PagedCallSettings<
ListAttributesRequest, ListAttributesResponse, ListAttributesPagedResponse>
listAttributesSettings() {
return listAttributesSettings;
}
/** Returns the object with the settings used for calls to searchResources. */
public PagedCallSettings<
SearchResourcesRequest, SearchResourcesResponse, SearchResourcesPagedResponse>
searchResourcesSettings() {
return searchResourcesSettings;
}
/** Returns the object with the settings used for calls to createExternalApi. */
public UnaryCallSettings createExternalApiSettings() {
return createExternalApiSettings;
}
/** Returns the object with the settings used for calls to getExternalApi. */
public UnaryCallSettings getExternalApiSettings() {
return getExternalApiSettings;
}
/** Returns the object with the settings used for calls to updateExternalApi. */
public UnaryCallSettings updateExternalApiSettings() {
return updateExternalApiSettings;
}
/** Returns the object with the settings used for calls to deleteExternalApi. */
public UnaryCallSettings deleteExternalApiSettings() {
return deleteExternalApiSettings;
}
/** Returns the object with the settings used for calls to listExternalApis. */
public PagedCallSettings<
ListExternalApisRequest, ListExternalApisResponse, ListExternalApisPagedResponse>
listExternalApisSettings() {
return listExternalApisSettings;
}
/** Returns the object with the settings used for calls to listLocations. */
public PagedCallSettings
listLocationsSettings() {
return listLocationsSettings;
}
/** Returns the object with the settings used for calls to getLocation. */
public UnaryCallSettings getLocationSettings() {
return getLocationSettings;
}
public ApiHubStub createStub() throws IOException {
if (getTransportChannelProvider()
.getTransportName()
.equals(HttpJsonTransportChannel.getHttpJsonTransportName())) {
return HttpJsonApiHubStub.create(this);
}
throw new UnsupportedOperationException(
String.format(
"Transport not supported: %s", getTransportChannelProvider().getTransportName()));
}
/** Returns the default service name. */
@Override
public String getServiceName() {
return "apihub";
}
/** Returns a builder for the default ExecutorProvider for this service. */
public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() {
return InstantiatingExecutorProvider.newBuilder();
}
/** Returns the default service endpoint. */
@ObsoleteApi("Use getEndpoint() instead")
public static String getDefaultEndpoint() {
return "apihub.googleapis.com:443";
}
/** Returns the default mTLS service endpoint. */
public static String getDefaultMtlsEndpoint() {
return "apihub.mtls.googleapis.com:443";
}
/** Returns the default service scopes. */
public static List getDefaultServiceScopes() {
return DEFAULT_SERVICE_SCOPES;
}
/** Returns a builder for the default credentials for this service. */
public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() {
return GoogleCredentialsProvider.newBuilder()
.setScopesToApply(DEFAULT_SERVICE_SCOPES)
.setUseJwtAccessWithScope(true);
}
/** Returns a builder for the default ChannelProvider for this service. */
public static InstantiatingHttpJsonChannelProvider.Builder
defaultHttpJsonTransportProviderBuilder() {
return InstantiatingHttpJsonChannelProvider.newBuilder();
}
public static TransportChannelProvider defaultTransportChannelProvider() {
return defaultHttpJsonTransportProviderBuilder().build();
}
public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() {
return ApiClientHeaderProvider.newBuilder()
.setGeneratedLibToken("gapic", GaxProperties.getLibraryVersion(ApiHubStubSettings.class))
.setTransportToken(
GaxHttpJsonProperties.getHttpJsonTokenName(),
GaxHttpJsonProperties.getHttpJsonVersion());
}
/** Returns a new builder for this class. */
public static Builder newBuilder() {
return Builder.createDefault();
}
/** Returns a new builder for this class. */
public static Builder newBuilder(ClientContext clientContext) {
return new Builder(clientContext);
}
/** Returns a builder containing all the values of this settings class. */
public Builder toBuilder() {
return new Builder(this);
}
protected ApiHubStubSettings(Builder settingsBuilder) throws IOException {
super(settingsBuilder);
createApiSettings = settingsBuilder.createApiSettings().build();
getApiSettings = settingsBuilder.getApiSettings().build();
listApisSettings = settingsBuilder.listApisSettings().build();
updateApiSettings = settingsBuilder.updateApiSettings().build();
deleteApiSettings = settingsBuilder.deleteApiSettings().build();
createVersionSettings = settingsBuilder.createVersionSettings().build();
getVersionSettings = settingsBuilder.getVersionSettings().build();
listVersionsSettings = settingsBuilder.listVersionsSettings().build();
updateVersionSettings = settingsBuilder.updateVersionSettings().build();
deleteVersionSettings = settingsBuilder.deleteVersionSettings().build();
createSpecSettings = settingsBuilder.createSpecSettings().build();
getSpecSettings = settingsBuilder.getSpecSettings().build();
getSpecContentsSettings = settingsBuilder.getSpecContentsSettings().build();
listSpecsSettings = settingsBuilder.listSpecsSettings().build();
updateSpecSettings = settingsBuilder.updateSpecSettings().build();
deleteSpecSettings = settingsBuilder.deleteSpecSettings().build();
getApiOperationSettings = settingsBuilder.getApiOperationSettings().build();
listApiOperationsSettings = settingsBuilder.listApiOperationsSettings().build();
getDefinitionSettings = settingsBuilder.getDefinitionSettings().build();
createDeploymentSettings = settingsBuilder.createDeploymentSettings().build();
getDeploymentSettings = settingsBuilder.getDeploymentSettings().build();
listDeploymentsSettings = settingsBuilder.listDeploymentsSettings().build();
updateDeploymentSettings = settingsBuilder.updateDeploymentSettings().build();
deleteDeploymentSettings = settingsBuilder.deleteDeploymentSettings().build();
createAttributeSettings = settingsBuilder.createAttributeSettings().build();
getAttributeSettings = settingsBuilder.getAttributeSettings().build();
updateAttributeSettings = settingsBuilder.updateAttributeSettings().build();
deleteAttributeSettings = settingsBuilder.deleteAttributeSettings().build();
listAttributesSettings = settingsBuilder.listAttributesSettings().build();
searchResourcesSettings = settingsBuilder.searchResourcesSettings().build();
createExternalApiSettings = settingsBuilder.createExternalApiSettings().build();
getExternalApiSettings = settingsBuilder.getExternalApiSettings().build();
updateExternalApiSettings = settingsBuilder.updateExternalApiSettings().build();
deleteExternalApiSettings = settingsBuilder.deleteExternalApiSettings().build();
listExternalApisSettings = settingsBuilder.listExternalApisSettings().build();
listLocationsSettings = settingsBuilder.listLocationsSettings().build();
getLocationSettings = settingsBuilder.getLocationSettings().build();
}
/** Builder for ApiHubStubSettings. */
public static class Builder extends StubSettings.Builder {
private final ImmutableList> unaryMethodSettingsBuilders;
private final UnaryCallSettings.Builder createApiSettings;
private final UnaryCallSettings.Builder getApiSettings;
private final PagedCallSettings.Builder<
ListApisRequest, ListApisResponse, ListApisPagedResponse>
listApisSettings;
private final UnaryCallSettings.Builder updateApiSettings;
private final UnaryCallSettings.Builder deleteApiSettings;
private final UnaryCallSettings.Builder createVersionSettings;
private final UnaryCallSettings.Builder getVersionSettings;
private final PagedCallSettings.Builder<
ListVersionsRequest, ListVersionsResponse, ListVersionsPagedResponse>
listVersionsSettings;
private final UnaryCallSettings.Builder updateVersionSettings;
private final UnaryCallSettings.Builder deleteVersionSettings;
private final UnaryCallSettings.Builder createSpecSettings;
private final UnaryCallSettings.Builder getSpecSettings;
private final UnaryCallSettings.Builder
getSpecContentsSettings;
private final PagedCallSettings.Builder<
ListSpecsRequest, ListSpecsResponse, ListSpecsPagedResponse>
listSpecsSettings;
private final UnaryCallSettings.Builder updateSpecSettings;
private final UnaryCallSettings.Builder deleteSpecSettings;
private final UnaryCallSettings.Builder
getApiOperationSettings;
private final PagedCallSettings.Builder<
ListApiOperationsRequest, ListApiOperationsResponse, ListApiOperationsPagedResponse>
listApiOperationsSettings;
private final UnaryCallSettings.Builder getDefinitionSettings;
private final UnaryCallSettings.Builder
createDeploymentSettings;
private final UnaryCallSettings.Builder getDeploymentSettings;
private final PagedCallSettings.Builder<
ListDeploymentsRequest, ListDeploymentsResponse, ListDeploymentsPagedResponse>
listDeploymentsSettings;
private final UnaryCallSettings.Builder
updateDeploymentSettings;
private final UnaryCallSettings.Builder
deleteDeploymentSettings;
private final UnaryCallSettings.Builder
createAttributeSettings;
private final UnaryCallSettings.Builder getAttributeSettings;
private final UnaryCallSettings.Builder
updateAttributeSettings;
private final UnaryCallSettings.Builder deleteAttributeSettings;
private final PagedCallSettings.Builder<
ListAttributesRequest, ListAttributesResponse, ListAttributesPagedResponse>
listAttributesSettings;
private final PagedCallSettings.Builder<
SearchResourcesRequest, SearchResourcesResponse, SearchResourcesPagedResponse>
searchResourcesSettings;
private final UnaryCallSettings.Builder
createExternalApiSettings;
private final UnaryCallSettings.Builder
getExternalApiSettings;
private final UnaryCallSettings.Builder
updateExternalApiSettings;
private final UnaryCallSettings.Builder
deleteExternalApiSettings;
private final PagedCallSettings.Builder<
ListExternalApisRequest, ListExternalApisResponse, ListExternalApisPagedResponse>
listExternalApisSettings;
private final PagedCallSettings.Builder<
ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse>
listLocationsSettings;
private final UnaryCallSettings.Builder getLocationSettings;
private static final ImmutableMap>
RETRYABLE_CODE_DEFINITIONS;
static {
ImmutableMap.Builder> definitions =
ImmutableMap.builder();
definitions.put(
"no_retry_1_codes", ImmutableSet.copyOf(Lists.newArrayList()));
definitions.put(
"retry_policy_0_codes",
ImmutableSet.copyOf(Lists.newArrayList(StatusCode.Code.UNAVAILABLE)));
definitions.put("no_retry_codes", ImmutableSet.copyOf(Lists.newArrayList()));
RETRYABLE_CODE_DEFINITIONS = definitions.build();
}
private static final ImmutableMap RETRY_PARAM_DEFINITIONS;
static {
ImmutableMap.Builder definitions = ImmutableMap.builder();
RetrySettings settings = null;
settings =
RetrySettings.newBuilder()
.setInitialRpcTimeout(Duration.ofMillis(60000L))
.setRpcTimeoutMultiplier(1.0)
.setMaxRpcTimeout(Duration.ofMillis(60000L))
.setTotalTimeout(Duration.ofMillis(60000L))
.build();
definitions.put("no_retry_1_params", settings);
settings =
RetrySettings.newBuilder()
.setInitialRetryDelay(Duration.ofMillis(1000L))
.setRetryDelayMultiplier(1.3)
.setMaxRetryDelay(Duration.ofMillis(10000L))
.setInitialRpcTimeout(Duration.ofMillis(60000L))
.setRpcTimeoutMultiplier(1.0)
.setMaxRpcTimeout(Duration.ofMillis(60000L))
.setTotalTimeout(Duration.ofMillis(60000L))
.build();
definitions.put("retry_policy_0_params", settings);
settings = RetrySettings.newBuilder().setRpcTimeoutMultiplier(1.0).build();
definitions.put("no_retry_params", settings);
RETRY_PARAM_DEFINITIONS = definitions.build();
}
protected Builder() {
this(((ClientContext) null));
}
protected Builder(ClientContext clientContext) {
super(clientContext);
createApiSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
getApiSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
listApisSettings = PagedCallSettings.newBuilder(LIST_APIS_PAGE_STR_FACT);
updateApiSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
deleteApiSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
createVersionSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
getVersionSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
listVersionsSettings = PagedCallSettings.newBuilder(LIST_VERSIONS_PAGE_STR_FACT);
updateVersionSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
deleteVersionSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
createSpecSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
getSpecSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
getSpecContentsSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
listSpecsSettings = PagedCallSettings.newBuilder(LIST_SPECS_PAGE_STR_FACT);
updateSpecSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
deleteSpecSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
getApiOperationSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
listApiOperationsSettings = PagedCallSettings.newBuilder(LIST_API_OPERATIONS_PAGE_STR_FACT);
getDefinitionSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
createDeploymentSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
getDeploymentSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
listDeploymentsSettings = PagedCallSettings.newBuilder(LIST_DEPLOYMENTS_PAGE_STR_FACT);
updateDeploymentSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
deleteDeploymentSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
createAttributeSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
getAttributeSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
updateAttributeSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
deleteAttributeSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
listAttributesSettings = PagedCallSettings.newBuilder(LIST_ATTRIBUTES_PAGE_STR_FACT);
searchResourcesSettings = PagedCallSettings.newBuilder(SEARCH_RESOURCES_PAGE_STR_FACT);
createExternalApiSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
getExternalApiSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
updateExternalApiSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
deleteExternalApiSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
listExternalApisSettings = PagedCallSettings.newBuilder(LIST_EXTERNAL_APIS_PAGE_STR_FACT);
listLocationsSettings = PagedCallSettings.newBuilder(LIST_LOCATIONS_PAGE_STR_FACT);
getLocationSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
unaryMethodSettingsBuilders =
ImmutableList.>of(
createApiSettings,
getApiSettings,
listApisSettings,
updateApiSettings,
deleteApiSettings,
createVersionSettings,
getVersionSettings,
listVersionsSettings,
updateVersionSettings,
deleteVersionSettings,
createSpecSettings,
getSpecSettings,
getSpecContentsSettings,
listSpecsSettings,
updateSpecSettings,
deleteSpecSettings,
getApiOperationSettings,
listApiOperationsSettings,
getDefinitionSettings,
createDeploymentSettings,
getDeploymentSettings,
listDeploymentsSettings,
updateDeploymentSettings,
deleteDeploymentSettings,
createAttributeSettings,
getAttributeSettings,
updateAttributeSettings,
deleteAttributeSettings,
listAttributesSettings,
searchResourcesSettings,
createExternalApiSettings,
getExternalApiSettings,
updateExternalApiSettings,
deleteExternalApiSettings,
listExternalApisSettings,
listLocationsSettings,
getLocationSettings);
initDefaults(this);
}
protected Builder(ApiHubStubSettings settings) {
super(settings);
createApiSettings = settings.createApiSettings.toBuilder();
getApiSettings = settings.getApiSettings.toBuilder();
listApisSettings = settings.listApisSettings.toBuilder();
updateApiSettings = settings.updateApiSettings.toBuilder();
deleteApiSettings = settings.deleteApiSettings.toBuilder();
createVersionSettings = settings.createVersionSettings.toBuilder();
getVersionSettings = settings.getVersionSettings.toBuilder();
listVersionsSettings = settings.listVersionsSettings.toBuilder();
updateVersionSettings = settings.updateVersionSettings.toBuilder();
deleteVersionSettings = settings.deleteVersionSettings.toBuilder();
createSpecSettings = settings.createSpecSettings.toBuilder();
getSpecSettings = settings.getSpecSettings.toBuilder();
getSpecContentsSettings = settings.getSpecContentsSettings.toBuilder();
listSpecsSettings = settings.listSpecsSettings.toBuilder();
updateSpecSettings = settings.updateSpecSettings.toBuilder();
deleteSpecSettings = settings.deleteSpecSettings.toBuilder();
getApiOperationSettings = settings.getApiOperationSettings.toBuilder();
listApiOperationsSettings = settings.listApiOperationsSettings.toBuilder();
getDefinitionSettings = settings.getDefinitionSettings.toBuilder();
createDeploymentSettings = settings.createDeploymentSettings.toBuilder();
getDeploymentSettings = settings.getDeploymentSettings.toBuilder();
listDeploymentsSettings = settings.listDeploymentsSettings.toBuilder();
updateDeploymentSettings = settings.updateDeploymentSettings.toBuilder();
deleteDeploymentSettings = settings.deleteDeploymentSettings.toBuilder();
createAttributeSettings = settings.createAttributeSettings.toBuilder();
getAttributeSettings = settings.getAttributeSettings.toBuilder();
updateAttributeSettings = settings.updateAttributeSettings.toBuilder();
deleteAttributeSettings = settings.deleteAttributeSettings.toBuilder();
listAttributesSettings = settings.listAttributesSettings.toBuilder();
searchResourcesSettings = settings.searchResourcesSettings.toBuilder();
createExternalApiSettings = settings.createExternalApiSettings.toBuilder();
getExternalApiSettings = settings.getExternalApiSettings.toBuilder();
updateExternalApiSettings = settings.updateExternalApiSettings.toBuilder();
deleteExternalApiSettings = settings.deleteExternalApiSettings.toBuilder();
listExternalApisSettings = settings.listExternalApisSettings.toBuilder();
listLocationsSettings = settings.listLocationsSettings.toBuilder();
getLocationSettings = settings.getLocationSettings.toBuilder();
unaryMethodSettingsBuilders =
ImmutableList.>of(
createApiSettings,
getApiSettings,
listApisSettings,
updateApiSettings,
deleteApiSettings,
createVersionSettings,
getVersionSettings,
listVersionsSettings,
updateVersionSettings,
deleteVersionSettings,
createSpecSettings,
getSpecSettings,
getSpecContentsSettings,
listSpecsSettings,
updateSpecSettings,
deleteSpecSettings,
getApiOperationSettings,
listApiOperationsSettings,
getDefinitionSettings,
createDeploymentSettings,
getDeploymentSettings,
listDeploymentsSettings,
updateDeploymentSettings,
deleteDeploymentSettings,
createAttributeSettings,
getAttributeSettings,
updateAttributeSettings,
deleteAttributeSettings,
listAttributesSettings,
searchResourcesSettings,
createExternalApiSettings,
getExternalApiSettings,
updateExternalApiSettings,
deleteExternalApiSettings,
listExternalApisSettings,
listLocationsSettings,
getLocationSettings);
}
private static Builder createDefault() {
Builder builder = new Builder(((ClientContext) null));
builder.setTransportChannelProvider(defaultTransportChannelProvider());
builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build());
builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build());
builder.setMtlsEndpoint(getDefaultMtlsEndpoint());
builder.setSwitchToMtlsEndpointAllowed(true);
return initDefaults(builder);
}
private static Builder initDefaults(Builder builder) {
builder
.createApiSettings()
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes"))
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params"));
builder
.getApiSettings()
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes"))
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params"));
builder
.listApisSettings()
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes"))
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params"));
builder
.updateApiSettings()
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes"))
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params"));
builder
.deleteApiSettings()
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes"))
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params"));
builder
.createVersionSettings()
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes"))
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params"));
builder
.getVersionSettings()
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes"))
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params"));
builder
.listVersionsSettings()
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes"))
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params"));
builder
.updateVersionSettings()
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes"))
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params"));
builder
.deleteVersionSettings()
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes"))
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params"));
builder
.createSpecSettings()
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes"))
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params"));
builder
.getSpecSettings()
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes"))
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params"));
builder
.getSpecContentsSettings()
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes"))
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params"));
builder
.listSpecsSettings()
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes"))
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params"));
builder
.updateSpecSettings()
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes"))
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params"));
builder
.deleteSpecSettings()
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes"))
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params"));
builder
.getApiOperationSettings()
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes"))
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params"));
builder
.listApiOperationsSettings()
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes"))
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params"));
builder
.getDefinitionSettings()
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes"))
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params"));
builder
.createDeploymentSettings()
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes"))
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params"));
builder
.getDeploymentSettings()
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes"))
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params"));
builder
.listDeploymentsSettings()
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes"))
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params"));
builder
.updateDeploymentSettings()
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes"))
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params"));
builder
.deleteDeploymentSettings()
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes"))
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params"));
builder
.createAttributeSettings()
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes"))
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params"));
builder
.getAttributeSettings()
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes"))
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params"));
builder
.updateAttributeSettings()
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes"))
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params"));
builder
.deleteAttributeSettings()
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes"))
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params"));
builder
.listAttributesSettings()
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes"))
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params"));
builder
.searchResourcesSettings()
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes"))
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params"));
builder
.createExternalApiSettings()
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes"))
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params"));
builder
.getExternalApiSettings()
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes"))
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params"));
builder
.updateExternalApiSettings()
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes"))
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params"));
builder
.deleteExternalApiSettings()
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes"))
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params"));
builder
.listExternalApisSettings()
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes"))
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params"));
builder
.listLocationsSettings()
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes"))
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params"));
builder
.getLocationSettings()
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes"))
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params"));
return builder;
}
/**
* Applies the given settings updater function to all of the unary API methods in this service.
*
* Note: This method does not support applying settings to streaming methods.
*/
public Builder applyToAllUnaryMethods(
ApiFunction, Void> settingsUpdater) {
super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater);
return this;
}
public ImmutableList> unaryMethodSettingsBuilders() {
return unaryMethodSettingsBuilders;
}
/** Returns the builder for the settings used for calls to createApi. */
public UnaryCallSettings.Builder createApiSettings() {
return createApiSettings;
}
/** Returns the builder for the settings used for calls to getApi. */
public UnaryCallSettings.Builder getApiSettings() {
return getApiSettings;
}
/** Returns the builder for the settings used for calls to listApis. */
public PagedCallSettings.Builder
listApisSettings() {
return listApisSettings;
}
/** Returns the builder for the settings used for calls to updateApi. */
public UnaryCallSettings.Builder updateApiSettings() {
return updateApiSettings;
}
/** Returns the builder for the settings used for calls to deleteApi. */
public UnaryCallSettings.Builder deleteApiSettings() {
return deleteApiSettings;
}
/** Returns the builder for the settings used for calls to createVersion. */
public UnaryCallSettings.Builder createVersionSettings() {
return createVersionSettings;
}
/** Returns the builder for the settings used for calls to getVersion. */
public UnaryCallSettings.Builder getVersionSettings() {
return getVersionSettings;
}
/** Returns the builder for the settings used for calls to listVersions. */
public PagedCallSettings.Builder<
ListVersionsRequest, ListVersionsResponse, ListVersionsPagedResponse>
listVersionsSettings() {
return listVersionsSettings;
}
/** Returns the builder for the settings used for calls to updateVersion. */
public UnaryCallSettings.Builder updateVersionSettings() {
return updateVersionSettings;
}
/** Returns the builder for the settings used for calls to deleteVersion. */
public UnaryCallSettings.Builder deleteVersionSettings() {
return deleteVersionSettings;
}
/** Returns the builder for the settings used for calls to createSpec. */
public UnaryCallSettings.Builder createSpecSettings() {
return createSpecSettings;
}
/** Returns the builder for the settings used for calls to getSpec. */
public UnaryCallSettings.Builder getSpecSettings() {
return getSpecSettings;
}
/** Returns the builder for the settings used for calls to getSpecContents. */
public UnaryCallSettings.Builder
getSpecContentsSettings() {
return getSpecContentsSettings;
}
/** Returns the builder for the settings used for calls to listSpecs. */
public PagedCallSettings.Builder
listSpecsSettings() {
return listSpecsSettings;
}
/** Returns the builder for the settings used for calls to updateSpec. */
public UnaryCallSettings.Builder updateSpecSettings() {
return updateSpecSettings;
}
/** Returns the builder for the settings used for calls to deleteSpec. */
public UnaryCallSettings.Builder deleteSpecSettings() {
return deleteSpecSettings;
}
/** Returns the builder for the settings used for calls to getApi. */
public UnaryCallSettings.Builder
getApiOperationSettings() {
return getApiOperationSettings;
}
/** Returns the builder for the settings used for calls to listApiOperations. */
public PagedCallSettings.Builder<
ListApiOperationsRequest, ListApiOperationsResponse, ListApiOperationsPagedResponse>
listApiOperationsSettings() {
return listApiOperationsSettings;
}
/** Returns the builder for the settings used for calls to getDefinition. */
public UnaryCallSettings.Builder getDefinitionSettings() {
return getDefinitionSettings;
}
/** Returns the builder for the settings used for calls to createDeployment. */
public UnaryCallSettings.Builder
createDeploymentSettings() {
return createDeploymentSettings;
}
/** Returns the builder for the settings used for calls to getDeployment. */
public UnaryCallSettings.Builder getDeploymentSettings() {
return getDeploymentSettings;
}
/** Returns the builder for the settings used for calls to listDeployments. */
public PagedCallSettings.Builder<
ListDeploymentsRequest, ListDeploymentsResponse, ListDeploymentsPagedResponse>
listDeploymentsSettings() {
return listDeploymentsSettings;
}
/** Returns the builder for the settings used for calls to updateDeployment. */
public UnaryCallSettings.Builder
updateDeploymentSettings() {
return updateDeploymentSettings;
}
/** Returns the builder for the settings used for calls to deleteDeployment. */
public UnaryCallSettings.Builder deleteDeploymentSettings() {
return deleteDeploymentSettings;
}
/** Returns the builder for the settings used for calls to createAttribute. */
public UnaryCallSettings.Builder createAttributeSettings() {
return createAttributeSettings;
}
/** Returns the builder for the settings used for calls to getAttribute. */
public UnaryCallSettings.Builder getAttributeSettings() {
return getAttributeSettings;
}
/** Returns the builder for the settings used for calls to updateAttribute. */
public UnaryCallSettings.Builder updateAttributeSettings() {
return updateAttributeSettings;
}
/** Returns the builder for the settings used for calls to deleteAttribute. */
public UnaryCallSettings.Builder deleteAttributeSettings() {
return deleteAttributeSettings;
}
/** Returns the builder for the settings used for calls to listAttributes. */
public PagedCallSettings.Builder<
ListAttributesRequest, ListAttributesResponse, ListAttributesPagedResponse>
listAttributesSettings() {
return listAttributesSettings;
}
/** Returns the builder for the settings used for calls to searchResources. */
public PagedCallSettings.Builder<
SearchResourcesRequest, SearchResourcesResponse, SearchResourcesPagedResponse>
searchResourcesSettings() {
return searchResourcesSettings;
}
/** Returns the builder for the settings used for calls to createExternalApi. */
public UnaryCallSettings.Builder
createExternalApiSettings() {
return createExternalApiSettings;
}
/** Returns the builder for the settings used for calls to getExternalApi. */
public UnaryCallSettings.Builder getExternalApiSettings() {
return getExternalApiSettings;
}
/** Returns the builder for the settings used for calls to updateExternalApi. */
public UnaryCallSettings.Builder
updateExternalApiSettings() {
return updateExternalApiSettings;
}
/** Returns the builder for the settings used for calls to deleteExternalApi. */
public UnaryCallSettings.Builder deleteExternalApiSettings() {
return deleteExternalApiSettings;
}
/** Returns the builder for the settings used for calls to listExternalApis. */
public PagedCallSettings.Builder<
ListExternalApisRequest, ListExternalApisResponse, ListExternalApisPagedResponse>
listExternalApisSettings() {
return listExternalApisSettings;
}
/** Returns the builder for the settings used for calls to listLocations. */
public PagedCallSettings.Builder<
ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse>
listLocationsSettings() {
return listLocationsSettings;
}
/** Returns the builder for the settings used for calls to getLocation. */
public UnaryCallSettings.Builder getLocationSettings() {
return getLocationSettings;
}
@Override
public ApiHubStubSettings build() throws IOException {
return new ApiHubStubSettings(this);
}
}
}