Class ApiHubDiscoveryClient
- All Implemented Interfaces:
BackgroundResource,AutoCloseable
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 (ApiHubDiscoveryClient apiHubDiscoveryClient = ApiHubDiscoveryClient.create()) {
DiscoveredApiObservationName name =
DiscoveredApiObservationName.of(
"[PROJECT]", "[LOCATION]", "[DISCOVERED_API_OBSERVATION]");
DiscoveredApiObservation response = apiHubDiscoveryClient.getDiscoveredApiObservation(name);
}
Note: close() needs to be called on the ApiHubDiscoveryClient object to clean up resources such as threads. In the example above, try-with-resources is used, which automatically calls close().
| Method | Description | Method Variants |
|---|---|---|
ListDiscoveredApiObservations |
Lists all the DiscoveredAPIObservations in a given project and location. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
GetDiscoveredApiObservation |
Gets a DiscoveredAPIObservation in a given project, location and ApiObservation. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
ListDiscoveredApiOperations |
Lists all the DiscoveredAPIOperations in a given project, location and ApiObservation. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
GetDiscoveredApiOperation |
Gets a DiscoveredAPIOperation in a given project, location, ApiObservation and ApiOperation. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
ListLocations |
Lists information about the supported locations for this service. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
GetLocation |
Gets information about a location. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Callable method variants take no parameters and return 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 ApiHubDiscoverySettings 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
ApiHubDiscoverySettings apiHubDiscoverySettings =
ApiHubDiscoverySettings.newBuilder()
.setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
.build();
ApiHubDiscoveryClient apiHubDiscoveryClient =
ApiHubDiscoveryClient.create(apiHubDiscoverySettings);
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
ApiHubDiscoverySettings apiHubDiscoverySettings =
ApiHubDiscoverySettings.newBuilder().setEndpoint(myEndpoint).build();
ApiHubDiscoveryClient apiHubDiscoveryClient =
ApiHubDiscoveryClient.create(apiHubDiscoverySettings);
Please refer to the GitHub repository's samples for more quickstart code snippets.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic class -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedApiHubDiscoveryClient(ApiHubDiscoverySettings settings) Constructs an instance of ApiHubDiscoveryClient, using the given settings.protected -
Method Summary
Modifier and TypeMethodDescriptionbooleanawaitTermination(long duration, TimeUnit unit) final voidclose()static final ApiHubDiscoveryClientcreate()Constructs an instance of ApiHubDiscoveryClient with default settings.static final ApiHubDiscoveryClientcreate(ApiHubDiscoverySettings settings) Constructs an instance of ApiHubDiscoveryClient, using the given settings.static final ApiHubDiscoveryClientcreate(ApiHubDiscoveryStub stub) Constructs an instance of ApiHubDiscoveryClient, using the given stub for making calls.final DiscoveredApiObservationGets a DiscoveredAPIObservation in a given project, location and ApiObservation.final DiscoveredApiObservationGets a DiscoveredAPIObservation in a given project, location and ApiObservation.final DiscoveredApiObservationGets a DiscoveredAPIObservation in a given project, location and ApiObservation.Gets a DiscoveredAPIObservation in a given project, location and ApiObservation.final DiscoveredApiOperationGets a DiscoveredAPIOperation in a given project, location, ApiObservation and ApiOperation.final DiscoveredApiOperationGets a DiscoveredAPIOperation in a given project, location, ApiObservation and ApiOperation.final DiscoveredApiOperationGets a DiscoveredAPIOperation in a given project, location, ApiObservation and ApiOperation.Gets a DiscoveredAPIOperation in a given project, location, ApiObservation and ApiOperation.final LocationgetLocation(GetLocationRequest request) Gets information about a location.Gets information about a location.final ApiHubDiscoverySettingsgetStub()booleanbooleanLists all the DiscoveredAPIObservations in a given project and location.Lists all the DiscoveredAPIObservations in a given project and location.listDiscoveredApiObservations(String parent) Lists all the DiscoveredAPIObservations in a given project and location.Lists all the DiscoveredAPIObservations in a given project and location.final UnaryCallable<ListDiscoveredApiObservationsRequest,ApiHubDiscoveryClient.ListDiscoveredApiObservationsPagedResponse> Lists all the DiscoveredAPIObservations in a given project and location.Lists all the DiscoveredAPIOperations in a given project, location and ApiObservation.Lists all the DiscoveredAPIOperations in a given project, location and ApiObservation.listDiscoveredApiOperations(String parent) Lists all the DiscoveredAPIOperations in a given project, location and ApiObservation.Lists all the DiscoveredAPIOperations in a given project, location and ApiObservation.final UnaryCallable<ListDiscoveredApiOperationsRequest,ApiHubDiscoveryClient.ListDiscoveredApiOperationsPagedResponse> Lists all the DiscoveredAPIOperations in a given project, location and ApiObservation.listLocations(ListLocationsRequest request) Lists information about the supported locations for this service.Lists information about the supported locations for this service.Lists information about the supported locations for this service.voidshutdown()void
-
Constructor Details
-
ApiHubDiscoveryClient
Constructs an instance of ApiHubDiscoveryClient, 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
-
ApiHubDiscoveryClient
-
-
Method Details
-
create
Constructs an instance of ApiHubDiscoveryClient with default settings.- Throws:
IOException
-
create
public static final ApiHubDiscoveryClient create(ApiHubDiscoverySettings settings) throws IOException Constructs an instance of ApiHubDiscoveryClient, 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
Constructs an instance of ApiHubDiscoveryClient, using the given stub for making calls. This is for advanced usage - prefer using create(ApiHubDiscoverySettings). -
getSettings
-
getStub
-
listDiscoveredApiObservations
public final ApiHubDiscoveryClient.ListDiscoveredApiObservationsPagedResponse listDiscoveredApiObservations(LocationName parent) Lists all the DiscoveredAPIObservations 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 (ApiHubDiscoveryClient apiHubDiscoveryClient = ApiHubDiscoveryClient.create()) { LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); for (DiscoveredApiObservation element : apiHubDiscoveryClient.listDiscoveredApiObservations(parent).iterateAll()) { // doThingsWith(element); } }- Parameters:
parent- Required. The parent, which owns this collection of ApiObservations. Format: projects/{project}/locations/{location}- Throws:
ApiException- if the remote call fails
-
listDiscoveredApiObservations
public final ApiHubDiscoveryClient.ListDiscoveredApiObservationsPagedResponse listDiscoveredApiObservations(String parent) Lists all the DiscoveredAPIObservations 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 (ApiHubDiscoveryClient apiHubDiscoveryClient = ApiHubDiscoveryClient.create()) { String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); for (DiscoveredApiObservation element : apiHubDiscoveryClient.listDiscoveredApiObservations(parent).iterateAll()) { // doThingsWith(element); } }- Parameters:
parent- Required. The parent, which owns this collection of ApiObservations. Format: projects/{project}/locations/{location}- Throws:
ApiException- if the remote call fails
-
listDiscoveredApiObservations
public final ApiHubDiscoveryClient.ListDiscoveredApiObservationsPagedResponse listDiscoveredApiObservations(ListDiscoveredApiObservationsRequest request) Lists all the DiscoveredAPIObservations 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 (ApiHubDiscoveryClient apiHubDiscoveryClient = ApiHubDiscoveryClient.create()) { ListDiscoveredApiObservationsRequest request = ListDiscoveredApiObservationsRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .build(); for (DiscoveredApiObservation element : apiHubDiscoveryClient.listDiscoveredApiObservations(request).iterateAll()) { // doThingsWith(element); } }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
listDiscoveredApiObservationsPagedCallable
public final UnaryCallable<ListDiscoveredApiObservationsRequest,ApiHubDiscoveryClient.ListDiscoveredApiObservationsPagedResponse> listDiscoveredApiObservationsPagedCallable()Lists all the DiscoveredAPIObservations 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 (ApiHubDiscoveryClient apiHubDiscoveryClient = ApiHubDiscoveryClient.create()) { ListDiscoveredApiObservationsRequest request = ListDiscoveredApiObservationsRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .build(); ApiFuture<DiscoveredApiObservation> future = apiHubDiscoveryClient.listDiscoveredApiObservationsPagedCallable().futureCall(request); // Do something. for (DiscoveredApiObservation element : future.get().iterateAll()) { // doThingsWith(element); } } -
listDiscoveredApiObservationsCallable
public final UnaryCallable<ListDiscoveredApiObservationsRequest,ListDiscoveredApiObservationsResponse> listDiscoveredApiObservationsCallable()Lists all the DiscoveredAPIObservations 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 (ApiHubDiscoveryClient apiHubDiscoveryClient = ApiHubDiscoveryClient.create()) { ListDiscoveredApiObservationsRequest request = ListDiscoveredApiObservationsRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .build(); while (true) { ListDiscoveredApiObservationsResponse response = apiHubDiscoveryClient.listDiscoveredApiObservationsCallable().call(request); for (DiscoveredApiObservation element : response.getDiscoveredApiObservationsList()) { // doThingsWith(element); } String nextPageToken = response.getNextPageToken(); if (!Strings.isNullOrEmpty(nextPageToken)) { request = request.toBuilder().setPageToken(nextPageToken).build(); } else { break; } } } -
getDiscoveredApiObservation
public final DiscoveredApiObservation getDiscoveredApiObservation(DiscoveredApiObservationName name) Gets a DiscoveredAPIObservation in a given project, location and ApiObservation.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 (ApiHubDiscoveryClient apiHubDiscoveryClient = ApiHubDiscoveryClient.create()) { DiscoveredApiObservationName name = DiscoveredApiObservationName.of( "[PROJECT]", "[LOCATION]", "[DISCOVERED_API_OBSERVATION]"); DiscoveredApiObservation response = apiHubDiscoveryClient.getDiscoveredApiObservation(name); }- Parameters:
name- Required. The name of the DiscoveredApiObservation to retrieve. Format: projects/{project}/locations/{location}/discoveredApiObservations/{discovered_api_observation}- Throws:
ApiException- if the remote call fails
-
getDiscoveredApiObservation
Gets a DiscoveredAPIObservation in a given project, location and ApiObservation.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 (ApiHubDiscoveryClient apiHubDiscoveryClient = ApiHubDiscoveryClient.create()) { String name = DiscoveredApiObservationName.of("[PROJECT]", "[LOCATION]", "[DISCOVERED_API_OBSERVATION]") .toString(); DiscoveredApiObservation response = apiHubDiscoveryClient.getDiscoveredApiObservation(name); }- Parameters:
name- Required. The name of the DiscoveredApiObservation to retrieve. Format: projects/{project}/locations/{location}/discoveredApiObservations/{discovered_api_observation}- Throws:
ApiException- if the remote call fails
-
getDiscoveredApiObservation
public final DiscoveredApiObservation getDiscoveredApiObservation(GetDiscoveredApiObservationRequest request) Gets a DiscoveredAPIObservation in a given project, location and ApiObservation.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 (ApiHubDiscoveryClient apiHubDiscoveryClient = ApiHubDiscoveryClient.create()) { GetDiscoveredApiObservationRequest request = GetDiscoveredApiObservationRequest.newBuilder() .setName( DiscoveredApiObservationName.of( "[PROJECT]", "[LOCATION]", "[DISCOVERED_API_OBSERVATION]") .toString()) .build(); DiscoveredApiObservation response = apiHubDiscoveryClient.getDiscoveredApiObservation(request); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
getDiscoveredApiObservationCallable
public final UnaryCallable<GetDiscoveredApiObservationRequest,DiscoveredApiObservation> getDiscoveredApiObservationCallable()Gets a DiscoveredAPIObservation in a given project, location and ApiObservation.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 (ApiHubDiscoveryClient apiHubDiscoveryClient = ApiHubDiscoveryClient.create()) { GetDiscoveredApiObservationRequest request = GetDiscoveredApiObservationRequest.newBuilder() .setName( DiscoveredApiObservationName.of( "[PROJECT]", "[LOCATION]", "[DISCOVERED_API_OBSERVATION]") .toString()) .build(); ApiFuture<DiscoveredApiObservation> future = apiHubDiscoveryClient.getDiscoveredApiObservationCallable().futureCall(request); // Do something. DiscoveredApiObservation response = future.get(); } -
listDiscoveredApiOperations
public final ApiHubDiscoveryClient.ListDiscoveredApiOperationsPagedResponse listDiscoveredApiOperations(DiscoveredApiObservationName parent) Lists all the DiscoveredAPIOperations in a given project, location and ApiObservation.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 (ApiHubDiscoveryClient apiHubDiscoveryClient = ApiHubDiscoveryClient.create()) { DiscoveredApiObservationName parent = DiscoveredApiObservationName.of( "[PROJECT]", "[LOCATION]", "[DISCOVERED_API_OBSERVATION]"); for (DiscoveredApiOperation element : apiHubDiscoveryClient.listDiscoveredApiOperations(parent).iterateAll()) { // doThingsWith(element); } }- Parameters:
parent- Required. The parent, which owns this collection of DiscoveredApiOperations. Format: projects/{project}/locations/{location}/discoveredApiObservations/{discovered_api_observation}- Throws:
ApiException- if the remote call fails
-
listDiscoveredApiOperations
public final ApiHubDiscoveryClient.ListDiscoveredApiOperationsPagedResponse listDiscoveredApiOperations(String parent) Lists all the DiscoveredAPIOperations in a given project, location and ApiObservation.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 (ApiHubDiscoveryClient apiHubDiscoveryClient = ApiHubDiscoveryClient.create()) { String parent = DiscoveredApiObservationName.of("[PROJECT]", "[LOCATION]", "[DISCOVERED_API_OBSERVATION]") .toString(); for (DiscoveredApiOperation element : apiHubDiscoveryClient.listDiscoveredApiOperations(parent).iterateAll()) { // doThingsWith(element); } }- Parameters:
parent- Required. The parent, which owns this collection of DiscoveredApiOperations. Format: projects/{project}/locations/{location}/discoveredApiObservations/{discovered_api_observation}- Throws:
ApiException- if the remote call fails
-
listDiscoveredApiOperations
public final ApiHubDiscoveryClient.ListDiscoveredApiOperationsPagedResponse listDiscoveredApiOperations(ListDiscoveredApiOperationsRequest request) Lists all the DiscoveredAPIOperations in a given project, location and ApiObservation.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 (ApiHubDiscoveryClient apiHubDiscoveryClient = ApiHubDiscoveryClient.create()) { ListDiscoveredApiOperationsRequest request = ListDiscoveredApiOperationsRequest.newBuilder() .setParent( DiscoveredApiObservationName.of( "[PROJECT]", "[LOCATION]", "[DISCOVERED_API_OBSERVATION]") .toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .build(); for (DiscoveredApiOperation element : apiHubDiscoveryClient.listDiscoveredApiOperations(request).iterateAll()) { // doThingsWith(element); } }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
listDiscoveredApiOperationsPagedCallable
public final UnaryCallable<ListDiscoveredApiOperationsRequest,ApiHubDiscoveryClient.ListDiscoveredApiOperationsPagedResponse> listDiscoveredApiOperationsPagedCallable()Lists all the DiscoveredAPIOperations in a given project, location and ApiObservation.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 (ApiHubDiscoveryClient apiHubDiscoveryClient = ApiHubDiscoveryClient.create()) { ListDiscoveredApiOperationsRequest request = ListDiscoveredApiOperationsRequest.newBuilder() .setParent( DiscoveredApiObservationName.of( "[PROJECT]", "[LOCATION]", "[DISCOVERED_API_OBSERVATION]") .toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .build(); ApiFuture<DiscoveredApiOperation> future = apiHubDiscoveryClient.listDiscoveredApiOperationsPagedCallable().futureCall(request); // Do something. for (DiscoveredApiOperation element : future.get().iterateAll()) { // doThingsWith(element); } } -
listDiscoveredApiOperationsCallable
public final UnaryCallable<ListDiscoveredApiOperationsRequest,ListDiscoveredApiOperationsResponse> listDiscoveredApiOperationsCallable()Lists all the DiscoveredAPIOperations in a given project, location and ApiObservation.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 (ApiHubDiscoveryClient apiHubDiscoveryClient = ApiHubDiscoveryClient.create()) { ListDiscoveredApiOperationsRequest request = ListDiscoveredApiOperationsRequest.newBuilder() .setParent( DiscoveredApiObservationName.of( "[PROJECT]", "[LOCATION]", "[DISCOVERED_API_OBSERVATION]") .toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .build(); while (true) { ListDiscoveredApiOperationsResponse response = apiHubDiscoveryClient.listDiscoveredApiOperationsCallable().call(request); for (DiscoveredApiOperation element : response.getDiscoveredApiOperationsList()) { // doThingsWith(element); } String nextPageToken = response.getNextPageToken(); if (!Strings.isNullOrEmpty(nextPageToken)) { request = request.toBuilder().setPageToken(nextPageToken).build(); } else { break; } } } -
getDiscoveredApiOperation
Gets a DiscoveredAPIOperation in a given project, location, ApiObservation and ApiOperation.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 (ApiHubDiscoveryClient apiHubDiscoveryClient = ApiHubDiscoveryClient.create()) { DiscoveredApiOperationName name = DiscoveredApiOperationName.of( "[PROJECT]", "[LOCATION]", "[DISCOVERED_API_OBSERVATION]", "[DISCOVERED_API_OPERATION]"); DiscoveredApiOperation response = apiHubDiscoveryClient.getDiscoveredApiOperation(name); }- Parameters:
name- Required. The name of the DiscoveredApiOperation to retrieve. Format: projects/{project}/locations/{location}/discoveredApiObservations/{discovered_api_observation}/discoveredApiOperations/{discovered_api_operation}- Throws:
ApiException- if the remote call fails
-
getDiscoveredApiOperation
Gets a DiscoveredAPIOperation in a given project, location, ApiObservation and ApiOperation.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 (ApiHubDiscoveryClient apiHubDiscoveryClient = ApiHubDiscoveryClient.create()) { String name = DiscoveredApiOperationName.of( "[PROJECT]", "[LOCATION]", "[DISCOVERED_API_OBSERVATION]", "[DISCOVERED_API_OPERATION]") .toString(); DiscoveredApiOperation response = apiHubDiscoveryClient.getDiscoveredApiOperation(name); }- Parameters:
name- Required. The name of the DiscoveredApiOperation to retrieve. Format: projects/{project}/locations/{location}/discoveredApiObservations/{discovered_api_observation}/discoveredApiOperations/{discovered_api_operation}- Throws:
ApiException- if the remote call fails
-
getDiscoveredApiOperation
public final DiscoveredApiOperation getDiscoveredApiOperation(GetDiscoveredApiOperationRequest request) Gets a DiscoveredAPIOperation in a given project, location, ApiObservation and ApiOperation.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 (ApiHubDiscoveryClient apiHubDiscoveryClient = ApiHubDiscoveryClient.create()) { GetDiscoveredApiOperationRequest request = GetDiscoveredApiOperationRequest.newBuilder() .setName( DiscoveredApiOperationName.of( "[PROJECT]", "[LOCATION]", "[DISCOVERED_API_OBSERVATION]", "[DISCOVERED_API_OPERATION]") .toString()) .build(); DiscoveredApiOperation response = apiHubDiscoveryClient.getDiscoveredApiOperation(request); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
getDiscoveredApiOperationCallable
public final UnaryCallable<GetDiscoveredApiOperationRequest,DiscoveredApiOperation> getDiscoveredApiOperationCallable()Gets a DiscoveredAPIOperation in a given project, location, ApiObservation and ApiOperation.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 (ApiHubDiscoveryClient apiHubDiscoveryClient = ApiHubDiscoveryClient.create()) { GetDiscoveredApiOperationRequest request = GetDiscoveredApiOperationRequest.newBuilder() .setName( DiscoveredApiOperationName.of( "[PROJECT]", "[LOCATION]", "[DISCOVERED_API_OBSERVATION]", "[DISCOVERED_API_OPERATION]") .toString()) .build(); ApiFuture<DiscoveredApiOperation> future = apiHubDiscoveryClient.getDiscoveredApiOperationCallable().futureCall(request); // Do something. DiscoveredApiOperation response = future.get(); } -
listLocations
public final ApiHubDiscoveryClient.ListLocationsPagedResponse listLocations(ListLocationsRequest request) Lists information about the supported locations for this service.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 (ApiHubDiscoveryClient apiHubDiscoveryClient = ApiHubDiscoveryClient.create()) { ListLocationsRequest request = ListLocationsRequest.newBuilder() .setName("name3373707") .setFilter("filter-1274492040") .setPageSize(883849137) .setPageToken("pageToken873572522") .build(); for (Location element : apiHubDiscoveryClient.listLocations(request).iterateAll()) { // doThingsWith(element); } }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
listLocationsPagedCallable
public final UnaryCallable<ListLocationsRequest,ApiHubDiscoveryClient.ListLocationsPagedResponse> listLocationsPagedCallable()Lists information about the supported locations for this service.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 (ApiHubDiscoveryClient apiHubDiscoveryClient = ApiHubDiscoveryClient.create()) { ListLocationsRequest request = ListLocationsRequest.newBuilder() .setName("name3373707") .setFilter("filter-1274492040") .setPageSize(883849137) .setPageToken("pageToken873572522") .build(); ApiFuture<Location> future = apiHubDiscoveryClient.listLocationsPagedCallable().futureCall(request); // Do something. for (Location element : future.get().iterateAll()) { // doThingsWith(element); } } -
listLocationsCallable
Lists information about the supported locations for this service.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 (ApiHubDiscoveryClient apiHubDiscoveryClient = ApiHubDiscoveryClient.create()) { ListLocationsRequest request = ListLocationsRequest.newBuilder() .setName("name3373707") .setFilter("filter-1274492040") .setPageSize(883849137) .setPageToken("pageToken873572522") .build(); while (true) { ListLocationsResponse response = apiHubDiscoveryClient.listLocationsCallable().call(request); for (Location element : response.getLocationsList()) { // doThingsWith(element); } String nextPageToken = response.getNextPageToken(); if (!Strings.isNullOrEmpty(nextPageToken)) { request = request.toBuilder().setPageToken(nextPageToken).build(); } else { break; } } } -
getLocation
Gets information about a 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 (ApiHubDiscoveryClient apiHubDiscoveryClient = ApiHubDiscoveryClient.create()) { GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build(); Location response = apiHubDiscoveryClient.getLocation(request); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
getLocationCallable
Gets information about a 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 (ApiHubDiscoveryClient apiHubDiscoveryClient = ApiHubDiscoveryClient.create()) { GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build(); ApiFuture<Location> future = apiHubDiscoveryClient.getLocationCallable().futureCall(request); // Do something. Location response = future.get(); } -
close
public final void close()- Specified by:
closein interfaceAutoCloseable
-
shutdown
public void shutdown()- Specified by:
shutdownin interfaceBackgroundResource
-
isShutdown
public boolean isShutdown()- Specified by:
isShutdownin interfaceBackgroundResource
-
isTerminated
public boolean isTerminated()- Specified by:
isTerminatedin interfaceBackgroundResource
-
shutdownNow
public void shutdownNow()- Specified by:
shutdownNowin interfaceBackgroundResource
-
awaitTermination
- Specified by:
awaitTerminationin interfaceBackgroundResource- Throws:
InterruptedException
-