diff --git a/generation_config.yaml b/generation_config.yaml index 802c18fa4216..effd1ec861ce 100644 --- a/generation_config.yaml +++ b/generation_config.yaml @@ -1,6 +1,6 @@ gapic_generator_version: 2.40.0 protoc_version: '25.3' -googleapis_commitish: 25a1a57957d9e4bf431897d280b2569b26dc9165 +googleapis_commitish: 584e0dee558b4b19bdecf1f2bdd4ec151190e5a4 libraries_bom_version: 26.39.0 template_excludes: - .github/* diff --git a/java-aiplatform/google-cloud-aiplatform/src/main/java/com/google/cloud/aiplatform/v1beta1/GenAiTuningServiceClient.java b/java-aiplatform/google-cloud-aiplatform/src/main/java/com/google/cloud/aiplatform/v1beta1/GenAiTuningServiceClient.java new file mode 100644 index 000000000000..4325165ce5c5 --- /dev/null +++ b/java-aiplatform/google-cloud-aiplatform/src/main/java/com/google/cloud/aiplatform/v1beta1/GenAiTuningServiceClient.java @@ -0,0 +1,1414 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.aiplatform.v1beta1; + +import com.google.api.core.ApiFuture; +import com.google.api.core.ApiFutures; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.paging.AbstractFixedSizeCollection; +import com.google.api.gax.paging.AbstractPage; +import com.google.api.gax.paging.AbstractPagedListResponse; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.aiplatform.v1beta1.stub.GenAiTuningServiceStub; +import com.google.cloud.aiplatform.v1beta1.stub.GenAiTuningServiceStubSettings; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.common.util.concurrent.MoreExecutors; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.protobuf.Empty; +import java.io.IOException; +import java.util.List; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Service Description: A service for creating and managing GenAI Tuning Jobs. + * + *
This class provides the ability to make remote calls to the backing service through method + * calls that map to API methods. Sample code to get started: + * + *
{@code + * // This snippet has been automatically generated and should be regarded as a code template only. + * // It will require modifications to work: + * // - It may require correct/in-range values for request initialization. + * // - It may require specifying regional endpoints when creating the service client as shown in + * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + * try (GenAiTuningServiceClient genAiTuningServiceClient = GenAiTuningServiceClient.create()) { + * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + * TuningJob tuningJob = TuningJob.newBuilder().build(); + * TuningJob response = genAiTuningServiceClient.createTuningJob(parent, tuningJob); + * } + * }+ * + *
Note: close() needs to be called on the GenAiTuningServiceClient 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 | + *
---|---|---|
CreateTuningJob |
+ * Creates a TuningJob. A created TuningJob right away will be attempted to be run. |
+ *
+ * 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. + *
|
+ *
GetTuningJob |
+ * Gets a TuningJob. |
+ *
+ * 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. + *
|
+ *
ListTuningJobs |
+ * Lists TuningJobs 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. + *
|
+ *
CancelTuningJob |
+ * Cancels a TuningJob. Starts asynchronous cancellation on the TuningJob. The server makes a best effort to cancel the job, but success is not guaranteed. Clients can use [GenAiTuningService.GetTuningJob][google.cloud.aiplatform.v1beta1.GenAiTuningService.GetTuningJob] or other methods to check whether the cancellation succeeded or whether the job completed despite cancellation. On successful cancellation, the TuningJob is not deleted; instead it becomes a job with a [TuningJob.error][google.cloud.aiplatform.v1beta1.TuningJob.error] value with a [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to `Code.CANCELLED`, and [TuningJob.state][google.cloud.aiplatform.v1beta1.TuningJob.state] is set to `CANCELLED`. |
+ *
+ * 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 GenAiTuningServiceSettings 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 + * GenAiTuningServiceSettings genAiTuningServiceSettings = + * GenAiTuningServiceSettings.newBuilder() + * .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials)) + * .build(); + * GenAiTuningServiceClient genAiTuningServiceClient = + * GenAiTuningServiceClient.create(genAiTuningServiceSettings); + * }+ * + *
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 + * GenAiTuningServiceSettings genAiTuningServiceSettings = + * GenAiTuningServiceSettings.newBuilder().setEndpoint(myEndpoint).build(); + * GenAiTuningServiceClient genAiTuningServiceClient = + * GenAiTuningServiceClient.create(genAiTuningServiceSettings); + * }+ * + *
Please refer to the GitHub repository's samples for more quickstart code snippets. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class GenAiTuningServiceClient implements BackgroundResource { + private final GenAiTuningServiceSettings settings; + private final GenAiTuningServiceStub stub; + + /** Constructs an instance of GenAiTuningServiceClient with default settings. */ + public static final GenAiTuningServiceClient create() throws IOException { + return create(GenAiTuningServiceSettings.newBuilder().build()); + } + + /** + * Constructs an instance of GenAiTuningServiceClient, 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 GenAiTuningServiceClient create(GenAiTuningServiceSettings settings) + throws IOException { + return new GenAiTuningServiceClient(settings); + } + + /** + * Constructs an instance of GenAiTuningServiceClient, using the given stub for making calls. This + * is for advanced usage - prefer using create(GenAiTuningServiceSettings). + */ + public static final GenAiTuningServiceClient create(GenAiTuningServiceStub stub) { + return new GenAiTuningServiceClient(stub); + } + + /** + * Constructs an instance of GenAiTuningServiceClient, 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 GenAiTuningServiceClient(GenAiTuningServiceSettings settings) throws IOException { + this.settings = settings; + this.stub = ((GenAiTuningServiceStubSettings) settings.getStubSettings()).createStub(); + } + + protected GenAiTuningServiceClient(GenAiTuningServiceStub stub) { + this.settings = null; + this.stub = stub; + } + + public final GenAiTuningServiceSettings getSettings() { + return settings; + } + + public GenAiTuningServiceStub getStub() { + return stub; + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a TuningJob. A created TuningJob right away will be attempted to be run. + * + *
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 (GenAiTuningServiceClient genAiTuningServiceClient = GenAiTuningServiceClient.create()) { + * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + * TuningJob tuningJob = TuningJob.newBuilder().build(); + * TuningJob response = genAiTuningServiceClient.createTuningJob(parent, tuningJob); + * } + * }+ * + * @param parent Required. The resource name of the Location to create the TuningJob in. Format: + * `projects/{project}/locations/{location}` + * @param tuningJob Required. The TuningJob to create. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final TuningJob createTuningJob(LocationName parent, TuningJob tuningJob) { + CreateTuningJobRequest request = + CreateTuningJobRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .setTuningJob(tuningJob) + .build(); + return createTuningJob(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a TuningJob. A created TuningJob right away will be attempted to be run. + * + *
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 (GenAiTuningServiceClient genAiTuningServiceClient = GenAiTuningServiceClient.create()) { + * String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); + * TuningJob tuningJob = TuningJob.newBuilder().build(); + * TuningJob response = genAiTuningServiceClient.createTuningJob(parent, tuningJob); + * } + * }+ * + * @param parent Required. The resource name of the Location to create the TuningJob in. Format: + * `projects/{project}/locations/{location}` + * @param tuningJob Required. The TuningJob to create. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final TuningJob createTuningJob(String parent, TuningJob tuningJob) { + CreateTuningJobRequest request = + CreateTuningJobRequest.newBuilder().setParent(parent).setTuningJob(tuningJob).build(); + return createTuningJob(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a TuningJob. A created TuningJob right away will be attempted to be run. + * + *
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 (GenAiTuningServiceClient genAiTuningServiceClient = GenAiTuningServiceClient.create()) { + * CreateTuningJobRequest request = + * CreateTuningJobRequest.newBuilder() + * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + * .setTuningJob(TuningJob.newBuilder().build()) + * .build(); + * TuningJob response = genAiTuningServiceClient.createTuningJob(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 TuningJob createTuningJob(CreateTuningJobRequest request) { + return createTuningJobCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a TuningJob. A created TuningJob right away will be attempted to be run. + * + *
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 (GenAiTuningServiceClient genAiTuningServiceClient = GenAiTuningServiceClient.create()) { + * CreateTuningJobRequest request = + * CreateTuningJobRequest.newBuilder() + * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + * .setTuningJob(TuningJob.newBuilder().build()) + * .build(); + * ApiFuture+ */ + public final UnaryCallablefuture = + * genAiTuningServiceClient.createTuningJobCallable().futureCall(request); + * // Do something. + * TuningJob response = future.get(); + * } + * }
Sample code: + * + *
{@code + * // This snippet has been automatically generated and should be regarded as a code template only. + * // It will require modifications to work: + * // - It may require correct/in-range values for request initialization. + * // - It may require specifying regional endpoints when creating the service client as shown in + * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + * try (GenAiTuningServiceClient genAiTuningServiceClient = GenAiTuningServiceClient.create()) { + * TuningJobName name = TuningJobName.of("[PROJECT]", "[LOCATION]", "[TUNING_JOB]"); + * TuningJob response = genAiTuningServiceClient.getTuningJob(name); + * } + * }+ * + * @param name Required. The name of the TuningJob resource. Format: + * `projects/{project}/locations/{location}/tuningJobs/{tuning_job}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final TuningJob getTuningJob(TuningJobName name) { + GetTuningJobRequest request = + GetTuningJobRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return getTuningJob(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets a TuningJob. + * + *
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 (GenAiTuningServiceClient genAiTuningServiceClient = GenAiTuningServiceClient.create()) { + * String name = TuningJobName.of("[PROJECT]", "[LOCATION]", "[TUNING_JOB]").toString(); + * TuningJob response = genAiTuningServiceClient.getTuningJob(name); + * } + * }+ * + * @param name Required. The name of the TuningJob resource. Format: + * `projects/{project}/locations/{location}/tuningJobs/{tuning_job}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final TuningJob getTuningJob(String name) { + GetTuningJobRequest request = GetTuningJobRequest.newBuilder().setName(name).build(); + return getTuningJob(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets a TuningJob. + * + *
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 (GenAiTuningServiceClient genAiTuningServiceClient = GenAiTuningServiceClient.create()) { + * GetTuningJobRequest request = + * GetTuningJobRequest.newBuilder() + * .setName(TuningJobName.of("[PROJECT]", "[LOCATION]", "[TUNING_JOB]").toString()) + * .build(); + * TuningJob response = genAiTuningServiceClient.getTuningJob(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 TuningJob getTuningJob(GetTuningJobRequest request) { + return getTuningJobCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets a TuningJob. + * + *
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 (GenAiTuningServiceClient genAiTuningServiceClient = GenAiTuningServiceClient.create()) { + * GetTuningJobRequest request = + * GetTuningJobRequest.newBuilder() + * .setName(TuningJobName.of("[PROJECT]", "[LOCATION]", "[TUNING_JOB]").toString()) + * .build(); + * ApiFuture+ */ + public final UnaryCallablefuture = + * genAiTuningServiceClient.getTuningJobCallable().futureCall(request); + * // Do something. + * TuningJob response = future.get(); + * } + * }
Sample code: + * + *
{@code + * // This snippet has been automatically generated and should be regarded as a code template only. + * // It will require modifications to work: + * // - It may require correct/in-range values for request initialization. + * // - It may require specifying regional endpoints when creating the service client as shown in + * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + * try (GenAiTuningServiceClient genAiTuningServiceClient = GenAiTuningServiceClient.create()) { + * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + * for (TuningJob element : genAiTuningServiceClient.listTuningJobs(parent).iterateAll()) { + * // doThingsWith(element); + * } + * } + * }+ * + * @param parent Required. The resource name of the Location to list the TuningJobs from. Format: + * `projects/{project}/locations/{location}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListTuningJobsPagedResponse listTuningJobs(LocationName parent) { + ListTuningJobsRequest request = + ListTuningJobsRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .build(); + return listTuningJobs(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists TuningJobs in 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 (GenAiTuningServiceClient genAiTuningServiceClient = GenAiTuningServiceClient.create()) { + * String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); + * for (TuningJob element : genAiTuningServiceClient.listTuningJobs(parent).iterateAll()) { + * // doThingsWith(element); + * } + * } + * }+ * + * @param parent Required. The resource name of the Location to list the TuningJobs from. Format: + * `projects/{project}/locations/{location}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListTuningJobsPagedResponse listTuningJobs(String parent) { + ListTuningJobsRequest request = ListTuningJobsRequest.newBuilder().setParent(parent).build(); + return listTuningJobs(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists TuningJobs in 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 (GenAiTuningServiceClient genAiTuningServiceClient = GenAiTuningServiceClient.create()) { + * ListTuningJobsRequest request = + * ListTuningJobsRequest.newBuilder() + * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + * .setFilter("filter-1274492040") + * .setPageSize(883849137) + * .setPageToken("pageToken873572522") + * .build(); + * for (TuningJob element : genAiTuningServiceClient.listTuningJobs(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 ListTuningJobsPagedResponse listTuningJobs(ListTuningJobsRequest request) { + return listTuningJobsPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists TuningJobs in 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 (GenAiTuningServiceClient genAiTuningServiceClient = GenAiTuningServiceClient.create()) { + * ListTuningJobsRequest request = + * ListTuningJobsRequest.newBuilder() + * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + * .setFilter("filter-1274492040") + * .setPageSize(883849137) + * .setPageToken("pageToken873572522") + * .build(); + * ApiFuture+ */ + public final UnaryCallablefuture = + * genAiTuningServiceClient.listTuningJobsPagedCallable().futureCall(request); + * // Do something. + * for (TuningJob element : future.get().iterateAll()) { + * // doThingsWith(element); + * } + * } + * }
Sample code: + * + *
{@code + * // This snippet has been automatically generated and should be regarded as a code template only. + * // It will require modifications to work: + * // - It may require correct/in-range values for request initialization. + * // - It may require specifying regional endpoints when creating the service client as shown in + * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + * try (GenAiTuningServiceClient genAiTuningServiceClient = GenAiTuningServiceClient.create()) { + * ListTuningJobsRequest request = + * ListTuningJobsRequest.newBuilder() + * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + * .setFilter("filter-1274492040") + * .setPageSize(883849137) + * .setPageToken("pageToken873572522") + * .build(); + * while (true) { + * ListTuningJobsResponse response = + * genAiTuningServiceClient.listTuningJobsCallable().call(request); + * for (TuningJob element : response.getTuningJobsList()) { + * // doThingsWith(element); + * } + * String nextPageToken = response.getNextPageToken(); + * if (!Strings.isNullOrEmpty(nextPageToken)) { + * request = request.toBuilder().setPageToken(nextPageToken).build(); + * } else { + * break; + * } + * } + * } + * }+ */ + public final UnaryCallable
Sample code: + * + *
{@code + * // This snippet has been automatically generated and should be regarded as a code template only. + * // It will require modifications to work: + * // - It may require correct/in-range values for request initialization. + * // - It may require specifying regional endpoints when creating the service client as shown in + * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + * try (GenAiTuningServiceClient genAiTuningServiceClient = GenAiTuningServiceClient.create()) { + * TuningJobName name = TuningJobName.of("[PROJECT]", "[LOCATION]", "[TUNING_JOB]"); + * genAiTuningServiceClient.cancelTuningJob(name); + * } + * }+ * + * @param name Required. The name of the TuningJob to cancel. Format: + * `projects/{project}/locations/{location}/tuningJobs/{tuning_job}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void cancelTuningJob(TuningJobName name) { + CancelTuningJobRequest request = + CancelTuningJobRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + cancelTuningJob(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Cancels a TuningJob. Starts asynchronous cancellation on the TuningJob. The server makes a best + * effort to cancel the job, but success is not guaranteed. Clients can use + * [GenAiTuningService.GetTuningJob][google.cloud.aiplatform.v1beta1.GenAiTuningService.GetTuningJob] + * or other methods to check whether the cancellation succeeded or whether the job completed + * despite cancellation. On successful cancellation, the TuningJob is not deleted; instead it + * becomes a job with a [TuningJob.error][google.cloud.aiplatform.v1beta1.TuningJob.error] value + * with a [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to + * `Code.CANCELLED`, and [TuningJob.state][google.cloud.aiplatform.v1beta1.TuningJob.state] is set + * to `CANCELLED`. + * + *
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 (GenAiTuningServiceClient genAiTuningServiceClient = GenAiTuningServiceClient.create()) { + * String name = TuningJobName.of("[PROJECT]", "[LOCATION]", "[TUNING_JOB]").toString(); + * genAiTuningServiceClient.cancelTuningJob(name); + * } + * }+ * + * @param name Required. The name of the TuningJob to cancel. Format: + * `projects/{project}/locations/{location}/tuningJobs/{tuning_job}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void cancelTuningJob(String name) { + CancelTuningJobRequest request = CancelTuningJobRequest.newBuilder().setName(name).build(); + cancelTuningJob(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Cancels a TuningJob. Starts asynchronous cancellation on the TuningJob. The server makes a best + * effort to cancel the job, but success is not guaranteed. Clients can use + * [GenAiTuningService.GetTuningJob][google.cloud.aiplatform.v1beta1.GenAiTuningService.GetTuningJob] + * or other methods to check whether the cancellation succeeded or whether the job completed + * despite cancellation. On successful cancellation, the TuningJob is not deleted; instead it + * becomes a job with a [TuningJob.error][google.cloud.aiplatform.v1beta1.TuningJob.error] value + * with a [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to + * `Code.CANCELLED`, and [TuningJob.state][google.cloud.aiplatform.v1beta1.TuningJob.state] is set + * to `CANCELLED`. + * + *
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 (GenAiTuningServiceClient genAiTuningServiceClient = GenAiTuningServiceClient.create()) { + * CancelTuningJobRequest request = + * CancelTuningJobRequest.newBuilder() + * .setName(TuningJobName.of("[PROJECT]", "[LOCATION]", "[TUNING_JOB]").toString()) + * .build(); + * genAiTuningServiceClient.cancelTuningJob(request); + * } + * }+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void cancelTuningJob(CancelTuningJobRequest request) { + cancelTuningJobCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Cancels a TuningJob. Starts asynchronous cancellation on the TuningJob. The server makes a best + * effort to cancel the job, but success is not guaranteed. Clients can use + * [GenAiTuningService.GetTuningJob][google.cloud.aiplatform.v1beta1.GenAiTuningService.GetTuningJob] + * or other methods to check whether the cancellation succeeded or whether the job completed + * despite cancellation. On successful cancellation, the TuningJob is not deleted; instead it + * becomes a job with a [TuningJob.error][google.cloud.aiplatform.v1beta1.TuningJob.error] value + * with a [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to + * `Code.CANCELLED`, and [TuningJob.state][google.cloud.aiplatform.v1beta1.TuningJob.state] is set + * to `CANCELLED`. + * + *
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 (GenAiTuningServiceClient genAiTuningServiceClient = GenAiTuningServiceClient.create()) { + * CancelTuningJobRequest request = + * CancelTuningJobRequest.newBuilder() + * .setName(TuningJobName.of("[PROJECT]", "[LOCATION]", "[TUNING_JOB]").toString()) + * .build(); + * ApiFuture+ */ + public final UnaryCallablefuture = + * genAiTuningServiceClient.cancelTuningJobCallable().futureCall(request); + * // Do something. + * future.get(); + * } + * }
Sample code: + * + *
{@code + * // This snippet has been automatically generated and should be regarded as a code template only. + * // It will require modifications to work: + * // - It may require correct/in-range values for request initialization. + * // - It may require specifying regional endpoints when creating the service client as shown in + * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + * try (GenAiTuningServiceClient genAiTuningServiceClient = GenAiTuningServiceClient.create()) { + * ListLocationsRequest request = + * ListLocationsRequest.newBuilder() + * .setName("name3373707") + * .setFilter("filter-1274492040") + * .setPageSize(883849137) + * .setPageToken("pageToken873572522") + * .build(); + * for (Location element : genAiTuningServiceClient.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 (GenAiTuningServiceClient genAiTuningServiceClient = GenAiTuningServiceClient.create()) { + * ListLocationsRequest request = + * ListLocationsRequest.newBuilder() + * .setName("name3373707") + * .setFilter("filter-1274492040") + * .setPageSize(883849137) + * .setPageToken("pageToken873572522") + * .build(); + * ApiFuture+ */ + public final UnaryCallablefuture = + * genAiTuningServiceClient.listLocationsPagedCallable().futureCall(request); + * // Do something. + * for (Location element : future.get().iterateAll()) { + * // doThingsWith(element); + * } + * } + * }
Sample code: + * + *
{@code + * // This snippet has been automatically generated and should be regarded as a code template only. + * // It will require modifications to work: + * // - It may require correct/in-range values for request initialization. + * // - It may require specifying regional endpoints when creating the service client as shown in + * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + * try (GenAiTuningServiceClient genAiTuningServiceClient = GenAiTuningServiceClient.create()) { + * ListLocationsRequest request = + * ListLocationsRequest.newBuilder() + * .setName("name3373707") + * .setFilter("filter-1274492040") + * .setPageSize(883849137) + * .setPageToken("pageToken873572522") + * .build(); + * while (true) { + * ListLocationsResponse response = + * genAiTuningServiceClient.listLocationsCallable().call(request); + * for (Location element : response.getLocationsList()) { + * // doThingsWith(element); + * } + * String nextPageToken = response.getNextPageToken(); + * if (!Strings.isNullOrEmpty(nextPageToken)) { + * request = request.toBuilder().setPageToken(nextPageToken).build(); + * } else { + * break; + * } + * } + * } + * }+ */ + public final UnaryCallable
Sample code: + * + *
{@code + * // This snippet has been automatically generated and should be regarded as a code template only. + * // It will require modifications to work: + * // - It may require correct/in-range values for request initialization. + * // - It may require specifying regional endpoints when creating the service client as shown in + * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + * try (GenAiTuningServiceClient genAiTuningServiceClient = GenAiTuningServiceClient.create()) { + * GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build(); + * Location response = genAiTuningServiceClient.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 (GenAiTuningServiceClient genAiTuningServiceClient = GenAiTuningServiceClient.create()) { + * GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build(); + * ApiFuture+ */ + public final UnaryCallablefuture = + * genAiTuningServiceClient.getLocationCallable().futureCall(request); + * // Do something. + * Location response = future.get(); + * } + * }
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 (GenAiTuningServiceClient genAiTuningServiceClient = GenAiTuningServiceClient.create()) { + * SetIamPolicyRequest request = + * SetIamPolicyRequest.newBuilder() + * .setResource( + * EndpointName.ofProjectLocationEndpointName( + * "[PROJECT]", "[LOCATION]", "[ENDPOINT]") + * .toString()) + * .setPolicy(Policy.newBuilder().build()) + * .setUpdateMask(FieldMask.newBuilder().build()) + * .build(); + * Policy response = genAiTuningServiceClient.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 (GenAiTuningServiceClient genAiTuningServiceClient = GenAiTuningServiceClient.create()) { + * SetIamPolicyRequest request = + * SetIamPolicyRequest.newBuilder() + * .setResource( + * EndpointName.ofProjectLocationEndpointName( + * "[PROJECT]", "[LOCATION]", "[ENDPOINT]") + * .toString()) + * .setPolicy(Policy.newBuilder().build()) + * .setUpdateMask(FieldMask.newBuilder().build()) + * .build(); + * ApiFuture+ */ + public final UnaryCallablefuture = + * genAiTuningServiceClient.setIamPolicyCallable().futureCall(request); + * // Do something. + * Policy response = future.get(); + * } + * }
Sample code: + * + *
{@code + * // This snippet has been automatically generated and should be regarded as a code template only. + * // It will require modifications to work: + * // - It may require correct/in-range values for request initialization. + * // - It may require specifying regional endpoints when creating the service client as shown in + * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + * try (GenAiTuningServiceClient genAiTuningServiceClient = GenAiTuningServiceClient.create()) { + * GetIamPolicyRequest request = + * GetIamPolicyRequest.newBuilder() + * .setResource( + * EndpointName.ofProjectLocationEndpointName( + * "[PROJECT]", "[LOCATION]", "[ENDPOINT]") + * .toString()) + * .setOptions(GetPolicyOptions.newBuilder().build()) + * .build(); + * Policy response = genAiTuningServiceClient.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 (GenAiTuningServiceClient genAiTuningServiceClient = GenAiTuningServiceClient.create()) { + * GetIamPolicyRequest request = + * GetIamPolicyRequest.newBuilder() + * .setResource( + * EndpointName.ofProjectLocationEndpointName( + * "[PROJECT]", "[LOCATION]", "[ENDPOINT]") + * .toString()) + * .setOptions(GetPolicyOptions.newBuilder().build()) + * .build(); + * ApiFuture+ */ + public final UnaryCallablefuture = + * genAiTuningServiceClient.getIamPolicyCallable().futureCall(request); + * // Do something. + * Policy response = future.get(); + * } + * }
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 (GenAiTuningServiceClient genAiTuningServiceClient = GenAiTuningServiceClient.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. + * + *()) + * .build(); + * TestIamPermissionsResponse response = genAiTuningServiceClient.testIamPermissions(request); + * } + * }
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 (GenAiTuningServiceClient genAiTuningServiceClient = GenAiTuningServiceClient.create()) { + * TestIamPermissionsRequest request = + * TestIamPermissionsRequest.newBuilder() + * .setResource( + * EndpointName.ofProjectLocationEndpointName( + * "[PROJECT]", "[LOCATION]", "[ENDPOINT]") + * .toString()) + * .addAllPermissions(new ArrayList+ */ + public final UnaryCallable()) + * .build(); + * ApiFuture future = + * genAiTuningServiceClient.testIamPermissionsCallable().futureCall(request); + * // Do something. + * TestIamPermissionsResponse response = future.get(); + * } + * }
The default instance has everything set to sensible defaults: + * + *
The builder of this class is recursive, so contained classes are themselves builders. When + * build() is called, the tree of builders is called to create the complete settings object. + * + *
For example, to set the total timeout of createTuningJob to 30 seconds: + * + *
{@code + * // This snippet has been automatically generated and should be regarded as a code template only. + * // It will require modifications to work: + * // - It may require correct/in-range values for request initialization. + * // - It may require specifying regional endpoints when creating the service client as shown in + * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + * GenAiTuningServiceSettings.Builder genAiTuningServiceSettingsBuilder = + * GenAiTuningServiceSettings.newBuilder(); + * genAiTuningServiceSettingsBuilder + * .createTuningJobSettings() + * .setRetrySettings( + * genAiTuningServiceSettingsBuilder + * .createTuningJobSettings() + * .getRetrySettings() + * .toBuilder() + * .setTotalTimeout(Duration.ofSeconds(30)) + * .build()); + * GenAiTuningServiceSettings genAiTuningServiceSettings = + * genAiTuningServiceSettingsBuilder.build(); + * }+ */ +@BetaApi +@Generated("by gapic-generator-java") +public class GenAiTuningServiceSettings extends ClientSettings
Note: This method does not support applying settings to streaming methods.
+ */
+ public Builder applyToAllUnaryMethods(
+ ApiFunction ======================= GenAiTuningServiceClient =======================
+ *
+ * Service Description: A service for creating and managing GenAI Tuning Jobs.
+ *
+ * Sample for GenAiTuningServiceClient:
+ *
+ * ======================= IndexEndpointServiceClient =======================
*
* Service Description: A service for managing Vertex AI's IndexEndpoints.
diff --git a/java-aiplatform/google-cloud-aiplatform/src/main/java/com/google/cloud/aiplatform/v1beta1/stub/GenAiTuningServiceStub.java b/java-aiplatform/google-cloud-aiplatform/src/main/java/com/google/cloud/aiplatform/v1beta1/stub/GenAiTuningServiceStub.java
new file mode 100644
index 000000000000..ac9737507858
--- /dev/null
+++ b/java-aiplatform/google-cloud-aiplatform/src/main/java/com/google/cloud/aiplatform/v1beta1/stub/GenAiTuningServiceStub.java
@@ -0,0 +1,102 @@
+/*
+ * Copyright 2024 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.google.cloud.aiplatform.v1beta1.stub;
+
+import static com.google.cloud.aiplatform.v1beta1.GenAiTuningServiceClient.ListLocationsPagedResponse;
+import static com.google.cloud.aiplatform.v1beta1.GenAiTuningServiceClient.ListTuningJobsPagedResponse;
+
+import com.google.api.core.BetaApi;
+import com.google.api.gax.core.BackgroundResource;
+import com.google.api.gax.rpc.UnaryCallable;
+import com.google.cloud.aiplatform.v1beta1.CancelTuningJobRequest;
+import com.google.cloud.aiplatform.v1beta1.CreateTuningJobRequest;
+import com.google.cloud.aiplatform.v1beta1.GetTuningJobRequest;
+import com.google.cloud.aiplatform.v1beta1.ListTuningJobsRequest;
+import com.google.cloud.aiplatform.v1beta1.ListTuningJobsResponse;
+import com.google.cloud.aiplatform.v1beta1.TuningJob;
+import com.google.cloud.location.GetLocationRequest;
+import com.google.cloud.location.ListLocationsRequest;
+import com.google.cloud.location.ListLocationsResponse;
+import com.google.cloud.location.Location;
+import com.google.iam.v1.GetIamPolicyRequest;
+import com.google.iam.v1.Policy;
+import com.google.iam.v1.SetIamPolicyRequest;
+import com.google.iam.v1.TestIamPermissionsRequest;
+import com.google.iam.v1.TestIamPermissionsResponse;
+import com.google.protobuf.Empty;
+import javax.annotation.Generated;
+
+// AUTO-GENERATED DOCUMENTATION AND CLASS.
+/**
+ * Base stub class for the GenAiTuningService service API.
+ *
+ * This class is for advanced usage and reflects the underlying API directly.
+ */
+@BetaApi
+@Generated("by gapic-generator-java")
+public abstract class GenAiTuningServiceStub implements BackgroundResource {
+
+ 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 total timeout of createTuningJob to 30 seconds:
+ *
+ * Note: This method does not support applying settings to streaming methods.
+ */
+ public Builder applyToAllUnaryMethods(
+ ApiFunction This class is for advanced usage.
+ */
+@BetaApi
+@Generated("by gapic-generator-java")
+public class GrpcGenAiTuningServiceCallableFactory implements GrpcStubCallableFactory {
+
+ @Override
+ public This class is for advanced usage and reflects the underlying API directly.
+ */
+@BetaApi
+@Generated("by gapic-generator-java")
+public class GrpcGenAiTuningServiceStub extends GenAiTuningServiceStub {
+ private static final MethodDescriptor{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (GenAiTuningServiceClient genAiTuningServiceClient = GenAiTuningServiceClient.create()) {
+ * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+ * TuningJob tuningJob = TuningJob.newBuilder().build();
+ * TuningJob response = genAiTuningServiceClient.createTuningJob(parent, tuningJob);
+ * }
+ * }
+ *
*
+ *
+ *
+ * {@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * GenAiTuningServiceStubSettings.Builder genAiTuningServiceSettingsBuilder =
+ * GenAiTuningServiceStubSettings.newBuilder();
+ * genAiTuningServiceSettingsBuilder
+ * .createTuningJobSettings()
+ * .setRetrySettings(
+ * genAiTuningServiceSettingsBuilder
+ * .createTuningJobSettings()
+ * .getRetrySettings()
+ * .toBuilder()
+ * .setTotalTimeout(Duration.ofSeconds(30))
+ * .build());
+ * GenAiTuningServiceStubSettings genAiTuningServiceSettings =
+ * genAiTuningServiceSettingsBuilder.build();
+ * }
+ */
+@BetaApi
+@Generated("by gapic-generator-java")
+public class GenAiTuningServiceStubSettings extends StubSettings