Class ApiGatewayServiceClient
- java.lang.Object
-
- com.google.cloud.apigateway.v1.ApiGatewayServiceClient
-
- All Implemented Interfaces:
com.google.api.gax.core.BackgroundResource
,AutoCloseable
@Generated("by gapic-generator-java") public class ApiGatewayServiceClient extends Object implements com.google.api.gax.core.BackgroundResource
Service Description: The API Gateway Service is the interface for managing API Gateways.This class provides the ability to make remote calls to the backing service through method calls that map to API methods. Sample code to get started:
// 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 try (ApiGatewayServiceClient apiGatewayServiceClient = ApiGatewayServiceClient.create()) { GatewayName name = GatewayName.of("[PROJECT]", "[LOCATION]", "[GATEWAY]"); Gateway response = apiGatewayServiceClient.getGateway(name); }
Note: close() needs to be called on the ApiGatewayServiceClient object to clean up resources such as threads. In the example above, try-with-resources is used, which automatically calls close().
The surface of this class includes several types of Java methods for each of the API's methods:
- A "flattened" method. With this type of method, the fields of the request type have been converted into function parameters. It may be the case that not all fields are available as parameters, and not every API method will have a flattened method entry point.
- A "request object" method. This type of method only takes one parameter, a request object, which must be constructed before the call. Not every API method will have a request object method.
- A "callable" method. This type of method takes no parameters and returns an immutable API callable object, which can be used to initiate calls to the service.
See the individual methods for example code.
Many parameters require resource names to be formatted in a particular way. To assist with these names, this class includes a format method for each type of name, and additionally a parse method to extract the individual identifiers contained within names that are returned.
This class can be customized by passing in a custom instance of ApiGatewayServiceSettings to create(). For example:
To customize credentials:
// 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 ApiGatewayServiceSettings apiGatewayServiceSettings = ApiGatewayServiceSettings.newBuilder() .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials)) .build(); ApiGatewayServiceClient apiGatewayServiceClient = ApiGatewayServiceClient.create(apiGatewayServiceSettings);
To customize the endpoint:
// 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 ApiGatewayServiceSettings apiGatewayServiceSettings = ApiGatewayServiceSettings.newBuilder().setEndpoint(myEndpoint).build(); ApiGatewayServiceClient apiGatewayServiceClient = ApiGatewayServiceClient.create(apiGatewayServiceSettings);
To use REST (HTTP1.1/JSON) transport (instead of gRPC) for sending and receiving requests over the wire:
// 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 ApiGatewayServiceSettings apiGatewayServiceSettings = ApiGatewayServiceSettings.newHttpJsonBuilder().build(); ApiGatewayServiceClient apiGatewayServiceClient = ApiGatewayServiceClient.create(apiGatewayServiceSettings);
Please refer to the GitHub repository's samples for more quickstart code snippets.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ApiGatewayServiceClient.ListApiConfigsFixedSizeCollection
static class
ApiGatewayServiceClient.ListApiConfigsPage
static class
ApiGatewayServiceClient.ListApiConfigsPagedResponse
static class
ApiGatewayServiceClient.ListApisFixedSizeCollection
static class
ApiGatewayServiceClient.ListApisPage
static class
ApiGatewayServiceClient.ListApisPagedResponse
static class
ApiGatewayServiceClient.ListGatewaysFixedSizeCollection
static class
ApiGatewayServiceClient.ListGatewaysPage
static class
ApiGatewayServiceClient.ListGatewaysPagedResponse
-
Constructor Summary
Constructors Modifier Constructor Description protected
ApiGatewayServiceClient(ApiGatewayServiceSettings settings)
Constructs an instance of ApiGatewayServiceClient, using the given settings.protected
ApiGatewayServiceClient(ApiGatewayServiceStub stub)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
awaitTermination(long duration, TimeUnit unit)
void
close()
static ApiGatewayServiceClient
create()
Constructs an instance of ApiGatewayServiceClient with default settings.static ApiGatewayServiceClient
create(ApiGatewayServiceSettings settings)
Constructs an instance of ApiGatewayServiceClient, using the given settings.static ApiGatewayServiceClient
create(ApiGatewayServiceStub stub)
Constructs an instance of ApiGatewayServiceClient, using the given stub for making calls.com.google.api.gax.longrunning.OperationFuture<Api,OperationMetadata>
createApiAsync(CreateApiRequest request)
Creates a new Api in a given project and location.com.google.api.gax.longrunning.OperationFuture<Api,OperationMetadata>
createApiAsync(LocationName parent, Api api, String apiId)
Creates a new Api in a given project and location.com.google.api.gax.longrunning.OperationFuture<Api,OperationMetadata>
createApiAsync(String parent, Api api, String apiId)
Creates a new Api in a given project and location.com.google.api.gax.rpc.UnaryCallable<CreateApiRequest,com.google.longrunning.Operation>
createApiCallable()
Creates a new Api in a given project and location.com.google.api.gax.longrunning.OperationFuture<ApiConfig,OperationMetadata>
createApiConfigAsync(ApiName parent, ApiConfig apiConfig, String apiConfigId)
Creates a new ApiConfig in a given project and location.com.google.api.gax.longrunning.OperationFuture<ApiConfig,OperationMetadata>
createApiConfigAsync(CreateApiConfigRequest request)
Creates a new ApiConfig in a given project and location.com.google.api.gax.longrunning.OperationFuture<ApiConfig,OperationMetadata>
createApiConfigAsync(String parent, ApiConfig apiConfig, String apiConfigId)
Creates a new ApiConfig in a given project and location.com.google.api.gax.rpc.UnaryCallable<CreateApiConfigRequest,com.google.longrunning.Operation>
createApiConfigCallable()
Creates a new ApiConfig in a given project and location.com.google.api.gax.rpc.OperationCallable<CreateApiConfigRequest,ApiConfig,OperationMetadata>
createApiConfigOperationCallable()
Creates a new ApiConfig in a given project and location.com.google.api.gax.rpc.OperationCallable<CreateApiRequest,Api,OperationMetadata>
createApiOperationCallable()
Creates a new Api in a given project and location.com.google.api.gax.longrunning.OperationFuture<Gateway,OperationMetadata>
createGatewayAsync(CreateGatewayRequest request)
Creates a new Gateway in a given project and location.com.google.api.gax.longrunning.OperationFuture<Gateway,OperationMetadata>
createGatewayAsync(LocationName parent, Gateway gateway, String gatewayId)
Creates a new Gateway in a given project and location.com.google.api.gax.longrunning.OperationFuture<Gateway,OperationMetadata>
createGatewayAsync(String parent, Gateway gateway, String gatewayId)
Creates a new Gateway in a given project and location.com.google.api.gax.rpc.UnaryCallable<CreateGatewayRequest,com.google.longrunning.Operation>
createGatewayCallable()
Creates a new Gateway in a given project and location.com.google.api.gax.rpc.OperationCallable<CreateGatewayRequest,Gateway,OperationMetadata>
createGatewayOperationCallable()
Creates a new Gateway in a given project and location.com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata>
deleteApiAsync(ApiName name)
Deletes a single Api.com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata>
deleteApiAsync(DeleteApiRequest request)
Deletes a single Api.com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata>
deleteApiAsync(String name)
Deletes a single Api.com.google.api.gax.rpc.UnaryCallable<DeleteApiRequest,com.google.longrunning.Operation>
deleteApiCallable()
Deletes a single Api.com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata>
deleteApiConfigAsync(ApiConfigName name)
Deletes a single ApiConfig.com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata>
deleteApiConfigAsync(DeleteApiConfigRequest request)
Deletes a single ApiConfig.com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata>
deleteApiConfigAsync(String name)
Deletes a single ApiConfig.com.google.api.gax.rpc.UnaryCallable<DeleteApiConfigRequest,com.google.longrunning.Operation>
deleteApiConfigCallable()
Deletes a single ApiConfig.com.google.api.gax.rpc.OperationCallable<DeleteApiConfigRequest,com.google.protobuf.Empty,OperationMetadata>
deleteApiConfigOperationCallable()
Deletes a single ApiConfig.com.google.api.gax.rpc.OperationCallable<DeleteApiRequest,com.google.protobuf.Empty,OperationMetadata>
deleteApiOperationCallable()
Deletes a single Api.com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata>
deleteGatewayAsync(DeleteGatewayRequest request)
Deletes a single Gateway.com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata>
deleteGatewayAsync(GatewayName name)
Deletes a single Gateway.com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata>
deleteGatewayAsync(String name)
Deletes a single Gateway.com.google.api.gax.rpc.UnaryCallable<DeleteGatewayRequest,com.google.longrunning.Operation>
deleteGatewayCallable()
Deletes a single Gateway.com.google.api.gax.rpc.OperationCallable<DeleteGatewayRequest,com.google.protobuf.Empty,OperationMetadata>
deleteGatewayOperationCallable()
Deletes a single Gateway.Api
getApi(ApiName name)
Gets details of a single Api.Api
getApi(GetApiRequest request)
Gets details of a single Api.Api
getApi(String name)
Gets details of a single Api.com.google.api.gax.rpc.UnaryCallable<GetApiRequest,Api>
getApiCallable()
Gets details of a single Api.ApiConfig
getApiConfig(ApiConfigName name)
Gets details of a single ApiConfig.ApiConfig
getApiConfig(GetApiConfigRequest request)
Gets details of a single ApiConfig.ApiConfig
getApiConfig(String name)
Gets details of a single ApiConfig.com.google.api.gax.rpc.UnaryCallable<GetApiConfigRequest,ApiConfig>
getApiConfigCallable()
Gets details of a single ApiConfig.Gateway
getGateway(GatewayName name)
Gets details of a single Gateway.Gateway
getGateway(GetGatewayRequest request)
Gets details of a single Gateway.Gateway
getGateway(String name)
Gets details of a single Gateway.com.google.api.gax.rpc.UnaryCallable<GetGatewayRequest,Gateway>
getGatewayCallable()
Gets details of a single Gateway.com.google.api.gax.httpjson.longrunning.OperationsClient
getHttpJsonOperationsClient()
Returns the OperationsClient that can be used to query the status of a long-running operation returned by another API method call.com.google.longrunning.OperationsClient
getOperationsClient()
Returns the OperationsClient that can be used to query the status of a long-running operation returned by another API method call.ApiGatewayServiceSettings
getSettings()
ApiGatewayServiceStub
getStub()
boolean
isShutdown()
boolean
isTerminated()
ApiGatewayServiceClient.ListApiConfigsPagedResponse
listApiConfigs(ApiName parent)
Lists ApiConfigs in a given project and location.ApiGatewayServiceClient.ListApiConfigsPagedResponse
listApiConfigs(ListApiConfigsRequest request)
Lists ApiConfigs in a given project and location.ApiGatewayServiceClient.ListApiConfigsPagedResponse
listApiConfigs(String parent)
Lists ApiConfigs in a given project and location.com.google.api.gax.rpc.UnaryCallable<ListApiConfigsRequest,ListApiConfigsResponse>
listApiConfigsCallable()
Lists ApiConfigs in a given project and location.com.google.api.gax.rpc.UnaryCallable<ListApiConfigsRequest,ApiGatewayServiceClient.ListApiConfigsPagedResponse>
listApiConfigsPagedCallable()
Lists ApiConfigs in a given project and location.ApiGatewayServiceClient.ListApisPagedResponse
listApis(ListApisRequest request)
Lists Apis in a given project and location.ApiGatewayServiceClient.ListApisPagedResponse
listApis(LocationName parent)
Lists Apis in a given project and location.ApiGatewayServiceClient.ListApisPagedResponse
listApis(String parent)
Lists Apis in a given project and location.com.google.api.gax.rpc.UnaryCallable<ListApisRequest,ListApisResponse>
listApisCallable()
Lists Apis in a given project and location.com.google.api.gax.rpc.UnaryCallable<ListApisRequest,ApiGatewayServiceClient.ListApisPagedResponse>
listApisPagedCallable()
Lists Apis in a given project and location.ApiGatewayServiceClient.ListGatewaysPagedResponse
listGateways(ListGatewaysRequest request)
Lists Gateways in a given project and location.ApiGatewayServiceClient.ListGatewaysPagedResponse
listGateways(LocationName parent)
Lists Gateways in a given project and location.ApiGatewayServiceClient.ListGatewaysPagedResponse
listGateways(String parent)
Lists Gateways in a given project and location.com.google.api.gax.rpc.UnaryCallable<ListGatewaysRequest,ListGatewaysResponse>
listGatewaysCallable()
Lists Gateways in a given project and location.com.google.api.gax.rpc.UnaryCallable<ListGatewaysRequest,ApiGatewayServiceClient.ListGatewaysPagedResponse>
listGatewaysPagedCallable()
Lists Gateways in a given project and location.void
shutdown()
void
shutdownNow()
com.google.api.gax.longrunning.OperationFuture<Api,OperationMetadata>
updateApiAsync(Api api, com.google.protobuf.FieldMask updateMask)
Updates the parameters of a single Api.com.google.api.gax.longrunning.OperationFuture<Api,OperationMetadata>
updateApiAsync(UpdateApiRequest request)
Updates the parameters of a single Api.com.google.api.gax.rpc.UnaryCallable<UpdateApiRequest,com.google.longrunning.Operation>
updateApiCallable()
Updates the parameters of a single Api.com.google.api.gax.longrunning.OperationFuture<ApiConfig,OperationMetadata>
updateApiConfigAsync(ApiConfig apiConfig, com.google.protobuf.FieldMask updateMask)
Updates the parameters of a single ApiConfig.com.google.api.gax.longrunning.OperationFuture<ApiConfig,OperationMetadata>
updateApiConfigAsync(UpdateApiConfigRequest request)
Updates the parameters of a single ApiConfig.com.google.api.gax.rpc.UnaryCallable<UpdateApiConfigRequest,com.google.longrunning.Operation>
updateApiConfigCallable()
Updates the parameters of a single ApiConfig.com.google.api.gax.rpc.OperationCallable<UpdateApiConfigRequest,ApiConfig,OperationMetadata>
updateApiConfigOperationCallable()
Updates the parameters of a single ApiConfig.com.google.api.gax.rpc.OperationCallable<UpdateApiRequest,Api,OperationMetadata>
updateApiOperationCallable()
Updates the parameters of a single Api.com.google.api.gax.longrunning.OperationFuture<Gateway,OperationMetadata>
updateGatewayAsync(Gateway gateway, com.google.protobuf.FieldMask updateMask)
Updates the parameters of a single Gateway.com.google.api.gax.longrunning.OperationFuture<Gateway,OperationMetadata>
updateGatewayAsync(UpdateGatewayRequest request)
Updates the parameters of a single Gateway.com.google.api.gax.rpc.UnaryCallable<UpdateGatewayRequest,com.google.longrunning.Operation>
updateGatewayCallable()
Updates the parameters of a single Gateway.com.google.api.gax.rpc.OperationCallable<UpdateGatewayRequest,Gateway,OperationMetadata>
updateGatewayOperationCallable()
Updates the parameters of a single Gateway.
-
-
-
Constructor Detail
-
ApiGatewayServiceClient
protected ApiGatewayServiceClient(ApiGatewayServiceSettings settings) throws IOException
Constructs an instance of ApiGatewayServiceClient, 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.- Throws:
IOException
-
ApiGatewayServiceClient
protected ApiGatewayServiceClient(ApiGatewayServiceStub stub)
-
-
Method Detail
-
create
public static final ApiGatewayServiceClient create() throws IOException
Constructs an instance of ApiGatewayServiceClient with default settings.- Throws:
IOException
-
create
public static final ApiGatewayServiceClient create(ApiGatewayServiceSettings settings) throws IOException
Constructs an instance of ApiGatewayServiceClient, using the given settings. The channels are created based on the settings passed in, or defaults for any settings that are not set.- Throws:
IOException
-
create
public static final ApiGatewayServiceClient create(ApiGatewayServiceStub stub)
Constructs an instance of ApiGatewayServiceClient, using the given stub for making calls. This is for advanced usage - prefer using create(ApiGatewayServiceSettings).
-
getSettings
public final ApiGatewayServiceSettings getSettings()
-
getStub
public ApiGatewayServiceStub getStub()
-
getOperationsClient
public final com.google.longrunning.OperationsClient getOperationsClient()
Returns the OperationsClient that can be used to query the status of a long-running operation returned by another API method call.
-
getHttpJsonOperationsClient
@BetaApi public final com.google.api.gax.httpjson.longrunning.OperationsClient getHttpJsonOperationsClient()
Returns the OperationsClient that can be used to query the status of a long-running operation returned by another API method call.
-
listGateways
public final ApiGatewayServiceClient.ListGatewaysPagedResponse listGateways(LocationName parent)
Lists Gateways in a given project and location.Sample 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 try (ApiGatewayServiceClient apiGatewayServiceClient = ApiGatewayServiceClient.create()) { LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); for (Gateway element : apiGatewayServiceClient.listGateways(parent).iterateAll()) { // doThingsWith(element); } }
- Parameters:
parent
- Required. Parent resource of the Gateway, of the form: `projects/*/locations/*`- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
listGateways
public final ApiGatewayServiceClient.ListGatewaysPagedResponse listGateways(String parent)
Lists Gateways in a given project and location.Sample 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 try (ApiGatewayServiceClient apiGatewayServiceClient = ApiGatewayServiceClient.create()) { String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); for (Gateway element : apiGatewayServiceClient.listGateways(parent).iterateAll()) { // doThingsWith(element); } }
- Parameters:
parent
- Required. Parent resource of the Gateway, of the form: `projects/*/locations/*`- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
listGateways
public final ApiGatewayServiceClient.ListGatewaysPagedResponse listGateways(ListGatewaysRequest request)
Lists Gateways in a given project and location.Sample 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 try (ApiGatewayServiceClient apiGatewayServiceClient = ApiGatewayServiceClient.create()) { ListGatewaysRequest request = ListGatewaysRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .setFilter("filter-1274492040") .setOrderBy("orderBy-1207110587") .build(); for (Gateway element : apiGatewayServiceClient.listGateways(request).iterateAll()) { // doThingsWith(element); } }
- Parameters:
request
- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
listGatewaysPagedCallable
public final com.google.api.gax.rpc.UnaryCallable<ListGatewaysRequest,ApiGatewayServiceClient.ListGatewaysPagedResponse> listGatewaysPagedCallable()
Lists Gateways in a given project and location.Sample 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 try (ApiGatewayServiceClient apiGatewayServiceClient = ApiGatewayServiceClient.create()) { ListGatewaysRequest request = ListGatewaysRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .setFilter("filter-1274492040") .setOrderBy("orderBy-1207110587") .build(); ApiFuture<Gateway> future = apiGatewayServiceClient.listGatewaysPagedCallable().futureCall(request); // Do something. for (Gateway element : future.get().iterateAll()) { // doThingsWith(element); } }
-
listGatewaysCallable
public final com.google.api.gax.rpc.UnaryCallable<ListGatewaysRequest,ListGatewaysResponse> listGatewaysCallable()
Lists Gateways in a given project and location.Sample 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 try (ApiGatewayServiceClient apiGatewayServiceClient = ApiGatewayServiceClient.create()) { ListGatewaysRequest request = ListGatewaysRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .setFilter("filter-1274492040") .setOrderBy("orderBy-1207110587") .build(); while (true) { ListGatewaysResponse response = apiGatewayServiceClient.listGatewaysCallable().call(request); for (Gateway element : response.getGatewaysList()) { // doThingsWith(element); } String nextPageToken = response.getNextPageToken(); if (!Strings.isNullOrEmpty(nextPageToken)) { request = request.toBuilder().setPageToken(nextPageToken).build(); } else { break; } } }
-
getGateway
public final Gateway getGateway(GatewayName name)
Gets details of a single Gateway.Sample 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 try (ApiGatewayServiceClient apiGatewayServiceClient = ApiGatewayServiceClient.create()) { GatewayName name = GatewayName.of("[PROJECT]", "[LOCATION]", "[GATEWAY]"); Gateway response = apiGatewayServiceClient.getGateway(name); }
- Parameters:
name
- Required. Resource name of the form: `projects/*/locations/*/gateways/*`- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
getGateway
public final Gateway getGateway(String name)
Gets details of a single Gateway.Sample 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 try (ApiGatewayServiceClient apiGatewayServiceClient = ApiGatewayServiceClient.create()) { String name = GatewayName.of("[PROJECT]", "[LOCATION]", "[GATEWAY]").toString(); Gateway response = apiGatewayServiceClient.getGateway(name); }
- Parameters:
name
- Required. Resource name of the form: `projects/*/locations/*/gateways/*`- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
getGateway
public final Gateway getGateway(GetGatewayRequest request)
Gets details of a single Gateway.Sample 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 try (ApiGatewayServiceClient apiGatewayServiceClient = ApiGatewayServiceClient.create()) { GetGatewayRequest request = GetGatewayRequest.newBuilder() .setName(GatewayName.of("[PROJECT]", "[LOCATION]", "[GATEWAY]").toString()) .build(); Gateway response = apiGatewayServiceClient.getGateway(request); }
- Parameters:
request
- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
getGatewayCallable
public final com.google.api.gax.rpc.UnaryCallable<GetGatewayRequest,Gateway> getGatewayCallable()
Gets details of a single Gateway.Sample 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 try (ApiGatewayServiceClient apiGatewayServiceClient = ApiGatewayServiceClient.create()) { GetGatewayRequest request = GetGatewayRequest.newBuilder() .setName(GatewayName.of("[PROJECT]", "[LOCATION]", "[GATEWAY]").toString()) .build(); ApiFuture<Gateway> future = apiGatewayServiceClient.getGatewayCallable().futureCall(request); // Do something. Gateway response = future.get(); }
-
createGatewayAsync
public final com.google.api.gax.longrunning.OperationFuture<Gateway,OperationMetadata> createGatewayAsync(LocationName parent, Gateway gateway, String gatewayId)
Creates a new Gateway in a given project and location.Sample 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 try (ApiGatewayServiceClient apiGatewayServiceClient = ApiGatewayServiceClient.create()) { LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); Gateway gateway = Gateway.newBuilder().build(); String gatewayId = "gatewayId-1354641793"; Gateway response = apiGatewayServiceClient.createGatewayAsync(parent, gateway, gatewayId).get(); }
- Parameters:
parent
- Required. Parent resource of the Gateway, of the form: `projects/*/locations/*`gateway
- Required. Gateway resource.gatewayId
- Required. Identifier to assign to the Gateway. Must be unique within scope of the parent resource.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
createGatewayAsync
public final com.google.api.gax.longrunning.OperationFuture<Gateway,OperationMetadata> createGatewayAsync(String parent, Gateway gateway, String gatewayId)
Creates a new Gateway in a given project and location.Sample 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 try (ApiGatewayServiceClient apiGatewayServiceClient = ApiGatewayServiceClient.create()) { String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); Gateway gateway = Gateway.newBuilder().build(); String gatewayId = "gatewayId-1354641793"; Gateway response = apiGatewayServiceClient.createGatewayAsync(parent, gateway, gatewayId).get(); }
- Parameters:
parent
- Required. Parent resource of the Gateway, of the form: `projects/*/locations/*`gateway
- Required. Gateway resource.gatewayId
- Required. Identifier to assign to the Gateway. Must be unique within scope of the parent resource.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
createGatewayAsync
public final com.google.api.gax.longrunning.OperationFuture<Gateway,OperationMetadata> createGatewayAsync(CreateGatewayRequest request)
Creates a new Gateway in a given project and location.Sample 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 try (ApiGatewayServiceClient apiGatewayServiceClient = ApiGatewayServiceClient.create()) { CreateGatewayRequest request = CreateGatewayRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setGatewayId("gatewayId-1354641793") .setGateway(Gateway.newBuilder().build()) .build(); Gateway response = apiGatewayServiceClient.createGatewayAsync(request).get(); }
- Parameters:
request
- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
createGatewayOperationCallable
public final com.google.api.gax.rpc.OperationCallable<CreateGatewayRequest,Gateway,OperationMetadata> createGatewayOperationCallable()
Creates a new Gateway in a given project and location.Sample 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 try (ApiGatewayServiceClient apiGatewayServiceClient = ApiGatewayServiceClient.create()) { CreateGatewayRequest request = CreateGatewayRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setGatewayId("gatewayId-1354641793") .setGateway(Gateway.newBuilder().build()) .build(); OperationFuture<Gateway, OperationMetadata> future = apiGatewayServiceClient.createGatewayOperationCallable().futureCall(request); // Do something. Gateway response = future.get(); }
-
createGatewayCallable
public final com.google.api.gax.rpc.UnaryCallable<CreateGatewayRequest,com.google.longrunning.Operation> createGatewayCallable()
Creates a new Gateway in a given project and location.Sample 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 try (ApiGatewayServiceClient apiGatewayServiceClient = ApiGatewayServiceClient.create()) { CreateGatewayRequest request = CreateGatewayRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setGatewayId("gatewayId-1354641793") .setGateway(Gateway.newBuilder().build()) .build(); ApiFuture<Operation> future = apiGatewayServiceClient.createGatewayCallable().futureCall(request); // Do something. Operation response = future.get(); }
-
updateGatewayAsync
public final com.google.api.gax.longrunning.OperationFuture<Gateway,OperationMetadata> updateGatewayAsync(Gateway gateway, com.google.protobuf.FieldMask updateMask)
Updates the parameters of a single Gateway.Sample 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 try (ApiGatewayServiceClient apiGatewayServiceClient = ApiGatewayServiceClient.create()) { Gateway gateway = Gateway.newBuilder().build(); FieldMask updateMask = FieldMask.newBuilder().build(); Gateway response = apiGatewayServiceClient.updateGatewayAsync(gateway, updateMask).get(); }
- Parameters:
gateway
- Required. Gateway resource.updateMask
- Field mask is used to specify the fields to be overwritten in the Gateway resource by the update. The fields specified in the update_mask are relative to the resource, not the full request. A field will be overwritten if it is in the mask. If the user does not provide a mask then all fields will be overwritten.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
updateGatewayAsync
public final com.google.api.gax.longrunning.OperationFuture<Gateway,OperationMetadata> updateGatewayAsync(UpdateGatewayRequest request)
Updates the parameters of a single Gateway.Sample 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 try (ApiGatewayServiceClient apiGatewayServiceClient = ApiGatewayServiceClient.create()) { UpdateGatewayRequest request = UpdateGatewayRequest.newBuilder() .setUpdateMask(FieldMask.newBuilder().build()) .setGateway(Gateway.newBuilder().build()) .build(); Gateway response = apiGatewayServiceClient.updateGatewayAsync(request).get(); }
- Parameters:
request
- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
updateGatewayOperationCallable
public final com.google.api.gax.rpc.OperationCallable<UpdateGatewayRequest,Gateway,OperationMetadata> updateGatewayOperationCallable()
Updates the parameters of a single Gateway.Sample 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 try (ApiGatewayServiceClient apiGatewayServiceClient = ApiGatewayServiceClient.create()) { UpdateGatewayRequest request = UpdateGatewayRequest.newBuilder() .setUpdateMask(FieldMask.newBuilder().build()) .setGateway(Gateway.newBuilder().build()) .build(); OperationFuture<Gateway, OperationMetadata> future = apiGatewayServiceClient.updateGatewayOperationCallable().futureCall(request); // Do something. Gateway response = future.get(); }
-
updateGatewayCallable
public final com.google.api.gax.rpc.UnaryCallable<UpdateGatewayRequest,com.google.longrunning.Operation> updateGatewayCallable()
Updates the parameters of a single Gateway.Sample 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 try (ApiGatewayServiceClient apiGatewayServiceClient = ApiGatewayServiceClient.create()) { UpdateGatewayRequest request = UpdateGatewayRequest.newBuilder() .setUpdateMask(FieldMask.newBuilder().build()) .setGateway(Gateway.newBuilder().build()) .build(); ApiFuture<Operation> future = apiGatewayServiceClient.updateGatewayCallable().futureCall(request); // Do something. Operation response = future.get(); }
-
deleteGatewayAsync
public final com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteGatewayAsync(GatewayName name)
Deletes a single Gateway.Sample 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 try (ApiGatewayServiceClient apiGatewayServiceClient = ApiGatewayServiceClient.create()) { GatewayName name = GatewayName.of("[PROJECT]", "[LOCATION]", "[GATEWAY]"); apiGatewayServiceClient.deleteGatewayAsync(name).get(); }
- Parameters:
name
- Required. Resource name of the form: `projects/*/locations/*/gateways/*`- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
deleteGatewayAsync
public final com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteGatewayAsync(String name)
Deletes a single Gateway.Sample 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 try (ApiGatewayServiceClient apiGatewayServiceClient = ApiGatewayServiceClient.create()) { String name = GatewayName.of("[PROJECT]", "[LOCATION]", "[GATEWAY]").toString(); apiGatewayServiceClient.deleteGatewayAsync(name).get(); }
- Parameters:
name
- Required. Resource name of the form: `projects/*/locations/*/gateways/*`- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
deleteGatewayAsync
public final com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteGatewayAsync(DeleteGatewayRequest request)
Deletes a single Gateway.Sample 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 try (ApiGatewayServiceClient apiGatewayServiceClient = ApiGatewayServiceClient.create()) { DeleteGatewayRequest request = DeleteGatewayRequest.newBuilder() .setName(GatewayName.of("[PROJECT]", "[LOCATION]", "[GATEWAY]").toString()) .build(); apiGatewayServiceClient.deleteGatewayAsync(request).get(); }
- Parameters:
request
- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
deleteGatewayOperationCallable
public final com.google.api.gax.rpc.OperationCallable<DeleteGatewayRequest,com.google.protobuf.Empty,OperationMetadata> deleteGatewayOperationCallable()
Deletes a single Gateway.Sample 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 try (ApiGatewayServiceClient apiGatewayServiceClient = ApiGatewayServiceClient.create()) { DeleteGatewayRequest request = DeleteGatewayRequest.newBuilder() .setName(GatewayName.of("[PROJECT]", "[LOCATION]", "[GATEWAY]").toString()) .build(); OperationFuture<Empty, OperationMetadata> future = apiGatewayServiceClient.deleteGatewayOperationCallable().futureCall(request); // Do something. future.get(); }
-
deleteGatewayCallable
public final com.google.api.gax.rpc.UnaryCallable<DeleteGatewayRequest,com.google.longrunning.Operation> deleteGatewayCallable()
Deletes a single Gateway.Sample 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 try (ApiGatewayServiceClient apiGatewayServiceClient = ApiGatewayServiceClient.create()) { DeleteGatewayRequest request = DeleteGatewayRequest.newBuilder() .setName(GatewayName.of("[PROJECT]", "[LOCATION]", "[GATEWAY]").toString()) .build(); ApiFuture<Operation> future = apiGatewayServiceClient.deleteGatewayCallable().futureCall(request); // Do something. future.get(); }
-
listApis
public final ApiGatewayServiceClient.ListApisPagedResponse listApis(LocationName parent)
Lists Apis in a given project and location.Sample 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 try (ApiGatewayServiceClient apiGatewayServiceClient = ApiGatewayServiceClient.create()) { LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); for (Api element : apiGatewayServiceClient.listApis(parent).iterateAll()) { // doThingsWith(element); } }
- Parameters:
parent
- Required. Parent resource of the API, of the form: `projects/*/locations/global`- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
listApis
public final ApiGatewayServiceClient.ListApisPagedResponse listApis(String parent)
Lists Apis in a given project and location.Sample 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 try (ApiGatewayServiceClient apiGatewayServiceClient = ApiGatewayServiceClient.create()) { String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); for (Api element : apiGatewayServiceClient.listApis(parent).iterateAll()) { // doThingsWith(element); } }
- Parameters:
parent
- Required. Parent resource of the API, of the form: `projects/*/locations/global`- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
listApis
public final ApiGatewayServiceClient.ListApisPagedResponse listApis(ListApisRequest request)
Lists Apis in a given project and location.Sample 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 try (ApiGatewayServiceClient apiGatewayServiceClient = ApiGatewayServiceClient.create()) { ListApisRequest request = ListApisRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .setFilter("filter-1274492040") .setOrderBy("orderBy-1207110587") .build(); for (Api element : apiGatewayServiceClient.listApis(request).iterateAll()) { // doThingsWith(element); } }
- Parameters:
request
- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
listApisPagedCallable
public final com.google.api.gax.rpc.UnaryCallable<ListApisRequest,ApiGatewayServiceClient.ListApisPagedResponse> listApisPagedCallable()
Lists Apis in a given project and location.Sample 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 try (ApiGatewayServiceClient apiGatewayServiceClient = ApiGatewayServiceClient.create()) { ListApisRequest request = ListApisRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .setFilter("filter-1274492040") .setOrderBy("orderBy-1207110587") .build(); ApiFuture<Api> future = apiGatewayServiceClient.listApisPagedCallable().futureCall(request); // Do something. for (Api element : future.get().iterateAll()) { // doThingsWith(element); } }
-
listApisCallable
public final com.google.api.gax.rpc.UnaryCallable<ListApisRequest,ListApisResponse> listApisCallable()
Lists Apis in a given project and location.Sample 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 try (ApiGatewayServiceClient apiGatewayServiceClient = ApiGatewayServiceClient.create()) { ListApisRequest request = ListApisRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .setFilter("filter-1274492040") .setOrderBy("orderBy-1207110587") .build(); while (true) { ListApisResponse response = apiGatewayServiceClient.listApisCallable().call(request); for (Api element : response.getApisList()) { // doThingsWith(element); } String nextPageToken = response.getNextPageToken(); if (!Strings.isNullOrEmpty(nextPageToken)) { request = request.toBuilder().setPageToken(nextPageToken).build(); } else { break; } } }
-
getApi
public final Api getApi(ApiName name)
Gets details of a single Api.Sample 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 try (ApiGatewayServiceClient apiGatewayServiceClient = ApiGatewayServiceClient.create()) { ApiName name = ApiName.of("[PROJECT]", "[API]"); Api response = apiGatewayServiceClient.getApi(name); }
- Parameters:
name
- Required. Resource name of the form: `projects/*/locations/global/apis/*`- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
getApi
public final Api getApi(String name)
Gets details of a single Api.Sample 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 try (ApiGatewayServiceClient apiGatewayServiceClient = ApiGatewayServiceClient.create()) { String name = ApiName.of("[PROJECT]", "[API]").toString(); Api response = apiGatewayServiceClient.getApi(name); }
- Parameters:
name
- Required. Resource name of the form: `projects/*/locations/global/apis/*`- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
getApi
public final Api getApi(GetApiRequest request)
Gets details of a single Api.Sample 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 try (ApiGatewayServiceClient apiGatewayServiceClient = ApiGatewayServiceClient.create()) { GetApiRequest request = GetApiRequest.newBuilder().setName(ApiName.of("[PROJECT]", "[API]").toString()).build(); Api response = apiGatewayServiceClient.getApi(request); }
- Parameters:
request
- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
getApiCallable
public final com.google.api.gax.rpc.UnaryCallable<GetApiRequest,Api> getApiCallable()
Gets details of a single Api.Sample 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 try (ApiGatewayServiceClient apiGatewayServiceClient = ApiGatewayServiceClient.create()) { GetApiRequest request = GetApiRequest.newBuilder().setName(ApiName.of("[PROJECT]", "[API]").toString()).build(); ApiFuture<Api> future = apiGatewayServiceClient.getApiCallable().futureCall(request); // Do something. Api response = future.get(); }
-
createApiAsync
public final com.google.api.gax.longrunning.OperationFuture<Api,OperationMetadata> createApiAsync(LocationName parent, Api api, String apiId)
Creates a new Api in a given project and location.Sample 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 try (ApiGatewayServiceClient apiGatewayServiceClient = ApiGatewayServiceClient.create()) { LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); Api api = Api.newBuilder().build(); String apiId = "apiId93021397"; Api response = apiGatewayServiceClient.createApiAsync(parent, api, apiId).get(); }
- Parameters:
parent
- Required. Parent resource of the API, of the form: `projects/*/locations/global`api
- Required. API resource.apiId
- Required. Identifier to assign to the API. Must be unique within scope of the parent resource.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
createApiAsync
public final com.google.api.gax.longrunning.OperationFuture<Api,OperationMetadata> createApiAsync(String parent, Api api, String apiId)
Creates a new Api in a given project and location.Sample 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 try (ApiGatewayServiceClient apiGatewayServiceClient = ApiGatewayServiceClient.create()) { String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); Api api = Api.newBuilder().build(); String apiId = "apiId93021397"; Api response = apiGatewayServiceClient.createApiAsync(parent, api, apiId).get(); }
- Parameters:
parent
- Required. Parent resource of the API, of the form: `projects/*/locations/global`api
- Required. API resource.apiId
- Required. Identifier to assign to the API. Must be unique within scope of the parent resource.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
createApiAsync
public final com.google.api.gax.longrunning.OperationFuture<Api,OperationMetadata> createApiAsync(CreateApiRequest request)
Creates a new Api in a given project and location.Sample 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 try (ApiGatewayServiceClient apiGatewayServiceClient = ApiGatewayServiceClient.create()) { CreateApiRequest request = CreateApiRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setApiId("apiId93021397") .setApi(Api.newBuilder().build()) .build(); Api response = apiGatewayServiceClient.createApiAsync(request).get(); }
- Parameters:
request
- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
createApiOperationCallable
public final com.google.api.gax.rpc.OperationCallable<CreateApiRequest,Api,OperationMetadata> createApiOperationCallable()
Creates a new Api in a given project and location.Sample 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 try (ApiGatewayServiceClient apiGatewayServiceClient = ApiGatewayServiceClient.create()) { CreateApiRequest request = CreateApiRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setApiId("apiId93021397") .setApi(Api.newBuilder().build()) .build(); OperationFuture<Api, OperationMetadata> future = apiGatewayServiceClient.createApiOperationCallable().futureCall(request); // Do something. Api response = future.get(); }
-
createApiCallable
public final com.google.api.gax.rpc.UnaryCallable<CreateApiRequest,com.google.longrunning.Operation> createApiCallable()
Creates a new Api in a given project and location.Sample 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 try (ApiGatewayServiceClient apiGatewayServiceClient = ApiGatewayServiceClient.create()) { CreateApiRequest request = CreateApiRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setApiId("apiId93021397") .setApi(Api.newBuilder().build()) .build(); ApiFuture<Operation> future = apiGatewayServiceClient.createApiCallable().futureCall(request); // Do something. Operation response = future.get(); }
-
updateApiAsync
public final com.google.api.gax.longrunning.OperationFuture<Api,OperationMetadata> updateApiAsync(Api api, com.google.protobuf.FieldMask updateMask)
Updates the parameters of a single Api.Sample 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 try (ApiGatewayServiceClient apiGatewayServiceClient = ApiGatewayServiceClient.create()) { Api api = Api.newBuilder().build(); FieldMask updateMask = FieldMask.newBuilder().build(); Api response = apiGatewayServiceClient.updateApiAsync(api, updateMask).get(); }
- Parameters:
api
- Required. API resource.updateMask
- Field mask is used to specify the fields to be overwritten in the Api resource by the update. The fields specified in the update_mask are relative to the resource, not the full request. A field will be overwritten if it is in the mask. If the user does not provide a mask then all fields will be overwritten.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
updateApiAsync
public final com.google.api.gax.longrunning.OperationFuture<Api,OperationMetadata> updateApiAsync(UpdateApiRequest request)
Updates the parameters of a single Api.Sample 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 try (ApiGatewayServiceClient apiGatewayServiceClient = ApiGatewayServiceClient.create()) { UpdateApiRequest request = UpdateApiRequest.newBuilder() .setUpdateMask(FieldMask.newBuilder().build()) .setApi(Api.newBuilder().build()) .build(); Api response = apiGatewayServiceClient.updateApiAsync(request).get(); }
- Parameters:
request
- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
updateApiOperationCallable
public final com.google.api.gax.rpc.OperationCallable<UpdateApiRequest,Api,OperationMetadata> updateApiOperationCallable()
Updates the parameters of a single Api.Sample 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 try (ApiGatewayServiceClient apiGatewayServiceClient = ApiGatewayServiceClient.create()) { UpdateApiRequest request = UpdateApiRequest.newBuilder() .setUpdateMask(FieldMask.newBuilder().build()) .setApi(Api.newBuilder().build()) .build(); OperationFuture<Api, OperationMetadata> future = apiGatewayServiceClient.updateApiOperationCallable().futureCall(request); // Do something. Api response = future.get(); }
-
updateApiCallable
public final com.google.api.gax.rpc.UnaryCallable<UpdateApiRequest,com.google.longrunning.Operation> updateApiCallable()
Updates the parameters of a single Api.Sample 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 try (ApiGatewayServiceClient apiGatewayServiceClient = ApiGatewayServiceClient.create()) { UpdateApiRequest request = UpdateApiRequest.newBuilder() .setUpdateMask(FieldMask.newBuilder().build()) .setApi(Api.newBuilder().build()) .build(); ApiFuture<Operation> future = apiGatewayServiceClient.updateApiCallable().futureCall(request); // Do something. Operation response = future.get(); }
-
deleteApiAsync
public final com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteApiAsync(ApiName name)
Deletes a single Api.Sample 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 try (ApiGatewayServiceClient apiGatewayServiceClient = ApiGatewayServiceClient.create()) { ApiName name = ApiName.of("[PROJECT]", "[API]"); apiGatewayServiceClient.deleteApiAsync(name).get(); }
- Parameters:
name
- Required. Resource name of the form: `projects/*/locations/global/apis/*`- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
deleteApiAsync
public final com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteApiAsync(String name)
Deletes a single Api.Sample 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 try (ApiGatewayServiceClient apiGatewayServiceClient = ApiGatewayServiceClient.create()) { String name = ApiName.of("[PROJECT]", "[API]").toString(); apiGatewayServiceClient.deleteApiAsync(name).get(); }
- Parameters:
name
- Required. Resource name of the form: `projects/*/locations/global/apis/*`- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
deleteApiAsync
public final com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteApiAsync(DeleteApiRequest request)
Deletes a single Api.Sample 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 try (ApiGatewayServiceClient apiGatewayServiceClient = ApiGatewayServiceClient.create()) { DeleteApiRequest request = DeleteApiRequest.newBuilder() .setName(ApiName.of("[PROJECT]", "[API]").toString()) .build(); apiGatewayServiceClient.deleteApiAsync(request).get(); }
- Parameters:
request
- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
deleteApiOperationCallable
public final com.google.api.gax.rpc.OperationCallable<DeleteApiRequest,com.google.protobuf.Empty,OperationMetadata> deleteApiOperationCallable()
Deletes a single Api.Sample 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 try (ApiGatewayServiceClient apiGatewayServiceClient = ApiGatewayServiceClient.create()) { DeleteApiRequest request = DeleteApiRequest.newBuilder() .setName(ApiName.of("[PROJECT]", "[API]").toString()) .build(); OperationFuture<Empty, OperationMetadata> future = apiGatewayServiceClient.deleteApiOperationCallable().futureCall(request); // Do something. future.get(); }
-
deleteApiCallable
public final com.google.api.gax.rpc.UnaryCallable<DeleteApiRequest,com.google.longrunning.Operation> deleteApiCallable()
Deletes a single Api.Sample 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 try (ApiGatewayServiceClient apiGatewayServiceClient = ApiGatewayServiceClient.create()) { DeleteApiRequest request = DeleteApiRequest.newBuilder() .setName(ApiName.of("[PROJECT]", "[API]").toString()) .build(); ApiFuture<Operation> future = apiGatewayServiceClient.deleteApiCallable().futureCall(request); // Do something. future.get(); }
-
listApiConfigs
public final ApiGatewayServiceClient.ListApiConfigsPagedResponse listApiConfigs(ApiName parent)
Lists ApiConfigs in a given project and location.Sample 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 try (ApiGatewayServiceClient apiGatewayServiceClient = ApiGatewayServiceClient.create()) { ApiName parent = ApiName.of("[PROJECT]", "[API]"); for (ApiConfig element : apiGatewayServiceClient.listApiConfigs(parent).iterateAll()) { // doThingsWith(element); } }
- Parameters:
parent
- Required. Parent resource of the API Config, of the form: `projects/*/locations/global/apis/*`- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
listApiConfigs
public final ApiGatewayServiceClient.ListApiConfigsPagedResponse listApiConfigs(String parent)
Lists ApiConfigs in a given project and location.Sample 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 try (ApiGatewayServiceClient apiGatewayServiceClient = ApiGatewayServiceClient.create()) { String parent = ApiName.of("[PROJECT]", "[API]").toString(); for (ApiConfig element : apiGatewayServiceClient.listApiConfigs(parent).iterateAll()) { // doThingsWith(element); } }
- Parameters:
parent
- Required. Parent resource of the API Config, of the form: `projects/*/locations/global/apis/*`- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
listApiConfigs
public final ApiGatewayServiceClient.ListApiConfigsPagedResponse listApiConfigs(ListApiConfigsRequest request)
Lists ApiConfigs in a given project and location.Sample 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 try (ApiGatewayServiceClient apiGatewayServiceClient = ApiGatewayServiceClient.create()) { ListApiConfigsRequest request = ListApiConfigsRequest.newBuilder() .setParent(ApiName.of("[PROJECT]", "[API]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .setFilter("filter-1274492040") .setOrderBy("orderBy-1207110587") .build(); for (ApiConfig element : apiGatewayServiceClient.listApiConfigs(request).iterateAll()) { // doThingsWith(element); } }
- Parameters:
request
- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
listApiConfigsPagedCallable
public final com.google.api.gax.rpc.UnaryCallable<ListApiConfigsRequest,ApiGatewayServiceClient.ListApiConfigsPagedResponse> listApiConfigsPagedCallable()
Lists ApiConfigs in a given project and location.Sample 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 try (ApiGatewayServiceClient apiGatewayServiceClient = ApiGatewayServiceClient.create()) { ListApiConfigsRequest request = ListApiConfigsRequest.newBuilder() .setParent(ApiName.of("[PROJECT]", "[API]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .setFilter("filter-1274492040") .setOrderBy("orderBy-1207110587") .build(); ApiFuture<ApiConfig> future = apiGatewayServiceClient.listApiConfigsPagedCallable().futureCall(request); // Do something. for (ApiConfig element : future.get().iterateAll()) { // doThingsWith(element); } }
-
listApiConfigsCallable
public final com.google.api.gax.rpc.UnaryCallable<ListApiConfigsRequest,ListApiConfigsResponse> listApiConfigsCallable()
Lists ApiConfigs in a given project and location.Sample 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 try (ApiGatewayServiceClient apiGatewayServiceClient = ApiGatewayServiceClient.create()) { ListApiConfigsRequest request = ListApiConfigsRequest.newBuilder() .setParent(ApiName.of("[PROJECT]", "[API]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .setFilter("filter-1274492040") .setOrderBy("orderBy-1207110587") .build(); while (true) { ListApiConfigsResponse response = apiGatewayServiceClient.listApiConfigsCallable().call(request); for (ApiConfig element : response.getApiConfigsList()) { // doThingsWith(element); } String nextPageToken = response.getNextPageToken(); if (!Strings.isNullOrEmpty(nextPageToken)) { request = request.toBuilder().setPageToken(nextPageToken).build(); } else { break; } } }
-
getApiConfig
public final ApiConfig getApiConfig(ApiConfigName name)
Gets details of a single ApiConfig.Sample 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 try (ApiGatewayServiceClient apiGatewayServiceClient = ApiGatewayServiceClient.create()) { ApiConfigName name = ApiConfigName.of("[PROJECT]", "[API]", "[API_CONFIG]"); ApiConfig response = apiGatewayServiceClient.getApiConfig(name); }
- Parameters:
name
- Required. Resource name of the form: `projects/*/locations/global/apis/*/configs/*`- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
getApiConfig
public final ApiConfig getApiConfig(String name)
Gets details of a single ApiConfig.Sample 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 try (ApiGatewayServiceClient apiGatewayServiceClient = ApiGatewayServiceClient.create()) { String name = ApiConfigName.of("[PROJECT]", "[API]", "[API_CONFIG]").toString(); ApiConfig response = apiGatewayServiceClient.getApiConfig(name); }
- Parameters:
name
- Required. Resource name of the form: `projects/*/locations/global/apis/*/configs/*`- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
getApiConfig
public final ApiConfig getApiConfig(GetApiConfigRequest request)
Gets details of a single ApiConfig.Sample 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 try (ApiGatewayServiceClient apiGatewayServiceClient = ApiGatewayServiceClient.create()) { GetApiConfigRequest request = GetApiConfigRequest.newBuilder() .setName(ApiConfigName.of("[PROJECT]", "[API]", "[API_CONFIG]").toString()) .build(); ApiConfig response = apiGatewayServiceClient.getApiConfig(request); }
- Parameters:
request
- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
getApiConfigCallable
public final com.google.api.gax.rpc.UnaryCallable<GetApiConfigRequest,ApiConfig> getApiConfigCallable()
Gets details of a single ApiConfig.Sample 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 try (ApiGatewayServiceClient apiGatewayServiceClient = ApiGatewayServiceClient.create()) { GetApiConfigRequest request = GetApiConfigRequest.newBuilder() .setName(ApiConfigName.of("[PROJECT]", "[API]", "[API_CONFIG]").toString()) .build(); ApiFuture<ApiConfig> future = apiGatewayServiceClient.getApiConfigCallable().futureCall(request); // Do something. ApiConfig response = future.get(); }
-
createApiConfigAsync
public final com.google.api.gax.longrunning.OperationFuture<ApiConfig,OperationMetadata> createApiConfigAsync(ApiName parent, ApiConfig apiConfig, String apiConfigId)
Creates a new ApiConfig in a given project and location.Sample 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 try (ApiGatewayServiceClient apiGatewayServiceClient = ApiGatewayServiceClient.create()) { ApiName parent = ApiName.of("[PROJECT]", "[API]"); ApiConfig apiConfig = ApiConfig.newBuilder().build(); String apiConfigId = "apiConfigId-64952265"; ApiConfig response = apiGatewayServiceClient.createApiConfigAsync(parent, apiConfig, apiConfigId).get(); }
- Parameters:
parent
- Required. Parent resource of the API Config, of the form: `projects/*/locations/global/apis/*`apiConfig
- Required. API resource.apiConfigId
- Required. Identifier to assign to the API Config. Must be unique within scope of the parent resource.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
createApiConfigAsync
public final com.google.api.gax.longrunning.OperationFuture<ApiConfig,OperationMetadata> createApiConfigAsync(String parent, ApiConfig apiConfig, String apiConfigId)
Creates a new ApiConfig in a given project and location.Sample 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 try (ApiGatewayServiceClient apiGatewayServiceClient = ApiGatewayServiceClient.create()) { String parent = ApiName.of("[PROJECT]", "[API]").toString(); ApiConfig apiConfig = ApiConfig.newBuilder().build(); String apiConfigId = "apiConfigId-64952265"; ApiConfig response = apiGatewayServiceClient.createApiConfigAsync(parent, apiConfig, apiConfigId).get(); }
- Parameters:
parent
- Required. Parent resource of the API Config, of the form: `projects/*/locations/global/apis/*`apiConfig
- Required. API resource.apiConfigId
- Required. Identifier to assign to the API Config. Must be unique within scope of the parent resource.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
createApiConfigAsync
public final com.google.api.gax.longrunning.OperationFuture<ApiConfig,OperationMetadata> createApiConfigAsync(CreateApiConfigRequest request)
Creates a new ApiConfig in a given project and location.Sample 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 try (ApiGatewayServiceClient apiGatewayServiceClient = ApiGatewayServiceClient.create()) { CreateApiConfigRequest request = CreateApiConfigRequest.newBuilder() .setParent(ApiName.of("[PROJECT]", "[API]").toString()) .setApiConfigId("apiConfigId-64952265") .setApiConfig(ApiConfig.newBuilder().build()) .build(); ApiConfig response = apiGatewayServiceClient.createApiConfigAsync(request).get(); }
- Parameters:
request
- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
createApiConfigOperationCallable
public final com.google.api.gax.rpc.OperationCallable<CreateApiConfigRequest,ApiConfig,OperationMetadata> createApiConfigOperationCallable()
Creates a new ApiConfig in a given project and location.Sample 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 try (ApiGatewayServiceClient apiGatewayServiceClient = ApiGatewayServiceClient.create()) { CreateApiConfigRequest request = CreateApiConfigRequest.newBuilder() .setParent(ApiName.of("[PROJECT]", "[API]").toString()) .setApiConfigId("apiConfigId-64952265") .setApiConfig(ApiConfig.newBuilder().build()) .build(); OperationFuture<ApiConfig, OperationMetadata> future = apiGatewayServiceClient.createApiConfigOperationCallable().futureCall(request); // Do something. ApiConfig response = future.get(); }
-
createApiConfigCallable
public final com.google.api.gax.rpc.UnaryCallable<CreateApiConfigRequest,com.google.longrunning.Operation> createApiConfigCallable()
Creates a new ApiConfig in a given project and location.Sample 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 try (ApiGatewayServiceClient apiGatewayServiceClient = ApiGatewayServiceClient.create()) { CreateApiConfigRequest request = CreateApiConfigRequest.newBuilder() .setParent(ApiName.of("[PROJECT]", "[API]").toString()) .setApiConfigId("apiConfigId-64952265") .setApiConfig(ApiConfig.newBuilder().build()) .build(); ApiFuture<Operation> future = apiGatewayServiceClient.createApiConfigCallable().futureCall(request); // Do something. Operation response = future.get(); }
-
updateApiConfigAsync
public final com.google.api.gax.longrunning.OperationFuture<ApiConfig,OperationMetadata> updateApiConfigAsync(ApiConfig apiConfig, com.google.protobuf.FieldMask updateMask)
Updates the parameters of a single ApiConfig.Sample 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 try (ApiGatewayServiceClient apiGatewayServiceClient = ApiGatewayServiceClient.create()) { ApiConfig apiConfig = ApiConfig.newBuilder().build(); FieldMask updateMask = FieldMask.newBuilder().build(); ApiConfig response = apiGatewayServiceClient.updateApiConfigAsync(apiConfig, updateMask).get(); }
- Parameters:
apiConfig
- Required. API Config resource.updateMask
- Field mask is used to specify the fields to be overwritten in the ApiConfig resource by the update. The fields specified in the update_mask are relative to the resource, not the full request. A field will be overwritten if it is in the mask. If the user does not provide a mask then all fields will be overwritten.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
updateApiConfigAsync
public final com.google.api.gax.longrunning.OperationFuture<ApiConfig,OperationMetadata> updateApiConfigAsync(UpdateApiConfigRequest request)
Updates the parameters of a single ApiConfig.Sample 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 try (ApiGatewayServiceClient apiGatewayServiceClient = ApiGatewayServiceClient.create()) { UpdateApiConfigRequest request = UpdateApiConfigRequest.newBuilder() .setUpdateMask(FieldMask.newBuilder().build()) .setApiConfig(ApiConfig.newBuilder().build()) .build(); ApiConfig response = apiGatewayServiceClient.updateApiConfigAsync(request).get(); }
- Parameters:
request
- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
updateApiConfigOperationCallable
public final com.google.api.gax.rpc.OperationCallable<UpdateApiConfigRequest,ApiConfig,OperationMetadata> updateApiConfigOperationCallable()
Updates the parameters of a single ApiConfig.Sample 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 try (ApiGatewayServiceClient apiGatewayServiceClient = ApiGatewayServiceClient.create()) { UpdateApiConfigRequest request = UpdateApiConfigRequest.newBuilder() .setUpdateMask(FieldMask.newBuilder().build()) .setApiConfig(ApiConfig.newBuilder().build()) .build(); OperationFuture<ApiConfig, OperationMetadata> future = apiGatewayServiceClient.updateApiConfigOperationCallable().futureCall(request); // Do something. ApiConfig response = future.get(); }
-
updateApiConfigCallable
public final com.google.api.gax.rpc.UnaryCallable<UpdateApiConfigRequest,com.google.longrunning.Operation> updateApiConfigCallable()
Updates the parameters of a single ApiConfig.Sample 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 try (ApiGatewayServiceClient apiGatewayServiceClient = ApiGatewayServiceClient.create()) { UpdateApiConfigRequest request = UpdateApiConfigRequest.newBuilder() .setUpdateMask(FieldMask.newBuilder().build()) .setApiConfig(ApiConfig.newBuilder().build()) .build(); ApiFuture<Operation> future = apiGatewayServiceClient.updateApiConfigCallable().futureCall(request); // Do something. Operation response = future.get(); }
-
deleteApiConfigAsync
public final com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteApiConfigAsync(ApiConfigName name)
Deletes a single ApiConfig.Sample 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 try (ApiGatewayServiceClient apiGatewayServiceClient = ApiGatewayServiceClient.create()) { ApiConfigName name = ApiConfigName.of("[PROJECT]", "[API]", "[API_CONFIG]"); apiGatewayServiceClient.deleteApiConfigAsync(name).get(); }
- Parameters:
name
- Required. Resource name of the form: `projects/*/locations/global/apis/*/configs/*`- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
deleteApiConfigAsync
public final com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteApiConfigAsync(String name)
Deletes a single ApiConfig.Sample 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 try (ApiGatewayServiceClient apiGatewayServiceClient = ApiGatewayServiceClient.create()) { String name = ApiConfigName.of("[PROJECT]", "[API]", "[API_CONFIG]").toString(); apiGatewayServiceClient.deleteApiConfigAsync(name).get(); }
- Parameters:
name
- Required. Resource name of the form: `projects/*/locations/global/apis/*/configs/*`- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
deleteApiConfigAsync
public final com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteApiConfigAsync(DeleteApiConfigRequest request)
Deletes a single ApiConfig.Sample 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 try (ApiGatewayServiceClient apiGatewayServiceClient = ApiGatewayServiceClient.create()) { DeleteApiConfigRequest request = DeleteApiConfigRequest.newBuilder() .setName(ApiConfigName.of("[PROJECT]", "[API]", "[API_CONFIG]").toString()) .build(); apiGatewayServiceClient.deleteApiConfigAsync(request).get(); }
- Parameters:
request
- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
deleteApiConfigOperationCallable
public final com.google.api.gax.rpc.OperationCallable<DeleteApiConfigRequest,com.google.protobuf.Empty,OperationMetadata> deleteApiConfigOperationCallable()
Deletes a single ApiConfig.Sample 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 try (ApiGatewayServiceClient apiGatewayServiceClient = ApiGatewayServiceClient.create()) { DeleteApiConfigRequest request = DeleteApiConfigRequest.newBuilder() .setName(ApiConfigName.of("[PROJECT]", "[API]", "[API_CONFIG]").toString()) .build(); OperationFuture<Empty, OperationMetadata> future = apiGatewayServiceClient.deleteApiConfigOperationCallable().futureCall(request); // Do something. future.get(); }
-
deleteApiConfigCallable
public final com.google.api.gax.rpc.UnaryCallable<DeleteApiConfigRequest,com.google.longrunning.Operation> deleteApiConfigCallable()
Deletes a single ApiConfig.Sample 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 try (ApiGatewayServiceClient apiGatewayServiceClient = ApiGatewayServiceClient.create()) { DeleteApiConfigRequest request = DeleteApiConfigRequest.newBuilder() .setName(ApiConfigName.of("[PROJECT]", "[API]", "[API_CONFIG]").toString()) .build(); ApiFuture<Operation> future = apiGatewayServiceClient.deleteApiConfigCallable().futureCall(request); // Do something. future.get(); }
-
close
public final void close()
- Specified by:
close
in interfaceAutoCloseable
-
shutdown
public void shutdown()
- Specified by:
shutdown
in interfacecom.google.api.gax.core.BackgroundResource
-
isShutdown
public boolean isShutdown()
- Specified by:
isShutdown
in interfacecom.google.api.gax.core.BackgroundResource
-
isTerminated
public boolean isTerminated()
- Specified by:
isTerminated
in interfacecom.google.api.gax.core.BackgroundResource
-
shutdownNow
public void shutdownNow()
- Specified by:
shutdownNow
in interfacecom.google.api.gax.core.BackgroundResource
-
awaitTermination
public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException
- Specified by:
awaitTermination
in interfacecom.google.api.gax.core.BackgroundResource
- Throws:
InterruptedException
-
-