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: + * + *
{@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 (ApiHubClient apiHubClient = ApiHubClient.create()) { + * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + * Api api = Api.newBuilder().build(); + * String apiId = "apiId93021397"; + * Api response = apiHubClient.createApi(parent, api, apiId); + * } + * }+ * + *
Note: close() needs to be called on the ApiHubClient 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 | + *
---|---|---|
CreateApi |
+ * Create an API resource in the API hub. Once an API resource is created, versions can be added to it. |
+ *
+ * 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. + *
|
+ *
GetApi |
+ * Get API resource details including the API versions contained in it. |
+ *
+ * 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. + *
|
+ *
ListApis |
+ * List API resources in the API hub. |
+ *
+ * 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. + *
|
+ *
UpdateApi |
+ * Update an API resource in the API hub. The following fields in the [API][] can be updated: + *
The [update_mask][google.cloud.apihub.v1.UpdateApiRequest.update_mask] should be used to specify the fields being updated. + * Updating the owner field requires complete owner message and updates both owner and email fields. |
+ *
+ * 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. + *
|
+ *
DeleteApi |
+ * Delete an API resource in the API hub. API can only be deleted if all underlying versions are deleted. |
+ *
+ * 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. + *
|
+ *
CreateVersion |
+ * Create an API version for an API resource in the API hub. |
+ *
+ * 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. + *
|
+ *
GetVersion |
+ * Get details about the API version of an API resource. This will include information about the specs and operations present in the API version as well as the deployments linked to it. |
+ *
+ * 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. + *
|
+ *
ListVersions |
+ * List API versions of an API resource in the API hub. |
+ *
+ * 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. + *
|
+ *
UpdateVersion |
+ * Update API version. The following fields in the [version][google.cloud.apihub.v1.Version] can be updated currently: + *
The [update_mask][google.cloud.apihub.v1.UpdateVersionRequest.update_mask] should be used to specify the fields being updated. |
+ *
+ * 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. + *
|
+ *
DeleteVersion |
+ * Delete an API version. Version can only be deleted if all underlying specs, operations, definitions and linked deployments are deleted. |
+ *
+ * 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. + *
|
+ *
CreateSpec |
+ * Add a spec to an API version in the API hub. Multiple specs can be added to an API version. Note, while adding a spec, at least one of `contents` or `source_uri` must be provided. If `contents` is provided, then `spec_type` must also be provided. + * On adding a spec with contents to the version, the operations present in it will be added to the version.Note that the file contents in the spec should be of the same type as defined in the `projects/{project}/locations/{location}/attributes/system-spec-type` attribute associated with spec resource. Note that specs of various types can be uploaded, however parsing of details is supported for OpenAPI spec currently. + * In order to access the information parsed from the spec, use the [GetSpec][google.cloud.apihub.v1.ApiHub.GetSpec] method. In order to access the raw contents for a particular spec, use the [GetSpecContents][google.cloud.apihub.v1.ApiHub.GetSpecContents] method. In order to access the operations parsed from the spec, use the [ListAPIOperations][google.cloud.apihub.v1.ApiHub.ListApiOperations] method. |
+ *
+ * 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. + *
|
+ *
GetSpec |
+ * Get details about the information parsed from a spec. Note that this method does not return the raw spec contents. Use [GetSpecContents][google.cloud.apihub.v1.ApiHub.GetSpecContents] method to retrieve the same. |
+ *
+ * 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. + *
|
+ *
GetSpecContents |
+ * Get spec contents. |
+ *
+ * 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. + *
|
+ *
ListSpecs |
+ * List specs corresponding to a particular API resource. |
+ *
+ * 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. + *
|
+ *
UpdateSpec |
+ * Update spec. The following fields in the [spec][google.cloud.apihub.v1.Spec] can be updated: + *
In case of an OAS spec, updating spec contents can lead to: 1. Creation, deletion and update of operations. 2. Creation, deletion and update of definitions. 3. Update of other info parsed out from the new spec. + * In case of contents or source_uri being present in update mask, spec_type must also be present. Also, spec_type can not be present in update mask if contents or source_uri is not present. + * The [update_mask][google.cloud.apihub.v1.UpdateSpecRequest.update_mask] should be used to specify the fields being updated. |
+ *
+ * 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. + *
|
+ *
DeleteSpec |
+ * Delete a spec. Deleting a spec will also delete the associated operations from the version. |
+ *
+ * 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. + *
|
+ *
GetApiOperation |
+ * Get details about a particular operation in API version. |
+ *
+ * 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. + *
|
+ *
ListApiOperations |
+ * List operations in an API version. |
+ *
+ * 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. + *
|
+ *
GetDefinition |
+ * Get details about a definition in an API version. |
+ *
+ * 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. + *
|
+ *
CreateDeployment |
+ * Create a deployment resource in the API hub. Once a deployment resource is created, it can be associated with API versions. |
+ *
+ * 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. + *
|
+ *
GetDeployment |
+ * Get details about a deployment and the API versions linked to it. |
+ *
+ * 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. + *
|
+ *
ListDeployments |
+ * List deployment resources in the API hub. |
+ *
+ * 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. + *
|
+ *
UpdateDeployment |
+ * Update a deployment resource in the API hub. The following fields in the [deployment resource][google.cloud.apihub.v1.Deployment] can be updated: + *
The [update_mask][google.cloud.apihub.v1.UpdateDeploymentRequest.update_mask] should be used to specify the fields being updated. |
+ *
+ * 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. + *
|
+ *
DeleteDeployment |
+ * Delete a deployment resource in the API hub. |
+ *
+ * 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. + *
|
+ *
CreateAttribute |
+ * Create a user defined attribute. + * Certain pre defined attributes are already created by the API hub. These attributes will have type as `SYSTEM_DEFINED` and can be listed via [ListAttributes][google.cloud.apihub.v1.ApiHub.ListAttributes] method. Allowed values for the same can be updated via [UpdateAttribute][google.cloud.apihub.v1.ApiHub.UpdateAttribute] method. |
+ *
+ * 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. + *
|
+ *
GetAttribute |
+ * Get details about the attribute. |
+ *
+ * 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. + *
|
+ *
UpdateAttribute |
+ * Update the attribute. The following fields in the [Attribute resource][google.cloud.apihub.v1.Attribute] can be updated: + *
The [update_mask][google.cloud.apihub.v1.UpdateAttributeRequest.update_mask] should be used to specify the fields being updated. |
+ *
+ * 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. + *
|
+ *
DeleteAttribute |
+ * Delete an attribute. + * Note: System defined attributes cannot be deleted. All associations of the attribute being deleted with any API hub resource will also get deleted. |
+ *
+ * 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. + *
|
+ *
ListAttributes |
+ * List all attributes. |
+ *
+ * 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. + *
|
+ *
SearchResources |
+ * Search across API-Hub resources. |
+ *
+ * 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. + *
|
+ *
CreateExternalApi |
+ * Create an External API resource in the API hub. |
+ *
+ * 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. + *
|
+ *
GetExternalApi |
+ * Get details about an External API resource in the API hub. |
+ *
+ * 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. + *
|
+ *
UpdateExternalApi |
+ * Update an External API resource in the API hub. The following fields can be updated: + *
The [update_mask][google.cloud.apihub.v1.UpdateExternalApiRequest.update_mask] should be used to specify the fields being updated. |
+ *
+ * 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. + *
|
+ *
DeleteExternalApi |
+ * Delete an External API resource in the API hub. |
+ *
+ * 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. + *
|
+ *
ListExternalApis |
+ * List External API resources in the API hub. |
+ *
+ * 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 ApiHubSettings to create(). + * For example: + * + *
To customize credentials: + * + *
{@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 + * ApiHubSettings apiHubSettings = + * ApiHubSettings.newBuilder() + * .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials)) + * .build(); + * ApiHubClient apiHubClient = ApiHubClient.create(apiHubSettings); + * }+ * + *
To customize the endpoint: + * + *
{@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 + * ApiHubSettings apiHubSettings = ApiHubSettings.newBuilder().setEndpoint(myEndpoint).build(); + * ApiHubClient apiHubClient = ApiHubClient.create(apiHubSettings); + * }+ * + *
To use REST (HTTP1.1/JSON) transport (instead of gRPC) for sending and receiving requests over + * the wire: + * + *
{@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 + * ApiHubSettings apiHubSettings = ApiHubSettings.newHttpJsonBuilder().build(); + * ApiHubClient apiHubClient = ApiHubClient.create(apiHubSettings); + * }+ * + *
Please refer to the GitHub repository's samples for more quickstart code snippets. + */ +@Generated("by gapic-generator-java") +public class ApiHubClient implements BackgroundResource { + private final ApiHubSettings settings; + private final ApiHubStub stub; + + /** Constructs an instance of ApiHubClient with default settings. */ + public static final ApiHubClient create() throws IOException { + return create(ApiHubSettings.newBuilder().build()); + } + + /** + * Constructs an instance of ApiHubClient, using the given settings. The channels are created + * based on the settings passed in, or defaults for any settings that are not set. + */ + public static final ApiHubClient create(ApiHubSettings settings) throws IOException { + return new ApiHubClient(settings); + } + + /** + * Constructs an instance of ApiHubClient, using the given stub for making calls. This is for + * advanced usage - prefer using create(ApiHubSettings). + */ + public static final ApiHubClient create(ApiHubStub stub) { + return new ApiHubClient(stub); + } + + /** + * Constructs an instance of ApiHubClient, using the given settings. This is protected so that it + * is easy to make a subclass, but otherwise, the static factory methods should be preferred. + */ + protected ApiHubClient(ApiHubSettings settings) throws IOException { + this.settings = settings; + this.stub = ((ApiHubStubSettings) settings.getStubSettings()).createStub(); + } + + protected ApiHubClient(ApiHubStub stub) { + this.settings = null; + this.stub = stub; + } + + public final ApiHubSettings getSettings() { + return settings; + } + + public ApiHubStub getStub() { + return stub; + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Create an API resource in the API hub. Once an API resource is created, versions can be added + * to it. + * + *
Sample code: + * + *
{@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 (ApiHubClient apiHubClient = ApiHubClient.create()) { + * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + * Api api = Api.newBuilder().build(); + * String apiId = "apiId93021397"; + * Api response = apiHubClient.createApi(parent, api, apiId); + * } + * }+ * + * @param parent Required. The parent resource for the API resource. Format: + * `projects/{project}/locations/{location}` + * @param api Required. The API resource to create. + * @param apiId Optional. The ID to use for the API resource, which will become the final + * component of the API's resource name. This field is optional. + *
This value should be 4-500 characters, and valid characters are /[a-z][A-Z][0-9]-_/. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Api createApi(LocationName parent, Api api, String apiId) { + CreateApiRequest request = + CreateApiRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .setApi(api) + .setApiId(apiId) + .build(); + return createApi(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Create an API resource in the API hub. Once an API resource is created, versions can be added + * to it. + * + *
Sample code: + * + *
{@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 (ApiHubClient apiHubClient = ApiHubClient.create()) { + * String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); + * Api api = Api.newBuilder().build(); + * String apiId = "apiId93021397"; + * Api response = apiHubClient.createApi(parent, api, apiId); + * } + * }+ * + * @param parent Required. The parent resource for the API resource. Format: + * `projects/{project}/locations/{location}` + * @param api Required. The API resource to create. + * @param apiId Optional. The ID to use for the API resource, which will become the final + * component of the API's resource name. This field is optional. + *
This value should be 4-500 characters, and valid characters are /[a-z][A-Z][0-9]-_/. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Api createApi(String parent, Api api, String apiId) { + CreateApiRequest request = + CreateApiRequest.newBuilder().setParent(parent).setApi(api).setApiId(apiId).build(); + return createApi(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Create an API resource in the API hub. Once an API resource is created, versions can be added + * to it. + * + *
Sample code: + * + *
{@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 (ApiHubClient apiHubClient = ApiHubClient.create()) { + * CreateApiRequest request = + * CreateApiRequest.newBuilder() + * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + * .setApiId("apiId93021397") + * .setApi(Api.newBuilder().build()) + * .build(); + * Api response = apiHubClient.createApi(request); + * } + * }+ * + * @param 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 + */ + public final Api createApi(CreateApiRequest request) { + return createApiCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Create an API resource in the API hub. Once an API resource is created, versions can be added + * to it. + * + *
Sample code: + * + *
{@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 (ApiHubClient apiHubClient = ApiHubClient.create()) { + * CreateApiRequest request = + * CreateApiRequest.newBuilder() + * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + * .setApiId("apiId93021397") + * .setApi(Api.newBuilder().build()) + * .build(); + * ApiFuture+ */ + public final UnaryCallablefuture = apiHubClient.createApiCallable().futureCall(request); + * // Do something. + * Api response = future.get(); + * } + * }
Sample code: + * + *
{@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 (ApiHubClient apiHubClient = ApiHubClient.create()) { + * ApiName name = ApiName.of("[PROJECT]", "[LOCATION]", "[API]"); + * Api response = apiHubClient.getApi(name); + * } + * }+ * + * @param name Required. The name of the API resource to retrieve. Format: + * `projects/{project}/locations/{location}/apis/{api}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Api getApi(ApiName name) { + GetApiRequest request = + GetApiRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return getApi(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Get API resource details including the API versions contained in it. + * + *
Sample code: + * + *
{@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 (ApiHubClient apiHubClient = ApiHubClient.create()) { + * String name = ApiName.of("[PROJECT]", "[LOCATION]", "[API]").toString(); + * Api response = apiHubClient.getApi(name); + * } + * }+ * + * @param name Required. The name of the API resource to retrieve. Format: + * `projects/{project}/locations/{location}/apis/{api}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Api getApi(String name) { + GetApiRequest request = GetApiRequest.newBuilder().setName(name).build(); + return getApi(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Get API resource details including the API versions contained in it. + * + *
Sample code: + * + *
{@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 (ApiHubClient apiHubClient = ApiHubClient.create()) { + * GetApiRequest request = + * GetApiRequest.newBuilder() + * .setName(ApiName.of("[PROJECT]", "[LOCATION]", "[API]").toString()) + * .build(); + * Api response = apiHubClient.getApi(request); + * } + * }+ * + * @param 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 + */ + public final Api getApi(GetApiRequest request) { + return getApiCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Get API resource details including the API versions contained in it. + * + *
Sample code: + * + *
{@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 (ApiHubClient apiHubClient = ApiHubClient.create()) { + * GetApiRequest request = + * GetApiRequest.newBuilder() + * .setName(ApiName.of("[PROJECT]", "[LOCATION]", "[API]").toString()) + * .build(); + * ApiFuture+ */ + public final UnaryCallablefuture = apiHubClient.getApiCallable().futureCall(request); + * // Do something. + * Api response = future.get(); + * } + * }
Sample code: + * + *
{@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 (ApiHubClient apiHubClient = ApiHubClient.create()) { + * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + * for (Api element : apiHubClient.listApis(parent).iterateAll()) { + * // doThingsWith(element); + * } + * } + * }+ * + * @param parent Required. The parent, which owns this collection of API resources. Format: + * `projects/{project}/locations/{location}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListApisPagedResponse listApis(LocationName parent) { + ListApisRequest request = + ListApisRequest.newBuilder().setParent(parent == null ? null : parent.toString()).build(); + return listApis(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * List API resources in the API hub. + * + *
Sample code: + * + *
{@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 (ApiHubClient apiHubClient = ApiHubClient.create()) { + * String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); + * for (Api element : apiHubClient.listApis(parent).iterateAll()) { + * // doThingsWith(element); + * } + * } + * }+ * + * @param parent Required. The parent, which owns this collection of API resources. Format: + * `projects/{project}/locations/{location}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListApisPagedResponse listApis(String parent) { + ListApisRequest request = ListApisRequest.newBuilder().setParent(parent).build(); + return listApis(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * List API resources in the API hub. + * + *
Sample code: + * + *
{@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 (ApiHubClient apiHubClient = ApiHubClient.create()) { + * ListApisRequest request = + * ListApisRequest.newBuilder() + * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + * .setFilter("filter-1274492040") + * .setPageSize(883849137) + * .setPageToken("pageToken873572522") + * .build(); + * for (Api element : apiHubClient.listApis(request).iterateAll()) { + * // doThingsWith(element); + * } + * } + * }+ * + * @param 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 + */ + public final ListApisPagedResponse listApis(ListApisRequest request) { + return listApisPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * List API resources in the API hub. + * + *
Sample code: + * + *
{@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 (ApiHubClient apiHubClient = ApiHubClient.create()) { + * ListApisRequest request = + * ListApisRequest.newBuilder() + * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + * .setFilter("filter-1274492040") + * .setPageSize(883849137) + * .setPageToken("pageToken873572522") + * .build(); + * ApiFuture+ */ + public final UnaryCallablefuture = apiHubClient.listApisPagedCallable().futureCall(request); + * // Do something. + * for (Api element : future.get().iterateAll()) { + * // doThingsWith(element); + * } + * } + * }
Sample code: + * + *
{@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 (ApiHubClient apiHubClient = ApiHubClient.create()) { + * ListApisRequest request = + * ListApisRequest.newBuilder() + * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + * .setFilter("filter-1274492040") + * .setPageSize(883849137) + * .setPageToken("pageToken873572522") + * .build(); + * while (true) { + * ListApisResponse response = apiHubClient.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; + * } + * } + * } + * }+ */ + public final UnaryCallable
The [update_mask][google.cloud.apihub.v1.UpdateApiRequest.update_mask] should be used to + * specify the fields being updated. + * + *
Updating the owner field requires complete owner message and updates both owner and email + * fields. + * + *
Sample code: + * + *
{@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 (ApiHubClient apiHubClient = ApiHubClient.create()) { + * Api api = Api.newBuilder().build(); + * FieldMask updateMask = FieldMask.newBuilder().build(); + * Api response = apiHubClient.updateApi(api, updateMask); + * } + * }+ * + * @param api Required. The API resource to update. + *
The API resource's `name` field is used to identify the API resource to update. Format: + * `projects/{project}/locations/{location}/apis/{api}` + * @param updateMask Required. The list of fields to update. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Api updateApi(Api api, FieldMask updateMask) { + UpdateApiRequest request = + UpdateApiRequest.newBuilder().setApi(api).setUpdateMask(updateMask).build(); + return updateApi(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Update an API resource in the API hub. The following fields in the [API][] can be updated: + * + *
The [update_mask][google.cloud.apihub.v1.UpdateApiRequest.update_mask] should be used to + * specify the fields being updated. + * + *
Updating the owner field requires complete owner message and updates both owner and email + * fields. + * + *
Sample code: + * + *
{@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 (ApiHubClient apiHubClient = ApiHubClient.create()) { + * UpdateApiRequest request = + * UpdateApiRequest.newBuilder() + * .setApi(Api.newBuilder().build()) + * .setUpdateMask(FieldMask.newBuilder().build()) + * .build(); + * Api response = apiHubClient.updateApi(request); + * } + * }+ * + * @param 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 + */ + public final Api updateApi(UpdateApiRequest request) { + return updateApiCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Update an API resource in the API hub. The following fields in the [API][] can be updated: + * + *
The [update_mask][google.cloud.apihub.v1.UpdateApiRequest.update_mask] should be used to + * specify the fields being updated. + * + *
Updating the owner field requires complete owner message and updates both owner and email + * fields. + * + *
Sample code: + * + *
{@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 (ApiHubClient apiHubClient = ApiHubClient.create()) { + * UpdateApiRequest request = + * UpdateApiRequest.newBuilder() + * .setApi(Api.newBuilder().build()) + * .setUpdateMask(FieldMask.newBuilder().build()) + * .build(); + * ApiFuture+ */ + public final UnaryCallablefuture = apiHubClient.updateApiCallable().futureCall(request); + * // Do something. + * Api response = future.get(); + * } + * }
Sample code: + * + *
{@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 (ApiHubClient apiHubClient = ApiHubClient.create()) { + * ApiName name = ApiName.of("[PROJECT]", "[LOCATION]", "[API]"); + * apiHubClient.deleteApi(name); + * } + * }+ * + * @param name Required. The name of the API resource to delete. Format: + * `projects/{project}/locations/{location}/apis/{api}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteApi(ApiName name) { + DeleteApiRequest request = + DeleteApiRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + deleteApi(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Delete an API resource in the API hub. API can only be deleted if all underlying versions are + * deleted. + * + *
Sample code: + * + *
{@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 (ApiHubClient apiHubClient = ApiHubClient.create()) { + * String name = ApiName.of("[PROJECT]", "[LOCATION]", "[API]").toString(); + * apiHubClient.deleteApi(name); + * } + * }+ * + * @param name Required. The name of the API resource to delete. Format: + * `projects/{project}/locations/{location}/apis/{api}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteApi(String name) { + DeleteApiRequest request = DeleteApiRequest.newBuilder().setName(name).build(); + deleteApi(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Delete an API resource in the API hub. API can only be deleted if all underlying versions are + * deleted. + * + *
Sample code: + * + *
{@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 (ApiHubClient apiHubClient = ApiHubClient.create()) { + * DeleteApiRequest request = + * DeleteApiRequest.newBuilder() + * .setName(ApiName.of("[PROJECT]", "[LOCATION]", "[API]").toString()) + * .setForce(true) + * .build(); + * apiHubClient.deleteApi(request); + * } + * }+ * + * @param 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 + */ + public final void deleteApi(DeleteApiRequest request) { + deleteApiCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Delete an API resource in the API hub. API can only be deleted if all underlying versions are + * deleted. + * + *
Sample code: + * + *
{@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 (ApiHubClient apiHubClient = ApiHubClient.create()) { + * DeleteApiRequest request = + * DeleteApiRequest.newBuilder() + * .setName(ApiName.of("[PROJECT]", "[LOCATION]", "[API]").toString()) + * .setForce(true) + * .build(); + * ApiFuture+ */ + public final UnaryCallablefuture = apiHubClient.deleteApiCallable().futureCall(request); + * // Do something. + * future.get(); + * } + * }
Sample code: + * + *
{@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 (ApiHubClient apiHubClient = ApiHubClient.create()) { + * ApiName parent = ApiName.of("[PROJECT]", "[LOCATION]", "[API]"); + * Version version = Version.newBuilder().build(); + * String versionId = "versionId-1407102957"; + * Version response = apiHubClient.createVersion(parent, version, versionId); + * } + * }+ * + * @param parent Required. The parent resource for API version. Format: + * `projects/{project}/locations/{location}/apis/{api}` + * @param version Required. The version to create. + * @param versionId Optional. The ID to use for the API version, which will become the final + * component of the version's resource name. This field is optional. + *
This value should be 4-500 characters, and valid characters are /[a-z][A-Z][0-9]-_/. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Version createVersion(ApiName parent, Version version, String versionId) { + CreateVersionRequest request = + CreateVersionRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .setVersion(version) + .setVersionId(versionId) + .build(); + return createVersion(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Create an API version for an API resource in the API hub. + * + *
Sample code: + * + *
{@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 (ApiHubClient apiHubClient = ApiHubClient.create()) { + * String parent = ApiName.of("[PROJECT]", "[LOCATION]", "[API]").toString(); + * Version version = Version.newBuilder().build(); + * String versionId = "versionId-1407102957"; + * Version response = apiHubClient.createVersion(parent, version, versionId); + * } + * }+ * + * @param parent Required. The parent resource for API version. Format: + * `projects/{project}/locations/{location}/apis/{api}` + * @param version Required. The version to create. + * @param versionId Optional. The ID to use for the API version, which will become the final + * component of the version's resource name. This field is optional. + *
This value should be 4-500 characters, and valid characters are /[a-z][A-Z][0-9]-_/. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Version createVersion(String parent, Version version, String versionId) { + CreateVersionRequest request = + CreateVersionRequest.newBuilder() + .setParent(parent) + .setVersion(version) + .setVersionId(versionId) + .build(); + return createVersion(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Create an API version for an API resource in the API hub. + * + *
Sample code: + * + *
{@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 (ApiHubClient apiHubClient = ApiHubClient.create()) { + * CreateVersionRequest request = + * CreateVersionRequest.newBuilder() + * .setParent(ApiName.of("[PROJECT]", "[LOCATION]", "[API]").toString()) + * .setVersionId("versionId-1407102957") + * .setVersion(Version.newBuilder().build()) + * .build(); + * Version response = apiHubClient.createVersion(request); + * } + * }+ * + * @param 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 + */ + public final Version createVersion(CreateVersionRequest request) { + return createVersionCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Create an API version for an API resource in the API hub. + * + *
Sample code: + * + *
{@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 (ApiHubClient apiHubClient = ApiHubClient.create()) { + * CreateVersionRequest request = + * CreateVersionRequest.newBuilder() + * .setParent(ApiName.of("[PROJECT]", "[LOCATION]", "[API]").toString()) + * .setVersionId("versionId-1407102957") + * .setVersion(Version.newBuilder().build()) + * .build(); + * ApiFuture+ */ + public final UnaryCallablefuture = apiHubClient.createVersionCallable().futureCall(request); + * // Do something. + * Version response = future.get(); + * } + * }
Sample code: + * + *
{@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 (ApiHubClient apiHubClient = ApiHubClient.create()) { + * VersionName name = VersionName.of("[PROJECT]", "[LOCATION]", "[API]", "[VERSION]"); + * Version response = apiHubClient.getVersion(name); + * } + * }+ * + * @param name Required. The name of the API version to retrieve. Format: + * `projects/{project}/locations/{location}/apis/{api}/versions/{version}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Version getVersion(VersionName name) { + GetVersionRequest request = + GetVersionRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return getVersion(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Get details about the API version of an API resource. This will include information about the + * specs and operations present in the API version as well as the deployments linked to it. + * + *
Sample code: + * + *
{@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 (ApiHubClient apiHubClient = ApiHubClient.create()) { + * String name = VersionName.of("[PROJECT]", "[LOCATION]", "[API]", "[VERSION]").toString(); + * Version response = apiHubClient.getVersion(name); + * } + * }+ * + * @param name Required. The name of the API version to retrieve. Format: + * `projects/{project}/locations/{location}/apis/{api}/versions/{version}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Version getVersion(String name) { + GetVersionRequest request = GetVersionRequest.newBuilder().setName(name).build(); + return getVersion(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Get details about the API version of an API resource. This will include information about the + * specs and operations present in the API version as well as the deployments linked to it. + * + *
Sample code: + * + *
{@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 (ApiHubClient apiHubClient = ApiHubClient.create()) { + * GetVersionRequest request = + * GetVersionRequest.newBuilder() + * .setName(VersionName.of("[PROJECT]", "[LOCATION]", "[API]", "[VERSION]").toString()) + * .build(); + * Version response = apiHubClient.getVersion(request); + * } + * }+ * + * @param 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 + */ + public final Version getVersion(GetVersionRequest request) { + return getVersionCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Get details about the API version of an API resource. This will include information about the + * specs and operations present in the API version as well as the deployments linked to it. + * + *
Sample code: + * + *
{@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 (ApiHubClient apiHubClient = ApiHubClient.create()) { + * GetVersionRequest request = + * GetVersionRequest.newBuilder() + * .setName(VersionName.of("[PROJECT]", "[LOCATION]", "[API]", "[VERSION]").toString()) + * .build(); + * ApiFuture+ */ + public final UnaryCallablefuture = apiHubClient.getVersionCallable().futureCall(request); + * // Do something. + * Version response = future.get(); + * } + * }
Sample code: + * + *
{@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 (ApiHubClient apiHubClient = ApiHubClient.create()) { + * ApiName parent = ApiName.of("[PROJECT]", "[LOCATION]", "[API]"); + * for (Version element : apiHubClient.listVersions(parent).iterateAll()) { + * // doThingsWith(element); + * } + * } + * }+ * + * @param parent Required. The parent which owns this collection of API versions i.e., the API + * resource Format: `projects/{project}/locations/{location}/apis/{api}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListVersionsPagedResponse listVersions(ApiName parent) { + ListVersionsRequest request = + ListVersionsRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .build(); + return listVersions(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * List API versions of an API resource in the API hub. + * + *
Sample code: + * + *
{@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 (ApiHubClient apiHubClient = ApiHubClient.create()) { + * String parent = ApiName.of("[PROJECT]", "[LOCATION]", "[API]").toString(); + * for (Version element : apiHubClient.listVersions(parent).iterateAll()) { + * // doThingsWith(element); + * } + * } + * }+ * + * @param parent Required. The parent which owns this collection of API versions i.e., the API + * resource Format: `projects/{project}/locations/{location}/apis/{api}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListVersionsPagedResponse listVersions(String parent) { + ListVersionsRequest request = ListVersionsRequest.newBuilder().setParent(parent).build(); + return listVersions(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * List API versions of an API resource in the API hub. + * + *
Sample code: + * + *
{@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 (ApiHubClient apiHubClient = ApiHubClient.create()) { + * ListVersionsRequest request = + * ListVersionsRequest.newBuilder() + * .setParent(ApiName.of("[PROJECT]", "[LOCATION]", "[API]").toString()) + * .setFilter("filter-1274492040") + * .setPageSize(883849137) + * .setPageToken("pageToken873572522") + * .build(); + * for (Version element : apiHubClient.listVersions(request).iterateAll()) { + * // doThingsWith(element); + * } + * } + * }+ * + * @param 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 + */ + public final ListVersionsPagedResponse listVersions(ListVersionsRequest request) { + return listVersionsPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * List API versions of an API resource in the API hub. + * + *
Sample code: + * + *
{@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 (ApiHubClient apiHubClient = ApiHubClient.create()) { + * ListVersionsRequest request = + * ListVersionsRequest.newBuilder() + * .setParent(ApiName.of("[PROJECT]", "[LOCATION]", "[API]").toString()) + * .setFilter("filter-1274492040") + * .setPageSize(883849137) + * .setPageToken("pageToken873572522") + * .build(); + * ApiFuture+ */ + public final UnaryCallablefuture = apiHubClient.listVersionsPagedCallable().futureCall(request); + * // Do something. + * for (Version element : future.get().iterateAll()) { + * // doThingsWith(element); + * } + * } + * }
Sample code: + * + *
{@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 (ApiHubClient apiHubClient = ApiHubClient.create()) { + * ListVersionsRequest request = + * ListVersionsRequest.newBuilder() + * .setParent(ApiName.of("[PROJECT]", "[LOCATION]", "[API]").toString()) + * .setFilter("filter-1274492040") + * .setPageSize(883849137) + * .setPageToken("pageToken873572522") + * .build(); + * while (true) { + * ListVersionsResponse response = apiHubClient.listVersionsCallable().call(request); + * for (Version element : response.getVersionsList()) { + * // doThingsWith(element); + * } + * String nextPageToken = response.getNextPageToken(); + * if (!Strings.isNullOrEmpty(nextPageToken)) { + * request = request.toBuilder().setPageToken(nextPageToken).build(); + * } else { + * break; + * } + * } + * } + * }+ */ + public final UnaryCallable
The [update_mask][google.cloud.apihub.v1.UpdateVersionRequest.update_mask] should be used to + * specify the fields being updated. + * + *
Sample code: + * + *
{@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 (ApiHubClient apiHubClient = ApiHubClient.create()) { + * Version version = Version.newBuilder().build(); + * FieldMask updateMask = FieldMask.newBuilder().build(); + * Version response = apiHubClient.updateVersion(version, updateMask); + * } + * }+ * + * @param version Required. The API version to update. + *
The version's `name` field is used to identify the API version to update. Format: + * `projects/{project}/locations/{location}/apis/{api}/versions/{version}` + * @param updateMask Required. The list of fields to update. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Version updateVersion(Version version, FieldMask updateMask) { + UpdateVersionRequest request = + UpdateVersionRequest.newBuilder().setVersion(version).setUpdateMask(updateMask).build(); + return updateVersion(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Update API version. The following fields in the [version][google.cloud.apihub.v1.Version] can + * be updated currently: + * + *
The [update_mask][google.cloud.apihub.v1.UpdateVersionRequest.update_mask] should be used to + * specify the fields being updated. + * + *
Sample code: + * + *
{@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 (ApiHubClient apiHubClient = ApiHubClient.create()) { + * UpdateVersionRequest request = + * UpdateVersionRequest.newBuilder() + * .setVersion(Version.newBuilder().build()) + * .setUpdateMask(FieldMask.newBuilder().build()) + * .build(); + * Version response = apiHubClient.updateVersion(request); + * } + * }+ * + * @param 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 + */ + public final Version updateVersion(UpdateVersionRequest request) { + return updateVersionCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Update API version. The following fields in the [version][google.cloud.apihub.v1.Version] can + * be updated currently: + * + *
The [update_mask][google.cloud.apihub.v1.UpdateVersionRequest.update_mask] should be used to + * specify the fields being updated. + * + *
Sample code: + * + *
{@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 (ApiHubClient apiHubClient = ApiHubClient.create()) { + * UpdateVersionRequest request = + * UpdateVersionRequest.newBuilder() + * .setVersion(Version.newBuilder().build()) + * .setUpdateMask(FieldMask.newBuilder().build()) + * .build(); + * ApiFuture+ */ + public final UnaryCallablefuture = apiHubClient.updateVersionCallable().futureCall(request); + * // Do something. + * Version response = future.get(); + * } + * }
Sample code: + * + *
{@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 (ApiHubClient apiHubClient = ApiHubClient.create()) { + * VersionName name = VersionName.of("[PROJECT]", "[LOCATION]", "[API]", "[VERSION]"); + * apiHubClient.deleteVersion(name); + * } + * }+ * + * @param name Required. The name of the version to delete. Format: + * `projects/{project}/locations/{location}/apis/{api}/versions/{version}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteVersion(VersionName name) { + DeleteVersionRequest request = + DeleteVersionRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + deleteVersion(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Delete an API version. Version can only be deleted if all underlying specs, operations, + * definitions and linked deployments are deleted. + * + *
Sample code: + * + *
{@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 (ApiHubClient apiHubClient = ApiHubClient.create()) { + * String name = VersionName.of("[PROJECT]", "[LOCATION]", "[API]", "[VERSION]").toString(); + * apiHubClient.deleteVersion(name); + * } + * }+ * + * @param name Required. The name of the version to delete. Format: + * `projects/{project}/locations/{location}/apis/{api}/versions/{version}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteVersion(String name) { + DeleteVersionRequest request = DeleteVersionRequest.newBuilder().setName(name).build(); + deleteVersion(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Delete an API version. Version can only be deleted if all underlying specs, operations, + * definitions and linked deployments are deleted. + * + *
Sample code: + * + *
{@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 (ApiHubClient apiHubClient = ApiHubClient.create()) { + * DeleteVersionRequest request = + * DeleteVersionRequest.newBuilder() + * .setName(VersionName.of("[PROJECT]", "[LOCATION]", "[API]", "[VERSION]").toString()) + * .setForce(true) + * .build(); + * apiHubClient.deleteVersion(request); + * } + * }+ * + * @param 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 + */ + public final void deleteVersion(DeleteVersionRequest request) { + deleteVersionCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Delete an API version. Version can only be deleted if all underlying specs, operations, + * definitions and linked deployments are deleted. + * + *
Sample code: + * + *
{@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 (ApiHubClient apiHubClient = ApiHubClient.create()) { + * DeleteVersionRequest request = + * DeleteVersionRequest.newBuilder() + * .setName(VersionName.of("[PROJECT]", "[LOCATION]", "[API]", "[VERSION]").toString()) + * .setForce(true) + * .build(); + * ApiFuture+ */ + public final UnaryCallablefuture = apiHubClient.deleteVersionCallable().futureCall(request); + * // Do something. + * future.get(); + * } + * }
On adding a spec with contents to the version, the operations present in it will be added to + * the version.Note that the file contents in the spec should be of the same type as defined in + * the `projects/{project}/locations/{location}/attributes/system-spec-type` attribute associated + * with spec resource. Note that specs of various types can be uploaded, however parsing of + * details is supported for OpenAPI spec currently. + * + *
In order to access the information parsed from the spec, use the + * [GetSpec][google.cloud.apihub.v1.ApiHub.GetSpec] method. In order to access the raw contents + * for a particular spec, use the [GetSpecContents][google.cloud.apihub.v1.ApiHub.GetSpecContents] + * method. In order to access the operations parsed from the spec, use the + * [ListAPIOperations][google.cloud.apihub.v1.ApiHub.ListApiOperations] method. + * + *
Sample code: + * + *
{@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 (ApiHubClient apiHubClient = ApiHubClient.create()) { + * VersionName parent = VersionName.of("[PROJECT]", "[LOCATION]", "[API]", "[VERSION]"); + * Spec spec = Spec.newBuilder().build(); + * String specId = "specId-896074186"; + * Spec response = apiHubClient.createSpec(parent, spec, specId); + * } + * }+ * + * @param parent Required. The parent resource for Spec. Format: + * `projects/{project}/locations/{location}/apis/{api}/versions/{version}` + * @param spec Required. The spec to create. + * @param specId Optional. The ID to use for the spec, which will become the final component of + * the spec's resource name. This field is optional. + *
This value should be 4-500 characters, and valid characters are /[a-z][A-Z][0-9]-_/. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Spec createSpec(VersionName parent, Spec spec, String specId) { + CreateSpecRequest request = + CreateSpecRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .setSpec(spec) + .setSpecId(specId) + .build(); + return createSpec(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Add a spec to an API version in the API hub. Multiple specs can be added to an API version. + * Note, while adding a spec, at least one of `contents` or `source_uri` must be provided. If + * `contents` is provided, then `spec_type` must also be provided. + * + *
On adding a spec with contents to the version, the operations present in it will be added to + * the version.Note that the file contents in the spec should be of the same type as defined in + * the `projects/{project}/locations/{location}/attributes/system-spec-type` attribute associated + * with spec resource. Note that specs of various types can be uploaded, however parsing of + * details is supported for OpenAPI spec currently. + * + *
In order to access the information parsed from the spec, use the + * [GetSpec][google.cloud.apihub.v1.ApiHub.GetSpec] method. In order to access the raw contents + * for a particular spec, use the [GetSpecContents][google.cloud.apihub.v1.ApiHub.GetSpecContents] + * method. In order to access the operations parsed from the spec, use the + * [ListAPIOperations][google.cloud.apihub.v1.ApiHub.ListApiOperations] method. + * + *
Sample code: + * + *
{@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 (ApiHubClient apiHubClient = ApiHubClient.create()) { + * String parent = VersionName.of("[PROJECT]", "[LOCATION]", "[API]", "[VERSION]").toString(); + * Spec spec = Spec.newBuilder().build(); + * String specId = "specId-896074186"; + * Spec response = apiHubClient.createSpec(parent, spec, specId); + * } + * }+ * + * @param parent Required. The parent resource for Spec. Format: + * `projects/{project}/locations/{location}/apis/{api}/versions/{version}` + * @param spec Required. The spec to create. + * @param specId Optional. The ID to use for the spec, which will become the final component of + * the spec's resource name. This field is optional. + *
This value should be 4-500 characters, and valid characters are /[a-z][A-Z][0-9]-_/. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Spec createSpec(String parent, Spec spec, String specId) { + CreateSpecRequest request = + CreateSpecRequest.newBuilder().setParent(parent).setSpec(spec).setSpecId(specId).build(); + return createSpec(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Add a spec to an API version in the API hub. Multiple specs can be added to an API version. + * Note, while adding a spec, at least one of `contents` or `source_uri` must be provided. If + * `contents` is provided, then `spec_type` must also be provided. + * + *
On adding a spec with contents to the version, the operations present in it will be added to + * the version.Note that the file contents in the spec should be of the same type as defined in + * the `projects/{project}/locations/{location}/attributes/system-spec-type` attribute associated + * with spec resource. Note that specs of various types can be uploaded, however parsing of + * details is supported for OpenAPI spec currently. + * + *
In order to access the information parsed from the spec, use the + * [GetSpec][google.cloud.apihub.v1.ApiHub.GetSpec] method. In order to access the raw contents + * for a particular spec, use the [GetSpecContents][google.cloud.apihub.v1.ApiHub.GetSpecContents] + * method. In order to access the operations parsed from the spec, use the + * [ListAPIOperations][google.cloud.apihub.v1.ApiHub.ListApiOperations] method. + * + *
Sample code: + * + *
{@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 (ApiHubClient apiHubClient = ApiHubClient.create()) { + * CreateSpecRequest request = + * CreateSpecRequest.newBuilder() + * .setParent(VersionName.of("[PROJECT]", "[LOCATION]", "[API]", "[VERSION]").toString()) + * .setSpecId("specId-896074186") + * .setSpec(Spec.newBuilder().build()) + * .build(); + * Spec response = apiHubClient.createSpec(request); + * } + * }+ * + * @param 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 + */ + public final Spec createSpec(CreateSpecRequest request) { + return createSpecCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Add a spec to an API version in the API hub. Multiple specs can be added to an API version. + * Note, while adding a spec, at least one of `contents` or `source_uri` must be provided. If + * `contents` is provided, then `spec_type` must also be provided. + * + *
On adding a spec with contents to the version, the operations present in it will be added to + * the version.Note that the file contents in the spec should be of the same type as defined in + * the `projects/{project}/locations/{location}/attributes/system-spec-type` attribute associated + * with spec resource. Note that specs of various types can be uploaded, however parsing of + * details is supported for OpenAPI spec currently. + * + *
In order to access the information parsed from the spec, use the + * [GetSpec][google.cloud.apihub.v1.ApiHub.GetSpec] method. In order to access the raw contents + * for a particular spec, use the [GetSpecContents][google.cloud.apihub.v1.ApiHub.GetSpecContents] + * method. In order to access the operations parsed from the spec, use the + * [ListAPIOperations][google.cloud.apihub.v1.ApiHub.ListApiOperations] method. + * + *
Sample code: + * + *
{@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 (ApiHubClient apiHubClient = ApiHubClient.create()) { + * CreateSpecRequest request = + * CreateSpecRequest.newBuilder() + * .setParent(VersionName.of("[PROJECT]", "[LOCATION]", "[API]", "[VERSION]").toString()) + * .setSpecId("specId-896074186") + * .setSpec(Spec.newBuilder().build()) + * .build(); + * ApiFuture+ */ + public final UnaryCallablefuture = apiHubClient.createSpecCallable().futureCall(request); + * // Do something. + * Spec response = future.get(); + * } + * }
Sample code: + * + *
{@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 (ApiHubClient apiHubClient = ApiHubClient.create()) { + * SpecName name = SpecName.of("[PROJECT]", "[LOCATION]", "[API]", "[VERSION]", "[SPEC]"); + * Spec response = apiHubClient.getSpec(name); + * } + * }+ * + * @param name Required. The name of the spec to retrieve. Format: + * `projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Spec getSpec(SpecName name) { + GetSpecRequest request = + GetSpecRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return getSpec(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Get details about the information parsed from a spec. Note that this method does not return the + * raw spec contents. Use [GetSpecContents][google.cloud.apihub.v1.ApiHub.GetSpecContents] method + * to retrieve the same. + * + *
Sample code: + * + *
{@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 (ApiHubClient apiHubClient = ApiHubClient.create()) { + * String name = + * SpecName.of("[PROJECT]", "[LOCATION]", "[API]", "[VERSION]", "[SPEC]").toString(); + * Spec response = apiHubClient.getSpec(name); + * } + * }+ * + * @param name Required. The name of the spec to retrieve. Format: + * `projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Spec getSpec(String name) { + GetSpecRequest request = GetSpecRequest.newBuilder().setName(name).build(); + return getSpec(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Get details about the information parsed from a spec. Note that this method does not return the + * raw spec contents. Use [GetSpecContents][google.cloud.apihub.v1.ApiHub.GetSpecContents] method + * to retrieve the same. + * + *
Sample code: + * + *
{@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 (ApiHubClient apiHubClient = ApiHubClient.create()) { + * GetSpecRequest request = + * GetSpecRequest.newBuilder() + * .setName( + * SpecName.of("[PROJECT]", "[LOCATION]", "[API]", "[VERSION]", "[SPEC]").toString()) + * .build(); + * Spec response = apiHubClient.getSpec(request); + * } + * }+ * + * @param 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 + */ + public final Spec getSpec(GetSpecRequest request) { + return getSpecCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Get details about the information parsed from a spec. Note that this method does not return the + * raw spec contents. Use [GetSpecContents][google.cloud.apihub.v1.ApiHub.GetSpecContents] method + * to retrieve the same. + * + *
Sample code: + * + *
{@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 (ApiHubClient apiHubClient = ApiHubClient.create()) { + * GetSpecRequest request = + * GetSpecRequest.newBuilder() + * .setName( + * SpecName.of("[PROJECT]", "[LOCATION]", "[API]", "[VERSION]", "[SPEC]").toString()) + * .build(); + * ApiFuture+ */ + public final UnaryCallablefuture = apiHubClient.getSpecCallable().futureCall(request); + * // Do something. + * Spec response = future.get(); + * } + * }
Sample code: + * + *
{@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 (ApiHubClient apiHubClient = ApiHubClient.create()) { + * SpecName name = SpecName.of("[PROJECT]", "[LOCATION]", "[API]", "[VERSION]", "[SPEC]"); + * SpecContents response = apiHubClient.getSpecContents(name); + * } + * }+ * + * @param name Required. The name of the spec whose contents need to be retrieved. Format: + * `projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final SpecContents getSpecContents(SpecName name) { + GetSpecContentsRequest request = + GetSpecContentsRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return getSpecContents(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Get spec contents. + * + *
Sample code: + * + *
{@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 (ApiHubClient apiHubClient = ApiHubClient.create()) { + * String name = + * SpecName.of("[PROJECT]", "[LOCATION]", "[API]", "[VERSION]", "[SPEC]").toString(); + * SpecContents response = apiHubClient.getSpecContents(name); + * } + * }+ * + * @param name Required. The name of the spec whose contents need to be retrieved. Format: + * `projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final SpecContents getSpecContents(String name) { + GetSpecContentsRequest request = GetSpecContentsRequest.newBuilder().setName(name).build(); + return getSpecContents(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Get spec contents. + * + *
Sample code: + * + *
{@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 (ApiHubClient apiHubClient = ApiHubClient.create()) { + * GetSpecContentsRequest request = + * GetSpecContentsRequest.newBuilder() + * .setName( + * SpecName.of("[PROJECT]", "[LOCATION]", "[API]", "[VERSION]", "[SPEC]").toString()) + * .build(); + * SpecContents response = apiHubClient.getSpecContents(request); + * } + * }+ * + * @param 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 + */ + public final SpecContents getSpecContents(GetSpecContentsRequest request) { + return getSpecContentsCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Get spec contents. + * + *
Sample code: + * + *
{@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 (ApiHubClient apiHubClient = ApiHubClient.create()) { + * GetSpecContentsRequest request = + * GetSpecContentsRequest.newBuilder() + * .setName( + * SpecName.of("[PROJECT]", "[LOCATION]", "[API]", "[VERSION]", "[SPEC]").toString()) + * .build(); + * ApiFuture+ */ + public final UnaryCallablefuture = apiHubClient.getSpecContentsCallable().futureCall(request); + * // Do something. + * SpecContents response = future.get(); + * } + * }
Sample code: + * + *
{@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 (ApiHubClient apiHubClient = ApiHubClient.create()) { + * VersionName parent = VersionName.of("[PROJECT]", "[LOCATION]", "[API]", "[VERSION]"); + * for (Spec element : apiHubClient.listSpecs(parent).iterateAll()) { + * // doThingsWith(element); + * } + * } + * }+ * + * @param parent Required. The parent, which owns this collection of specs. Format: + * `projects/{project}/locations/{location}/apis/{api}/versions/{version}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListSpecsPagedResponse listSpecs(VersionName parent) { + ListSpecsRequest request = + ListSpecsRequest.newBuilder().setParent(parent == null ? null : parent.toString()).build(); + return listSpecs(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * List specs corresponding to a particular API resource. + * + *
Sample code: + * + *
{@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 (ApiHubClient apiHubClient = ApiHubClient.create()) { + * String parent = VersionName.of("[PROJECT]", "[LOCATION]", "[API]", "[VERSION]").toString(); + * for (Spec element : apiHubClient.listSpecs(parent).iterateAll()) { + * // doThingsWith(element); + * } + * } + * }+ * + * @param parent Required. The parent, which owns this collection of specs. Format: + * `projects/{project}/locations/{location}/apis/{api}/versions/{version}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListSpecsPagedResponse listSpecs(String parent) { + ListSpecsRequest request = ListSpecsRequest.newBuilder().setParent(parent).build(); + return listSpecs(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * List specs corresponding to a particular API resource. + * + *
Sample code: + * + *
{@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 (ApiHubClient apiHubClient = ApiHubClient.create()) { + * ListSpecsRequest request = + * ListSpecsRequest.newBuilder() + * .setParent(VersionName.of("[PROJECT]", "[LOCATION]", "[API]", "[VERSION]").toString()) + * .setFilter("filter-1274492040") + * .setPageSize(883849137) + * .setPageToken("pageToken873572522") + * .build(); + * for (Spec element : apiHubClient.listSpecs(request).iterateAll()) { + * // doThingsWith(element); + * } + * } + * }+ * + * @param 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 + */ + public final ListSpecsPagedResponse listSpecs(ListSpecsRequest request) { + return listSpecsPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * List specs corresponding to a particular API resource. + * + *
Sample code: + * + *
{@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 (ApiHubClient apiHubClient = ApiHubClient.create()) { + * ListSpecsRequest request = + * ListSpecsRequest.newBuilder() + * .setParent(VersionName.of("[PROJECT]", "[LOCATION]", "[API]", "[VERSION]").toString()) + * .setFilter("filter-1274492040") + * .setPageSize(883849137) + * .setPageToken("pageToken873572522") + * .build(); + * ApiFuture+ */ + public final UnaryCallablefuture = apiHubClient.listSpecsPagedCallable().futureCall(request); + * // Do something. + * for (Spec element : future.get().iterateAll()) { + * // doThingsWith(element); + * } + * } + * }
Sample code: + * + *
{@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 (ApiHubClient apiHubClient = ApiHubClient.create()) { + * ListSpecsRequest request = + * ListSpecsRequest.newBuilder() + * .setParent(VersionName.of("[PROJECT]", "[LOCATION]", "[API]", "[VERSION]").toString()) + * .setFilter("filter-1274492040") + * .setPageSize(883849137) + * .setPageToken("pageToken873572522") + * .build(); + * while (true) { + * ListSpecsResponse response = apiHubClient.listSpecsCallable().call(request); + * for (Spec element : response.getSpecsList()) { + * // doThingsWith(element); + * } + * String nextPageToken = response.getNextPageToken(); + * if (!Strings.isNullOrEmpty(nextPageToken)) { + * request = request.toBuilder().setPageToken(nextPageToken).build(); + * } else { + * break; + * } + * } + * } + * }+ */ + public final UnaryCallable
In case of an OAS spec, updating spec contents can lead to: 1. Creation, deletion and update + * of operations. 2. Creation, deletion and update of definitions. 3. Update of other info parsed + * out from the new spec. + * + *
In case of contents or source_uri being present in update mask, spec_type must also be + * present. Also, spec_type can not be present in update mask if contents or source_uri is not + * present. + * + *
The [update_mask][google.cloud.apihub.v1.UpdateSpecRequest.update_mask] should be used to + * specify the fields being updated. + * + *
Sample code: + * + *
{@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 (ApiHubClient apiHubClient = ApiHubClient.create()) { + * Spec spec = Spec.newBuilder().build(); + * FieldMask updateMask = FieldMask.newBuilder().build(); + * Spec response = apiHubClient.updateSpec(spec, updateMask); + * } + * }+ * + * @param spec Required. The spec to update. + *
The spec's `name` field is used to identify the spec to update. Format: + * `projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}` + * @param updateMask Required. The list of fields to update. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Spec updateSpec(Spec spec, FieldMask updateMask) { + UpdateSpecRequest request = + UpdateSpecRequest.newBuilder().setSpec(spec).setUpdateMask(updateMask).build(); + return updateSpec(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Update spec. The following fields in the [spec][google.cloud.apihub.v1.Spec] can be updated: + * + *
In case of an OAS spec, updating spec contents can lead to: 1. Creation, deletion and update + * of operations. 2. Creation, deletion and update of definitions. 3. Update of other info parsed + * out from the new spec. + * + *
In case of contents or source_uri being present in update mask, spec_type must also be + * present. Also, spec_type can not be present in update mask if contents or source_uri is not + * present. + * + *
The [update_mask][google.cloud.apihub.v1.UpdateSpecRequest.update_mask] should be used to + * specify the fields being updated. + * + *
Sample code: + * + *
{@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 (ApiHubClient apiHubClient = ApiHubClient.create()) { + * UpdateSpecRequest request = + * UpdateSpecRequest.newBuilder() + * .setSpec(Spec.newBuilder().build()) + * .setUpdateMask(FieldMask.newBuilder().build()) + * .build(); + * Spec response = apiHubClient.updateSpec(request); + * } + * }+ * + * @param 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 + */ + public final Spec updateSpec(UpdateSpecRequest request) { + return updateSpecCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Update spec. The following fields in the [spec][google.cloud.apihub.v1.Spec] can be updated: + * + *
In case of an OAS spec, updating spec contents can lead to: 1. Creation, deletion and update + * of operations. 2. Creation, deletion and update of definitions. 3. Update of other info parsed + * out from the new spec. + * + *
In case of contents or source_uri being present in update mask, spec_type must also be + * present. Also, spec_type can not be present in update mask if contents or source_uri is not + * present. + * + *
The [update_mask][google.cloud.apihub.v1.UpdateSpecRequest.update_mask] should be used to + * specify the fields being updated. + * + *
Sample code: + * + *
{@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 (ApiHubClient apiHubClient = ApiHubClient.create()) { + * UpdateSpecRequest request = + * UpdateSpecRequest.newBuilder() + * .setSpec(Spec.newBuilder().build()) + * .setUpdateMask(FieldMask.newBuilder().build()) + * .build(); + * ApiFuture+ */ + public final UnaryCallablefuture = apiHubClient.updateSpecCallable().futureCall(request); + * // Do something. + * Spec response = future.get(); + * } + * }
Sample code: + * + *
{@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 (ApiHubClient apiHubClient = ApiHubClient.create()) { + * SpecName name = SpecName.of("[PROJECT]", "[LOCATION]", "[API]", "[VERSION]", "[SPEC]"); + * apiHubClient.deleteSpec(name); + * } + * }+ * + * @param name Required. The name of the spec to delete. Format: + * `projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteSpec(SpecName name) { + DeleteSpecRequest request = + DeleteSpecRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + deleteSpec(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Delete a spec. Deleting a spec will also delete the associated operations from the version. + * + *
Sample code: + * + *
{@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 (ApiHubClient apiHubClient = ApiHubClient.create()) { + * String name = + * SpecName.of("[PROJECT]", "[LOCATION]", "[API]", "[VERSION]", "[SPEC]").toString(); + * apiHubClient.deleteSpec(name); + * } + * }+ * + * @param name Required. The name of the spec to delete. Format: + * `projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteSpec(String name) { + DeleteSpecRequest request = DeleteSpecRequest.newBuilder().setName(name).build(); + deleteSpec(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Delete a spec. Deleting a spec will also delete the associated operations from the version. + * + *
Sample code: + * + *
{@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 (ApiHubClient apiHubClient = ApiHubClient.create()) { + * DeleteSpecRequest request = + * DeleteSpecRequest.newBuilder() + * .setName( + * SpecName.of("[PROJECT]", "[LOCATION]", "[API]", "[VERSION]", "[SPEC]").toString()) + * .build(); + * apiHubClient.deleteSpec(request); + * } + * }+ * + * @param 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 + */ + public final void deleteSpec(DeleteSpecRequest request) { + deleteSpecCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Delete a spec. Deleting a spec will also delete the associated operations from the version. + * + *
Sample code: + * + *
{@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 (ApiHubClient apiHubClient = ApiHubClient.create()) { + * DeleteSpecRequest request = + * DeleteSpecRequest.newBuilder() + * .setName( + * SpecName.of("[PROJECT]", "[LOCATION]", "[API]", "[VERSION]", "[SPEC]").toString()) + * .build(); + * ApiFuture+ */ + public final UnaryCallablefuture = apiHubClient.deleteSpecCallable().futureCall(request); + * // Do something. + * future.get(); + * } + * }
Sample code: + * + *
{@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 (ApiHubClient apiHubClient = ApiHubClient.create()) { + * ApiOperationName name = + * ApiOperationName.of("[PROJECT]", "[LOCATION]", "[API]", "[VERSION]", "[OPERATION]"); + * ApiOperation response = apiHubClient.getApiOperation(name); + * } + * }+ * + * @param name Required. The name of the operation to retrieve. Format: + * `projects/{project}/locations/{location}/apis/{api}/versions/{version}/operations/{operation}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ApiOperation getApiOperation(ApiOperationName name) { + GetApiOperationRequest request = + GetApiOperationRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return getApiOperation(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Get details about a particular operation in API version. + * + *
Sample code: + * + *
{@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 (ApiHubClient apiHubClient = ApiHubClient.create()) { + * String name = + * ApiOperationName.of("[PROJECT]", "[LOCATION]", "[API]", "[VERSION]", "[OPERATION]") + * .toString(); + * ApiOperation response = apiHubClient.getApiOperation(name); + * } + * }+ * + * @param name Required. The name of the operation to retrieve. Format: + * `projects/{project}/locations/{location}/apis/{api}/versions/{version}/operations/{operation}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ApiOperation getApiOperation(String name) { + GetApiOperationRequest request = GetApiOperationRequest.newBuilder().setName(name).build(); + return getApiOperation(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Get details about a particular operation in API version. + * + *
Sample code: + * + *
{@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 (ApiHubClient apiHubClient = ApiHubClient.create()) { + * GetApiOperationRequest request = + * GetApiOperationRequest.newBuilder() + * .setName( + * ApiOperationName.of( + * "[PROJECT]", "[LOCATION]", "[API]", "[VERSION]", "[OPERATION]") + * .toString()) + * .build(); + * ApiOperation response = apiHubClient.getApiOperation(request); + * } + * }+ * + * @param 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 + */ + public final ApiOperation getApiOperation(GetApiOperationRequest request) { + return getApiOperationCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Get details about a particular operation in API version. + * + *
Sample code: + * + *
{@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 (ApiHubClient apiHubClient = ApiHubClient.create()) { + * GetApiOperationRequest request = + * GetApiOperationRequest.newBuilder() + * .setName( + * ApiOperationName.of( + * "[PROJECT]", "[LOCATION]", "[API]", "[VERSION]", "[OPERATION]") + * .toString()) + * .build(); + * ApiFuture+ */ + public final UnaryCallablefuture = apiHubClient.getApiOperationCallable().futureCall(request); + * // Do something. + * ApiOperation response = future.get(); + * } + * }
Sample code: + * + *
{@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 (ApiHubClient apiHubClient = ApiHubClient.create()) { + * VersionName parent = VersionName.of("[PROJECT]", "[LOCATION]", "[API]", "[VERSION]"); + * for (ApiOperation element : apiHubClient.listApiOperations(parent).iterateAll()) { + * // doThingsWith(element); + * } + * } + * }+ * + * @param parent Required. The parent which owns this collection of operations i.e., the API + * version. Format: `projects/{project}/locations/{location}/apis/{api}/versions/{version}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListApiOperationsPagedResponse listApiOperations(VersionName parent) { + ListApiOperationsRequest request = + ListApiOperationsRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .build(); + return listApiOperations(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * List operations in an API version. + * + *
Sample code: + * + *
{@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 (ApiHubClient apiHubClient = ApiHubClient.create()) { + * String parent = VersionName.of("[PROJECT]", "[LOCATION]", "[API]", "[VERSION]").toString(); + * for (ApiOperation element : apiHubClient.listApiOperations(parent).iterateAll()) { + * // doThingsWith(element); + * } + * } + * }+ * + * @param parent Required. The parent which owns this collection of operations i.e., the API + * version. Format: `projects/{project}/locations/{location}/apis/{api}/versions/{version}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListApiOperationsPagedResponse listApiOperations(String parent) { + ListApiOperationsRequest request = + ListApiOperationsRequest.newBuilder().setParent(parent).build(); + return listApiOperations(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * List operations in an API version. + * + *
Sample code: + * + *
{@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 (ApiHubClient apiHubClient = ApiHubClient.create()) { + * ListApiOperationsRequest request = + * ListApiOperationsRequest.newBuilder() + * .setParent(VersionName.of("[PROJECT]", "[LOCATION]", "[API]", "[VERSION]").toString()) + * .setFilter("filter-1274492040") + * .setPageSize(883849137) + * .setPageToken("pageToken873572522") + * .build(); + * for (ApiOperation element : apiHubClient.listApiOperations(request).iterateAll()) { + * // doThingsWith(element); + * } + * } + * }+ * + * @param 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 + */ + public final ListApiOperationsPagedResponse listApiOperations(ListApiOperationsRequest request) { + return listApiOperationsPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * List operations in an API version. + * + *
Sample code: + * + *
{@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 (ApiHubClient apiHubClient = ApiHubClient.create()) { + * ListApiOperationsRequest request = + * ListApiOperationsRequest.newBuilder() + * .setParent(VersionName.of("[PROJECT]", "[LOCATION]", "[API]", "[VERSION]").toString()) + * .setFilter("filter-1274492040") + * .setPageSize(883849137) + * .setPageToken("pageToken873572522") + * .build(); + * ApiFuture+ */ + public final UnaryCallablefuture = + * apiHubClient.listApiOperationsPagedCallable().futureCall(request); + * // Do something. + * for (ApiOperation element : future.get().iterateAll()) { + * // doThingsWith(element); + * } + * } + * }
Sample code: + * + *
{@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 (ApiHubClient apiHubClient = ApiHubClient.create()) { + * ListApiOperationsRequest request = + * ListApiOperationsRequest.newBuilder() + * .setParent(VersionName.of("[PROJECT]", "[LOCATION]", "[API]", "[VERSION]").toString()) + * .setFilter("filter-1274492040") + * .setPageSize(883849137) + * .setPageToken("pageToken873572522") + * .build(); + * while (true) { + * ListApiOperationsResponse response = apiHubClient.listApiOperationsCallable().call(request); + * for (ApiOperation element : response.getApiOperationsList()) { + * // doThingsWith(element); + * } + * String nextPageToken = response.getNextPageToken(); + * if (!Strings.isNullOrEmpty(nextPageToken)) { + * request = request.toBuilder().setPageToken(nextPageToken).build(); + * } else { + * break; + * } + * } + * } + * }+ */ + public final UnaryCallable
Sample code: + * + *
{@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 (ApiHubClient apiHubClient = ApiHubClient.create()) { + * DefinitionName name = + * DefinitionName.of("[PROJECT]", "[LOCATION]", "[API]", "[VERSION]", "[DEFINITION]"); + * Definition response = apiHubClient.getDefinition(name); + * } + * }+ * + * @param name Required. The name of the definition to retrieve. Format: + * `projects/{project}/locations/{location}/apis/{api}/versions/{version}/definitions/{definition}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Definition getDefinition(DefinitionName name) { + GetDefinitionRequest request = + GetDefinitionRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return getDefinition(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Get details about a definition in an API version. + * + *
Sample code: + * + *
{@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 (ApiHubClient apiHubClient = ApiHubClient.create()) { + * String name = + * DefinitionName.of("[PROJECT]", "[LOCATION]", "[API]", "[VERSION]", "[DEFINITION]") + * .toString(); + * Definition response = apiHubClient.getDefinition(name); + * } + * }+ * + * @param name Required. The name of the definition to retrieve. Format: + * `projects/{project}/locations/{location}/apis/{api}/versions/{version}/definitions/{definition}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Definition getDefinition(String name) { + GetDefinitionRequest request = GetDefinitionRequest.newBuilder().setName(name).build(); + return getDefinition(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Get details about a definition in an API version. + * + *
Sample code: + * + *
{@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 (ApiHubClient apiHubClient = ApiHubClient.create()) { + * GetDefinitionRequest request = + * GetDefinitionRequest.newBuilder() + * .setName( + * DefinitionName.of("[PROJECT]", "[LOCATION]", "[API]", "[VERSION]", "[DEFINITION]") + * .toString()) + * .build(); + * Definition response = apiHubClient.getDefinition(request); + * } + * }+ * + * @param 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 + */ + public final Definition getDefinition(GetDefinitionRequest request) { + return getDefinitionCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Get details about a definition in an API version. + * + *
Sample code: + * + *
{@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 (ApiHubClient apiHubClient = ApiHubClient.create()) { + * GetDefinitionRequest request = + * GetDefinitionRequest.newBuilder() + * .setName( + * DefinitionName.of("[PROJECT]", "[LOCATION]", "[API]", "[VERSION]", "[DEFINITION]") + * .toString()) + * .build(); + * ApiFuture+ */ + public final UnaryCallablefuture = apiHubClient.getDefinitionCallable().futureCall(request); + * // Do something. + * Definition response = future.get(); + * } + * }
Sample code: + * + *
{@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 (ApiHubClient apiHubClient = ApiHubClient.create()) { + * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + * Deployment deployment = Deployment.newBuilder().build(); + * String deploymentId = "deploymentId-136894784"; + * Deployment response = apiHubClient.createDeployment(parent, deployment, deploymentId); + * } + * }+ * + * @param parent Required. The parent resource for the deployment resource. Format: + * `projects/{project}/locations/{location}` + * @param deployment Required. The deployment resource to create. + * @param deploymentId Optional. The ID to use for the deployment resource, which will become the + * final component of the deployment's resource name. This field is optional. + *
This value should be 4-500 characters, and valid characters are /[a-z][A-Z][0-9]-_/. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Deployment createDeployment( + LocationName parent, Deployment deployment, String deploymentId) { + CreateDeploymentRequest request = + CreateDeploymentRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .setDeployment(deployment) + .setDeploymentId(deploymentId) + .build(); + return createDeployment(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Create a deployment resource in the API hub. Once a deployment resource is created, it can be + * associated with API versions. + * + *
Sample code: + * + *
{@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 (ApiHubClient apiHubClient = ApiHubClient.create()) { + * String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); + * Deployment deployment = Deployment.newBuilder().build(); + * String deploymentId = "deploymentId-136894784"; + * Deployment response = apiHubClient.createDeployment(parent, deployment, deploymentId); + * } + * }+ * + * @param parent Required. The parent resource for the deployment resource. Format: + * `projects/{project}/locations/{location}` + * @param deployment Required. The deployment resource to create. + * @param deploymentId Optional. The ID to use for the deployment resource, which will become the + * final component of the deployment's resource name. This field is optional. + *
This value should be 4-500 characters, and valid characters are /[a-z][A-Z][0-9]-_/. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Deployment createDeployment( + String parent, Deployment deployment, String deploymentId) { + CreateDeploymentRequest request = + CreateDeploymentRequest.newBuilder() + .setParent(parent) + .setDeployment(deployment) + .setDeploymentId(deploymentId) + .build(); + return createDeployment(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Create a deployment resource in the API hub. Once a deployment resource is created, it can be + * associated with API versions. + * + *
Sample code: + * + *
{@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 (ApiHubClient apiHubClient = ApiHubClient.create()) { + * CreateDeploymentRequest request = + * CreateDeploymentRequest.newBuilder() + * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + * .setDeploymentId("deploymentId-136894784") + * .setDeployment(Deployment.newBuilder().build()) + * .build(); + * Deployment response = apiHubClient.createDeployment(request); + * } + * }+ * + * @param 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 + */ + public final Deployment createDeployment(CreateDeploymentRequest request) { + return createDeploymentCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Create a deployment resource in the API hub. Once a deployment resource is created, it can be + * associated with API versions. + * + *
Sample code: + * + *
{@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 (ApiHubClient apiHubClient = ApiHubClient.create()) { + * CreateDeploymentRequest request = + * CreateDeploymentRequest.newBuilder() + * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + * .setDeploymentId("deploymentId-136894784") + * .setDeployment(Deployment.newBuilder().build()) + * .build(); + * ApiFuture+ */ + public final UnaryCallablefuture = apiHubClient.createDeploymentCallable().futureCall(request); + * // Do something. + * Deployment response = future.get(); + * } + * }
Sample code: + * + *
{@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 (ApiHubClient apiHubClient = ApiHubClient.create()) { + * DeploymentName name = DeploymentName.of("[PROJECT]", "[LOCATION]", "[DEPLOYMENT]"); + * Deployment response = apiHubClient.getDeployment(name); + * } + * }+ * + * @param name Required. The name of the deployment resource to retrieve. Format: + * `projects/{project}/locations/{location}/deployments/{deployment}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Deployment getDeployment(DeploymentName name) { + GetDeploymentRequest request = + GetDeploymentRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return getDeployment(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Get details about a deployment and the API versions linked to it. + * + *
Sample code: + * + *
{@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 (ApiHubClient apiHubClient = ApiHubClient.create()) { + * String name = DeploymentName.of("[PROJECT]", "[LOCATION]", "[DEPLOYMENT]").toString(); + * Deployment response = apiHubClient.getDeployment(name); + * } + * }+ * + * @param name Required. The name of the deployment resource to retrieve. Format: + * `projects/{project}/locations/{location}/deployments/{deployment}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Deployment getDeployment(String name) { + GetDeploymentRequest request = GetDeploymentRequest.newBuilder().setName(name).build(); + return getDeployment(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Get details about a deployment and the API versions linked to it. + * + *
Sample code: + * + *
{@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 (ApiHubClient apiHubClient = ApiHubClient.create()) { + * GetDeploymentRequest request = + * GetDeploymentRequest.newBuilder() + * .setName(DeploymentName.of("[PROJECT]", "[LOCATION]", "[DEPLOYMENT]").toString()) + * .build(); + * Deployment response = apiHubClient.getDeployment(request); + * } + * }+ * + * @param 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 + */ + public final Deployment getDeployment(GetDeploymentRequest request) { + return getDeploymentCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Get details about a deployment and the API versions linked to it. + * + *
Sample code: + * + *
{@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 (ApiHubClient apiHubClient = ApiHubClient.create()) { + * GetDeploymentRequest request = + * GetDeploymentRequest.newBuilder() + * .setName(DeploymentName.of("[PROJECT]", "[LOCATION]", "[DEPLOYMENT]").toString()) + * .build(); + * ApiFuture+ */ + public final UnaryCallablefuture = apiHubClient.getDeploymentCallable().futureCall(request); + * // Do something. + * Deployment response = future.get(); + * } + * }
Sample code: + * + *
{@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 (ApiHubClient apiHubClient = ApiHubClient.create()) { + * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + * for (Deployment element : apiHubClient.listDeployments(parent).iterateAll()) { + * // doThingsWith(element); + * } + * } + * }+ * + * @param parent Required. The parent, which owns this collection of deployment resources. Format: + * `projects/{project}/locations/{location}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListDeploymentsPagedResponse listDeployments(LocationName parent) { + ListDeploymentsRequest request = + ListDeploymentsRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .build(); + return listDeployments(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * List deployment resources in the API hub. + * + *
Sample code: + * + *
{@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 (ApiHubClient apiHubClient = ApiHubClient.create()) { + * String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); + * for (Deployment element : apiHubClient.listDeployments(parent).iterateAll()) { + * // doThingsWith(element); + * } + * } + * }+ * + * @param parent Required. The parent, which owns this collection of deployment resources. Format: + * `projects/{project}/locations/{location}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListDeploymentsPagedResponse listDeployments(String parent) { + ListDeploymentsRequest request = ListDeploymentsRequest.newBuilder().setParent(parent).build(); + return listDeployments(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * List deployment resources in the API hub. + * + *
Sample code: + * + *
{@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 (ApiHubClient apiHubClient = ApiHubClient.create()) { + * ListDeploymentsRequest request = + * ListDeploymentsRequest.newBuilder() + * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + * .setFilter("filter-1274492040") + * .setPageSize(883849137) + * .setPageToken("pageToken873572522") + * .build(); + * for (Deployment element : apiHubClient.listDeployments(request).iterateAll()) { + * // doThingsWith(element); + * } + * } + * }+ * + * @param 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 + */ + public final ListDeploymentsPagedResponse listDeployments(ListDeploymentsRequest request) { + return listDeploymentsPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * List deployment resources in the API hub. + * + *
Sample code: + * + *
{@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 (ApiHubClient apiHubClient = ApiHubClient.create()) { + * ListDeploymentsRequest request = + * ListDeploymentsRequest.newBuilder() + * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + * .setFilter("filter-1274492040") + * .setPageSize(883849137) + * .setPageToken("pageToken873572522") + * .build(); + * ApiFuture+ */ + public final UnaryCallablefuture = + * apiHubClient.listDeploymentsPagedCallable().futureCall(request); + * // Do something. + * for (Deployment element : future.get().iterateAll()) { + * // doThingsWith(element); + * } + * } + * }
Sample code: + * + *
{@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 (ApiHubClient apiHubClient = ApiHubClient.create()) { + * ListDeploymentsRequest request = + * ListDeploymentsRequest.newBuilder() + * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + * .setFilter("filter-1274492040") + * .setPageSize(883849137) + * .setPageToken("pageToken873572522") + * .build(); + * while (true) { + * ListDeploymentsResponse response = apiHubClient.listDeploymentsCallable().call(request); + * for (Deployment element : response.getDeploymentsList()) { + * // doThingsWith(element); + * } + * String nextPageToken = response.getNextPageToken(); + * if (!Strings.isNullOrEmpty(nextPageToken)) { + * request = request.toBuilder().setPageToken(nextPageToken).build(); + * } else { + * break; + * } + * } + * } + * }+ */ + public final UnaryCallable
The [update_mask][google.cloud.apihub.v1.UpdateDeploymentRequest.update_mask] should be used + * to specify the fields being updated. + * + *
Sample code: + * + *
{@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 (ApiHubClient apiHubClient = ApiHubClient.create()) { + * Deployment deployment = Deployment.newBuilder().build(); + * FieldMask updateMask = FieldMask.newBuilder().build(); + * Deployment response = apiHubClient.updateDeployment(deployment, updateMask); + * } + * }+ * + * @param deployment Required. The deployment resource to update. + *
The deployment resource's `name` field is used to identify the deployment resource to + * update. Format: `projects/{project}/locations/{location}/deployments/{deployment}` + * @param updateMask Required. The list of fields to update. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Deployment updateDeployment(Deployment deployment, FieldMask updateMask) { + UpdateDeploymentRequest request = + UpdateDeploymentRequest.newBuilder() + .setDeployment(deployment) + .setUpdateMask(updateMask) + .build(); + return updateDeployment(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Update a deployment resource in the API hub. The following fields in the [deployment + * resource][google.cloud.apihub.v1.Deployment] can be updated: + * + *
The [update_mask][google.cloud.apihub.v1.UpdateDeploymentRequest.update_mask] should be used + * to specify the fields being updated. + * + *
Sample code: + * + *
{@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 (ApiHubClient apiHubClient = ApiHubClient.create()) { + * UpdateDeploymentRequest request = + * UpdateDeploymentRequest.newBuilder() + * .setDeployment(Deployment.newBuilder().build()) + * .setUpdateMask(FieldMask.newBuilder().build()) + * .build(); + * Deployment response = apiHubClient.updateDeployment(request); + * } + * }+ * + * @param 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 + */ + public final Deployment updateDeployment(UpdateDeploymentRequest request) { + return updateDeploymentCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Update a deployment resource in the API hub. The following fields in the [deployment + * resource][google.cloud.apihub.v1.Deployment] can be updated: + * + *
The [update_mask][google.cloud.apihub.v1.UpdateDeploymentRequest.update_mask] should be used + * to specify the fields being updated. + * + *
Sample code: + * + *
{@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 (ApiHubClient apiHubClient = ApiHubClient.create()) { + * UpdateDeploymentRequest request = + * UpdateDeploymentRequest.newBuilder() + * .setDeployment(Deployment.newBuilder().build()) + * .setUpdateMask(FieldMask.newBuilder().build()) + * .build(); + * ApiFuture+ */ + public final UnaryCallablefuture = apiHubClient.updateDeploymentCallable().futureCall(request); + * // Do something. + * Deployment response = future.get(); + * } + * }
Sample code: + * + *
{@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 (ApiHubClient apiHubClient = ApiHubClient.create()) { + * DeploymentName name = DeploymentName.of("[PROJECT]", "[LOCATION]", "[DEPLOYMENT]"); + * apiHubClient.deleteDeployment(name); + * } + * }+ * + * @param name Required. The name of the deployment resource to delete. Format: + * `projects/{project}/locations/{location}/deployments/{deployment}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteDeployment(DeploymentName name) { + DeleteDeploymentRequest request = + DeleteDeploymentRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + deleteDeployment(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Delete a deployment resource in the API hub. + * + *
Sample code: + * + *
{@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 (ApiHubClient apiHubClient = ApiHubClient.create()) { + * String name = DeploymentName.of("[PROJECT]", "[LOCATION]", "[DEPLOYMENT]").toString(); + * apiHubClient.deleteDeployment(name); + * } + * }+ * + * @param name Required. The name of the deployment resource to delete. Format: + * `projects/{project}/locations/{location}/deployments/{deployment}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteDeployment(String name) { + DeleteDeploymentRequest request = DeleteDeploymentRequest.newBuilder().setName(name).build(); + deleteDeployment(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Delete a deployment resource in the API hub. + * + *
Sample code: + * + *
{@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 (ApiHubClient apiHubClient = ApiHubClient.create()) { + * DeleteDeploymentRequest request = + * DeleteDeploymentRequest.newBuilder() + * .setName(DeploymentName.of("[PROJECT]", "[LOCATION]", "[DEPLOYMENT]").toString()) + * .build(); + * apiHubClient.deleteDeployment(request); + * } + * }+ * + * @param 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 + */ + public final void deleteDeployment(DeleteDeploymentRequest request) { + deleteDeploymentCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Delete a deployment resource in the API hub. + * + *
Sample code: + * + *
{@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 (ApiHubClient apiHubClient = ApiHubClient.create()) { + * DeleteDeploymentRequest request = + * DeleteDeploymentRequest.newBuilder() + * .setName(DeploymentName.of("[PROJECT]", "[LOCATION]", "[DEPLOYMENT]").toString()) + * .build(); + * ApiFuture+ */ + public final UnaryCallablefuture = apiHubClient.deleteDeploymentCallable().futureCall(request); + * // Do something. + * future.get(); + * } + * }
Certain pre defined attributes are already created by the API hub. These attributes will + * have type as `SYSTEM_DEFINED` and can be listed via + * [ListAttributes][google.cloud.apihub.v1.ApiHub.ListAttributes] method. Allowed values for the + * same can be updated via [UpdateAttribute][google.cloud.apihub.v1.ApiHub.UpdateAttribute] + * method. + * + *
Sample code: + * + *
{@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 (ApiHubClient apiHubClient = ApiHubClient.create()) { + * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + * Attribute attribute = Attribute.newBuilder().build(); + * String attributeId = "attributeId-309887785"; + * Attribute response = apiHubClient.createAttribute(parent, attribute, attributeId); + * } + * }+ * + * @param parent Required. The parent resource for Attribute. Format: + * `projects/{project}/locations/{location}` + * @param attribute Required. The attribute to create. + * @param attributeId Optional. The ID to use for the attribute, which will become the final + * component of the attribute's resource name. This field is optional. + *
This value should be 4-500 characters, and valid characters are /[a-z][A-Z][0-9]-_/. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Attribute createAttribute( + LocationName parent, Attribute attribute, String attributeId) { + CreateAttributeRequest request = + CreateAttributeRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .setAttribute(attribute) + .setAttributeId(attributeId) + .build(); + return createAttribute(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Create a user defined attribute. + * + *
Certain pre defined attributes are already created by the API hub. These attributes will + * have type as `SYSTEM_DEFINED` and can be listed via + * [ListAttributes][google.cloud.apihub.v1.ApiHub.ListAttributes] method. Allowed values for the + * same can be updated via [UpdateAttribute][google.cloud.apihub.v1.ApiHub.UpdateAttribute] + * method. + * + *
Sample code: + * + *
{@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 (ApiHubClient apiHubClient = ApiHubClient.create()) { + * String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); + * Attribute attribute = Attribute.newBuilder().build(); + * String attributeId = "attributeId-309887785"; + * Attribute response = apiHubClient.createAttribute(parent, attribute, attributeId); + * } + * }+ * + * @param parent Required. The parent resource for Attribute. Format: + * `projects/{project}/locations/{location}` + * @param attribute Required. The attribute to create. + * @param attributeId Optional. The ID to use for the attribute, which will become the final + * component of the attribute's resource name. This field is optional. + *
This value should be 4-500 characters, and valid characters are /[a-z][A-Z][0-9]-_/. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Attribute createAttribute(String parent, Attribute attribute, String attributeId) { + CreateAttributeRequest request = + CreateAttributeRequest.newBuilder() + .setParent(parent) + .setAttribute(attribute) + .setAttributeId(attributeId) + .build(); + return createAttribute(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Create a user defined attribute. + * + *
Certain pre defined attributes are already created by the API hub. These attributes will + * have type as `SYSTEM_DEFINED` and can be listed via + * [ListAttributes][google.cloud.apihub.v1.ApiHub.ListAttributes] method. Allowed values for the + * same can be updated via [UpdateAttribute][google.cloud.apihub.v1.ApiHub.UpdateAttribute] + * method. + * + *
Sample code: + * + *
{@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 (ApiHubClient apiHubClient = ApiHubClient.create()) { + * CreateAttributeRequest request = + * CreateAttributeRequest.newBuilder() + * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + * .setAttributeId("attributeId-309887785") + * .setAttribute(Attribute.newBuilder().build()) + * .build(); + * Attribute response = apiHubClient.createAttribute(request); + * } + * }+ * + * @param 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 + */ + public final Attribute createAttribute(CreateAttributeRequest request) { + return createAttributeCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Create a user defined attribute. + * + *
Certain pre defined attributes are already created by the API hub. These attributes will + * have type as `SYSTEM_DEFINED` and can be listed via + * [ListAttributes][google.cloud.apihub.v1.ApiHub.ListAttributes] method. Allowed values for the + * same can be updated via [UpdateAttribute][google.cloud.apihub.v1.ApiHub.UpdateAttribute] + * method. + * + *
Sample code: + * + *
{@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 (ApiHubClient apiHubClient = ApiHubClient.create()) { + * CreateAttributeRequest request = + * CreateAttributeRequest.newBuilder() + * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + * .setAttributeId("attributeId-309887785") + * .setAttribute(Attribute.newBuilder().build()) + * .build(); + * ApiFuture+ */ + public final UnaryCallablefuture = apiHubClient.createAttributeCallable().futureCall(request); + * // Do something. + * Attribute response = future.get(); + * } + * }
Sample code: + * + *
{@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 (ApiHubClient apiHubClient = ApiHubClient.create()) { + * AttributeName name = AttributeName.of("[PROJECT]", "[LOCATION]", "[ATTRIBUTE]"); + * Attribute response = apiHubClient.getAttribute(name); + * } + * }+ * + * @param name Required. The name of the attribute to retrieve. Format: + * `projects/{project}/locations/{location}/attributes/{attribute}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Attribute getAttribute(AttributeName name) { + GetAttributeRequest request = + GetAttributeRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return getAttribute(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Get details about the attribute. + * + *
Sample code: + * + *
{@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 (ApiHubClient apiHubClient = ApiHubClient.create()) { + * String name = AttributeName.of("[PROJECT]", "[LOCATION]", "[ATTRIBUTE]").toString(); + * Attribute response = apiHubClient.getAttribute(name); + * } + * }+ * + * @param name Required. The name of the attribute to retrieve. Format: + * `projects/{project}/locations/{location}/attributes/{attribute}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Attribute getAttribute(String name) { + GetAttributeRequest request = GetAttributeRequest.newBuilder().setName(name).build(); + return getAttribute(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Get details about the attribute. + * + *
Sample code: + * + *
{@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 (ApiHubClient apiHubClient = ApiHubClient.create()) { + * GetAttributeRequest request = + * GetAttributeRequest.newBuilder() + * .setName(AttributeName.of("[PROJECT]", "[LOCATION]", "[ATTRIBUTE]").toString()) + * .build(); + * Attribute response = apiHubClient.getAttribute(request); + * } + * }+ * + * @param 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 + */ + public final Attribute getAttribute(GetAttributeRequest request) { + return getAttributeCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Get details about the attribute. + * + *
Sample code: + * + *
{@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 (ApiHubClient apiHubClient = ApiHubClient.create()) { + * GetAttributeRequest request = + * GetAttributeRequest.newBuilder() + * .setName(AttributeName.of("[PROJECT]", "[LOCATION]", "[ATTRIBUTE]").toString()) + * .build(); + * ApiFuture+ */ + public final UnaryCallablefuture = apiHubClient.getAttributeCallable().futureCall(request); + * // Do something. + * Attribute response = future.get(); + * } + * }
The [update_mask][google.cloud.apihub.v1.UpdateAttributeRequest.update_mask] should be used + * to specify the fields being updated. + * + *
Sample code: + * + *
{@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 (ApiHubClient apiHubClient = ApiHubClient.create()) { + * Attribute attribute = Attribute.newBuilder().build(); + * FieldMask updateMask = FieldMask.newBuilder().build(); + * Attribute response = apiHubClient.updateAttribute(attribute, updateMask); + * } + * }+ * + * @param attribute Required. The attribute to update. + *
The attribute's `name` field is used to identify the attribute to update. Format: + * `projects/{project}/locations/{location}/attributes/{attribute}` + * @param updateMask Required. The list of fields to update. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Attribute updateAttribute(Attribute attribute, FieldMask updateMask) { + UpdateAttributeRequest request = + UpdateAttributeRequest.newBuilder() + .setAttribute(attribute) + .setUpdateMask(updateMask) + .build(); + return updateAttribute(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Update the attribute. The following fields in the [Attribute + * resource][google.cloud.apihub.v1.Attribute] can be updated: + * + *
The [update_mask][google.cloud.apihub.v1.UpdateAttributeRequest.update_mask] should be used + * to specify the fields being updated. + * + *
Sample code: + * + *
{@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 (ApiHubClient apiHubClient = ApiHubClient.create()) { + * UpdateAttributeRequest request = + * UpdateAttributeRequest.newBuilder() + * .setAttribute(Attribute.newBuilder().build()) + * .setUpdateMask(FieldMask.newBuilder().build()) + * .build(); + * Attribute response = apiHubClient.updateAttribute(request); + * } + * }+ * + * @param 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 + */ + public final Attribute updateAttribute(UpdateAttributeRequest request) { + return updateAttributeCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Update the attribute. The following fields in the [Attribute + * resource][google.cloud.apihub.v1.Attribute] can be updated: + * + *
The [update_mask][google.cloud.apihub.v1.UpdateAttributeRequest.update_mask] should be used + * to specify the fields being updated. + * + *
Sample code: + * + *
{@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 (ApiHubClient apiHubClient = ApiHubClient.create()) { + * UpdateAttributeRequest request = + * UpdateAttributeRequest.newBuilder() + * .setAttribute(Attribute.newBuilder().build()) + * .setUpdateMask(FieldMask.newBuilder().build()) + * .build(); + * ApiFuture+ */ + public final UnaryCallablefuture = apiHubClient.updateAttributeCallable().futureCall(request); + * // Do something. + * Attribute response = future.get(); + * } + * }
Note: System defined attributes cannot be deleted. All associations of the attribute being + * deleted with any API hub resource will also get deleted. + * + *
Sample code: + * + *
{@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 (ApiHubClient apiHubClient = ApiHubClient.create()) { + * AttributeName name = AttributeName.of("[PROJECT]", "[LOCATION]", "[ATTRIBUTE]"); + * apiHubClient.deleteAttribute(name); + * } + * }+ * + * @param name Required. The name of the attribute to delete. Format: + * `projects/{project}/locations/{location}/attributes/{attribute}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteAttribute(AttributeName name) { + DeleteAttributeRequest request = + DeleteAttributeRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + deleteAttribute(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Delete an attribute. + * + *
Note: System defined attributes cannot be deleted. All associations of the attribute being + * deleted with any API hub resource will also get deleted. + * + *
Sample code: + * + *
{@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 (ApiHubClient apiHubClient = ApiHubClient.create()) { + * String name = AttributeName.of("[PROJECT]", "[LOCATION]", "[ATTRIBUTE]").toString(); + * apiHubClient.deleteAttribute(name); + * } + * }+ * + * @param name Required. The name of the attribute to delete. Format: + * `projects/{project}/locations/{location}/attributes/{attribute}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteAttribute(String name) { + DeleteAttributeRequest request = DeleteAttributeRequest.newBuilder().setName(name).build(); + deleteAttribute(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Delete an attribute. + * + *
Note: System defined attributes cannot be deleted. All associations of the attribute being + * deleted with any API hub resource will also get deleted. + * + *
Sample code: + * + *
{@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 (ApiHubClient apiHubClient = ApiHubClient.create()) { + * DeleteAttributeRequest request = + * DeleteAttributeRequest.newBuilder() + * .setName(AttributeName.of("[PROJECT]", "[LOCATION]", "[ATTRIBUTE]").toString()) + * .build(); + * apiHubClient.deleteAttribute(request); + * } + * }+ * + * @param 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 + */ + public final void deleteAttribute(DeleteAttributeRequest request) { + deleteAttributeCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Delete an attribute. + * + *
Note: System defined attributes cannot be deleted. All associations of the attribute being + * deleted with any API hub resource will also get deleted. + * + *
Sample code: + * + *
{@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 (ApiHubClient apiHubClient = ApiHubClient.create()) { + * DeleteAttributeRequest request = + * DeleteAttributeRequest.newBuilder() + * .setName(AttributeName.of("[PROJECT]", "[LOCATION]", "[ATTRIBUTE]").toString()) + * .build(); + * ApiFuture+ */ + public final UnaryCallablefuture = apiHubClient.deleteAttributeCallable().futureCall(request); + * // Do something. + * future.get(); + * } + * }
Sample code: + * + *
{@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 (ApiHubClient apiHubClient = ApiHubClient.create()) { + * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + * for (Attribute element : apiHubClient.listAttributes(parent).iterateAll()) { + * // doThingsWith(element); + * } + * } + * }+ * + * @param parent Required. The parent resource for Attribute. Format: + * `projects/{project}/locations/{location}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListAttributesPagedResponse listAttributes(LocationName parent) { + ListAttributesRequest request = + ListAttributesRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .build(); + return listAttributes(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * List all attributes. + * + *
Sample code: + * + *
{@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 (ApiHubClient apiHubClient = ApiHubClient.create()) { + * String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); + * for (Attribute element : apiHubClient.listAttributes(parent).iterateAll()) { + * // doThingsWith(element); + * } + * } + * }+ * + * @param parent Required. The parent resource for Attribute. Format: + * `projects/{project}/locations/{location}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListAttributesPagedResponse listAttributes(String parent) { + ListAttributesRequest request = ListAttributesRequest.newBuilder().setParent(parent).build(); + return listAttributes(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * List all attributes. + * + *
Sample code: + * + *
{@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 (ApiHubClient apiHubClient = ApiHubClient.create()) { + * ListAttributesRequest request = + * ListAttributesRequest.newBuilder() + * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + * .setFilter("filter-1274492040") + * .setPageSize(883849137) + * .setPageToken("pageToken873572522") + * .build(); + * for (Attribute element : apiHubClient.listAttributes(request).iterateAll()) { + * // doThingsWith(element); + * } + * } + * }+ * + * @param 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 + */ + public final ListAttributesPagedResponse listAttributes(ListAttributesRequest request) { + return listAttributesPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * List all attributes. + * + *
Sample code: + * + *
{@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 (ApiHubClient apiHubClient = ApiHubClient.create()) { + * ListAttributesRequest request = + * ListAttributesRequest.newBuilder() + * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + * .setFilter("filter-1274492040") + * .setPageSize(883849137) + * .setPageToken("pageToken873572522") + * .build(); + * ApiFuture+ */ + public final UnaryCallablefuture = apiHubClient.listAttributesPagedCallable().futureCall(request); + * // Do something. + * for (Attribute element : future.get().iterateAll()) { + * // doThingsWith(element); + * } + * } + * }
Sample code: + * + *
{@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 (ApiHubClient apiHubClient = ApiHubClient.create()) { + * ListAttributesRequest request = + * ListAttributesRequest.newBuilder() + * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + * .setFilter("filter-1274492040") + * .setPageSize(883849137) + * .setPageToken("pageToken873572522") + * .build(); + * while (true) { + * ListAttributesResponse response = apiHubClient.listAttributesCallable().call(request); + * for (Attribute element : response.getAttributesList()) { + * // doThingsWith(element); + * } + * String nextPageToken = response.getNextPageToken(); + * if (!Strings.isNullOrEmpty(nextPageToken)) { + * request = request.toBuilder().setPageToken(nextPageToken).build(); + * } else { + * break; + * } + * } + * } + * }+ */ + public final UnaryCallable
Sample code: + * + *
{@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 (ApiHubClient apiHubClient = ApiHubClient.create()) { + * LocationName location = LocationName.of("[PROJECT]", "[LOCATION]"); + * String query = "query107944136"; + * for (SearchResult element : apiHubClient.searchResources(location, query).iterateAll()) { + * // doThingsWith(element); + * } + * } + * }+ * + * @param location Required. The resource name of the location which will be of the type + * `projects/{project_id}/locations/{location_id}`. This field is used to identify the + * instance of API-Hub in which resources should be searched. + * @param query Required. The free text search query. This query can contain keywords which could + * be related to any detail of the API-Hub resources such display names, descriptions, + * attributes etc. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final SearchResourcesPagedResponse searchResources(LocationName location, String query) { + SearchResourcesRequest request = + SearchResourcesRequest.newBuilder() + .setLocation(location == null ? null : location.toString()) + .setQuery(query) + .build(); + return searchResources(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Search across API-Hub resources. + * + *
Sample code: + * + *
{@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 (ApiHubClient apiHubClient = ApiHubClient.create()) { + * String location = LocationName.of("[PROJECT]", "[LOCATION]").toString(); + * String query = "query107944136"; + * for (SearchResult element : apiHubClient.searchResources(location, query).iterateAll()) { + * // doThingsWith(element); + * } + * } + * }+ * + * @param location Required. The resource name of the location which will be of the type + * `projects/{project_id}/locations/{location_id}`. This field is used to identify the + * instance of API-Hub in which resources should be searched. + * @param query Required. The free text search query. This query can contain keywords which could + * be related to any detail of the API-Hub resources such display names, descriptions, + * attributes etc. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final SearchResourcesPagedResponse searchResources(String location, String query) { + SearchResourcesRequest request = + SearchResourcesRequest.newBuilder().setLocation(location).setQuery(query).build(); + return searchResources(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Search across API-Hub resources. + * + *
Sample code: + * + *
{@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 (ApiHubClient apiHubClient = ApiHubClient.create()) { + * SearchResourcesRequest request = + * SearchResourcesRequest.newBuilder() + * .setLocation(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + * .setQuery("query107944136") + * .setFilter("filter-1274492040") + * .setPageSize(883849137) + * .setPageToken("pageToken873572522") + * .build(); + * for (SearchResult element : apiHubClient.searchResources(request).iterateAll()) { + * // doThingsWith(element); + * } + * } + * }+ * + * @param 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 + */ + public final SearchResourcesPagedResponse searchResources(SearchResourcesRequest request) { + return searchResourcesPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Search across API-Hub resources. + * + *
Sample code: + * + *
{@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 (ApiHubClient apiHubClient = ApiHubClient.create()) { + * SearchResourcesRequest request = + * SearchResourcesRequest.newBuilder() + * .setLocation(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + * .setQuery("query107944136") + * .setFilter("filter-1274492040") + * .setPageSize(883849137) + * .setPageToken("pageToken873572522") + * .build(); + * ApiFuture+ */ + public final UnaryCallablefuture = + * apiHubClient.searchResourcesPagedCallable().futureCall(request); + * // Do something. + * for (SearchResult element : future.get().iterateAll()) { + * // doThingsWith(element); + * } + * } + * }
Sample code: + * + *
{@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 (ApiHubClient apiHubClient = ApiHubClient.create()) { + * SearchResourcesRequest request = + * SearchResourcesRequest.newBuilder() + * .setLocation(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + * .setQuery("query107944136") + * .setFilter("filter-1274492040") + * .setPageSize(883849137) + * .setPageToken("pageToken873572522") + * .build(); + * while (true) { + * SearchResourcesResponse response = apiHubClient.searchResourcesCallable().call(request); + * for (SearchResult element : response.getSearchResultsList()) { + * // doThingsWith(element); + * } + * String nextPageToken = response.getNextPageToken(); + * if (!Strings.isNullOrEmpty(nextPageToken)) { + * request = request.toBuilder().setPageToken(nextPageToken).build(); + * } else { + * break; + * } + * } + * } + * }+ */ + public final UnaryCallable
Sample code: + * + *
{@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 (ApiHubClient apiHubClient = ApiHubClient.create()) { + * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + * ExternalApi externalApi = ExternalApi.newBuilder().build(); + * String externalApiId = "externalApiId-31672374"; + * ExternalApi response = apiHubClient.createExternalApi(parent, externalApi, externalApiId); + * } + * }+ * + * @param parent Required. The parent resource for the External API resource. Format: + * `projects/{project}/locations/{location}` + * @param externalApi Required. The External API resource to create. + * @param externalApiId Optional. The ID to use for the External API resource, which will become + * the final component of the External API's resource name. This field is optional. + *
This value should be 4-500 characters, and valid characters are /[a-z][A-Z][0-9]-_/. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ExternalApi createExternalApi( + LocationName parent, ExternalApi externalApi, String externalApiId) { + CreateExternalApiRequest request = + CreateExternalApiRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .setExternalApi(externalApi) + .setExternalApiId(externalApiId) + .build(); + return createExternalApi(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Create an External API resource in the API hub. + * + *
Sample code: + * + *
{@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 (ApiHubClient apiHubClient = ApiHubClient.create()) { + * String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); + * ExternalApi externalApi = ExternalApi.newBuilder().build(); + * String externalApiId = "externalApiId-31672374"; + * ExternalApi response = apiHubClient.createExternalApi(parent, externalApi, externalApiId); + * } + * }+ * + * @param parent Required. The parent resource for the External API resource. Format: + * `projects/{project}/locations/{location}` + * @param externalApi Required. The External API resource to create. + * @param externalApiId Optional. The ID to use for the External API resource, which will become + * the final component of the External API's resource name. This field is optional. + *
This value should be 4-500 characters, and valid characters are /[a-z][A-Z][0-9]-_/. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ExternalApi createExternalApi( + String parent, ExternalApi externalApi, String externalApiId) { + CreateExternalApiRequest request = + CreateExternalApiRequest.newBuilder() + .setParent(parent) + .setExternalApi(externalApi) + .setExternalApiId(externalApiId) + .build(); + return createExternalApi(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Create an External API resource in the API hub. + * + *
Sample code: + * + *
{@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 (ApiHubClient apiHubClient = ApiHubClient.create()) { + * CreateExternalApiRequest request = + * CreateExternalApiRequest.newBuilder() + * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + * .setExternalApiId("externalApiId-31672374") + * .setExternalApi(ExternalApi.newBuilder().build()) + * .build(); + * ExternalApi response = apiHubClient.createExternalApi(request); + * } + * }+ * + * @param 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 + */ + public final ExternalApi createExternalApi(CreateExternalApiRequest request) { + return createExternalApiCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Create an External API resource in the API hub. + * + *
Sample code: + * + *
{@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 (ApiHubClient apiHubClient = ApiHubClient.create()) { + * CreateExternalApiRequest request = + * CreateExternalApiRequest.newBuilder() + * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + * .setExternalApiId("externalApiId-31672374") + * .setExternalApi(ExternalApi.newBuilder().build()) + * .build(); + * ApiFuture+ */ + public final UnaryCallablefuture = apiHubClient.createExternalApiCallable().futureCall(request); + * // Do something. + * ExternalApi response = future.get(); + * } + * }
Sample code: + * + *
{@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 (ApiHubClient apiHubClient = ApiHubClient.create()) { + * ExternalApiName name = ExternalApiName.of("[PROJECT]", "[LOCATION]", "[EXTERNAL_API]"); + * ExternalApi response = apiHubClient.getExternalApi(name); + * } + * }+ * + * @param name Required. The name of the External API resource to retrieve. Format: + * `projects/{project}/locations/{location}/externalApis/{externalApi}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ExternalApi getExternalApi(ExternalApiName name) { + GetExternalApiRequest request = + GetExternalApiRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return getExternalApi(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Get details about an External API resource in the API hub. + * + *
Sample code: + * + *
{@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 (ApiHubClient apiHubClient = ApiHubClient.create()) { + * String name = ExternalApiName.of("[PROJECT]", "[LOCATION]", "[EXTERNAL_API]").toString(); + * ExternalApi response = apiHubClient.getExternalApi(name); + * } + * }+ * + * @param name Required. The name of the External API resource to retrieve. Format: + * `projects/{project}/locations/{location}/externalApis/{externalApi}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ExternalApi getExternalApi(String name) { + GetExternalApiRequest request = GetExternalApiRequest.newBuilder().setName(name).build(); + return getExternalApi(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Get details about an External API resource in the API hub. + * + *
Sample code: + * + *
{@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 (ApiHubClient apiHubClient = ApiHubClient.create()) { + * GetExternalApiRequest request = + * GetExternalApiRequest.newBuilder() + * .setName(ExternalApiName.of("[PROJECT]", "[LOCATION]", "[EXTERNAL_API]").toString()) + * .build(); + * ExternalApi response = apiHubClient.getExternalApi(request); + * } + * }+ * + * @param 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 + */ + public final ExternalApi getExternalApi(GetExternalApiRequest request) { + return getExternalApiCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Get details about an External API resource in the API hub. + * + *
Sample code: + * + *
{@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 (ApiHubClient apiHubClient = ApiHubClient.create()) { + * GetExternalApiRequest request = + * GetExternalApiRequest.newBuilder() + * .setName(ExternalApiName.of("[PROJECT]", "[LOCATION]", "[EXTERNAL_API]").toString()) + * .build(); + * ApiFuture+ */ + public final UnaryCallablefuture = apiHubClient.getExternalApiCallable().futureCall(request); + * // Do something. + * ExternalApi response = future.get(); + * } + * }
The [update_mask][google.cloud.apihub.v1.UpdateExternalApiRequest.update_mask] should be + * used to specify the fields being updated. + * + *
Sample code: + * + *
{@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 (ApiHubClient apiHubClient = ApiHubClient.create()) { + * ExternalApi externalApi = ExternalApi.newBuilder().build(); + * FieldMask updateMask = FieldMask.newBuilder().build(); + * ExternalApi response = apiHubClient.updateExternalApi(externalApi, updateMask); + * } + * }+ * + * @param externalApi Required. The External API resource to update. + *
The External API resource's `name` field is used to identify the External API resource + * to update. Format: `projects/{project}/locations/{location}/externalApis/{externalApi}` + * @param updateMask Required. The list of fields to update. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ExternalApi updateExternalApi(ExternalApi externalApi, FieldMask updateMask) { + UpdateExternalApiRequest request = + UpdateExternalApiRequest.newBuilder() + .setExternalApi(externalApi) + .setUpdateMask(updateMask) + .build(); + return updateExternalApi(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Update an External API resource in the API hub. The following fields can be updated: + * + *
The [update_mask][google.cloud.apihub.v1.UpdateExternalApiRequest.update_mask] should be + * used to specify the fields being updated. + * + *
Sample code: + * + *
{@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 (ApiHubClient apiHubClient = ApiHubClient.create()) { + * UpdateExternalApiRequest request = + * UpdateExternalApiRequest.newBuilder() + * .setExternalApi(ExternalApi.newBuilder().build()) + * .setUpdateMask(FieldMask.newBuilder().build()) + * .build(); + * ExternalApi response = apiHubClient.updateExternalApi(request); + * } + * }+ * + * @param 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 + */ + public final ExternalApi updateExternalApi(UpdateExternalApiRequest request) { + return updateExternalApiCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Update an External API resource in the API hub. The following fields can be updated: + * + *
The [update_mask][google.cloud.apihub.v1.UpdateExternalApiRequest.update_mask] should be + * used to specify the fields being updated. + * + *
Sample code: + * + *
{@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 (ApiHubClient apiHubClient = ApiHubClient.create()) { + * UpdateExternalApiRequest request = + * UpdateExternalApiRequest.newBuilder() + * .setExternalApi(ExternalApi.newBuilder().build()) + * .setUpdateMask(FieldMask.newBuilder().build()) + * .build(); + * ApiFuture+ */ + public final UnaryCallablefuture = apiHubClient.updateExternalApiCallable().futureCall(request); + * // Do something. + * ExternalApi response = future.get(); + * } + * }
Sample code: + * + *
{@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 (ApiHubClient apiHubClient = ApiHubClient.create()) { + * ExternalApiName name = ExternalApiName.of("[PROJECT]", "[LOCATION]", "[EXTERNAL_API]"); + * apiHubClient.deleteExternalApi(name); + * } + * }+ * + * @param name Required. The name of the External API resource to delete. Format: + * `projects/{project}/locations/{location}/externalApis/{externalApi}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteExternalApi(ExternalApiName name) { + DeleteExternalApiRequest request = + DeleteExternalApiRequest.newBuilder() + .setName(name == null ? null : name.toString()) + .build(); + deleteExternalApi(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Delete an External API resource in the API hub. + * + *
Sample code: + * + *
{@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 (ApiHubClient apiHubClient = ApiHubClient.create()) { + * String name = ExternalApiName.of("[PROJECT]", "[LOCATION]", "[EXTERNAL_API]").toString(); + * apiHubClient.deleteExternalApi(name); + * } + * }+ * + * @param name Required. The name of the External API resource to delete. Format: + * `projects/{project}/locations/{location}/externalApis/{externalApi}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteExternalApi(String name) { + DeleteExternalApiRequest request = DeleteExternalApiRequest.newBuilder().setName(name).build(); + deleteExternalApi(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Delete an External API resource in the API hub. + * + *
Sample code: + * + *
{@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 (ApiHubClient apiHubClient = ApiHubClient.create()) { + * DeleteExternalApiRequest request = + * DeleteExternalApiRequest.newBuilder() + * .setName(ExternalApiName.of("[PROJECT]", "[LOCATION]", "[EXTERNAL_API]").toString()) + * .build(); + * apiHubClient.deleteExternalApi(request); + * } + * }+ * + * @param 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 + */ + public final void deleteExternalApi(DeleteExternalApiRequest request) { + deleteExternalApiCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Delete an External API resource in the API hub. + * + *
Sample code: + * + *
{@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 (ApiHubClient apiHubClient = ApiHubClient.create()) { + * DeleteExternalApiRequest request = + * DeleteExternalApiRequest.newBuilder() + * .setName(ExternalApiName.of("[PROJECT]", "[LOCATION]", "[EXTERNAL_API]").toString()) + * .build(); + * ApiFuture+ */ + public final UnaryCallablefuture = apiHubClient.deleteExternalApiCallable().futureCall(request); + * // Do something. + * future.get(); + * } + * }
Sample code: + * + *
{@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 (ApiHubClient apiHubClient = ApiHubClient.create()) { + * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + * for (ExternalApi element : apiHubClient.listExternalApis(parent).iterateAll()) { + * // doThingsWith(element); + * } + * } + * }+ * + * @param parent Required. The parent, which owns this collection of External API resources. + * Format: `projects/{project}/locations/{location}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListExternalApisPagedResponse listExternalApis(LocationName parent) { + ListExternalApisRequest request = + ListExternalApisRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .build(); + return listExternalApis(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * List External API resources in the API hub. + * + *
Sample code: + * + *
{@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 (ApiHubClient apiHubClient = ApiHubClient.create()) { + * String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); + * for (ExternalApi element : apiHubClient.listExternalApis(parent).iterateAll()) { + * // doThingsWith(element); + * } + * } + * }+ * + * @param parent Required. The parent, which owns this collection of External API resources. + * Format: `projects/{project}/locations/{location}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListExternalApisPagedResponse listExternalApis(String parent) { + ListExternalApisRequest request = + ListExternalApisRequest.newBuilder().setParent(parent).build(); + return listExternalApis(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * List External API resources in the API hub. + * + *
Sample code: + * + *
{@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 (ApiHubClient apiHubClient = ApiHubClient.create()) { + * ListExternalApisRequest request = + * ListExternalApisRequest.newBuilder() + * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + * .setPageSize(883849137) + * .setPageToken("pageToken873572522") + * .build(); + * for (ExternalApi element : apiHubClient.listExternalApis(request).iterateAll()) { + * // doThingsWith(element); + * } + * } + * }+ * + * @param 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 + */ + public final ListExternalApisPagedResponse listExternalApis(ListExternalApisRequest request) { + return listExternalApisPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * List External API resources in the API hub. + * + *
Sample code: + * + *
{@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 (ApiHubClient apiHubClient = ApiHubClient.create()) { + * ListExternalApisRequest request = + * ListExternalApisRequest.newBuilder() + * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + * .setPageSize(883849137) + * .setPageToken("pageToken873572522") + * .build(); + * ApiFuture+ */ + public final UnaryCallablefuture = + * apiHubClient.listExternalApisPagedCallable().futureCall(request); + * // Do something. + * for (ExternalApi element : future.get().iterateAll()) { + * // doThingsWith(element); + * } + * } + * }
Sample code: + * + *
{@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 (ApiHubClient apiHubClient = ApiHubClient.create()) { + * ListExternalApisRequest request = + * ListExternalApisRequest.newBuilder() + * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + * .setPageSize(883849137) + * .setPageToken("pageToken873572522") + * .build(); + * while (true) { + * ListExternalApisResponse response = apiHubClient.listExternalApisCallable().call(request); + * for (ExternalApi element : response.getExternalApisList()) { + * // doThingsWith(element); + * } + * String nextPageToken = response.getNextPageToken(); + * if (!Strings.isNullOrEmpty(nextPageToken)) { + * request = request.toBuilder().setPageToken(nextPageToken).build(); + * } else { + * break; + * } + * } + * } + * }+ */ + public final UnaryCallable
Sample code: + * + *
{@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 (ApiHubClient apiHubClient = ApiHubClient.create()) { + * ListLocationsRequest request = + * ListLocationsRequest.newBuilder() + * .setName("name3373707") + * .setFilter("filter-1274492040") + * .setPageSize(883849137) + * .setPageToken("pageToken873572522") + * .build(); + * for (Location element : apiHubClient.listLocations(request).iterateAll()) { + * // doThingsWith(element); + * } + * } + * }+ * + * @param 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 + */ + public final ListLocationsPagedResponse listLocations(ListLocationsRequest request) { + return listLocationsPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists information about the supported locations for this service. + * + *
Sample code: + * + *
{@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 (ApiHubClient apiHubClient = ApiHubClient.create()) { + * ListLocationsRequest request = + * ListLocationsRequest.newBuilder() + * .setName("name3373707") + * .setFilter("filter-1274492040") + * .setPageSize(883849137) + * .setPageToken("pageToken873572522") + * .build(); + * ApiFuture+ */ + public final UnaryCallablefuture = apiHubClient.listLocationsPagedCallable().futureCall(request); + * // Do something. + * for (Location element : future.get().iterateAll()) { + * // doThingsWith(element); + * } + * } + * }
Sample code: + * + *
{@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 (ApiHubClient apiHubClient = ApiHubClient.create()) { + * ListLocationsRequest request = + * ListLocationsRequest.newBuilder() + * .setName("name3373707") + * .setFilter("filter-1274492040") + * .setPageSize(883849137) + * .setPageToken("pageToken873572522") + * .build(); + * while (true) { + * ListLocationsResponse response = apiHubClient.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; + * } + * } + * } + * }+ */ + public final UnaryCallable
Sample code: + * + *
{@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 (ApiHubClient apiHubClient = ApiHubClient.create()) { + * GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build(); + * Location response = apiHubClient.getLocation(request); + * } + * }+ * + * @param 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 + */ + public final Location getLocation(GetLocationRequest request) { + return getLocationCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets information about a location. + * + *
Sample code: + * + *
{@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 (ApiHubClient apiHubClient = ApiHubClient.create()) { + * GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build(); + * ApiFuture+ */ + public final UnaryCallablefuture = apiHubClient.getLocationCallable().futureCall(request); + * // Do something. + * Location response = future.get(); + * } + * }
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: + * + *
{@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 (ApiHubDependenciesClient apiHubDependenciesClient = ApiHubDependenciesClient.create()) { + * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + * Dependency dependency = Dependency.newBuilder().build(); + * String dependencyId = "dependencyId503788998"; + * Dependency response = + * apiHubDependenciesClient.createDependency(parent, dependency, dependencyId); + * } + * }+ * + *
Note: close() needs to be called on the ApiHubDependenciesClient 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 | + *
---|---|---|
CreateDependency |
+ * Create a dependency between two entities in the API hub. |
+ *
+ * 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. + *
|
+ *
GetDependency |
+ * Get details about a dependency resource in the API hub. |
+ *
+ * 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. + *
|
+ *
UpdateDependency |
+ * Update a dependency based on the [update_mask][google.cloud.apihub.v1.UpdateDependencyRequest.update_mask] provided in the request. + * The following fields in the [dependency][google.cloud.apihub.v1.Dependency] can be updated: + *
|
+ *
+ * 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. + *
|
+ *
DeleteDependency |
+ * Delete the dependency resource. |
+ *
+ * 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. + *
|
+ *
ListDependencies |
+ * List dependencies based on the provided filter and pagination parameters. |
+ *
+ * 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 ApiHubDependenciesSettings to + * create(). For example: + * + *
To customize credentials: + * + *
{@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 + * ApiHubDependenciesSettings apiHubDependenciesSettings = + * ApiHubDependenciesSettings.newBuilder() + * .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials)) + * .build(); + * ApiHubDependenciesClient apiHubDependenciesClient = + * ApiHubDependenciesClient.create(apiHubDependenciesSettings); + * }+ * + *
To customize the endpoint: + * + *
{@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 + * ApiHubDependenciesSettings apiHubDependenciesSettings = + * ApiHubDependenciesSettings.newBuilder().setEndpoint(myEndpoint).build(); + * ApiHubDependenciesClient apiHubDependenciesClient = + * ApiHubDependenciesClient.create(apiHubDependenciesSettings); + * }+ * + *
To use REST (HTTP1.1/JSON) transport (instead of gRPC) for sending and receiving requests over + * the wire: + * + *
{@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 + * ApiHubDependenciesSettings apiHubDependenciesSettings = + * ApiHubDependenciesSettings.newHttpJsonBuilder().build(); + * ApiHubDependenciesClient apiHubDependenciesClient = + * ApiHubDependenciesClient.create(apiHubDependenciesSettings); + * }+ * + *
Please refer to the GitHub repository's samples for more quickstart code snippets. + */ +@Generated("by gapic-generator-java") +public class ApiHubDependenciesClient implements BackgroundResource { + private final ApiHubDependenciesSettings settings; + private final ApiHubDependenciesStub stub; + + /** Constructs an instance of ApiHubDependenciesClient with default settings. */ + public static final ApiHubDependenciesClient create() throws IOException { + return create(ApiHubDependenciesSettings.newBuilder().build()); + } + + /** + * Constructs an instance of ApiHubDependenciesClient, using the given settings. The channels are + * created based on the settings passed in, or defaults for any settings that are not set. + */ + public static final ApiHubDependenciesClient create(ApiHubDependenciesSettings settings) + throws IOException { + return new ApiHubDependenciesClient(settings); + } + + /** + * Constructs an instance of ApiHubDependenciesClient, using the given stub for making calls. This + * is for advanced usage - prefer using create(ApiHubDependenciesSettings). + */ + public static final ApiHubDependenciesClient create(ApiHubDependenciesStub stub) { + return new ApiHubDependenciesClient(stub); + } + + /** + * Constructs an instance of ApiHubDependenciesClient, using the given settings. This is protected + * so that it is easy to make a subclass, but otherwise, the static factory methods should be + * preferred. + */ + protected ApiHubDependenciesClient(ApiHubDependenciesSettings settings) throws IOException { + this.settings = settings; + this.stub = ((ApiHubDependenciesStubSettings) settings.getStubSettings()).createStub(); + } + + protected ApiHubDependenciesClient(ApiHubDependenciesStub stub) { + this.settings = null; + this.stub = stub; + } + + public final ApiHubDependenciesSettings getSettings() { + return settings; + } + + public ApiHubDependenciesStub getStub() { + return stub; + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Create a dependency between two entities in the API hub. + * + *
Sample code: + * + *
{@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 (ApiHubDependenciesClient apiHubDependenciesClient = ApiHubDependenciesClient.create()) { + * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + * Dependency dependency = Dependency.newBuilder().build(); + * String dependencyId = "dependencyId503788998"; + * Dependency response = + * apiHubDependenciesClient.createDependency(parent, dependency, dependencyId); + * } + * }+ * + * @param parent Required. The parent resource for the dependency resource. Format: + * `projects/{project}/locations/{location}` + * @param dependency Required. The dependency resource to create. + * @param dependencyId Optional. The ID to use for the dependency resource, which will become the + * final component of the dependency's resource name. This field is optional. + *
This value should be 4-500 characters, and valid characters are `[a-z][A-Z][0-9]-_`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Dependency createDependency( + LocationName parent, Dependency dependency, String dependencyId) { + CreateDependencyRequest request = + CreateDependencyRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .setDependency(dependency) + .setDependencyId(dependencyId) + .build(); + return createDependency(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Create a dependency between two entities in the API hub. + * + *
Sample code: + * + *
{@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 (ApiHubDependenciesClient apiHubDependenciesClient = ApiHubDependenciesClient.create()) { + * String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); + * Dependency dependency = Dependency.newBuilder().build(); + * String dependencyId = "dependencyId503788998"; + * Dependency response = + * apiHubDependenciesClient.createDependency(parent, dependency, dependencyId); + * } + * }+ * + * @param parent Required. The parent resource for the dependency resource. Format: + * `projects/{project}/locations/{location}` + * @param dependency Required. The dependency resource to create. + * @param dependencyId Optional. The ID to use for the dependency resource, which will become the + * final component of the dependency's resource name. This field is optional. + *
This value should be 4-500 characters, and valid characters are `[a-z][A-Z][0-9]-_`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Dependency createDependency( + String parent, Dependency dependency, String dependencyId) { + CreateDependencyRequest request = + CreateDependencyRequest.newBuilder() + .setParent(parent) + .setDependency(dependency) + .setDependencyId(dependencyId) + .build(); + return createDependency(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Create a dependency between two entities in the API hub. + * + *
Sample code: + * + *
{@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 (ApiHubDependenciesClient apiHubDependenciesClient = ApiHubDependenciesClient.create()) { + * CreateDependencyRequest request = + * CreateDependencyRequest.newBuilder() + * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + * .setDependencyId("dependencyId503788998") + * .setDependency(Dependency.newBuilder().build()) + * .build(); + * Dependency response = apiHubDependenciesClient.createDependency(request); + * } + * }+ * + * @param 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 + */ + public final Dependency createDependency(CreateDependencyRequest request) { + return createDependencyCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Create a dependency between two entities in the API hub. + * + *
Sample code: + * + *
{@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 (ApiHubDependenciesClient apiHubDependenciesClient = ApiHubDependenciesClient.create()) { + * CreateDependencyRequest request = + * CreateDependencyRequest.newBuilder() + * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + * .setDependencyId("dependencyId503788998") + * .setDependency(Dependency.newBuilder().build()) + * .build(); + * ApiFuture+ */ + public final UnaryCallablefuture = + * apiHubDependenciesClient.createDependencyCallable().futureCall(request); + * // Do something. + * Dependency response = future.get(); + * } + * }
Sample code: + * + *
{@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 (ApiHubDependenciesClient apiHubDependenciesClient = ApiHubDependenciesClient.create()) { + * DependencyName name = DependencyName.of("[PROJECT]", "[LOCATION]", "[DEPENDENCY]"); + * Dependency response = apiHubDependenciesClient.getDependency(name); + * } + * }+ * + * @param name Required. The name of the dependency resource to retrieve. Format: + * `projects/{project}/locations/{location}/dependencies/{dependency}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Dependency getDependency(DependencyName name) { + GetDependencyRequest request = + GetDependencyRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return getDependency(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Get details about a dependency resource in the API hub. + * + *
Sample code: + * + *
{@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 (ApiHubDependenciesClient apiHubDependenciesClient = ApiHubDependenciesClient.create()) { + * String name = DependencyName.of("[PROJECT]", "[LOCATION]", "[DEPENDENCY]").toString(); + * Dependency response = apiHubDependenciesClient.getDependency(name); + * } + * }+ * + * @param name Required. The name of the dependency resource to retrieve. Format: + * `projects/{project}/locations/{location}/dependencies/{dependency}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Dependency getDependency(String name) { + GetDependencyRequest request = GetDependencyRequest.newBuilder().setName(name).build(); + return getDependency(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Get details about a dependency resource in the API hub. + * + *
Sample code: + * + *
{@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 (ApiHubDependenciesClient apiHubDependenciesClient = ApiHubDependenciesClient.create()) { + * GetDependencyRequest request = + * GetDependencyRequest.newBuilder() + * .setName(DependencyName.of("[PROJECT]", "[LOCATION]", "[DEPENDENCY]").toString()) + * .build(); + * Dependency response = apiHubDependenciesClient.getDependency(request); + * } + * }+ * + * @param 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 + */ + public final Dependency getDependency(GetDependencyRequest request) { + return getDependencyCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Get details about a dependency resource in the API hub. + * + *
Sample code: + * + *
{@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 (ApiHubDependenciesClient apiHubDependenciesClient = ApiHubDependenciesClient.create()) { + * GetDependencyRequest request = + * GetDependencyRequest.newBuilder() + * .setName(DependencyName.of("[PROJECT]", "[LOCATION]", "[DEPENDENCY]").toString()) + * .build(); + * ApiFuture+ */ + public final UnaryCallablefuture = + * apiHubDependenciesClient.getDependencyCallable().futureCall(request); + * // Do something. + * Dependency response = future.get(); + * } + * }
The following fields in the [dependency][google.cloud.apihub.v1.Dependency] can be updated: + * + *
Sample code: + * + *
{@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 (ApiHubDependenciesClient apiHubDependenciesClient = ApiHubDependenciesClient.create()) { + * Dependency dependency = Dependency.newBuilder().build(); + * FieldMask updateMask = FieldMask.newBuilder().build(); + * Dependency response = apiHubDependenciesClient.updateDependency(dependency, updateMask); + * } + * }+ * + * @param dependency Required. The dependency resource to update. + *
The dependency's `name` field is used to identify the dependency to update. Format: + * `projects/{project}/locations/{location}/dependencies/{dependency}` + * @param updateMask Required. The list of fields to update. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Dependency updateDependency(Dependency dependency, FieldMask updateMask) { + UpdateDependencyRequest request = + UpdateDependencyRequest.newBuilder() + .setDependency(dependency) + .setUpdateMask(updateMask) + .build(); + return updateDependency(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Update a dependency based on the + * [update_mask][google.cloud.apihub.v1.UpdateDependencyRequest.update_mask] provided in the + * request. + * + *
The following fields in the [dependency][google.cloud.apihub.v1.Dependency] can be updated: + * + *
Sample code: + * + *
{@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 (ApiHubDependenciesClient apiHubDependenciesClient = ApiHubDependenciesClient.create()) { + * UpdateDependencyRequest request = + * UpdateDependencyRequest.newBuilder() + * .setDependency(Dependency.newBuilder().build()) + * .setUpdateMask(FieldMask.newBuilder().build()) + * .build(); + * Dependency response = apiHubDependenciesClient.updateDependency(request); + * } + * }+ * + * @param 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 + */ + public final Dependency updateDependency(UpdateDependencyRequest request) { + return updateDependencyCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Update a dependency based on the + * [update_mask][google.cloud.apihub.v1.UpdateDependencyRequest.update_mask] provided in the + * request. + * + *
The following fields in the [dependency][google.cloud.apihub.v1.Dependency] can be updated: + * + *
Sample code: + * + *
{@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 (ApiHubDependenciesClient apiHubDependenciesClient = ApiHubDependenciesClient.create()) { + * UpdateDependencyRequest request = + * UpdateDependencyRequest.newBuilder() + * .setDependency(Dependency.newBuilder().build()) + * .setUpdateMask(FieldMask.newBuilder().build()) + * .build(); + * ApiFuture+ */ + public final UnaryCallablefuture = + * apiHubDependenciesClient.updateDependencyCallable().futureCall(request); + * // Do something. + * Dependency response = future.get(); + * } + * }
Sample code: + * + *
{@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 (ApiHubDependenciesClient apiHubDependenciesClient = ApiHubDependenciesClient.create()) { + * DependencyName name = DependencyName.of("[PROJECT]", "[LOCATION]", "[DEPENDENCY]"); + * apiHubDependenciesClient.deleteDependency(name); + * } + * }+ * + * @param name Required. The name of the dependency resource to delete. Format: + * `projects/{project}/locations/{location}/dependencies/{dependency}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteDependency(DependencyName name) { + DeleteDependencyRequest request = + DeleteDependencyRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + deleteDependency(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Delete the dependency resource. + * + *
Sample code: + * + *
{@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 (ApiHubDependenciesClient apiHubDependenciesClient = ApiHubDependenciesClient.create()) { + * String name = DependencyName.of("[PROJECT]", "[LOCATION]", "[DEPENDENCY]").toString(); + * apiHubDependenciesClient.deleteDependency(name); + * } + * }+ * + * @param name Required. The name of the dependency resource to delete. Format: + * `projects/{project}/locations/{location}/dependencies/{dependency}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteDependency(String name) { + DeleteDependencyRequest request = DeleteDependencyRequest.newBuilder().setName(name).build(); + deleteDependency(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Delete the dependency resource. + * + *
Sample code: + * + *
{@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 (ApiHubDependenciesClient apiHubDependenciesClient = ApiHubDependenciesClient.create()) { + * DeleteDependencyRequest request = + * DeleteDependencyRequest.newBuilder() + * .setName(DependencyName.of("[PROJECT]", "[LOCATION]", "[DEPENDENCY]").toString()) + * .build(); + * apiHubDependenciesClient.deleteDependency(request); + * } + * }+ * + * @param 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 + */ + public final void deleteDependency(DeleteDependencyRequest request) { + deleteDependencyCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Delete the dependency resource. + * + *
Sample code: + * + *
{@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 (ApiHubDependenciesClient apiHubDependenciesClient = ApiHubDependenciesClient.create()) { + * DeleteDependencyRequest request = + * DeleteDependencyRequest.newBuilder() + * .setName(DependencyName.of("[PROJECT]", "[LOCATION]", "[DEPENDENCY]").toString()) + * .build(); + * ApiFuture+ */ + public final UnaryCallablefuture = + * apiHubDependenciesClient.deleteDependencyCallable().futureCall(request); + * // Do something. + * future.get(); + * } + * }
Sample code: + * + *
{@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 (ApiHubDependenciesClient apiHubDependenciesClient = ApiHubDependenciesClient.create()) { + * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + * for (Dependency element : apiHubDependenciesClient.listDependencies(parent).iterateAll()) { + * // doThingsWith(element); + * } + * } + * }+ * + * @param parent Required. The parent which owns this collection of dependency resources. Format: + * `projects/{project}/locations/{location}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListDependenciesPagedResponse listDependencies(LocationName parent) { + ListDependenciesRequest request = + ListDependenciesRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .build(); + return listDependencies(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * List dependencies based on the provided filter and pagination parameters. + * + *
Sample code: + * + *
{@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 (ApiHubDependenciesClient apiHubDependenciesClient = ApiHubDependenciesClient.create()) { + * String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); + * for (Dependency element : apiHubDependenciesClient.listDependencies(parent).iterateAll()) { + * // doThingsWith(element); + * } + * } + * }+ * + * @param parent Required. The parent which owns this collection of dependency resources. Format: + * `projects/{project}/locations/{location}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListDependenciesPagedResponse listDependencies(String parent) { + ListDependenciesRequest request = + ListDependenciesRequest.newBuilder().setParent(parent).build(); + return listDependencies(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * List dependencies based on the provided filter and pagination parameters. + * + *
Sample code: + * + *
{@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 (ApiHubDependenciesClient apiHubDependenciesClient = ApiHubDependenciesClient.create()) { + * ListDependenciesRequest request = + * ListDependenciesRequest.newBuilder() + * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + * .setFilter("filter-1274492040") + * .setPageSize(883849137) + * .setPageToken("pageToken873572522") + * .build(); + * for (Dependency element : apiHubDependenciesClient.listDependencies(request).iterateAll()) { + * // doThingsWith(element); + * } + * } + * }+ * + * @param 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 + */ + public final ListDependenciesPagedResponse listDependencies(ListDependenciesRequest request) { + return listDependenciesPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * List dependencies based on the provided filter and pagination parameters. + * + *
Sample code: + * + *
{@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 (ApiHubDependenciesClient apiHubDependenciesClient = ApiHubDependenciesClient.create()) { + * ListDependenciesRequest request = + * ListDependenciesRequest.newBuilder() + * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + * .setFilter("filter-1274492040") + * .setPageSize(883849137) + * .setPageToken("pageToken873572522") + * .build(); + * ApiFuture+ */ + public final UnaryCallablefuture = + * apiHubDependenciesClient.listDependenciesPagedCallable().futureCall(request); + * // Do something. + * for (Dependency element : future.get().iterateAll()) { + * // doThingsWith(element); + * } + * } + * }
Sample code: + * + *
{@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 (ApiHubDependenciesClient apiHubDependenciesClient = ApiHubDependenciesClient.create()) { + * ListDependenciesRequest request = + * ListDependenciesRequest.newBuilder() + * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + * .setFilter("filter-1274492040") + * .setPageSize(883849137) + * .setPageToken("pageToken873572522") + * .build(); + * while (true) { + * ListDependenciesResponse response = + * apiHubDependenciesClient.listDependenciesCallable().call(request); + * for (Dependency element : response.getDependenciesList()) { + * // doThingsWith(element); + * } + * String nextPageToken = response.getNextPageToken(); + * if (!Strings.isNullOrEmpty(nextPageToken)) { + * request = request.toBuilder().setPageToken(nextPageToken).build(); + * } else { + * break; + * } + * } + * } + * }+ */ + public final UnaryCallable
Sample code: + * + *
{@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 (ApiHubDependenciesClient apiHubDependenciesClient = ApiHubDependenciesClient.create()) { + * ListLocationsRequest request = + * ListLocationsRequest.newBuilder() + * .setName("name3373707") + * .setFilter("filter-1274492040") + * .setPageSize(883849137) + * .setPageToken("pageToken873572522") + * .build(); + * for (Location element : apiHubDependenciesClient.listLocations(request).iterateAll()) { + * // doThingsWith(element); + * } + * } + * }+ * + * @param 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 + */ + public final ListLocationsPagedResponse listLocations(ListLocationsRequest request) { + return listLocationsPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists information about the supported locations for this service. + * + *
Sample code: + * + *
{@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 (ApiHubDependenciesClient apiHubDependenciesClient = ApiHubDependenciesClient.create()) { + * ListLocationsRequest request = + * ListLocationsRequest.newBuilder() + * .setName("name3373707") + * .setFilter("filter-1274492040") + * .setPageSize(883849137) + * .setPageToken("pageToken873572522") + * .build(); + * ApiFuture+ */ + public final UnaryCallablefuture = + * apiHubDependenciesClient.listLocationsPagedCallable().futureCall(request); + * // Do something. + * for (Location element : future.get().iterateAll()) { + * // doThingsWith(element); + * } + * } + * }
Sample code: + * + *
{@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 (ApiHubDependenciesClient apiHubDependenciesClient = ApiHubDependenciesClient.create()) { + * ListLocationsRequest request = + * ListLocationsRequest.newBuilder() + * .setName("name3373707") + * .setFilter("filter-1274492040") + * .setPageSize(883849137) + * .setPageToken("pageToken873572522") + * .build(); + * while (true) { + * ListLocationsResponse response = + * apiHubDependenciesClient.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; + * } + * } + * } + * }+ */ + public final UnaryCallable
Sample code: + * + *
{@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 (ApiHubDependenciesClient apiHubDependenciesClient = ApiHubDependenciesClient.create()) { + * GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build(); + * Location response = apiHubDependenciesClient.getLocation(request); + * } + * }+ * + * @param 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 + */ + public final Location getLocation(GetLocationRequest request) { + return getLocationCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets information about a location. + * + *
Sample code: + * + *
{@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 (ApiHubDependenciesClient apiHubDependenciesClient = ApiHubDependenciesClient.create()) { + * GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build(); + * ApiFuture+ */ + public final UnaryCallablefuture = + * apiHubDependenciesClient.getLocationCallable().futureCall(request); + * // Do something. + * Location response = future.get(); + * } + * }
The default instance has everything set to sensible defaults: + * + *
The builder of this class is recursive, so contained classes are themselves builders. When + * build() is called, the tree of builders is called to create the complete settings object. + * + *
For example, to set the total timeout of createDependency to 30 seconds: + * + *
{@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 + * ApiHubDependenciesSettings.Builder apiHubDependenciesSettingsBuilder = + * ApiHubDependenciesSettings.newBuilder(); + * apiHubDependenciesSettingsBuilder + * .createDependencySettings() + * .setRetrySettings( + * apiHubDependenciesSettingsBuilder + * .createDependencySettings() + * .getRetrySettings() + * .toBuilder() + * .setTotalTimeout(Duration.ofSeconds(30)) + * .build()); + * ApiHubDependenciesSettings apiHubDependenciesSettings = + * apiHubDependenciesSettingsBuilder.build(); + * }+ */ +@Generated("by gapic-generator-java") +public class ApiHubDependenciesSettings extends ClientSettings
Note: This method does not support applying settings to streaming methods.
+ */
+ public Builder applyToAllUnaryMethods(
+ ApiFunction 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:
+ *
+ * Note: close() needs to be called on the ApiHubPluginClient object to clean up resources such
+ * as threads. In the example above, try-with-resources is used, which automatically calls close().
+ *
+ * GetPlugin Get details about an API Hub plugin. Request object method variants only take one parameter, a request object, which must be constructed before the call. getPlugin(GetPluginRequest request)
+ * "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method. getPlugin(PluginName name)
+ * getPlugin(String name)
+ * Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. getPluginCallable()
+ * EnablePlugin Enables a plugin. The `state` of the plugin after enabling is `ENABLED` Request object method variants only take one parameter, a request object, which must be constructed before the call. enablePlugin(EnablePluginRequest request)
+ * "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method. enablePlugin(PluginName name)
+ * enablePlugin(String name)
+ * Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. enablePluginCallable()
+ * DisablePlugin Disables a plugin. The `state` of the plugin after disabling is `DISABLED` Request object method variants only take one parameter, a request object, which must be constructed before the call. disablePlugin(DisablePluginRequest request)
+ * "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method. disablePlugin(PluginName name)
+ * disablePlugin(String name)
+ * Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. disablePluginCallable()
+ * 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. listLocations(ListLocationsRequest request)
+ * Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. listLocationsPagedCallable()
+ * listLocationsCallable()
+ * GetLocation Gets information about a location. Request object method variants only take one parameter, a request object, which must be constructed before the call. getLocation(GetLocationRequest request)
+ * Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. getLocationCallable()
+ * 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 ApiHubPluginSettings to
+ * create(). For example:
+ *
+ * To customize credentials:
+ *
+ * To customize the endpoint:
+ *
+ * To use REST (HTTP1.1/JSON) transport (instead of gRPC) for sending and receiving requests over
+ * the wire:
+ *
+ * Please refer to the GitHub repository's samples for more quickstart code snippets.
+ */
+@Generated("by gapic-generator-java")
+public class ApiHubPluginClient implements BackgroundResource {
+ private final ApiHubPluginSettings settings;
+ private final ApiHubPluginStub stub;
+
+ /** Constructs an instance of ApiHubPluginClient with default settings. */
+ public static final ApiHubPluginClient create() throws IOException {
+ return create(ApiHubPluginSettings.newBuilder().build());
+ }
+
+ /**
+ * Constructs an instance of ApiHubPluginClient, using the given settings. The channels are
+ * created based on the settings passed in, or defaults for any settings that are not set.
+ */
+ public static final ApiHubPluginClient create(ApiHubPluginSettings settings) throws IOException {
+ return new ApiHubPluginClient(settings);
+ }
+
+ /**
+ * Constructs an instance of ApiHubPluginClient, using the given stub for making calls. This is
+ * for advanced usage - prefer using create(ApiHubPluginSettings).
+ */
+ public static final ApiHubPluginClient create(ApiHubPluginStub stub) {
+ return new ApiHubPluginClient(stub);
+ }
+
+ /**
+ * Constructs an instance of ApiHubPluginClient, using the given settings. This is protected so
+ * that it is easy to make a subclass, but otherwise, the static factory methods should be
+ * preferred.
+ */
+ protected ApiHubPluginClient(ApiHubPluginSettings settings) throws IOException {
+ this.settings = settings;
+ this.stub = ((ApiHubPluginStubSettings) settings.getStubSettings()).createStub();
+ }
+
+ protected ApiHubPluginClient(ApiHubPluginStub stub) {
+ this.settings = null;
+ this.stub = stub;
+ }
+
+ public final ApiHubPluginSettings getSettings() {
+ return settings;
+ }
+
+ public ApiHubPluginStub getStub() {
+ return stub;
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Get details about an API Hub plugin.
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * The default instance has everything set to sensible defaults:
+ *
+ * The builder of this class is recursive, so contained classes are themselves builders. When
+ * build() is called, the tree of builders is called to create the complete settings object.
+ *
+ * For example, to set the total timeout of getPlugin to 30 seconds:
+ *
+ * Note: This method does not support applying settings to streaming methods.
+ */
+ public Builder applyToAllUnaryMethods(
+ ApiFunction The default instance has everything set to sensible defaults:
+ *
+ * The builder of this class is recursive, so contained classes are themselves builders. When
+ * build() is called, the tree of builders is called to create the complete settings object.
+ *
+ * For example, to set the total timeout of createApi to 30 seconds:
+ *
+ * {@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 (ApiHubPluginClient apiHubPluginClient = ApiHubPluginClient.create()) {
+ * PluginName name = PluginName.of("[PROJECT]", "[LOCATION]", "[PLUGIN]");
+ * Plugin response = apiHubPluginClient.getPlugin(name);
+ * }
+ * }
+ *
+ *
+ *
+ *
+ *
+ *
+ * Method
+ * Description
+ * Method Variants
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ * {@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
+ * ApiHubPluginSettings apiHubPluginSettings =
+ * ApiHubPluginSettings.newBuilder()
+ * .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ * .build();
+ * ApiHubPluginClient apiHubPluginClient = ApiHubPluginClient.create(apiHubPluginSettings);
+ * }
+ *
+ * {@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
+ * ApiHubPluginSettings apiHubPluginSettings =
+ * ApiHubPluginSettings.newBuilder().setEndpoint(myEndpoint).build();
+ * ApiHubPluginClient apiHubPluginClient = ApiHubPluginClient.create(apiHubPluginSettings);
+ * }
+ *
+ * {@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
+ * ApiHubPluginSettings apiHubPluginSettings = ApiHubPluginSettings.newHttpJsonBuilder().build();
+ * ApiHubPluginClient apiHubPluginClient = ApiHubPluginClient.create(apiHubPluginSettings);
+ * }
+ *
+ * {@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 (ApiHubPluginClient apiHubPluginClient = ApiHubPluginClient.create()) {
+ * PluginName name = PluginName.of("[PROJECT]", "[LOCATION]", "[PLUGIN]");
+ * Plugin response = apiHubPluginClient.getPlugin(name);
+ * }
+ * }
+ *
+ * @param name Required. The name of the plugin to retrieve. Format:
+ * `projects/{project}/locations/{location}/plugins/{plugin}`.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final Plugin getPlugin(PluginName name) {
+ GetPluginRequest request =
+ GetPluginRequest.newBuilder().setName(name == null ? null : name.toString()).build();
+ return getPlugin(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Get details about an API Hub plugin.
+ *
+ * {@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 (ApiHubPluginClient apiHubPluginClient = ApiHubPluginClient.create()) {
+ * String name = PluginName.of("[PROJECT]", "[LOCATION]", "[PLUGIN]").toString();
+ * Plugin response = apiHubPluginClient.getPlugin(name);
+ * }
+ * }
+ *
+ * @param name Required. The name of the plugin to retrieve. Format:
+ * `projects/{project}/locations/{location}/plugins/{plugin}`.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final Plugin getPlugin(String name) {
+ GetPluginRequest request = GetPluginRequest.newBuilder().setName(name).build();
+ return getPlugin(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Get details about an API Hub plugin.
+ *
+ * {@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 (ApiHubPluginClient apiHubPluginClient = ApiHubPluginClient.create()) {
+ * GetPluginRequest request =
+ * GetPluginRequest.newBuilder()
+ * .setName(PluginName.of("[PROJECT]", "[LOCATION]", "[PLUGIN]").toString())
+ * .build();
+ * Plugin response = apiHubPluginClient.getPlugin(request);
+ * }
+ * }
+ *
+ * @param 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
+ */
+ public final Plugin getPlugin(GetPluginRequest request) {
+ return getPluginCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Get details about an API Hub plugin.
+ *
+ * {@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 (ApiHubPluginClient apiHubPluginClient = ApiHubPluginClient.create()) {
+ * GetPluginRequest request =
+ * GetPluginRequest.newBuilder()
+ * .setName(PluginName.of("[PROJECT]", "[LOCATION]", "[PLUGIN]").toString())
+ * .build();
+ * ApiFuture
+ */
+ public final UnaryCallable{@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 (ApiHubPluginClient apiHubPluginClient = ApiHubPluginClient.create()) {
+ * PluginName name = PluginName.of("[PROJECT]", "[LOCATION]", "[PLUGIN]");
+ * Plugin response = apiHubPluginClient.enablePlugin(name);
+ * }
+ * }
+ *
+ * @param name Required. The name of the plugin to enable. Format:
+ * `projects/{project}/locations/{location}/plugins/{plugin}`.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final Plugin enablePlugin(PluginName name) {
+ EnablePluginRequest request =
+ EnablePluginRequest.newBuilder().setName(name == null ? null : name.toString()).build();
+ return enablePlugin(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Enables a plugin. The `state` of the plugin after enabling is `ENABLED`
+ *
+ * {@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 (ApiHubPluginClient apiHubPluginClient = ApiHubPluginClient.create()) {
+ * String name = PluginName.of("[PROJECT]", "[LOCATION]", "[PLUGIN]").toString();
+ * Plugin response = apiHubPluginClient.enablePlugin(name);
+ * }
+ * }
+ *
+ * @param name Required. The name of the plugin to enable. Format:
+ * `projects/{project}/locations/{location}/plugins/{plugin}`.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final Plugin enablePlugin(String name) {
+ EnablePluginRequest request = EnablePluginRequest.newBuilder().setName(name).build();
+ return enablePlugin(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Enables a plugin. The `state` of the plugin after enabling is `ENABLED`
+ *
+ * {@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 (ApiHubPluginClient apiHubPluginClient = ApiHubPluginClient.create()) {
+ * EnablePluginRequest request =
+ * EnablePluginRequest.newBuilder()
+ * .setName(PluginName.of("[PROJECT]", "[LOCATION]", "[PLUGIN]").toString())
+ * .build();
+ * Plugin response = apiHubPluginClient.enablePlugin(request);
+ * }
+ * }
+ *
+ * @param 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
+ */
+ public final Plugin enablePlugin(EnablePluginRequest request) {
+ return enablePluginCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Enables a plugin. The `state` of the plugin after enabling is `ENABLED`
+ *
+ * {@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 (ApiHubPluginClient apiHubPluginClient = ApiHubPluginClient.create()) {
+ * EnablePluginRequest request =
+ * EnablePluginRequest.newBuilder()
+ * .setName(PluginName.of("[PROJECT]", "[LOCATION]", "[PLUGIN]").toString())
+ * .build();
+ * ApiFuture
+ */
+ public final UnaryCallable{@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 (ApiHubPluginClient apiHubPluginClient = ApiHubPluginClient.create()) {
+ * PluginName name = PluginName.of("[PROJECT]", "[LOCATION]", "[PLUGIN]");
+ * Plugin response = apiHubPluginClient.disablePlugin(name);
+ * }
+ * }
+ *
+ * @param name Required. The name of the plugin to disable. Format:
+ * `projects/{project}/locations/{location}/plugins/{plugin}`.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final Plugin disablePlugin(PluginName name) {
+ DisablePluginRequest request =
+ DisablePluginRequest.newBuilder().setName(name == null ? null : name.toString()).build();
+ return disablePlugin(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Disables a plugin. The `state` of the plugin after disabling is `DISABLED`
+ *
+ * {@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 (ApiHubPluginClient apiHubPluginClient = ApiHubPluginClient.create()) {
+ * String name = PluginName.of("[PROJECT]", "[LOCATION]", "[PLUGIN]").toString();
+ * Plugin response = apiHubPluginClient.disablePlugin(name);
+ * }
+ * }
+ *
+ * @param name Required. The name of the plugin to disable. Format:
+ * `projects/{project}/locations/{location}/plugins/{plugin}`.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final Plugin disablePlugin(String name) {
+ DisablePluginRequest request = DisablePluginRequest.newBuilder().setName(name).build();
+ return disablePlugin(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Disables a plugin. The `state` of the plugin after disabling is `DISABLED`
+ *
+ * {@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 (ApiHubPluginClient apiHubPluginClient = ApiHubPluginClient.create()) {
+ * DisablePluginRequest request =
+ * DisablePluginRequest.newBuilder()
+ * .setName(PluginName.of("[PROJECT]", "[LOCATION]", "[PLUGIN]").toString())
+ * .build();
+ * Plugin response = apiHubPluginClient.disablePlugin(request);
+ * }
+ * }
+ *
+ * @param 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
+ */
+ public final Plugin disablePlugin(DisablePluginRequest request) {
+ return disablePluginCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Disables a plugin. The `state` of the plugin after disabling is `DISABLED`
+ *
+ * {@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 (ApiHubPluginClient apiHubPluginClient = ApiHubPluginClient.create()) {
+ * DisablePluginRequest request =
+ * DisablePluginRequest.newBuilder()
+ * .setName(PluginName.of("[PROJECT]", "[LOCATION]", "[PLUGIN]").toString())
+ * .build();
+ * ApiFuture
+ */
+ public final UnaryCallable{@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 (ApiHubPluginClient apiHubPluginClient = ApiHubPluginClient.create()) {
+ * ListLocationsRequest request =
+ * ListLocationsRequest.newBuilder()
+ * .setName("name3373707")
+ * .setFilter("filter-1274492040")
+ * .setPageSize(883849137)
+ * .setPageToken("pageToken873572522")
+ * .build();
+ * for (Location element : apiHubPluginClient.listLocations(request).iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ * }
+ *
+ * @param 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
+ */
+ public final ListLocationsPagedResponse listLocations(ListLocationsRequest request) {
+ return listLocationsPagedCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Lists information about the supported locations for this service.
+ *
+ * {@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 (ApiHubPluginClient apiHubPluginClient = ApiHubPluginClient.create()) {
+ * ListLocationsRequest request =
+ * ListLocationsRequest.newBuilder()
+ * .setName("name3373707")
+ * .setFilter("filter-1274492040")
+ * .setPageSize(883849137)
+ * .setPageToken("pageToken873572522")
+ * .build();
+ * ApiFuture
+ */
+ public final UnaryCallable{@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 (ApiHubPluginClient apiHubPluginClient = ApiHubPluginClient.create()) {
+ * ListLocationsRequest request =
+ * ListLocationsRequest.newBuilder()
+ * .setName("name3373707")
+ * .setFilter("filter-1274492040")
+ * .setPageSize(883849137)
+ * .setPageToken("pageToken873572522")
+ * .build();
+ * while (true) {
+ * ListLocationsResponse response = apiHubPluginClient.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;
+ * }
+ * }
+ * }
+ * }
+ */
+ public final UnaryCallable{@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 (ApiHubPluginClient apiHubPluginClient = ApiHubPluginClient.create()) {
+ * GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
+ * Location response = apiHubPluginClient.getLocation(request);
+ * }
+ * }
+ *
+ * @param 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
+ */
+ public final Location getLocation(GetLocationRequest request) {
+ return getLocationCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Gets information about a location.
+ *
+ * {@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 (ApiHubPluginClient apiHubPluginClient = ApiHubPluginClient.create()) {
+ * GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
+ * ApiFuture
+ */
+ public final UnaryCallable
+ *
+ *
+ * {@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
+ * ApiHubPluginSettings.Builder apiHubPluginSettingsBuilder = ApiHubPluginSettings.newBuilder();
+ * apiHubPluginSettingsBuilder
+ * .getPluginSettings()
+ * .setRetrySettings(
+ * apiHubPluginSettingsBuilder
+ * .getPluginSettings()
+ * .getRetrySettings()
+ * .toBuilder()
+ * .setTotalTimeout(Duration.ofSeconds(30))
+ * .build());
+ * ApiHubPluginSettings apiHubPluginSettings = apiHubPluginSettingsBuilder.build();
+ * }
+ */
+@Generated("by gapic-generator-java")
+public class ApiHubPluginSettings extends ClientSettings
+ *
+ *
+ * {@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
+ * ApiHubSettings.Builder apiHubSettingsBuilder = ApiHubSettings.newBuilder();
+ * apiHubSettingsBuilder
+ * .createApiSettings()
+ * .setRetrySettings(
+ * apiHubSettingsBuilder
+ * .createApiSettings()
+ * .getRetrySettings()
+ * .toBuilder()
+ * .setTotalTimeout(Duration.ofSeconds(30))
+ * .build());
+ * ApiHubSettings apiHubSettings = apiHubSettingsBuilder.build();
+ * }
+ */
+@Generated("by gapic-generator-java")
+public class ApiHubSettings extends ClientSettings