ListAnnotations
Lists Annotations belongs to a dataitem
Lists Annotations belongs to a dataitem.
Request object method variants only take one parameter, a request object, which must be constructed before the call.
*AssessData
Assesses the state or validity of the dataset with respect to a given use case.
Request object method variants only take one parameter, a request object, which must be constructed before the call.
+ *assessDataAsync(AssessDataRequest request) + *
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
+ *assessDataOperationCallable() + *
assessDataCallable() + *
AssembleData
Assembles each row of a multimodal dataset and writes the result into a BigQuery table.
Request object method variants only take one parameter, a request object, which must be constructed before the call.
+ *assembleDataAsync(AssembleDataRequest request) + *
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
+ *assembleDataOperationCallable() + *
assembleDataCallable() + *
ListLocations
Lists information about the supported locations for this service.
Sample code: * @@ -3259,7 +3289,7 @@ public final ListAnnotationsPagedResponse listAnnotations(DataItemName parent) { // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Lists Annotations belongs to a dataitem + * Lists Annotations belongs to a dataitem. * *
Sample code: * @@ -3289,7 +3319,7 @@ public final ListAnnotationsPagedResponse listAnnotations(String parent) { // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Lists Annotations belongs to a dataitem + * Lists Annotations belongs to a dataitem. * *
Sample code: * @@ -3325,7 +3355,7 @@ public final ListAnnotationsPagedResponse listAnnotations(ListAnnotationsRequest // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Lists Annotations belongs to a dataitem + * Lists Annotations belongs to a dataitem. * *
Sample code: * @@ -3362,7 +3392,7 @@ public final ListAnnotationsPagedResponse listAnnotations(ListAnnotationsRequest // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Lists Annotations belongs to a dataitem + * Lists Annotations belongs to a dataitem. * *
Sample code: * @@ -3404,6 +3434,177 @@ public final ListAnnotationsPagedResponse listAnnotations(ListAnnotationsRequest return stub.listAnnotationsCallable(); } + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Assesses the state or validity of the dataset with respect to a given use case. + * + *
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 (DatasetServiceClient datasetServiceClient = DatasetServiceClient.create()) {
+ * AssessDataRequest request =
+ * AssessDataRequest.newBuilder()
+ * .setName(DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]").toString())
+ * .build();
+ * AssessDataResponse response = datasetServiceClient.assessDataAsync(request).get();
+ * }
+ * }
+ *
+ * @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 OperationFutureSample 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 (DatasetServiceClient datasetServiceClient = DatasetServiceClient.create()) {
+ * AssessDataRequest request =
+ * AssessDataRequest.newBuilder()
+ * .setName(DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]").toString())
+ * .build();
+ * OperationFuture future =
+ * datasetServiceClient.assessDataOperationCallable().futureCall(request);
+ * // Do something.
+ * AssessDataResponse response = future.get();
+ * }
+ * }
+ */
+ public final OperationCallableSample 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 (DatasetServiceClient datasetServiceClient = DatasetServiceClient.create()) {
+ * AssessDataRequest request =
+ * AssessDataRequest.newBuilder()
+ * .setName(DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]").toString())
+ * .build();
+ * ApiFuture future = datasetServiceClient.assessDataCallable().futureCall(request);
+ * // Do something.
+ * Operation response = future.get();
+ * }
+ * }
+ */
+ public final UnaryCallableSample 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 (DatasetServiceClient datasetServiceClient = DatasetServiceClient.create()) {
+ * AssembleDataRequest request =
+ * AssembleDataRequest.newBuilder()
+ * .setName(DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]").toString())
+ * .build();
+ * AssembleDataResponse response = datasetServiceClient.assembleDataAsync(request).get();
+ * }
+ * }
+ *
+ * @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 OperationFutureSample 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 (DatasetServiceClient datasetServiceClient = DatasetServiceClient.create()) {
+ * AssembleDataRequest request =
+ * AssembleDataRequest.newBuilder()
+ * .setName(DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]").toString())
+ * .build();
+ * OperationFuture future =
+ * datasetServiceClient.assembleDataOperationCallable().futureCall(request);
+ * // Do something.
+ * AssembleDataResponse response = future.get();
+ * }
+ * }
+ */
+ public final OperationCallable<
+ AssembleDataRequest, AssembleDataResponse, AssembleDataOperationMetadata>
+ assembleDataOperationCallable() {
+ return stub.assembleDataOperationCallable();
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Assembles each row of a multimodal dataset and writes the result into a BigQuery table.
+ *
+ * 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 (DatasetServiceClient datasetServiceClient = DatasetServiceClient.create()) {
+ * AssembleDataRequest request =
+ * AssembleDataRequest.newBuilder()
+ * .setName(DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]").toString())
+ * .build();
+ * ApiFuture future = datasetServiceClient.assembleDataCallable().futureCall(request);
+ * // Do something.
+ * Operation response = future.get();
+ * }
+ * }
+ */
+ public final UnaryCallableThis 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 (ExampleStoreServiceClient exampleStoreServiceClient = ExampleStoreServiceClient.create()) {
+ * ExampleStoreName name = ExampleStoreName.of("[PROJECT]", "[LOCATION]", "[EXAMPLE_STORE]");
+ * ExampleStore response = exampleStoreServiceClient.getExampleStore(name);
+ * }
+ * }
+ *
+ * Note: close() needs to be called on the ExampleStoreServiceClient 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 | + *
|---|---|---|
CreateExampleStore |
+ * Create an ExampleStore. |
+ *
+ * Request object method variants only take one parameter, a request object, which must be constructed before the call. + *
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service. + *
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. + *
|
+ *
GetExampleStore |
+ * Get an ExampleStore. |
+ *
+ * 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. + *
|
+ *
UpdateExampleStore |
+ * Update an ExampleStore. |
+ *
+ * Request object method variants only take one parameter, a request object, which must be constructed before the call. + *
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service. + *
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. + *
|
+ *
DeleteExampleStore |
+ * Delete an ExampleStore. |
+ *
+ * Request object method variants only take one parameter, a request object, which must be constructed before the call. + *
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service. + *
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. + *
|
+ *
ListExampleStores |
+ * List ExampleStores in a Location. |
+ *
+ * Request object method variants only take one parameter, a request object, which must be constructed before the call. + *
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method. + *
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. + *
|
+ *
UpsertExamples |
+ * Create or update Examples in the Example Store. |
+ *
+ * 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. + *
|
+ *
RemoveExamples |
+ * Remove Examples from the Example Store. |
+ *
+ * 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. + *
|
+ *
SearchExamples |
+ * Search for similar Examples for given selection criteria. |
+ *
+ * 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. + *
|
+ *
FetchExamples |
+ * Get Examples from the Example Store. |
+ *
+ * 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. + *
|
+ *
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. + *
|
+ *
SetIamPolicy |
+ * Sets the access control policy on the specified resource. Replacesany existing policy. + * Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED`errors. |
+ *
+ * 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. + *
|
+ *
GetIamPolicy |
+ * Gets the access control policy for a resource. Returns an empty policyif the resource exists and does not have a policy set. |
+ *
+ * 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. + *
|
+ *
TestIamPermissions |
+ * Returns permissions that a caller has on the specified resource. If theresource does not exist, this will return an empty set ofpermissions, not a `NOT_FOUND` error. + * Note: This operation is designed to be used for buildingpermission-aware UIs and command-line tools, not for authorizationchecking. This operation may "fail open" without warning. |
+ *
+ * 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 ExampleStoreServiceSettings 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
+ * ExampleStoreServiceSettings exampleStoreServiceSettings =
+ * ExampleStoreServiceSettings.newBuilder()
+ * .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ * .build();
+ * ExampleStoreServiceClient exampleStoreServiceClient =
+ * ExampleStoreServiceClient.create(exampleStoreServiceSettings);
+ * }
+ *
+ * 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
+ * ExampleStoreServiceSettings exampleStoreServiceSettings =
+ * ExampleStoreServiceSettings.newBuilder().setEndpoint(myEndpoint).build();
+ * ExampleStoreServiceClient exampleStoreServiceClient =
+ * ExampleStoreServiceClient.create(exampleStoreServiceSettings);
+ * }
+ *
+ * Please refer to the GitHub repository's samples for more quickstart code snippets. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class ExampleStoreServiceClient implements BackgroundResource { + private final ExampleStoreServiceSettings settings; + private final ExampleStoreServiceStub stub; + private final OperationsClient operationsClient; + + /** Constructs an instance of ExampleStoreServiceClient with default settings. */ + public static final ExampleStoreServiceClient create() throws IOException { + return create(ExampleStoreServiceSettings.newBuilder().build()); + } + + /** + * Constructs an instance of ExampleStoreServiceClient, 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 ExampleStoreServiceClient create(ExampleStoreServiceSettings settings) + throws IOException { + return new ExampleStoreServiceClient(settings); + } + + /** + * Constructs an instance of ExampleStoreServiceClient, using the given stub for making calls. + * This is for advanced usage - prefer using create(ExampleStoreServiceSettings). + */ + public static final ExampleStoreServiceClient create(ExampleStoreServiceStub stub) { + return new ExampleStoreServiceClient(stub); + } + + /** + * Constructs an instance of ExampleStoreServiceClient, 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 ExampleStoreServiceClient(ExampleStoreServiceSettings settings) throws IOException { + this.settings = settings; + this.stub = ((ExampleStoreServiceStubSettings) settings.getStubSettings()).createStub(); + this.operationsClient = OperationsClient.create(this.stub.getOperationsStub()); + } + + protected ExampleStoreServiceClient(ExampleStoreServiceStub stub) { + this.settings = null; + this.stub = stub; + this.operationsClient = OperationsClient.create(this.stub.getOperationsStub()); + } + + public final ExampleStoreServiceSettings getSettings() { + return settings; + } + + public ExampleStoreServiceStub getStub() { + return stub; + } + + /** + * Returns the OperationsClient that can be used to query the status of a long-running operation + * returned by another API method call. + */ + public final OperationsClient getOperationsClient() { + return operationsClient; + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Create an ExampleStore. + * + *
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 (ExampleStoreServiceClient exampleStoreServiceClient = ExampleStoreServiceClient.create()) {
+ * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+ * ExampleStore exampleStore = ExampleStore.newBuilder().build();
+ * ExampleStore response =
+ * exampleStoreServiceClient.createExampleStoreAsync(parent, exampleStore).get();
+ * }
+ * }
+ *
+ * @param parent Required. The resource name of the Location to create the ExampleStore in.
+ * Format: `projects/{project}/locations/{location}`
+ * @param exampleStore Required. The Example Store to be created.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final OperationFutureSample 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 (ExampleStoreServiceClient exampleStoreServiceClient = ExampleStoreServiceClient.create()) {
+ * String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
+ * ExampleStore exampleStore = ExampleStore.newBuilder().build();
+ * ExampleStore response =
+ * exampleStoreServiceClient.createExampleStoreAsync(parent, exampleStore).get();
+ * }
+ * }
+ *
+ * @param parent Required. The resource name of the Location to create the ExampleStore in.
+ * Format: `projects/{project}/locations/{location}`
+ * @param exampleStore Required. The Example Store to be created.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final OperationFutureSample 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 (ExampleStoreServiceClient exampleStoreServiceClient = ExampleStoreServiceClient.create()) {
+ * CreateExampleStoreRequest request =
+ * CreateExampleStoreRequest.newBuilder()
+ * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+ * .setExampleStore(ExampleStore.newBuilder().build())
+ * .build();
+ * ExampleStore response = exampleStoreServiceClient.createExampleStoreAsync(request).get();
+ * }
+ * }
+ *
+ * @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 OperationFutureSample 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 (ExampleStoreServiceClient exampleStoreServiceClient = ExampleStoreServiceClient.create()) {
+ * CreateExampleStoreRequest request =
+ * CreateExampleStoreRequest.newBuilder()
+ * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+ * .setExampleStore(ExampleStore.newBuilder().build())
+ * .build();
+ * OperationFuture future =
+ * exampleStoreServiceClient.createExampleStoreOperationCallable().futureCall(request);
+ * // Do something.
+ * ExampleStore response = future.get();
+ * }
+ * }
+ */
+ public final OperationCallable<
+ CreateExampleStoreRequest, ExampleStore, CreateExampleStoreOperationMetadata>
+ createExampleStoreOperationCallable() {
+ return stub.createExampleStoreOperationCallable();
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Create an ExampleStore.
+ *
+ * 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 (ExampleStoreServiceClient exampleStoreServiceClient = ExampleStoreServiceClient.create()) {
+ * CreateExampleStoreRequest request =
+ * CreateExampleStoreRequest.newBuilder()
+ * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+ * .setExampleStore(ExampleStore.newBuilder().build())
+ * .build();
+ * ApiFuture future =
+ * exampleStoreServiceClient.createExampleStoreCallable().futureCall(request);
+ * // Do something.
+ * Operation response = future.get();
+ * }
+ * }
+ */
+ public final UnaryCallableSample 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 (ExampleStoreServiceClient exampleStoreServiceClient = ExampleStoreServiceClient.create()) {
+ * ExampleStoreName name = ExampleStoreName.of("[PROJECT]", "[LOCATION]", "[EXAMPLE_STORE]");
+ * ExampleStore response = exampleStoreServiceClient.getExampleStore(name);
+ * }
+ * }
+ *
+ * @param name Required. The resource name of the ExampleStore. Format:
+ * `projects/{project}/locations/{location}/exampleStores/{example_store}`
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final ExampleStore getExampleStore(ExampleStoreName name) {
+ GetExampleStoreRequest request =
+ GetExampleStoreRequest.newBuilder().setName(name == null ? null : name.toString()).build();
+ return getExampleStore(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Get an ExampleStore.
+ *
+ * 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 (ExampleStoreServiceClient exampleStoreServiceClient = ExampleStoreServiceClient.create()) {
+ * String name = ExampleStoreName.of("[PROJECT]", "[LOCATION]", "[EXAMPLE_STORE]").toString();
+ * ExampleStore response = exampleStoreServiceClient.getExampleStore(name);
+ * }
+ * }
+ *
+ * @param name Required. The resource name of the ExampleStore. Format:
+ * `projects/{project}/locations/{location}/exampleStores/{example_store}`
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final ExampleStore getExampleStore(String name) {
+ GetExampleStoreRequest request = GetExampleStoreRequest.newBuilder().setName(name).build();
+ return getExampleStore(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Get an ExampleStore.
+ *
+ * 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 (ExampleStoreServiceClient exampleStoreServiceClient = ExampleStoreServiceClient.create()) {
+ * GetExampleStoreRequest request =
+ * GetExampleStoreRequest.newBuilder()
+ * .setName(ExampleStoreName.of("[PROJECT]", "[LOCATION]", "[EXAMPLE_STORE]").toString())
+ * .build();
+ * ExampleStore response = exampleStoreServiceClient.getExampleStore(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 ExampleStore getExampleStore(GetExampleStoreRequest request) {
+ return getExampleStoreCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Get an ExampleStore.
+ *
+ * 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 (ExampleStoreServiceClient exampleStoreServiceClient = ExampleStoreServiceClient.create()) {
+ * GetExampleStoreRequest request =
+ * GetExampleStoreRequest.newBuilder()
+ * .setName(ExampleStoreName.of("[PROJECT]", "[LOCATION]", "[EXAMPLE_STORE]").toString())
+ * .build();
+ * ApiFuture future =
+ * exampleStoreServiceClient.getExampleStoreCallable().futureCall(request);
+ * // Do something.
+ * ExampleStore response = future.get();
+ * }
+ * }
+ */
+ public final UnaryCallableSample 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 (ExampleStoreServiceClient exampleStoreServiceClient = ExampleStoreServiceClient.create()) {
+ * ExampleStore exampleStore = ExampleStore.newBuilder().build();
+ * FieldMask updateMask = FieldMask.newBuilder().build();
+ * ExampleStore response =
+ * exampleStoreServiceClient.updateExampleStoreAsync(exampleStore, updateMask).get();
+ * }
+ * }
+ *
+ * @param exampleStore Required. The Example Store which replaces the resource on the server.
+ * @param updateMask Optional. Mask specifying which fields to update. Supported fields:
+ * * `display_name` * `description`
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final OperationFuture 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:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED`errors.
+ *
+ * Sample code:
+ *
+ * Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED`errors.
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Note: This operation is designed to be used for buildingpermission-aware UIs and
+ * command-line tools, not for authorizationchecking. This operation may "fail open" without
+ * warning.
+ *
+ * Sample code:
+ *
+ * Note: This operation is designed to be used for buildingpermission-aware UIs and
+ * command-line tools, not for authorizationchecking. This operation may "fail open" without
+ * warning.
+ *
+ * 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
+ * [RetrySettings](https://cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.retrying.RetrySettings)
+ * of getExampleStore:
+ *
+ * To configure the RetrySettings of a Long Running Operation method, create an
+ * OperationTimedPollAlgorithm object and update the RPC's polling algorithm. For example, to
+ * configure the RetrySettings for createExampleStore:
+ *
+ * Note: This method does not support applying settings to streaming methods.
+ */
+ public Builder applyToAllUnaryMethods(
+ ApiFunction{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (ExampleStoreServiceClient exampleStoreServiceClient = ExampleStoreServiceClient.create()) {
+ * UpdateExampleStoreRequest request =
+ * UpdateExampleStoreRequest.newBuilder()
+ * .setExampleStore(ExampleStore.newBuilder().build())
+ * .setUpdateMask(FieldMask.newBuilder().build())
+ * .build();
+ * ExampleStore response = exampleStoreServiceClient.updateExampleStoreAsync(request).get();
+ * }
+ * }
+ *
+ * @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 OperationFuture{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (ExampleStoreServiceClient exampleStoreServiceClient = ExampleStoreServiceClient.create()) {
+ * UpdateExampleStoreRequest request =
+ * UpdateExampleStoreRequest.newBuilder()
+ * .setExampleStore(ExampleStore.newBuilder().build())
+ * .setUpdateMask(FieldMask.newBuilder().build())
+ * .build();
+ * OperationFuture
+ */
+ public final OperationCallable<
+ UpdateExampleStoreRequest, ExampleStore, UpdateExampleStoreOperationMetadata>
+ updateExampleStoreOperationCallable() {
+ return stub.updateExampleStoreOperationCallable();
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Update an ExampleStore.
+ *
+ * {@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (ExampleStoreServiceClient exampleStoreServiceClient = ExampleStoreServiceClient.create()) {
+ * UpdateExampleStoreRequest request =
+ * UpdateExampleStoreRequest.newBuilder()
+ * .setExampleStore(ExampleStore.newBuilder().build())
+ * .setUpdateMask(FieldMask.newBuilder().build())
+ * .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 (ExampleStoreServiceClient exampleStoreServiceClient = ExampleStoreServiceClient.create()) {
+ * ExampleStoreName name = ExampleStoreName.of("[PROJECT]", "[LOCATION]", "[EXAMPLE_STORE]");
+ * exampleStoreServiceClient.deleteExampleStoreAsync(name).get();
+ * }
+ * }
+ *
+ * @param name Required. The resource name of the ExampleStore to be deleted. Format:
+ * `projects/{project}/locations/{location}/exampleStores/{example_store}`
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final OperationFuture{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (ExampleStoreServiceClient exampleStoreServiceClient = ExampleStoreServiceClient.create()) {
+ * String name = ExampleStoreName.of("[PROJECT]", "[LOCATION]", "[EXAMPLE_STORE]").toString();
+ * exampleStoreServiceClient.deleteExampleStoreAsync(name).get();
+ * }
+ * }
+ *
+ * @param name Required. The resource name of the ExampleStore to be deleted. Format:
+ * `projects/{project}/locations/{location}/exampleStores/{example_store}`
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final OperationFuture{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (ExampleStoreServiceClient exampleStoreServiceClient = ExampleStoreServiceClient.create()) {
+ * DeleteExampleStoreRequest request =
+ * DeleteExampleStoreRequest.newBuilder()
+ * .setName(ExampleStoreName.of("[PROJECT]", "[LOCATION]", "[EXAMPLE_STORE]").toString())
+ * .build();
+ * exampleStoreServiceClient.deleteExampleStoreAsync(request).get();
+ * }
+ * }
+ *
+ * @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 OperationFuture{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (ExampleStoreServiceClient exampleStoreServiceClient = ExampleStoreServiceClient.create()) {
+ * DeleteExampleStoreRequest request =
+ * DeleteExampleStoreRequest.newBuilder()
+ * .setName(ExampleStoreName.of("[PROJECT]", "[LOCATION]", "[EXAMPLE_STORE]").toString())
+ * .build();
+ * OperationFuture
+ */
+ public final OperationCallable<
+ DeleteExampleStoreRequest, Empty, DeleteExampleStoreOperationMetadata>
+ deleteExampleStoreOperationCallable() {
+ return stub.deleteExampleStoreOperationCallable();
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Delete an ExampleStore.
+ *
+ * {@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (ExampleStoreServiceClient exampleStoreServiceClient = ExampleStoreServiceClient.create()) {
+ * DeleteExampleStoreRequest request =
+ * DeleteExampleStoreRequest.newBuilder()
+ * .setName(ExampleStoreName.of("[PROJECT]", "[LOCATION]", "[EXAMPLE_STORE]").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 (ExampleStoreServiceClient exampleStoreServiceClient = ExampleStoreServiceClient.create()) {
+ * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+ * for (ExampleStore element :
+ * exampleStoreServiceClient.listExampleStores(parent).iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ * }
+ *
+ * @param parent Required. The resource name of the Location to list the ExampleStores from.
+ * Format: `projects/{project}/locations/{location}`
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final ListExampleStoresPagedResponse listExampleStores(LocationName parent) {
+ ListExampleStoresRequest request =
+ ListExampleStoresRequest.newBuilder()
+ .setParent(parent == null ? null : parent.toString())
+ .build();
+ return listExampleStores(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * List ExampleStores in 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 (ExampleStoreServiceClient exampleStoreServiceClient = ExampleStoreServiceClient.create()) {
+ * String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
+ * for (ExampleStore element :
+ * exampleStoreServiceClient.listExampleStores(parent).iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ * }
+ *
+ * @param parent Required. The resource name of the Location to list the ExampleStores from.
+ * Format: `projects/{project}/locations/{location}`
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final ListExampleStoresPagedResponse listExampleStores(String parent) {
+ ListExampleStoresRequest request =
+ ListExampleStoresRequest.newBuilder().setParent(parent).build();
+ return listExampleStores(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * List ExampleStores in 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 (ExampleStoreServiceClient exampleStoreServiceClient = ExampleStoreServiceClient.create()) {
+ * ListExampleStoresRequest request =
+ * ListExampleStoresRequest.newBuilder()
+ * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+ * .setFilter("filter-1274492040")
+ * .setPageSize(883849137)
+ * .setPageToken("pageToken873572522")
+ * .build();
+ * for (ExampleStore element :
+ * exampleStoreServiceClient.listExampleStores(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 ListExampleStoresPagedResponse listExampleStores(ListExampleStoresRequest request) {
+ return listExampleStoresPagedCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * List ExampleStores in 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 (ExampleStoreServiceClient exampleStoreServiceClient = ExampleStoreServiceClient.create()) {
+ * ListExampleStoresRequest request =
+ * ListExampleStoresRequest.newBuilder()
+ * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+ * .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 (ExampleStoreServiceClient exampleStoreServiceClient = ExampleStoreServiceClient.create()) {
+ * ListExampleStoresRequest request =
+ * ListExampleStoresRequest.newBuilder()
+ * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+ * .setFilter("filter-1274492040")
+ * .setPageSize(883849137)
+ * .setPageToken("pageToken873572522")
+ * .build();
+ * while (true) {
+ * ListExampleStoresResponse response =
+ * exampleStoreServiceClient.listExampleStoresCallable().call(request);
+ * for (ExampleStore element : response.getExampleStoresList()) {
+ * // 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 (ExampleStoreServiceClient exampleStoreServiceClient = ExampleStoreServiceClient.create()) {
+ * UpsertExamplesRequest request =
+ * UpsertExamplesRequest.newBuilder()
+ * .setExampleStore(
+ * ExampleStoreName.of("[PROJECT]", "[LOCATION]", "[EXAMPLE_STORE]").toString())
+ * .addAllExamples(new ArrayList
+ *
+ * @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 UpsertExamplesResponse upsertExamples(UpsertExamplesRequest request) {
+ return upsertExamplesCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Create or update Examples in the Example Store.
+ *
+ * {@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (ExampleStoreServiceClient exampleStoreServiceClient = ExampleStoreServiceClient.create()) {
+ * UpsertExamplesRequest request =
+ * UpsertExamplesRequest.newBuilder()
+ * .setExampleStore(
+ * ExampleStoreName.of("[PROJECT]", "[LOCATION]", "[EXAMPLE_STORE]").toString())
+ * .addAllExamples(new ArrayList
+ */
+ 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 (ExampleStoreServiceClient exampleStoreServiceClient = ExampleStoreServiceClient.create()) {
+ * RemoveExamplesRequest request =
+ * RemoveExamplesRequest.newBuilder()
+ * .setExampleStore(
+ * ExampleStoreName.of("[PROJECT]", "[LOCATION]", "[EXAMPLE_STORE]").toString())
+ * .addAllExampleIds(new ArrayList
+ *
+ * @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 RemoveExamplesResponse removeExamples(RemoveExamplesRequest request) {
+ return removeExamplesCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Remove Examples from the Example Store.
+ *
+ * {@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (ExampleStoreServiceClient exampleStoreServiceClient = ExampleStoreServiceClient.create()) {
+ * RemoveExamplesRequest request =
+ * RemoveExamplesRequest.newBuilder()
+ * .setExampleStore(
+ * ExampleStoreName.of("[PROJECT]", "[LOCATION]", "[EXAMPLE_STORE]").toString())
+ * .addAllExampleIds(new ArrayList
+ */
+ 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 (ExampleStoreServiceClient exampleStoreServiceClient = ExampleStoreServiceClient.create()) {
+ * SearchExamplesRequest request =
+ * SearchExamplesRequest.newBuilder()
+ * .setExampleStore(
+ * ExampleStoreName.of("[PROJECT]", "[LOCATION]", "[EXAMPLE_STORE]").toString())
+ * .setTopK(110545921)
+ * .build();
+ * SearchExamplesResponse response = exampleStoreServiceClient.searchExamples(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 SearchExamplesResponse searchExamples(SearchExamplesRequest request) {
+ return searchExamplesCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Search for similar Examples for given selection criteria.
+ *
+ * {@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (ExampleStoreServiceClient exampleStoreServiceClient = ExampleStoreServiceClient.create()) {
+ * SearchExamplesRequest request =
+ * SearchExamplesRequest.newBuilder()
+ * .setExampleStore(
+ * ExampleStoreName.of("[PROJECT]", "[LOCATION]", "[EXAMPLE_STORE]").toString())
+ * .setTopK(110545921)
+ * .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 (ExampleStoreServiceClient exampleStoreServiceClient = ExampleStoreServiceClient.create()) {
+ * FetchExamplesRequest request =
+ * FetchExamplesRequest.newBuilder()
+ * .setExampleStore(
+ * ExampleStoreName.of("[PROJECT]", "[LOCATION]", "[EXAMPLE_STORE]").toString())
+ * .setPageSize(883849137)
+ * .setPageToken("pageToken873572522")
+ * .addAllExampleIds(new ArrayList
+ *
+ * @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 FetchExamplesPagedResponse fetchExamples(FetchExamplesRequest request) {
+ return fetchExamplesPagedCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Get Examples from the Example Store.
+ *
+ * {@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (ExampleStoreServiceClient exampleStoreServiceClient = ExampleStoreServiceClient.create()) {
+ * FetchExamplesRequest request =
+ * FetchExamplesRequest.newBuilder()
+ * .setExampleStore(
+ * ExampleStoreName.of("[PROJECT]", "[LOCATION]", "[EXAMPLE_STORE]").toString())
+ * .setPageSize(883849137)
+ * .setPageToken("pageToken873572522")
+ * .addAllExampleIds(new ArrayList
+ */
+ 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 (ExampleStoreServiceClient exampleStoreServiceClient = ExampleStoreServiceClient.create()) {
+ * FetchExamplesRequest request =
+ * FetchExamplesRequest.newBuilder()
+ * .setExampleStore(
+ * ExampleStoreName.of("[PROJECT]", "[LOCATION]", "[EXAMPLE_STORE]").toString())
+ * .setPageSize(883849137)
+ * .setPageToken("pageToken873572522")
+ * .addAllExampleIds(new ArrayList
+ */
+ 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 (ExampleStoreServiceClient exampleStoreServiceClient = ExampleStoreServiceClient.create()) {
+ * ListLocationsRequest request =
+ * ListLocationsRequest.newBuilder()
+ * .setName("name3373707")
+ * .setFilter("filter-1274492040")
+ * .setPageSize(883849137)
+ * .setPageToken("pageToken873572522")
+ * .build();
+ * for (Location element : exampleStoreServiceClient.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 (ExampleStoreServiceClient exampleStoreServiceClient = ExampleStoreServiceClient.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 (ExampleStoreServiceClient exampleStoreServiceClient = ExampleStoreServiceClient.create()) {
+ * ListLocationsRequest request =
+ * ListLocationsRequest.newBuilder()
+ * .setName("name3373707")
+ * .setFilter("filter-1274492040")
+ * .setPageSize(883849137)
+ * .setPageToken("pageToken873572522")
+ * .build();
+ * while (true) {
+ * ListLocationsResponse response =
+ * exampleStoreServiceClient.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 (ExampleStoreServiceClient exampleStoreServiceClient = ExampleStoreServiceClient.create()) {
+ * GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
+ * Location response = exampleStoreServiceClient.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 (ExampleStoreServiceClient exampleStoreServiceClient = ExampleStoreServiceClient.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
+ * try (ExampleStoreServiceClient exampleStoreServiceClient = ExampleStoreServiceClient.create()) {
+ * SetIamPolicyRequest request =
+ * SetIamPolicyRequest.newBuilder()
+ * .setResource(
+ * EndpointName.ofProjectLocationEndpointName(
+ * "[PROJECT]", "[LOCATION]", "[ENDPOINT]")
+ * .toString())
+ * .setPolicy(Policy.newBuilder().build())
+ * .setUpdateMask(FieldMask.newBuilder().build())
+ * .build();
+ * Policy response = exampleStoreServiceClient.setIamPolicy(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 Policy setIamPolicy(SetIamPolicyRequest request) {
+ return setIamPolicyCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Sets the access control policy on the specified resource. Replacesany existing policy.
+ *
+ * {@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (ExampleStoreServiceClient exampleStoreServiceClient = ExampleStoreServiceClient.create()) {
+ * SetIamPolicyRequest request =
+ * SetIamPolicyRequest.newBuilder()
+ * .setResource(
+ * EndpointName.ofProjectLocationEndpointName(
+ * "[PROJECT]", "[LOCATION]", "[ENDPOINT]")
+ * .toString())
+ * .setPolicy(Policy.newBuilder().build())
+ * .setUpdateMask(FieldMask.newBuilder().build())
+ * .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 (ExampleStoreServiceClient exampleStoreServiceClient = ExampleStoreServiceClient.create()) {
+ * GetIamPolicyRequest request =
+ * GetIamPolicyRequest.newBuilder()
+ * .setResource(
+ * EndpointName.ofProjectLocationEndpointName(
+ * "[PROJECT]", "[LOCATION]", "[ENDPOINT]")
+ * .toString())
+ * .setOptions(GetPolicyOptions.newBuilder().build())
+ * .build();
+ * Policy response = exampleStoreServiceClient.getIamPolicy(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 Policy getIamPolicy(GetIamPolicyRequest request) {
+ return getIamPolicyCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Gets the access control policy for a resource. Returns an empty policyif the resource exists
+ * and does not have a policy set.
+ *
+ * {@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (ExampleStoreServiceClient exampleStoreServiceClient = ExampleStoreServiceClient.create()) {
+ * GetIamPolicyRequest request =
+ * GetIamPolicyRequest.newBuilder()
+ * .setResource(
+ * EndpointName.ofProjectLocationEndpointName(
+ * "[PROJECT]", "[LOCATION]", "[ENDPOINT]")
+ * .toString())
+ * .setOptions(GetPolicyOptions.newBuilder().build())
+ * .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 (ExampleStoreServiceClient exampleStoreServiceClient = ExampleStoreServiceClient.create()) {
+ * TestIamPermissionsRequest request =
+ * TestIamPermissionsRequest.newBuilder()
+ * .setResource(
+ * EndpointName.ofProjectLocationEndpointName(
+ * "[PROJECT]", "[LOCATION]", "[ENDPOINT]")
+ * .toString())
+ * .addAllPermissions(new ArrayList
+ *
+ * @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 TestIamPermissionsResponse testIamPermissions(TestIamPermissionsRequest request) {
+ return testIamPermissionsCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Returns permissions that a caller has on the specified resource. If theresource does not exist,
+ * this will return an empty set ofpermissions, not a `NOT_FOUND` error.
+ *
+ * {@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (ExampleStoreServiceClient exampleStoreServiceClient = ExampleStoreServiceClient.create()) {
+ * TestIamPermissionsRequest request =
+ * TestIamPermissionsRequest.newBuilder()
+ * .setResource(
+ * EndpointName.ofProjectLocationEndpointName(
+ * "[PROJECT]", "[LOCATION]", "[ENDPOINT]")
+ * .toString())
+ * .addAllPermissions(new ArrayList
+ */
+ 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
+ * ExampleStoreServiceSettings.Builder exampleStoreServiceSettingsBuilder =
+ * ExampleStoreServiceSettings.newBuilder();
+ * exampleStoreServiceSettingsBuilder
+ * .getExampleStoreSettings()
+ * .setRetrySettings(
+ * exampleStoreServiceSettingsBuilder
+ * .getExampleStoreSettings()
+ * .getRetrySettings()
+ * .toBuilder()
+ * .setInitialRetryDelayDuration(Duration.ofSeconds(1))
+ * .setInitialRpcTimeoutDuration(Duration.ofSeconds(5))
+ * .setMaxAttempts(5)
+ * .setMaxRetryDelayDuration(Duration.ofSeconds(30))
+ * .setMaxRpcTimeoutDuration(Duration.ofSeconds(60))
+ * .setRetryDelayMultiplier(1.3)
+ * .setRpcTimeoutMultiplier(1.5)
+ * .setTotalTimeoutDuration(Duration.ofSeconds(300))
+ * .build());
+ * ExampleStoreServiceSettings exampleStoreServiceSettings =
+ * exampleStoreServiceSettingsBuilder.build();
+ * }
+ *
+ * Please refer to the [Client Side Retry
+ * Guide](https://github.com/googleapis/google-cloud-java/blob/main/docs/client_retries.md) for
+ * additional support in setting retries.
+ *
+ * {@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * ExampleStoreServiceSettings.Builder exampleStoreServiceSettingsBuilder =
+ * ExampleStoreServiceSettings.newBuilder();
+ * TimedRetryAlgorithm timedRetryAlgorithm =
+ * OperationalTimedPollAlgorithm.create(
+ * RetrySettings.newBuilder()
+ * .setInitialRetryDelayDuration(Duration.ofMillis(500))
+ * .setRetryDelayMultiplier(1.5)
+ * .setMaxRetryDelayDuration(Duration.ofMillis(5000))
+ * .setTotalTimeoutDuration(Duration.ofHours(24))
+ * .build());
+ * exampleStoreServiceSettingsBuilder
+ * .createClusterOperationSettings()
+ * .setPollingAlgorithm(timedRetryAlgorithm)
+ * .build();
+ * }
+ */
+@BetaApi
+@Generated("by gapic-generator-java")
+public class ExampleStoreServiceSettings extends ClientSettings
ExportPublisherModel
Exports a publisher model to a user provided Google Cloud Storage bucket.
Request object method variants only take one parameter, a request object, which must be constructed before the call.
+ *exportPublisherModelAsync(ExportPublisherModelRequest request) + *
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
+ *exportPublisherModelOperationCallable() + *
exportPublisherModelCallable() + *
ListLocations
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 (ModelGardenServiceClient modelGardenServiceClient = ModelGardenServiceClient.create()) {
+ * ExportPublisherModelRequest request =
+ * ExportPublisherModelRequest.newBuilder()
+ * .setName("name3373707")
+ * .setDestination(GcsDestination.newBuilder().build())
+ * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+ * .build();
+ * ExportPublisherModelResponse response =
+ * modelGardenServiceClient.exportPublisherModelAsync(request).get();
+ * }
+ * }
+ *
+ * @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 OperationFutureSample 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 (ModelGardenServiceClient modelGardenServiceClient = ModelGardenServiceClient.create()) {
+ * ExportPublisherModelRequest request =
+ * ExportPublisherModelRequest.newBuilder()
+ * .setName("name3373707")
+ * .setDestination(GcsDestination.newBuilder().build())
+ * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+ * .build();
+ * OperationFuture future =
+ * modelGardenServiceClient.exportPublisherModelOperationCallable().futureCall(request);
+ * // Do something.
+ * ExportPublisherModelResponse response = future.get();
+ * }
+ * }
+ */
+ public final OperationCallable<
+ ExportPublisherModelRequest,
+ ExportPublisherModelResponse,
+ ExportPublisherModelOperationMetadata>
+ exportPublisherModelOperationCallable() {
+ return stub.exportPublisherModelOperationCallable();
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Exports a publisher model to a user provided Google Cloud Storage bucket.
+ *
+ * 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 (ModelGardenServiceClient modelGardenServiceClient = ModelGardenServiceClient.create()) {
+ * ExportPublisherModelRequest request =
+ * ExportPublisherModelRequest.newBuilder()
+ * .setName("name3373707")
+ * .setDestination(GcsDestination.newBuilder().build())
+ * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+ * .build();
+ * ApiFuture future =
+ * modelGardenServiceClient.exportPublisherModelCallable().futureCall(request);
+ * // Do something.
+ * Operation response = future.get();
+ * }
+ * }
+ */
+ public final UnaryCallableThis 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 (SessionServiceClient sessionServiceClient = SessionServiceClient.create()) {
+ * SessionName name =
+ * SessionName.ofProjectLocationSessionName("[PROJECT]", "[LOCATION]", "[SESSION]");
+ * Session response = sessionServiceClient.getSession(name);
+ * }
+ * }
+ *
+ * Note: close() needs to be called on the SessionServiceClient 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 | + *
|---|---|---|
CreateSession |
+ * Creates a new [Session][google.cloud.aiplatform.v1beta1.Session] in a given project and location. |
+ *
+ * Request object method variants only take one parameter, a request object, which must be constructed before the call. + *
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service. + *
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. + *
|
+ *
GetSession |
+ * Gets details of the specific [Session][google.cloud.aiplatform.v1beta1.Session]. |
+ *
+ * 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. + *
|
+ *
ListSessions |
+ * Lists [Sessions][google.cloud.aiplatform.v1beta1.Session] in a given project and location. |
+ *
+ * Request object method variants only take one parameter, a request object, which must be constructed before the call. + *
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method. + *
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. + *
|
+ *
UpdateSession |
+ * Updates the specific [Session][google.cloud.aiplatform.v1beta1.Session]. |
+ *
+ * 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. + *
|
+ *
DeleteSession |
+ * Deletes details of the specific [Session][google.cloud.aiplatform.v1beta1.Session]. |
+ *
+ * Request object method variants only take one parameter, a request object, which must be constructed before the call. + *
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service. + *
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. + *
|
+ *
ListEvents |
+ * Lists [Events][google.cloud.aiplatform.v1beta1.Event] in a given session. |
+ *
+ * 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. + *
|
+ *
AppendEvent |
+ * Appends an event to a given session. |
+ *
+ * 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. + *
|
+ *
SetIamPolicy |
+ * Sets the access control policy on the specified resource. Replacesany existing policy. + * Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED`errors. |
+ *
+ * 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. + *
|
+ *
GetIamPolicy |
+ * Gets the access control policy for a resource. Returns an empty policyif the resource exists and does not have a policy set. |
+ *
+ * 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. + *
|
+ *
TestIamPermissions |
+ * Returns permissions that a caller has on the specified resource. If theresource does not exist, this will return an empty set ofpermissions, not a `NOT_FOUND` error. + * Note: This operation is designed to be used for buildingpermission-aware UIs and command-line tools, not for authorizationchecking. This operation may "fail open" without warning. |
+ *
+ * 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 SessionServiceSettings 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
+ * SessionServiceSettings sessionServiceSettings =
+ * SessionServiceSettings.newBuilder()
+ * .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ * .build();
+ * SessionServiceClient sessionServiceClient = SessionServiceClient.create(sessionServiceSettings);
+ * }
+ *
+ * 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
+ * SessionServiceSettings sessionServiceSettings =
+ * SessionServiceSettings.newBuilder().setEndpoint(myEndpoint).build();
+ * SessionServiceClient sessionServiceClient = SessionServiceClient.create(sessionServiceSettings);
+ * }
+ *
+ * Please refer to the GitHub repository's samples for more quickstart code snippets. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class SessionServiceClient implements BackgroundResource { + private final SessionServiceSettings settings; + private final SessionServiceStub stub; + private final OperationsClient operationsClient; + + /** Constructs an instance of SessionServiceClient with default settings. */ + public static final SessionServiceClient create() throws IOException { + return create(SessionServiceSettings.newBuilder().build()); + } + + /** + * Constructs an instance of SessionServiceClient, 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 SessionServiceClient create(SessionServiceSettings settings) + throws IOException { + return new SessionServiceClient(settings); + } + + /** + * Constructs an instance of SessionServiceClient, using the given stub for making calls. This is + * for advanced usage - prefer using create(SessionServiceSettings). + */ + public static final SessionServiceClient create(SessionServiceStub stub) { + return new SessionServiceClient(stub); + } + + /** + * Constructs an instance of SessionServiceClient, 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 SessionServiceClient(SessionServiceSettings settings) throws IOException { + this.settings = settings; + this.stub = ((SessionServiceStubSettings) settings.getStubSettings()).createStub(); + this.operationsClient = OperationsClient.create(this.stub.getOperationsStub()); + } + + protected SessionServiceClient(SessionServiceStub stub) { + this.settings = null; + this.stub = stub; + this.operationsClient = OperationsClient.create(this.stub.getOperationsStub()); + } + + public final SessionServiceSettings getSettings() { + return settings; + } + + public SessionServiceStub getStub() { + return stub; + } + + /** + * Returns the OperationsClient that can be used to query the status of a long-running operation + * returned by another API method call. + */ + public final OperationsClient getOperationsClient() { + return operationsClient; + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a new [Session][google.cloud.aiplatform.v1beta1.Session] in a given project and + * 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 (SessionServiceClient sessionServiceClient = SessionServiceClient.create()) {
+ * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+ * Session session = Session.newBuilder().build();
+ * Session response = sessionServiceClient.createSessionAsync(parent, session).get();
+ * }
+ * }
+ *
+ * @param parent Required. The resource name of the location to create the session in. Format:
+ * `projects/{project}/locations/{location}` or
+ * `projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}`
+ * @param session Required. The session to create.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final OperationFutureSample 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 (SessionServiceClient sessionServiceClient = SessionServiceClient.create()) {
+ * ReasoningEngineName parent =
+ * ReasoningEngineName.of("[PROJECT]", "[LOCATION]", "[REASONING_ENGINE]");
+ * Session session = Session.newBuilder().build();
+ * Session response = sessionServiceClient.createSessionAsync(parent, session).get();
+ * }
+ * }
+ *
+ * @param parent Required. The resource name of the location to create the session in. Format:
+ * `projects/{project}/locations/{location}` or
+ * `projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}`
+ * @param session Required. The session to create.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final OperationFutureSample 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 (SessionServiceClient sessionServiceClient = SessionServiceClient.create()) {
+ * String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
+ * Session session = Session.newBuilder().build();
+ * Session response = sessionServiceClient.createSessionAsync(parent, session).get();
+ * }
+ * }
+ *
+ * @param parent Required. The resource name of the location to create the session in. Format:
+ * `projects/{project}/locations/{location}` or
+ * `projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}`
+ * @param session Required. The session to create.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final OperationFutureSample 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 (SessionServiceClient sessionServiceClient = SessionServiceClient.create()) {
+ * CreateSessionRequest request =
+ * CreateSessionRequest.newBuilder()
+ * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+ * .setSession(Session.newBuilder().build())
+ * .build();
+ * Session response = sessionServiceClient.createSessionAsync(request).get();
+ * }
+ * }
+ *
+ * @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 OperationFutureSample 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 (SessionServiceClient sessionServiceClient = SessionServiceClient.create()) {
+ * CreateSessionRequest request =
+ * CreateSessionRequest.newBuilder()
+ * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+ * .setSession(Session.newBuilder().build())
+ * .build();
+ * OperationFuture future =
+ * sessionServiceClient.createSessionOperationCallable().futureCall(request);
+ * // Do something.
+ * Session response = future.get();
+ * }
+ * }
+ */
+ public final OperationCallableSample 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 (SessionServiceClient sessionServiceClient = SessionServiceClient.create()) {
+ * CreateSessionRequest request =
+ * CreateSessionRequest.newBuilder()
+ * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+ * .setSession(Session.newBuilder().build())
+ * .build();
+ * ApiFuture future =
+ * sessionServiceClient.createSessionCallable().futureCall(request);
+ * // Do something.
+ * Operation response = future.get();
+ * }
+ * }
+ */
+ public final UnaryCallableSample 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 (SessionServiceClient sessionServiceClient = SessionServiceClient.create()) {
+ * SessionName name =
+ * SessionName.ofProjectLocationSessionName("[PROJECT]", "[LOCATION]", "[SESSION]");
+ * Session response = sessionServiceClient.getSession(name);
+ * }
+ * }
+ *
+ * @param name Required. The resource name of the session. Format:
+ * `projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}/sessions/{session}`
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final Session getSession(SessionName name) {
+ GetSessionRequest request =
+ GetSessionRequest.newBuilder().setName(name == null ? null : name.toString()).build();
+ return getSession(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Gets details of the specific [Session][google.cloud.aiplatform.v1beta1.Session].
+ *
+ * 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 (SessionServiceClient sessionServiceClient = SessionServiceClient.create()) {
+ * String name =
+ * SessionName.ofProjectLocationSessionName("[PROJECT]", "[LOCATION]", "[SESSION]")
+ * .toString();
+ * Session response = sessionServiceClient.getSession(name);
+ * }
+ * }
+ *
+ * @param name Required. The resource name of the session. Format:
+ * `projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}/sessions/{session}`
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final Session getSession(String name) {
+ GetSessionRequest request = GetSessionRequest.newBuilder().setName(name).build();
+ return getSession(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Gets details of the specific [Session][google.cloud.aiplatform.v1beta1.Session].
+ *
+ * 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 (SessionServiceClient sessionServiceClient = SessionServiceClient.create()) {
+ * GetSessionRequest request =
+ * GetSessionRequest.newBuilder()
+ * .setName(
+ * SessionName.ofProjectLocationSessionName("[PROJECT]", "[LOCATION]", "[SESSION]")
+ * .toString())
+ * .build();
+ * Session response = sessionServiceClient.getSession(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 Session getSession(GetSessionRequest request) {
+ return getSessionCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Gets details of the specific [Session][google.cloud.aiplatform.v1beta1.Session].
+ *
+ * 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 (SessionServiceClient sessionServiceClient = SessionServiceClient.create()) {
+ * GetSessionRequest request =
+ * GetSessionRequest.newBuilder()
+ * .setName(
+ * SessionName.ofProjectLocationSessionName("[PROJECT]", "[LOCATION]", "[SESSION]")
+ * .toString())
+ * .build();
+ * ApiFuture future = sessionServiceClient.getSessionCallable().futureCall(request);
+ * // Do something.
+ * Session response = future.get();
+ * }
+ * }
+ */
+ public final UnaryCallableSample 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 (SessionServiceClient sessionServiceClient = SessionServiceClient.create()) {
+ * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+ * for (Session element : sessionServiceClient.listSessions(parent).iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ * }
+ *
+ * @param parent Required. The resource name of the location to list sessions from. Format:
+ * `projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}`
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final ListSessionsPagedResponse listSessions(LocationName parent) {
+ ListSessionsRequest request =
+ ListSessionsRequest.newBuilder()
+ .setParent(parent == null ? null : parent.toString())
+ .build();
+ return listSessions(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Lists [Sessions][google.cloud.aiplatform.v1beta1.Session] in a given project and 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 (SessionServiceClient sessionServiceClient = SessionServiceClient.create()) {
+ * ReasoningEngineName parent =
+ * ReasoningEngineName.of("[PROJECT]", "[LOCATION]", "[REASONING_ENGINE]");
+ * for (Session element : sessionServiceClient.listSessions(parent).iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ * }
+ *
+ * @param parent Required. The resource name of the location to list sessions from. Format:
+ * `projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}`
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final ListSessionsPagedResponse listSessions(ReasoningEngineName parent) {
+ ListSessionsRequest request =
+ ListSessionsRequest.newBuilder()
+ .setParent(parent == null ? null : parent.toString())
+ .build();
+ return listSessions(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Lists [Sessions][google.cloud.aiplatform.v1beta1.Session] in a given project and 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 (SessionServiceClient sessionServiceClient = SessionServiceClient.create()) {
+ * String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
+ * for (Session element : sessionServiceClient.listSessions(parent).iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ * }
+ *
+ * @param parent Required. The resource name of the location to list sessions from. Format:
+ * `projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}`
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final ListSessionsPagedResponse listSessions(String parent) {
+ ListSessionsRequest request = ListSessionsRequest.newBuilder().setParent(parent).build();
+ return listSessions(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Lists [Sessions][google.cloud.aiplatform.v1beta1.Session] in a given project and 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 (SessionServiceClient sessionServiceClient = SessionServiceClient.create()) {
+ * ListSessionsRequest request =
+ * ListSessionsRequest.newBuilder()
+ * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+ * .setPageSize(883849137)
+ * .setPageToken("pageToken873572522")
+ * .setFilter("filter-1274492040")
+ * .setOrderBy("orderBy-1207110587")
+ * .build();
+ * for (Session element : sessionServiceClient.listSessions(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 ListSessionsPagedResponse listSessions(ListSessionsRequest request) {
+ return listSessionsPagedCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Lists [Sessions][google.cloud.aiplatform.v1beta1.Session] in a given project and 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 (SessionServiceClient sessionServiceClient = SessionServiceClient.create()) {
+ * ListSessionsRequest request =
+ * ListSessionsRequest.newBuilder()
+ * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+ * .setPageSize(883849137)
+ * .setPageToken("pageToken873572522")
+ * .setFilter("filter-1274492040")
+ * .setOrderBy("orderBy-1207110587")
+ * .build();
+ * ApiFuture future =
+ * sessionServiceClient.listSessionsPagedCallable().futureCall(request);
+ * // Do something.
+ * for (Session element : future.get().iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ * }
+ */
+ public final UnaryCallableSample 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 (SessionServiceClient sessionServiceClient = SessionServiceClient.create()) {
+ * ListSessionsRequest request =
+ * ListSessionsRequest.newBuilder()
+ * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+ * .setPageSize(883849137)
+ * .setPageToken("pageToken873572522")
+ * .setFilter("filter-1274492040")
+ * .setOrderBy("orderBy-1207110587")
+ * .build();
+ * while (true) {
+ * ListSessionsResponse response = sessionServiceClient.listSessionsCallable().call(request);
+ * for (Session element : response.getSessionsList()) {
+ * // doThingsWith(element);
+ * }
+ * String nextPageToken = response.getNextPageToken();
+ * if (!Strings.isNullOrEmpty(nextPageToken)) {
+ * request = request.toBuilder().setPageToken(nextPageToken).build();
+ * } else {
+ * break;
+ * }
+ * }
+ * }
+ * }
+ */
+ public final UnaryCallableSample 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 (SessionServiceClient sessionServiceClient = SessionServiceClient.create()) {
+ * Session session = Session.newBuilder().build();
+ * FieldMask updateMask = FieldMask.newBuilder().build();
+ * Session response = sessionServiceClient.updateSession(session, updateMask);
+ * }
+ * }
+ *
+ * @param session Required. The session to update. Format:
+ * `projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}/sessions/{session}`
+ * @param updateMask Optional. Field mask is used to control which fields get updated. If the mask
+ * is not present, all fields will be updated.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final Session updateSession(Session session, FieldMask updateMask) {
+ UpdateSessionRequest request =
+ UpdateSessionRequest.newBuilder().setSession(session).setUpdateMask(updateMask).build();
+ return updateSession(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Updates the specific [Session][google.cloud.aiplatform.v1beta1.Session].
+ *
+ * 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 (SessionServiceClient sessionServiceClient = SessionServiceClient.create()) {
+ * UpdateSessionRequest request =
+ * UpdateSessionRequest.newBuilder()
+ * .setSession(Session.newBuilder().build())
+ * .setUpdateMask(FieldMask.newBuilder().build())
+ * .build();
+ * Session response = sessionServiceClient.updateSession(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 Session updateSession(UpdateSessionRequest request) {
+ return updateSessionCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Updates the specific [Session][google.cloud.aiplatform.v1beta1.Session].
+ *
+ * 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 (SessionServiceClient sessionServiceClient = SessionServiceClient.create()) {
+ * UpdateSessionRequest request =
+ * UpdateSessionRequest.newBuilder()
+ * .setSession(Session.newBuilder().build())
+ * .setUpdateMask(FieldMask.newBuilder().build())
+ * .build();
+ * ApiFuture future = sessionServiceClient.updateSessionCallable().futureCall(request);
+ * // Do something.
+ * Session response = future.get();
+ * }
+ * }
+ */
+ public final UnaryCallableSample 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 (SessionServiceClient sessionServiceClient = SessionServiceClient.create()) {
+ * SessionName name =
+ * SessionName.ofProjectLocationSessionName("[PROJECT]", "[LOCATION]", "[SESSION]");
+ * sessionServiceClient.deleteSessionAsync(name).get();
+ * }
+ * }
+ *
+ * @param name Required. The resource name of the session. Format:
+ * `projects/{project}/locations/{location}/sessions/{session}` or
+ * `projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}/sessions/{session}`
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final OperationFutureSample 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 (SessionServiceClient sessionServiceClient = SessionServiceClient.create()) {
+ * String name =
+ * SessionName.ofProjectLocationSessionName("[PROJECT]", "[LOCATION]", "[SESSION]")
+ * .toString();
+ * sessionServiceClient.deleteSessionAsync(name).get();
+ * }
+ * }
+ *
+ * @param name Required. The resource name of the session. Format:
+ * `projects/{project}/locations/{location}/sessions/{session}` or
+ * `projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}/sessions/{session}`
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final OperationFutureSample 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 (SessionServiceClient sessionServiceClient = SessionServiceClient.create()) {
+ * DeleteSessionRequest request =
+ * DeleteSessionRequest.newBuilder()
+ * .setName(
+ * SessionName.ofProjectLocationSessionName("[PROJECT]", "[LOCATION]", "[SESSION]")
+ * .toString())
+ * .build();
+ * sessionServiceClient.deleteSessionAsync(request).get();
+ * }
+ * }
+ *
+ * @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 OperationFutureSample 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 (SessionServiceClient sessionServiceClient = SessionServiceClient.create()) {
+ * DeleteSessionRequest request =
+ * DeleteSessionRequest.newBuilder()
+ * .setName(
+ * SessionName.ofProjectLocationSessionName("[PROJECT]", "[LOCATION]", "[SESSION]")
+ * .toString())
+ * .build();
+ * OperationFuture future =
+ * sessionServiceClient.deleteSessionOperationCallable().futureCall(request);
+ * // Do something.
+ * future.get();
+ * }
+ * }
+ */
+ public final OperationCallableSample 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 (SessionServiceClient sessionServiceClient = SessionServiceClient.create()) {
+ * DeleteSessionRequest request =
+ * DeleteSessionRequest.newBuilder()
+ * .setName(
+ * SessionName.ofProjectLocationSessionName("[PROJECT]", "[LOCATION]", "[SESSION]")
+ * .toString())
+ * .build();
+ * ApiFuture future =
+ * sessionServiceClient.deleteSessionCallable().futureCall(request);
+ * // Do something.
+ * future.get();
+ * }
+ * }
+ */
+ public final UnaryCallableSample 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 (SessionServiceClient sessionServiceClient = SessionServiceClient.create()) {
+ * SessionName parent =
+ * SessionName.ofProjectLocationReasoningEngineSessionName(
+ * "[PROJECT]", "[LOCATION]", "[REASONING_ENGINE]", "[SESSION]");
+ * for (SessionEvent element : sessionServiceClient.listEvents(parent).iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ * }
+ *
+ * @param parent Required. The resource name of the session to list events from. Format:
+ * `projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}/sessions/{session}`
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final ListEventsPagedResponse listEvents(SessionName parent) {
+ ListEventsRequest request =
+ ListEventsRequest.newBuilder().setParent(parent == null ? null : parent.toString()).build();
+ return listEvents(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Lists [Events][google.cloud.aiplatform.v1beta1.Event] in a given session.
+ *
+ * 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 (SessionServiceClient sessionServiceClient = SessionServiceClient.create()) {
+ * String parent =
+ * SessionName.ofProjectLocationSessionName("[PROJECT]", "[LOCATION]", "[SESSION]")
+ * .toString();
+ * for (SessionEvent element : sessionServiceClient.listEvents(parent).iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ * }
+ *
+ * @param parent Required. The resource name of the session to list events from. Format:
+ * `projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}/sessions/{session}`
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final ListEventsPagedResponse listEvents(String parent) {
+ ListEventsRequest request = ListEventsRequest.newBuilder().setParent(parent).build();
+ return listEvents(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Lists [Events][google.cloud.aiplatform.v1beta1.Event] in a given session.
+ *
+ * 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 (SessionServiceClient sessionServiceClient = SessionServiceClient.create()) {
+ * ListEventsRequest request =
+ * ListEventsRequest.newBuilder()
+ * .setParent(
+ * SessionName.ofProjectLocationReasoningEngineSessionName(
+ * "[PROJECT]", "[LOCATION]", "[REASONING_ENGINE]", "[SESSION]")
+ * .toString())
+ * .setPageSize(883849137)
+ * .setPageToken("pageToken873572522")
+ * .build();
+ * for (SessionEvent element : sessionServiceClient.listEvents(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 ListEventsPagedResponse listEvents(ListEventsRequest request) {
+ return listEventsPagedCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Lists [Events][google.cloud.aiplatform.v1beta1.Event] in a given session.
+ *
+ * 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 (SessionServiceClient sessionServiceClient = SessionServiceClient.create()) {
+ * ListEventsRequest request =
+ * ListEventsRequest.newBuilder()
+ * .setParent(
+ * SessionName.ofProjectLocationReasoningEngineSessionName(
+ * "[PROJECT]", "[LOCATION]", "[REASONING_ENGINE]", "[SESSION]")
+ * .toString())
+ * .setPageSize(883849137)
+ * .setPageToken("pageToken873572522")
+ * .build();
+ * ApiFuture future =
+ * sessionServiceClient.listEventsPagedCallable().futureCall(request);
+ * // Do something.
+ * for (SessionEvent element : future.get().iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ * }
+ */
+ public final UnaryCallableSample 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 (SessionServiceClient sessionServiceClient = SessionServiceClient.create()) {
+ * ListEventsRequest request =
+ * ListEventsRequest.newBuilder()
+ * .setParent(
+ * SessionName.ofProjectLocationReasoningEngineSessionName(
+ * "[PROJECT]", "[LOCATION]", "[REASONING_ENGINE]", "[SESSION]")
+ * .toString())
+ * .setPageSize(883849137)
+ * .setPageToken("pageToken873572522")
+ * .build();
+ * while (true) {
+ * ListEventsResponse response = sessionServiceClient.listEventsCallable().call(request);
+ * for (SessionEvent element : response.getSessionEventsList()) {
+ * // doThingsWith(element);
+ * }
+ * String nextPageToken = response.getNextPageToken();
+ * if (!Strings.isNullOrEmpty(nextPageToken)) {
+ * request = request.toBuilder().setPageToken(nextPageToken).build();
+ * } else {
+ * break;
+ * }
+ * }
+ * }
+ * }
+ */
+ public final UnaryCallableSample 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 (SessionServiceClient sessionServiceClient = SessionServiceClient.create()) {
+ * SessionName name =
+ * SessionName.ofProjectLocationReasoningEngineSessionName(
+ * "[PROJECT]", "[LOCATION]", "[REASONING_ENGINE]", "[SESSION]");
+ * SessionEvent event = SessionEvent.newBuilder().build();
+ * AppendEventResponse response = sessionServiceClient.appendEvent(name, event);
+ * }
+ * }
+ *
+ * @param name Required. The resource name of the session to append event to. Format:
+ * `projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}/sessions/{session}`
+ * @param event Required. The event to append to the session.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final AppendEventResponse appendEvent(SessionName name, SessionEvent event) {
+ AppendEventRequest request =
+ AppendEventRequest.newBuilder()
+ .setName(name == null ? null : name.toString())
+ .setEvent(event)
+ .build();
+ return appendEvent(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Appends an event to a given session.
+ *
+ * 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 (SessionServiceClient sessionServiceClient = SessionServiceClient.create()) {
+ * String name =
+ * SessionName.ofProjectLocationSessionName("[PROJECT]", "[LOCATION]", "[SESSION]")
+ * .toString();
+ * SessionEvent event = SessionEvent.newBuilder().build();
+ * AppendEventResponse response = sessionServiceClient.appendEvent(name, event);
+ * }
+ * }
+ *
+ * @param name Required. The resource name of the session to append event to. Format:
+ * `projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}/sessions/{session}`
+ * @param event Required. The event to append to the session.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final AppendEventResponse appendEvent(String name, SessionEvent event) {
+ AppendEventRequest request =
+ AppendEventRequest.newBuilder().setName(name).setEvent(event).build();
+ return appendEvent(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Appends an event to a given session.
+ *
+ * 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 (SessionServiceClient sessionServiceClient = SessionServiceClient.create()) {
+ * AppendEventRequest request =
+ * AppendEventRequest.newBuilder()
+ * .setName(
+ * SessionName.ofProjectLocationReasoningEngineSessionName(
+ * "[PROJECT]", "[LOCATION]", "[REASONING_ENGINE]", "[SESSION]")
+ * .toString())
+ * .setEvent(SessionEvent.newBuilder().build())
+ * .build();
+ * AppendEventResponse response = sessionServiceClient.appendEvent(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 AppendEventResponse appendEvent(AppendEventRequest request) {
+ return appendEventCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Appends an event to a given session.
+ *
+ * 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 (SessionServiceClient sessionServiceClient = SessionServiceClient.create()) {
+ * AppendEventRequest request =
+ * AppendEventRequest.newBuilder()
+ * .setName(
+ * SessionName.ofProjectLocationReasoningEngineSessionName(
+ * "[PROJECT]", "[LOCATION]", "[REASONING_ENGINE]", "[SESSION]")
+ * .toString())
+ * .setEvent(SessionEvent.newBuilder().build())
+ * .build();
+ * ApiFuture future =
+ * sessionServiceClient.appendEventCallable().futureCall(request);
+ * // Do something.
+ * AppendEventResponse response = future.get();
+ * }
+ * }
+ */
+ public final UnaryCallableSample 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 (SessionServiceClient sessionServiceClient = SessionServiceClient.create()) {
+ * ListLocationsRequest request =
+ * ListLocationsRequest.newBuilder()
+ * .setName("name3373707")
+ * .setFilter("filter-1274492040")
+ * .setPageSize(883849137)
+ * .setPageToken("pageToken873572522")
+ * .build();
+ * for (Location element : sessionServiceClient.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 (SessionServiceClient sessionServiceClient = SessionServiceClient.create()) {
+ * ListLocationsRequest request =
+ * ListLocationsRequest.newBuilder()
+ * .setName("name3373707")
+ * .setFilter("filter-1274492040")
+ * .setPageSize(883849137)
+ * .setPageToken("pageToken873572522")
+ * .build();
+ * ApiFuture future =
+ * sessionServiceClient.listLocationsPagedCallable().futureCall(request);
+ * // Do something.
+ * for (Location element : future.get().iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ * }
+ */
+ public final UnaryCallableSample 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 (SessionServiceClient sessionServiceClient = SessionServiceClient.create()) {
+ * ListLocationsRequest request =
+ * ListLocationsRequest.newBuilder()
+ * .setName("name3373707")
+ * .setFilter("filter-1274492040")
+ * .setPageSize(883849137)
+ * .setPageToken("pageToken873572522")
+ * .build();
+ * while (true) {
+ * ListLocationsResponse response = sessionServiceClient.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 UnaryCallableSample 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 (SessionServiceClient sessionServiceClient = SessionServiceClient.create()) {
+ * GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
+ * Location response = sessionServiceClient.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 (SessionServiceClient sessionServiceClient = SessionServiceClient.create()) {
+ * GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
+ * ApiFuture future = sessionServiceClient.getLocationCallable().futureCall(request);
+ * // Do something.
+ * Location response = future.get();
+ * }
+ * }
+ */
+ public final UnaryCallableCan return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED`errors. + * + *
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 (SessionServiceClient sessionServiceClient = SessionServiceClient.create()) {
+ * SetIamPolicyRequest request =
+ * SetIamPolicyRequest.newBuilder()
+ * .setResource(
+ * EndpointName.ofProjectLocationEndpointName(
+ * "[PROJECT]", "[LOCATION]", "[ENDPOINT]")
+ * .toString())
+ * .setPolicy(Policy.newBuilder().build())
+ * .setUpdateMask(FieldMask.newBuilder().build())
+ * .build();
+ * Policy response = sessionServiceClient.setIamPolicy(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 Policy setIamPolicy(SetIamPolicyRequest request) {
+ return setIamPolicyCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Sets the access control policy on the specified resource. Replacesany existing policy.
+ *
+ * Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED`errors. + * + *
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 (SessionServiceClient sessionServiceClient = SessionServiceClient.create()) {
+ * SetIamPolicyRequest request =
+ * SetIamPolicyRequest.newBuilder()
+ * .setResource(
+ * EndpointName.ofProjectLocationEndpointName(
+ * "[PROJECT]", "[LOCATION]", "[ENDPOINT]")
+ * .toString())
+ * .setPolicy(Policy.newBuilder().build())
+ * .setUpdateMask(FieldMask.newBuilder().build())
+ * .build();
+ * ApiFuture future = sessionServiceClient.setIamPolicyCallable().futureCall(request);
+ * // Do something.
+ * Policy response = future.get();
+ * }
+ * }
+ */
+ public final UnaryCallableSample 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 (SessionServiceClient sessionServiceClient = SessionServiceClient.create()) {
+ * GetIamPolicyRequest request =
+ * GetIamPolicyRequest.newBuilder()
+ * .setResource(
+ * EndpointName.ofProjectLocationEndpointName(
+ * "[PROJECT]", "[LOCATION]", "[ENDPOINT]")
+ * .toString())
+ * .setOptions(GetPolicyOptions.newBuilder().build())
+ * .build();
+ * Policy response = sessionServiceClient.getIamPolicy(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 Policy getIamPolicy(GetIamPolicyRequest request) {
+ return getIamPolicyCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Gets the access control policy for a resource. Returns an empty policyif the resource exists
+ * and does not have a policy set.
+ *
+ * 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 (SessionServiceClient sessionServiceClient = SessionServiceClient.create()) {
+ * GetIamPolicyRequest request =
+ * GetIamPolicyRequest.newBuilder()
+ * .setResource(
+ * EndpointName.ofProjectLocationEndpointName(
+ * "[PROJECT]", "[LOCATION]", "[ENDPOINT]")
+ * .toString())
+ * .setOptions(GetPolicyOptions.newBuilder().build())
+ * .build();
+ * ApiFuture future = sessionServiceClient.getIamPolicyCallable().futureCall(request);
+ * // Do something.
+ * Policy response = future.get();
+ * }
+ * }
+ */
+ public final UnaryCallableNote: This operation is designed to be used for buildingpermission-aware UIs and + * command-line tools, not for authorizationchecking. This operation may "fail open" without + * warning. + * + *
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 (SessionServiceClient sessionServiceClient = SessionServiceClient.create()) {
+ * TestIamPermissionsRequest request =
+ * TestIamPermissionsRequest.newBuilder()
+ * .setResource(
+ * EndpointName.ofProjectLocationEndpointName(
+ * "[PROJECT]", "[LOCATION]", "[ENDPOINT]")
+ * .toString())
+ * .addAllPermissions(new ArrayList())
+ * .build();
+ * TestIamPermissionsResponse response = sessionServiceClient.testIamPermissions(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 TestIamPermissionsResponse testIamPermissions(TestIamPermissionsRequest request) {
+ return testIamPermissionsCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Returns permissions that a caller has on the specified resource. If theresource does not exist,
+ * this will return an empty set ofpermissions, not a `NOT_FOUND` error.
+ *
+ * Note: This operation is designed to be used for buildingpermission-aware UIs and + * command-line tools, not for authorizationchecking. This operation may "fail open" without + * warning. + * + *
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 (SessionServiceClient sessionServiceClient = SessionServiceClient.create()) {
+ * TestIamPermissionsRequest request =
+ * TestIamPermissionsRequest.newBuilder()
+ * .setResource(
+ * EndpointName.ofProjectLocationEndpointName(
+ * "[PROJECT]", "[LOCATION]", "[ENDPOINT]")
+ * .toString())
+ * .addAllPermissions(new ArrayList())
+ * .build();
+ * ApiFuture future =
+ * sessionServiceClient.testIamPermissionsCallable().futureCall(request);
+ * // Do something.
+ * TestIamPermissionsResponse response = future.get();
+ * }
+ * }
+ */
+ public final UnaryCallableThe 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 + * [RetrySettings](https://cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.retrying.RetrySettings) + * of getSession: + * + *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * SessionServiceSettings.Builder sessionServiceSettingsBuilder =
+ * SessionServiceSettings.newBuilder();
+ * sessionServiceSettingsBuilder
+ * .getSessionSettings()
+ * .setRetrySettings(
+ * sessionServiceSettingsBuilder
+ * .getSessionSettings()
+ * .getRetrySettings()
+ * .toBuilder()
+ * .setInitialRetryDelayDuration(Duration.ofSeconds(1))
+ * .setInitialRpcTimeoutDuration(Duration.ofSeconds(5))
+ * .setMaxAttempts(5)
+ * .setMaxRetryDelayDuration(Duration.ofSeconds(30))
+ * .setMaxRpcTimeoutDuration(Duration.ofSeconds(60))
+ * .setRetryDelayMultiplier(1.3)
+ * .setRpcTimeoutMultiplier(1.5)
+ * .setTotalTimeoutDuration(Duration.ofSeconds(300))
+ * .build());
+ * SessionServiceSettings sessionServiceSettings = sessionServiceSettingsBuilder.build();
+ * }
+ *
+ * Please refer to the [Client Side Retry
+ * Guide](https://github.com/googleapis/google-cloud-java/blob/main/docs/client_retries.md) for
+ * additional support in setting retries.
+ *
+ * To configure the RetrySettings of a Long Running Operation method, create an + * OperationTimedPollAlgorithm object and update the RPC's polling algorithm. For example, to + * configure the RetrySettings for createSession: + * + *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * SessionServiceSettings.Builder sessionServiceSettingsBuilder =
+ * SessionServiceSettings.newBuilder();
+ * TimedRetryAlgorithm timedRetryAlgorithm =
+ * OperationalTimedPollAlgorithm.create(
+ * RetrySettings.newBuilder()
+ * .setInitialRetryDelayDuration(Duration.ofMillis(500))
+ * .setRetryDelayMultiplier(1.5)
+ * .setMaxRetryDelayDuration(Duration.ofMillis(5000))
+ * .setTotalTimeoutDuration(Duration.ofHours(24))
+ * .build());
+ * sessionServiceSettingsBuilder
+ * .createClusterOperationSettings()
+ * .setPollingAlgorithm(timedRetryAlgorithm)
+ * .build();
+ * }
+ */
+@BetaApi
+@Generated("by gapic-generator-java")
+public class SessionServiceSettings extends ClientSettingsNote: This method does not support applying settings to streaming methods.
+ */
+ public Builder applyToAllUnaryMethods(
+ ApiFunction ======================= ExampleStoreServiceClient =======================
+ *
+ * Service Description: A service for managing and retrieving few-shot examples.
+ *
+ * Sample for ExampleStoreServiceClient:
+ *
+ * ======================= ExtensionExecutionServiceClient =======================
*
* Service Description: A service for Extension execution.
@@ -623,6 +641,25 @@
* }
* }
*
+ * ======================= SessionServiceClient =======================
+ *
+ * Service Description: The service that manages Vertex Session related resources.
+ *
+ * Sample for SessionServiceClient:
+ *
+ * ======================= SpecialistPoolServiceClient =======================
*
* Service Description: A service for creating and managing Customer SpecialistPools. When
diff --git a/java-aiplatform/google-cloud-aiplatform/src/main/java/com/google/cloud/aiplatform/v1beta1/stub/DatasetServiceStub.java b/java-aiplatform/google-cloud-aiplatform/src/main/java/com/google/cloud/aiplatform/v1beta1/stub/DatasetServiceStub.java
index b4f8d61f89c6..936b1b663b73 100644
--- a/java-aiplatform/google-cloud-aiplatform/src/main/java/com/google/cloud/aiplatform/v1beta1/stub/DatasetServiceStub.java
+++ b/java-aiplatform/google-cloud-aiplatform/src/main/java/com/google/cloud/aiplatform/v1beta1/stub/DatasetServiceStub.java
@@ -29,6 +29,12 @@
import com.google.api.gax.rpc.OperationCallable;
import com.google.api.gax.rpc.UnaryCallable;
import com.google.cloud.aiplatform.v1beta1.AnnotationSpec;
+import com.google.cloud.aiplatform.v1beta1.AssembleDataOperationMetadata;
+import com.google.cloud.aiplatform.v1beta1.AssembleDataRequest;
+import com.google.cloud.aiplatform.v1beta1.AssembleDataResponse;
+import com.google.cloud.aiplatform.v1beta1.AssessDataOperationMetadata;
+import com.google.cloud.aiplatform.v1beta1.AssessDataRequest;
+import com.google.cloud.aiplatform.v1beta1.AssessDataResponse;
import com.google.cloud.aiplatform.v1beta1.CreateDatasetOperationMetadata;
import com.google.cloud.aiplatform.v1beta1.CreateDatasetRequest;
import com.google.cloud.aiplatform.v1beta1.CreateDatasetVersionOperationMetadata;
@@ -244,6 +250,24 @@ public UnaryCallable This class is for advanced usage and reflects the underlying API directly.
+ */
+@BetaApi
+@Generated("by gapic-generator-java")
+public abstract class ExampleStoreServiceStub implements BackgroundResource {
+
+ public OperationsStub getOperationsStub() {
+ throw new UnsupportedOperationException("Not implemented: getOperationsStub()");
+ }
+
+ public OperationCallable<
+ CreateExampleStoreRequest, ExampleStore, CreateExampleStoreOperationMetadata>
+ createExampleStoreOperationCallable() {
+ throw new UnsupportedOperationException(
+ "Not implemented: createExampleStoreOperationCallable()");
+ }
+
+ public UnaryCallable 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
+ * [RetrySettings](https://cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.retrying.RetrySettings)
+ * of getExampleStore:
+ *
+ * To configure the RetrySettings of a Long Running Operation method, create an
+ * OperationTimedPollAlgorithm object and update the RPC's polling algorithm. For example, to
+ * configure the RetrySettings for createExampleStore:
+ *
+ * Note: This method does not support applying settings to streaming methods.
+ */
+ public Builder applyToAllUnaryMethods(
+ ApiFunction{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (ExampleStoreServiceClient exampleStoreServiceClient = ExampleStoreServiceClient.create()) {
+ * ExampleStoreName name = ExampleStoreName.of("[PROJECT]", "[LOCATION]", "[EXAMPLE_STORE]");
+ * ExampleStore response = exampleStoreServiceClient.getExampleStore(name);
+ * }
+ * }
+ *
* {@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (SessionServiceClient sessionServiceClient = SessionServiceClient.create()) {
+ * SessionName name =
+ * SessionName.ofProjectLocationSessionName("[PROJECT]", "[LOCATION]", "[SESSION]");
+ * Session response = sessionServiceClient.getSession(name);
+ * }
+ * }
+ *
*
+ *
+ *
+ * {@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * ExampleStoreServiceStubSettings.Builder exampleStoreServiceSettingsBuilder =
+ * ExampleStoreServiceStubSettings.newBuilder();
+ * exampleStoreServiceSettingsBuilder
+ * .getExampleStoreSettings()
+ * .setRetrySettings(
+ * exampleStoreServiceSettingsBuilder
+ * .getExampleStoreSettings()
+ * .getRetrySettings()
+ * .toBuilder()
+ * .setInitialRetryDelayDuration(Duration.ofSeconds(1))
+ * .setInitialRpcTimeoutDuration(Duration.ofSeconds(5))
+ * .setMaxAttempts(5)
+ * .setMaxRetryDelayDuration(Duration.ofSeconds(30))
+ * .setMaxRpcTimeoutDuration(Duration.ofSeconds(60))
+ * .setRetryDelayMultiplier(1.3)
+ * .setRpcTimeoutMultiplier(1.5)
+ * .setTotalTimeoutDuration(Duration.ofSeconds(300))
+ * .build());
+ * ExampleStoreServiceStubSettings exampleStoreServiceSettings =
+ * exampleStoreServiceSettingsBuilder.build();
+ * }
+ *
+ * Please refer to the [Client Side Retry
+ * Guide](https://github.com/googleapis/google-cloud-java/blob/main/docs/client_retries.md) for
+ * additional support in setting retries.
+ *
+ * {@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * ExampleStoreServiceStubSettings.Builder exampleStoreServiceSettingsBuilder =
+ * ExampleStoreServiceStubSettings.newBuilder();
+ * TimedRetryAlgorithm timedRetryAlgorithm =
+ * OperationalTimedPollAlgorithm.create(
+ * RetrySettings.newBuilder()
+ * .setInitialRetryDelayDuration(Duration.ofMillis(500))
+ * .setRetryDelayMultiplier(1.5)
+ * .setMaxRetryDelayDuration(Duration.ofMillis(5000))
+ * .setTotalTimeoutDuration(Duration.ofHours(24))
+ * .build());
+ * exampleStoreServiceSettingsBuilder
+ * .createClusterOperationSettings()
+ * .setPollingAlgorithm(timedRetryAlgorithm)
+ * .build();
+ * }
+ */
+@BetaApi
+@Generated("by gapic-generator-java")
+public class ExampleStoreServiceStubSettings extends StubSettings