Skip to content

Commit 058e805

Browse files
chore: Update generation configuration at Sat Sep 21 02:20:50 UTC 2024 (#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
1 parent 85d5a1d commit 058e805

File tree

67 files changed

+11609
-576
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

67 files changed

+11609
-576
lines changed

generation_config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
gapic_generator_version: 2.45.0
2-
googleapis_commitish: 07b069bfb0f49d0e95097ac1811c99fc7ad6d3f4
2+
googleapis_commitish: a18d9b2c3563527b26c4b713469e795b92795271
33
libraries_bom_version: 26.47.0
44

55
# the libraries are ordered with respect to library name, which is

java-aiplatform/google-cloud-aiplatform/src/main/java/com/google/cloud/aiplatform/v1/GenAiTuningServiceClient.java

Lines changed: 209 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,11 @@
1919
import com.google.api.core.ApiFuture;
2020
import com.google.api.core.ApiFutures;
2121
import com.google.api.gax.core.BackgroundResource;
22+
import com.google.api.gax.longrunning.OperationFuture;
2223
import com.google.api.gax.paging.AbstractFixedSizeCollection;
2324
import com.google.api.gax.paging.AbstractPage;
2425
import com.google.api.gax.paging.AbstractPagedListResponse;
26+
import com.google.api.gax.rpc.OperationCallable;
2527
import com.google.api.gax.rpc.PageContext;
2628
import com.google.api.gax.rpc.UnaryCallable;
2729
import com.google.cloud.aiplatform.v1.stub.GenAiTuningServiceStub;
@@ -36,6 +38,8 @@
3638
import com.google.iam.v1.SetIamPolicyRequest;
3739
import com.google.iam.v1.TestIamPermissionsRequest;
3840
import com.google.iam.v1.TestIamPermissionsResponse;
41+
import com.google.longrunning.Operation;
42+
import com.google.longrunning.OperationsClient;
3943
import com.google.protobuf.Empty;
4044
import java.io.IOException;
4145
import java.util.List;
@@ -151,6 +155,26 @@
151155
* </td>
152156
* </tr>
153157
* <tr>
158+
* <td><p> RebaseTunedModel</td>
159+
* <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>
160+
* <td>
161+
* <p>Request object method variants only take one parameter, a request object, which must be constructed before the call.</p>
162+
* <ul>
163+
* <li><p> rebaseTunedModelAsync(RebaseTunedModelRequest request)
164+
* </ul>
165+
* <p>Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.</p>
166+
* <ul>
167+
* <li><p> rebaseTunedModelAsync(LocationName parent, TunedModelRef tunedModelRef)
168+
* <li><p> rebaseTunedModelAsync(String parent, TunedModelRef tunedModelRef)
169+
* </ul>
170+
* <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>
171+
* <ul>
172+
* <li><p> rebaseTunedModelOperationCallable()
173+
* <li><p> rebaseTunedModelCallable()
174+
* </ul>
175+
* </td>
176+
* </tr>
177+
* <tr>
154178
* <td><p> ListLocations</td>
155179
* <td><p> Lists information about the supported locations for this service.</td>
156180
* <td>
@@ -270,6 +294,7 @@
270294
public class GenAiTuningServiceClient implements BackgroundResource {
271295
private final GenAiTuningServiceSettings settings;
272296
private final GenAiTuningServiceStub stub;
297+
private final OperationsClient operationsClient;
273298

274299
/** Constructs an instance of GenAiTuningServiceClient with default settings. */
275300
public static final GenAiTuningServiceClient create() throws IOException {
@@ -301,11 +326,13 @@ public static final GenAiTuningServiceClient create(GenAiTuningServiceStub stub)
301326
protected GenAiTuningServiceClient(GenAiTuningServiceSettings settings) throws IOException {
302327
this.settings = settings;
303328
this.stub = ((GenAiTuningServiceStubSettings) settings.getStubSettings()).createStub();
329+
this.operationsClient = OperationsClient.create(this.stub.getOperationsStub());
304330
}
305331

306332
protected GenAiTuningServiceClient(GenAiTuningServiceStub stub) {
307333
this.settings = null;
308334
this.stub = stub;
335+
this.operationsClient = OperationsClient.create(this.stub.getOperationsStub());
309336
}
310337

311338
public final GenAiTuningServiceSettings getSettings() {
@@ -316,6 +343,14 @@ public GenAiTuningServiceStub getStub() {
316343
return stub;
317344
}
318345

346+
/**
347+
* Returns the OperationsClient that can be used to query the status of a long-running operation
348+
* returned by another API method call.
349+
*/
350+
public final OperationsClient getOperationsClient() {
351+
return operationsClient;
352+
}
353+
319354
// AUTO-GENERATED DOCUMENTATION AND METHOD.
320355
/**
321356
* Creates a TuningJob. A created TuningJob right away will be attempted to be run.
@@ -856,6 +891,180 @@ public final UnaryCallable<CancelTuningJobRequest, Empty> cancelTuningJobCallabl
856891
return stub.cancelTuningJobCallable();
857892
}
858893

894+
// AUTO-GENERATED DOCUMENTATION AND METHOD.
895+
/**
896+
* Rebase a TunedModel. Creates a LongRunningOperation that takes a legacy Tuned GenAI model
897+
* Reference and creates a TuningJob based on newly available model.
898+
*
899+
* <p>Sample code:
900+
*
901+
* <pre>{@code
902+
* // This snippet has been automatically generated and should be regarded as a code template only.
903+
* // It will require modifications to work:
904+
* // - It may require correct/in-range values for request initialization.
905+
* // - It may require specifying regional endpoints when creating the service client as shown in
906+
* // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
907+
* try (GenAiTuningServiceClient genAiTuningServiceClient = GenAiTuningServiceClient.create()) {
908+
* LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
909+
* TunedModelRef tunedModelRef = TunedModelRef.newBuilder().build();
910+
* TuningJob response =
911+
* genAiTuningServiceClient.rebaseTunedModelAsync(parent, tunedModelRef).get();
912+
* }
913+
* }</pre>
914+
*
915+
* @param parent Required. The resource name of the Location into which to rebase the Model.
916+
* Format: `projects/{project}/locations/{location}`
917+
* @param tunedModelRef Required. TunedModel reference to retrieve the legacy model information.
918+
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
919+
*/
920+
public final OperationFuture<TuningJob, RebaseTunedModelOperationMetadata> rebaseTunedModelAsync(
921+
LocationName parent, TunedModelRef tunedModelRef) {
922+
RebaseTunedModelRequest request =
923+
RebaseTunedModelRequest.newBuilder()
924+
.setParent(parent == null ? null : parent.toString())
925+
.setTunedModelRef(tunedModelRef)
926+
.build();
927+
return rebaseTunedModelAsync(request);
928+
}
929+
930+
// AUTO-GENERATED DOCUMENTATION AND METHOD.
931+
/**
932+
* Rebase a TunedModel. Creates a LongRunningOperation that takes a legacy Tuned GenAI model
933+
* Reference and creates a TuningJob based on newly available model.
934+
*
935+
* <p>Sample code:
936+
*
937+
* <pre>{@code
938+
* // This snippet has been automatically generated and should be regarded as a code template only.
939+
* // It will require modifications to work:
940+
* // - It may require correct/in-range values for request initialization.
941+
* // - It may require specifying regional endpoints when creating the service client as shown in
942+
* // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
943+
* try (GenAiTuningServiceClient genAiTuningServiceClient = GenAiTuningServiceClient.create()) {
944+
* String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
945+
* TunedModelRef tunedModelRef = TunedModelRef.newBuilder().build();
946+
* TuningJob response =
947+
* genAiTuningServiceClient.rebaseTunedModelAsync(parent, tunedModelRef).get();
948+
* }
949+
* }</pre>
950+
*
951+
* @param parent Required. The resource name of the Location into which to rebase the Model.
952+
* Format: `projects/{project}/locations/{location}`
953+
* @param tunedModelRef Required. TunedModel reference to retrieve the legacy model information.
954+
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
955+
*/
956+
public final OperationFuture<TuningJob, RebaseTunedModelOperationMetadata> rebaseTunedModelAsync(
957+
String parent, TunedModelRef tunedModelRef) {
958+
RebaseTunedModelRequest request =
959+
RebaseTunedModelRequest.newBuilder()
960+
.setParent(parent)
961+
.setTunedModelRef(tunedModelRef)
962+
.build();
963+
return rebaseTunedModelAsync(request);
964+
}
965+
966+
// AUTO-GENERATED DOCUMENTATION AND METHOD.
967+
/**
968+
* Rebase a TunedModel. Creates a LongRunningOperation that takes a legacy Tuned GenAI model
969+
* Reference and creates a TuningJob based on newly available model.
970+
*
971+
* <p>Sample code:
972+
*
973+
* <pre>{@code
974+
* // This snippet has been automatically generated and should be regarded as a code template only.
975+
* // It will require modifications to work:
976+
* // - It may require correct/in-range values for request initialization.
977+
* // - It may require specifying regional endpoints when creating the service client as shown in
978+
* // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
979+
* try (GenAiTuningServiceClient genAiTuningServiceClient = GenAiTuningServiceClient.create()) {
980+
* RebaseTunedModelRequest request =
981+
* RebaseTunedModelRequest.newBuilder()
982+
* .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
983+
* .setTunedModelRef(TunedModelRef.newBuilder().build())
984+
* .setTuningJob(TuningJob.newBuilder().build())
985+
* .setArtifactDestination(GcsDestination.newBuilder().build())
986+
* .setDeployToSameEndpoint(true)
987+
* .build();
988+
* TuningJob response = genAiTuningServiceClient.rebaseTunedModelAsync(request).get();
989+
* }
990+
* }</pre>
991+
*
992+
* @param request The request object containing all of the parameters for the API call.
993+
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
994+
*/
995+
public final OperationFuture<TuningJob, RebaseTunedModelOperationMetadata> rebaseTunedModelAsync(
996+
RebaseTunedModelRequest request) {
997+
return rebaseTunedModelOperationCallable().futureCall(request);
998+
}
999+
1000+
// AUTO-GENERATED DOCUMENTATION AND METHOD.
1001+
/**
1002+
* Rebase a TunedModel. Creates a LongRunningOperation that takes a legacy Tuned GenAI model
1003+
* Reference and creates a TuningJob based on newly available model.
1004+
*
1005+
* <p>Sample code:
1006+
*
1007+
* <pre>{@code
1008+
* // This snippet has been automatically generated and should be regarded as a code template only.
1009+
* // It will require modifications to work:
1010+
* // - It may require correct/in-range values for request initialization.
1011+
* // - It may require specifying regional endpoints when creating the service client as shown in
1012+
* // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
1013+
* try (GenAiTuningServiceClient genAiTuningServiceClient = GenAiTuningServiceClient.create()) {
1014+
* RebaseTunedModelRequest request =
1015+
* RebaseTunedModelRequest.newBuilder()
1016+
* .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
1017+
* .setTunedModelRef(TunedModelRef.newBuilder().build())
1018+
* .setTuningJob(TuningJob.newBuilder().build())
1019+
* .setArtifactDestination(GcsDestination.newBuilder().build())
1020+
* .setDeployToSameEndpoint(true)
1021+
* .build();
1022+
* OperationFuture<TuningJob, RebaseTunedModelOperationMetadata> future =
1023+
* genAiTuningServiceClient.rebaseTunedModelOperationCallable().futureCall(request);
1024+
* // Do something.
1025+
* TuningJob response = future.get();
1026+
* }
1027+
* }</pre>
1028+
*/
1029+
public final OperationCallable<
1030+
RebaseTunedModelRequest, TuningJob, RebaseTunedModelOperationMetadata>
1031+
rebaseTunedModelOperationCallable() {
1032+
return stub.rebaseTunedModelOperationCallable();
1033+
}
1034+
1035+
// AUTO-GENERATED DOCUMENTATION AND METHOD.
1036+
/**
1037+
* Rebase a TunedModel. Creates a LongRunningOperation that takes a legacy Tuned GenAI model
1038+
* Reference and creates a TuningJob based on newly available model.
1039+
*
1040+
* <p>Sample code:
1041+
*
1042+
* <pre>{@code
1043+
* // This snippet has been automatically generated and should be regarded as a code template only.
1044+
* // It will require modifications to work:
1045+
* // - It may require correct/in-range values for request initialization.
1046+
* // - It may require specifying regional endpoints when creating the service client as shown in
1047+
* // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
1048+
* try (GenAiTuningServiceClient genAiTuningServiceClient = GenAiTuningServiceClient.create()) {
1049+
* RebaseTunedModelRequest request =
1050+
* RebaseTunedModelRequest.newBuilder()
1051+
* .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
1052+
* .setTunedModelRef(TunedModelRef.newBuilder().build())
1053+
* .setTuningJob(TuningJob.newBuilder().build())
1054+
* .setArtifactDestination(GcsDestination.newBuilder().build())
1055+
* .setDeployToSameEndpoint(true)
1056+
* .build();
1057+
* ApiFuture<Operation> future =
1058+
* genAiTuningServiceClient.rebaseTunedModelCallable().futureCall(request);
1059+
* // Do something.
1060+
* Operation response = future.get();
1061+
* }
1062+
* }</pre>
1063+
*/
1064+
public final UnaryCallable<RebaseTunedModelRequest, Operation> rebaseTunedModelCallable() {
1065+
return stub.rebaseTunedModelCallable();
1066+
}
1067+
8591068
// AUTO-GENERATED DOCUMENTATION AND METHOD.
8601069
/**
8611070
* Lists information about the supported locations for this service.

java-aiplatform/google-cloud-aiplatform/src/main/java/com/google/cloud/aiplatform/v1/GenAiTuningServiceSettings.java

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
import com.google.api.gax.rpc.ApiClientHeaderProvider;
2727
import com.google.api.gax.rpc.ClientContext;
2828
import com.google.api.gax.rpc.ClientSettings;
29+
import com.google.api.gax.rpc.OperationCallSettings;
2930
import com.google.api.gax.rpc.PagedCallSettings;
3031
import com.google.api.gax.rpc.TransportChannelProvider;
3132
import com.google.api.gax.rpc.UnaryCallSettings;
@@ -39,6 +40,7 @@
3940
import com.google.iam.v1.SetIamPolicyRequest;
4041
import com.google.iam.v1.TestIamPermissionsRequest;
4142
import com.google.iam.v1.TestIamPermissionsResponse;
43+
import com.google.longrunning.Operation;
4244
import com.google.protobuf.Empty;
4345
import java.io.IOException;
4446
import java.util.List;
@@ -94,6 +96,32 @@
9496
* Please refer to the [Client Side Retry
9597
* Guide](https://github.com/googleapis/google-cloud-java/blob/main/docs/client_retries.md) for
9698
* additional support in setting retries.
99+
*
100+
* <p>To configure the RetrySettings of a Long Running Operation method, create an
101+
* OperationTimedPollAlgorithm object and update the RPC's polling algorithm. For example, to
102+
* configure the RetrySettings for rebaseTunedModel:
103+
*
104+
* <pre>{@code
105+
* // This snippet has been automatically generated and should be regarded as a code template only.
106+
* // It will require modifications to work:
107+
* // - It may require correct/in-range values for request initialization.
108+
* // - It may require specifying regional endpoints when creating the service client as shown in
109+
* // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
110+
* GenAiTuningServiceSettings.Builder genAiTuningServiceSettingsBuilder =
111+
* GenAiTuningServiceSettings.newBuilder();
112+
* TimedRetryAlgorithm timedRetryAlgorithm =
113+
* OperationalTimedPollAlgorithm.create(
114+
* RetrySettings.newBuilder()
115+
* .setInitialRetryDelayDuration(Duration.ofMillis(500))
116+
* .setRetryDelayMultiplier(1.5)
117+
* .setMaxRetryDelay(Duration.ofMillis(5000))
118+
* .setTotalTimeoutDuration(Duration.ofHours(24))
119+
* .build());
120+
* genAiTuningServiceSettingsBuilder
121+
* .createClusterOperationSettings()
122+
* .setPollingAlgorithm(timedRetryAlgorithm)
123+
* .build();
124+
* }</pre>
97125
*/
98126
@Generated("by gapic-generator-java")
99127
public class GenAiTuningServiceSettings extends ClientSettings<GenAiTuningServiceSettings> {
@@ -120,6 +148,18 @@ public UnaryCallSettings<CancelTuningJobRequest, Empty> cancelTuningJobSettings(
120148
return ((GenAiTuningServiceStubSettings) getStubSettings()).cancelTuningJobSettings();
121149
}
122150

151+
/** Returns the object with the settings used for calls to rebaseTunedModel. */
152+
public UnaryCallSettings<RebaseTunedModelRequest, Operation> rebaseTunedModelSettings() {
153+
return ((GenAiTuningServiceStubSettings) getStubSettings()).rebaseTunedModelSettings();
154+
}
155+
156+
/** Returns the object with the settings used for calls to rebaseTunedModel. */
157+
public OperationCallSettings<
158+
RebaseTunedModelRequest, TuningJob, RebaseTunedModelOperationMetadata>
159+
rebaseTunedModelOperationSettings() {
160+
return ((GenAiTuningServiceStubSettings) getStubSettings()).rebaseTunedModelOperationSettings();
161+
}
162+
123163
/** Returns the object with the settings used for calls to listLocations. */
124164
public PagedCallSettings<ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse>
125165
listLocationsSettings() {
@@ -265,6 +305,19 @@ public UnaryCallSettings.Builder<CancelTuningJobRequest, Empty> cancelTuningJobS
265305
return getStubSettingsBuilder().cancelTuningJobSettings();
266306
}
267307

308+
/** Returns the builder for the settings used for calls to rebaseTunedModel. */
309+
public UnaryCallSettings.Builder<RebaseTunedModelRequest, Operation>
310+
rebaseTunedModelSettings() {
311+
return getStubSettingsBuilder().rebaseTunedModelSettings();
312+
}
313+
314+
/** Returns the builder for the settings used for calls to rebaseTunedModel. */
315+
public OperationCallSettings.Builder<
316+
RebaseTunedModelRequest, TuningJob, RebaseTunedModelOperationMetadata>
317+
rebaseTunedModelOperationSettings() {
318+
return getStubSettingsBuilder().rebaseTunedModelOperationSettings();
319+
}
320+
268321
/** Returns the builder for the settings used for calls to listLocations. */
269322
public PagedCallSettings.Builder<
270323
ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse>

java-aiplatform/google-cloud-aiplatform/src/main/java/com/google/cloud/aiplatform/v1/gapic_metadata.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -496,6 +496,9 @@
496496
"ListTuningJobs": {
497497
"methods": ["listTuningJobs", "listTuningJobs", "listTuningJobs", "listTuningJobsPagedCallable", "listTuningJobsCallable"]
498498
},
499+
"RebaseTunedModel": {
500+
"methods": ["rebaseTunedModelAsync", "rebaseTunedModelAsync", "rebaseTunedModelAsync", "rebaseTunedModelOperationCallable", "rebaseTunedModelCallable"]
501+
},
499502
"SetIamPolicy": {
500503
"methods": ["setIamPolicy", "setIamPolicyCallable"]
501504
},

0 commit comments

Comments
 (0)