Skip to content

Commit

Permalink
chore: Update generation configuration at Sat Sep 21 02:20:50 UTC 2024 (
Browse files Browse the repository at this point in the history
#11169)

* chore: Update generation configuration at Sat Sep 21 02:20:50 UTC 2024

* chore: generate libraries at Sat Sep 21 02:24:25 UTC 2024
  • Loading branch information
cloud-java-bot authored Sep 23, 2024
1 parent 85d5a1d commit 058e805
Show file tree
Hide file tree
Showing 67 changed files with 11,609 additions and 576 deletions.
2 changes: 1 addition & 1 deletion generation_config.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
gapic_generator_version: 2.45.0
googleapis_commitish: 07b069bfb0f49d0e95097ac1811c99fc7ad6d3f4
googleapis_commitish: a18d9b2c3563527b26c4b713469e795b92795271
libraries_bom_version: 26.47.0

# the libraries are ordered with respect to library name, which is
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,11 @@
import com.google.api.core.ApiFuture;
import com.google.api.core.ApiFutures;
import com.google.api.gax.core.BackgroundResource;
import com.google.api.gax.longrunning.OperationFuture;
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.OperationCallable;
import com.google.api.gax.rpc.PageContext;
import com.google.api.gax.rpc.UnaryCallable;
import com.google.cloud.aiplatform.v1.stub.GenAiTuningServiceStub;
Expand All @@ -36,6 +38,8 @@
import com.google.iam.v1.SetIamPolicyRequest;
import com.google.iam.v1.TestIamPermissionsRequest;
import com.google.iam.v1.TestIamPermissionsResponse;
import com.google.longrunning.Operation;
import com.google.longrunning.OperationsClient;
import com.google.protobuf.Empty;
import java.io.IOException;
import java.util.List;
Expand Down Expand Up @@ -151,6 +155,26 @@
* </td>
* </tr>
* <tr>
* <td><p> RebaseTunedModel</td>
* <td><p> Rebase a TunedModel. Creates a LongRunningOperation that takes a legacy Tuned GenAI model Reference and creates a TuningJob based on newly available model.</td>
* <td>
* <p>Request object method variants only take one parameter, a request object, which must be constructed before the call.</p>
* <ul>
* <li><p> rebaseTunedModelAsync(RebaseTunedModelRequest request)
* </ul>
* <p>Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.</p>
* <ul>
* <li><p> rebaseTunedModelAsync(LocationName parent, TunedModelRef tunedModelRef)
* <li><p> rebaseTunedModelAsync(String parent, TunedModelRef tunedModelRef)
* </ul>
* <p>Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.</p>
* <ul>
* <li><p> rebaseTunedModelOperationCallable()
* <li><p> rebaseTunedModelCallable()
* </ul>
* </td>
* </tr>
* <tr>
* <td><p> ListLocations</td>
* <td><p> Lists information about the supported locations for this service.</td>
* <td>
Expand Down Expand Up @@ -270,6 +294,7 @@
public class GenAiTuningServiceClient implements BackgroundResource {
private final GenAiTuningServiceSettings settings;
private final GenAiTuningServiceStub stub;
private final OperationsClient operationsClient;

/** Constructs an instance of GenAiTuningServiceClient with default settings. */
public static final GenAiTuningServiceClient create() throws IOException {
Expand Down Expand Up @@ -301,11 +326,13 @@ public static final GenAiTuningServiceClient create(GenAiTuningServiceStub stub)
protected GenAiTuningServiceClient(GenAiTuningServiceSettings settings) throws IOException {
this.settings = settings;
this.stub = ((GenAiTuningServiceStubSettings) settings.getStubSettings()).createStub();
this.operationsClient = OperationsClient.create(this.stub.getOperationsStub());
}

protected GenAiTuningServiceClient(GenAiTuningServiceStub stub) {
this.settings = null;
this.stub = stub;
this.operationsClient = OperationsClient.create(this.stub.getOperationsStub());
}

public final GenAiTuningServiceSettings getSettings() {
Expand All @@ -316,6 +343,14 @@ public GenAiTuningServiceStub 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 TuningJob. A created TuningJob right away will be attempted to be run.
Expand Down Expand Up @@ -856,6 +891,180 @@ public final UnaryCallable<CancelTuningJobRequest, Empty> cancelTuningJobCallabl
return stub.cancelTuningJobCallable();
}

// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Rebase a TunedModel. Creates a LongRunningOperation that takes a legacy Tuned GenAI model
* Reference and creates a TuningJob based on newly available model.
*
* <p>Sample code:
*
* <pre>{@code
* // This snippet has been automatically generated and should be regarded as a code template only.
* // It will require modifications to work:
* // - It may require correct/in-range values for request initialization.
* // - It may require specifying 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]");
* TunedModelRef tunedModelRef = TunedModelRef.newBuilder().build();
* TuningJob response =
* genAiTuningServiceClient.rebaseTunedModelAsync(parent, tunedModelRef).get();
* }
* }</pre>
*
* @param parent Required. The resource name of the Location into which to rebase the Model.
* Format: `projects/{project}/locations/{location}`
* @param tunedModelRef Required. TunedModel reference to retrieve the legacy model information.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
public final OperationFuture<TuningJob, RebaseTunedModelOperationMetadata> rebaseTunedModelAsync(
LocationName parent, TunedModelRef tunedModelRef) {
RebaseTunedModelRequest request =
RebaseTunedModelRequest.newBuilder()
.setParent(parent == null ? null : parent.toString())
.setTunedModelRef(tunedModelRef)
.build();
return rebaseTunedModelAsync(request);
}

// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Rebase a TunedModel. Creates a LongRunningOperation that takes a legacy Tuned GenAI model
* Reference and creates a TuningJob based on newly available model.
*
* <p>Sample code:
*
* <pre>{@code
* // This snippet has been automatically generated and should be regarded as a code template only.
* // It will require modifications to work:
* // - It may require correct/in-range values for request initialization.
* // - It may require specifying 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();
* TunedModelRef tunedModelRef = TunedModelRef.newBuilder().build();
* TuningJob response =
* genAiTuningServiceClient.rebaseTunedModelAsync(parent, tunedModelRef).get();
* }
* }</pre>
*
* @param parent Required. The resource name of the Location into which to rebase the Model.
* Format: `projects/{project}/locations/{location}`
* @param tunedModelRef Required. TunedModel reference to retrieve the legacy model information.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
public final OperationFuture<TuningJob, RebaseTunedModelOperationMetadata> rebaseTunedModelAsync(
String parent, TunedModelRef tunedModelRef) {
RebaseTunedModelRequest request =
RebaseTunedModelRequest.newBuilder()
.setParent(parent)
.setTunedModelRef(tunedModelRef)
.build();
return rebaseTunedModelAsync(request);
}

// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Rebase a TunedModel. Creates a LongRunningOperation that takes a legacy Tuned GenAI model
* Reference and creates a TuningJob based on newly available model.
*
* <p>Sample code:
*
* <pre>{@code
* // This snippet has been automatically generated and should be regarded as a code template only.
* // It will require modifications to work:
* // - It may require correct/in-range values for request initialization.
* // - It may require specifying 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()) {
* RebaseTunedModelRequest request =
* RebaseTunedModelRequest.newBuilder()
* .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
* .setTunedModelRef(TunedModelRef.newBuilder().build())
* .setTuningJob(TuningJob.newBuilder().build())
* .setArtifactDestination(GcsDestination.newBuilder().build())
* .setDeployToSameEndpoint(true)
* .build();
* TuningJob response = genAiTuningServiceClient.rebaseTunedModelAsync(request).get();
* }
* }</pre>
*
* @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<TuningJob, RebaseTunedModelOperationMetadata> rebaseTunedModelAsync(
RebaseTunedModelRequest request) {
return rebaseTunedModelOperationCallable().futureCall(request);
}

// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Rebase a TunedModel. Creates a LongRunningOperation that takes a legacy Tuned GenAI model
* Reference and creates a TuningJob based on newly available model.
*
* <p>Sample code:
*
* <pre>{@code
* // This snippet has been automatically generated and should be regarded as a code template only.
* // It will require modifications to work:
* // - It may require correct/in-range values for request initialization.
* // - It may require specifying 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()) {
* RebaseTunedModelRequest request =
* RebaseTunedModelRequest.newBuilder()
* .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
* .setTunedModelRef(TunedModelRef.newBuilder().build())
* .setTuningJob(TuningJob.newBuilder().build())
* .setArtifactDestination(GcsDestination.newBuilder().build())
* .setDeployToSameEndpoint(true)
* .build();
* OperationFuture<TuningJob, RebaseTunedModelOperationMetadata> future =
* genAiTuningServiceClient.rebaseTunedModelOperationCallable().futureCall(request);
* // Do something.
* TuningJob response = future.get();
* }
* }</pre>
*/
public final OperationCallable<
RebaseTunedModelRequest, TuningJob, RebaseTunedModelOperationMetadata>
rebaseTunedModelOperationCallable() {
return stub.rebaseTunedModelOperationCallable();
}

// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Rebase a TunedModel. Creates a LongRunningOperation that takes a legacy Tuned GenAI model
* Reference and creates a TuningJob based on newly available model.
*
* <p>Sample code:
*
* <pre>{@code
* // This snippet has been automatically generated and should be regarded as a code template only.
* // It will require modifications to work:
* // - It may require correct/in-range values for request initialization.
* // - It may require specifying 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()) {
* RebaseTunedModelRequest request =
* RebaseTunedModelRequest.newBuilder()
* .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
* .setTunedModelRef(TunedModelRef.newBuilder().build())
* .setTuningJob(TuningJob.newBuilder().build())
* .setArtifactDestination(GcsDestination.newBuilder().build())
* .setDeployToSameEndpoint(true)
* .build();
* ApiFuture<Operation> future =
* genAiTuningServiceClient.rebaseTunedModelCallable().futureCall(request);
* // Do something.
* Operation response = future.get();
* }
* }</pre>
*/
public final UnaryCallable<RebaseTunedModelRequest, Operation> rebaseTunedModelCallable() {
return stub.rebaseTunedModelCallable();
}

// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Lists information about the supported locations for this service.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
import com.google.api.gax.rpc.ApiClientHeaderProvider;
import com.google.api.gax.rpc.ClientContext;
import com.google.api.gax.rpc.ClientSettings;
import com.google.api.gax.rpc.OperationCallSettings;
import com.google.api.gax.rpc.PagedCallSettings;
import com.google.api.gax.rpc.TransportChannelProvider;
import com.google.api.gax.rpc.UnaryCallSettings;
Expand All @@ -39,6 +40,7 @@
import com.google.iam.v1.SetIamPolicyRequest;
import com.google.iam.v1.TestIamPermissionsRequest;
import com.google.iam.v1.TestIamPermissionsResponse;
import com.google.longrunning.Operation;
import com.google.protobuf.Empty;
import java.io.IOException;
import java.util.List;
Expand Down Expand Up @@ -94,6 +96,32 @@
* 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.
*
* <p>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 rebaseTunedModel:
*
* <pre>{@code
* // This snippet has been automatically generated and should be regarded as a code template only.
* // It will require modifications to work:
* // - It may require correct/in-range values for request initialization.
* // - It may require 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();
* TimedRetryAlgorithm timedRetryAlgorithm =
* OperationalTimedPollAlgorithm.create(
* RetrySettings.newBuilder()
* .setInitialRetryDelayDuration(Duration.ofMillis(500))
* .setRetryDelayMultiplier(1.5)
* .setMaxRetryDelay(Duration.ofMillis(5000))
* .setTotalTimeoutDuration(Duration.ofHours(24))
* .build());
* genAiTuningServiceSettingsBuilder
* .createClusterOperationSettings()
* .setPollingAlgorithm(timedRetryAlgorithm)
* .build();
* }</pre>
*/
@Generated("by gapic-generator-java")
public class GenAiTuningServiceSettings extends ClientSettings<GenAiTuningServiceSettings> {
Expand All @@ -120,6 +148,18 @@ public UnaryCallSettings<CancelTuningJobRequest, Empty> cancelTuningJobSettings(
return ((GenAiTuningServiceStubSettings) getStubSettings()).cancelTuningJobSettings();
}

/** Returns the object with the settings used for calls to rebaseTunedModel. */
public UnaryCallSettings<RebaseTunedModelRequest, Operation> rebaseTunedModelSettings() {
return ((GenAiTuningServiceStubSettings) getStubSettings()).rebaseTunedModelSettings();
}

/** Returns the object with the settings used for calls to rebaseTunedModel. */
public OperationCallSettings<
RebaseTunedModelRequest, TuningJob, RebaseTunedModelOperationMetadata>
rebaseTunedModelOperationSettings() {
return ((GenAiTuningServiceStubSettings) getStubSettings()).rebaseTunedModelOperationSettings();
}

/** Returns the object with the settings used for calls to listLocations. */
public PagedCallSettings<ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse>
listLocationsSettings() {
Expand Down Expand Up @@ -265,6 +305,19 @@ public UnaryCallSettings.Builder<CancelTuningJobRequest, Empty> cancelTuningJobS
return getStubSettingsBuilder().cancelTuningJobSettings();
}

/** Returns the builder for the settings used for calls to rebaseTunedModel. */
public UnaryCallSettings.Builder<RebaseTunedModelRequest, Operation>
rebaseTunedModelSettings() {
return getStubSettingsBuilder().rebaseTunedModelSettings();
}

/** Returns the builder for the settings used for calls to rebaseTunedModel. */
public OperationCallSettings.Builder<
RebaseTunedModelRequest, TuningJob, RebaseTunedModelOperationMetadata>
rebaseTunedModelOperationSettings() {
return getStubSettingsBuilder().rebaseTunedModelOperationSettings();
}

/** Returns the builder for the settings used for calls to listLocations. */
public PagedCallSettings.Builder<
ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -496,6 +496,9 @@
"ListTuningJobs": {
"methods": ["listTuningJobs", "listTuningJobs", "listTuningJobs", "listTuningJobsPagedCallable", "listTuningJobsCallable"]
},
"RebaseTunedModel": {
"methods": ["rebaseTunedModelAsync", "rebaseTunedModelAsync", "rebaseTunedModelAsync", "rebaseTunedModelOperationCallable", "rebaseTunedModelCallable"]
},
"SetIamPolicy": {
"methods": ["setIamPolicy", "setIamPolicyCallable"]
},
Expand Down
Loading

0 comments on commit 058e805

Please sign in to comment.