|
156 | 156 | * </td> |
157 | 157 | * </tr> |
158 | 158 | * <tr> |
| 159 | + * <td><p> ListModelVersionCheckpoints</td> |
| 160 | + * <td><p> Lists checkpoints of the specified model version.</td> |
| 161 | + * <td> |
| 162 | + * <p>Request object method variants only take one parameter, a request object, which must be constructed before the call.</p> |
| 163 | + * <ul> |
| 164 | + * <li><p> listModelVersionCheckpoints(ListModelVersionCheckpointsRequest request) |
| 165 | + * </ul> |
| 166 | + * <p>"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.</p> |
| 167 | + * <ul> |
| 168 | + * <li><p> listModelVersionCheckpoints(ModelName name) |
| 169 | + * <li><p> listModelVersionCheckpoints(String name) |
| 170 | + * </ul> |
| 171 | + * <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> |
| 172 | + * <ul> |
| 173 | + * <li><p> listModelVersionCheckpointsPagedCallable() |
| 174 | + * <li><p> listModelVersionCheckpointsCallable() |
| 175 | + * </ul> |
| 176 | + * </td> |
| 177 | + * </tr> |
| 178 | + * <tr> |
159 | 179 | * <td><p> UpdateModel</td> |
160 | 180 | * <td><p> Updates a Model.</td> |
161 | 181 | * <td> |
@@ -1234,6 +1254,186 @@ public final ListModelVersionsPagedResponse listModelVersions(ListModelVersionsR |
1234 | 1254 | return stub.listModelVersionsCallable(); |
1235 | 1255 | } |
1236 | 1256 |
|
| 1257 | + // AUTO-GENERATED DOCUMENTATION AND METHOD. |
| 1258 | + /** |
| 1259 | + * Lists checkpoints of the specified model version. |
| 1260 | + * |
| 1261 | + * <p>Sample code: |
| 1262 | + * |
| 1263 | + * <pre>{@code |
| 1264 | + * // This snippet has been automatically generated and should be regarded as a code template only. |
| 1265 | + * // It will require modifications to work: |
| 1266 | + * // - It may require correct/in-range values for request initialization. |
| 1267 | + * // - It may require specifying regional endpoints when creating the service client as shown in |
| 1268 | + * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library |
| 1269 | + * try (ModelServiceClient modelServiceClient = ModelServiceClient.create()) { |
| 1270 | + * ModelName name = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]"); |
| 1271 | + * for (ModelVersionCheckpoint element : |
| 1272 | + * modelServiceClient.listModelVersionCheckpoints(name).iterateAll()) { |
| 1273 | + * // doThingsWith(element); |
| 1274 | + * } |
| 1275 | + * } |
| 1276 | + * }</pre> |
| 1277 | + * |
| 1278 | + * @param name Required. The name of the model version to list checkpoints for. |
| 1279 | + * `projects/{project}/locations/{location}/models/{model}{@literal @}{version}` Example: |
| 1280 | + * `projects/{project}/locations/{location}/models/{model}{@literal @}2` or |
| 1281 | + * `projects/{project}/locations/{location}/models/{model}{@literal @}golden` If no version ID |
| 1282 | + * or alias is specified, the latest version will be used. |
| 1283 | + * @throws com.google.api.gax.rpc.ApiException if the remote call fails |
| 1284 | + */ |
| 1285 | + public final ListModelVersionCheckpointsPagedResponse listModelVersionCheckpoints( |
| 1286 | + ModelName name) { |
| 1287 | + ListModelVersionCheckpointsRequest request = |
| 1288 | + ListModelVersionCheckpointsRequest.newBuilder() |
| 1289 | + .setName(name == null ? null : name.toString()) |
| 1290 | + .build(); |
| 1291 | + return listModelVersionCheckpoints(request); |
| 1292 | + } |
| 1293 | + |
| 1294 | + // AUTO-GENERATED DOCUMENTATION AND METHOD. |
| 1295 | + /** |
| 1296 | + * Lists checkpoints of the specified model version. |
| 1297 | + * |
| 1298 | + * <p>Sample code: |
| 1299 | + * |
| 1300 | + * <pre>{@code |
| 1301 | + * // This snippet has been automatically generated and should be regarded as a code template only. |
| 1302 | + * // It will require modifications to work: |
| 1303 | + * // - It may require correct/in-range values for request initialization. |
| 1304 | + * // - It may require specifying regional endpoints when creating the service client as shown in |
| 1305 | + * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library |
| 1306 | + * try (ModelServiceClient modelServiceClient = ModelServiceClient.create()) { |
| 1307 | + * String name = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]").toString(); |
| 1308 | + * for (ModelVersionCheckpoint element : |
| 1309 | + * modelServiceClient.listModelVersionCheckpoints(name).iterateAll()) { |
| 1310 | + * // doThingsWith(element); |
| 1311 | + * } |
| 1312 | + * } |
| 1313 | + * }</pre> |
| 1314 | + * |
| 1315 | + * @param name Required. The name of the model version to list checkpoints for. |
| 1316 | + * `projects/{project}/locations/{location}/models/{model}{@literal @}{version}` Example: |
| 1317 | + * `projects/{project}/locations/{location}/models/{model}{@literal @}2` or |
| 1318 | + * `projects/{project}/locations/{location}/models/{model}{@literal @}golden` If no version ID |
| 1319 | + * or alias is specified, the latest version will be used. |
| 1320 | + * @throws com.google.api.gax.rpc.ApiException if the remote call fails |
| 1321 | + */ |
| 1322 | + public final ListModelVersionCheckpointsPagedResponse listModelVersionCheckpoints(String name) { |
| 1323 | + ListModelVersionCheckpointsRequest request = |
| 1324 | + ListModelVersionCheckpointsRequest.newBuilder().setName(name).build(); |
| 1325 | + return listModelVersionCheckpoints(request); |
| 1326 | + } |
| 1327 | + |
| 1328 | + // AUTO-GENERATED DOCUMENTATION AND METHOD. |
| 1329 | + /** |
| 1330 | + * Lists checkpoints of the specified model version. |
| 1331 | + * |
| 1332 | + * <p>Sample code: |
| 1333 | + * |
| 1334 | + * <pre>{@code |
| 1335 | + * // This snippet has been automatically generated and should be regarded as a code template only. |
| 1336 | + * // It will require modifications to work: |
| 1337 | + * // - It may require correct/in-range values for request initialization. |
| 1338 | + * // - It may require specifying regional endpoints when creating the service client as shown in |
| 1339 | + * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library |
| 1340 | + * try (ModelServiceClient modelServiceClient = ModelServiceClient.create()) { |
| 1341 | + * ListModelVersionCheckpointsRequest request = |
| 1342 | + * ListModelVersionCheckpointsRequest.newBuilder() |
| 1343 | + * .setName(ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]").toString()) |
| 1344 | + * .setPageSize(883849137) |
| 1345 | + * .setPageToken("pageToken873572522") |
| 1346 | + * .build(); |
| 1347 | + * for (ModelVersionCheckpoint element : |
| 1348 | + * modelServiceClient.listModelVersionCheckpoints(request).iterateAll()) { |
| 1349 | + * // doThingsWith(element); |
| 1350 | + * } |
| 1351 | + * } |
| 1352 | + * }</pre> |
| 1353 | + * |
| 1354 | + * @param request The request object containing all of the parameters for the API call. |
| 1355 | + * @throws com.google.api.gax.rpc.ApiException if the remote call fails |
| 1356 | + */ |
| 1357 | + public final ListModelVersionCheckpointsPagedResponse listModelVersionCheckpoints( |
| 1358 | + ListModelVersionCheckpointsRequest request) { |
| 1359 | + return listModelVersionCheckpointsPagedCallable().call(request); |
| 1360 | + } |
| 1361 | + |
| 1362 | + // AUTO-GENERATED DOCUMENTATION AND METHOD. |
| 1363 | + /** |
| 1364 | + * Lists checkpoints of the specified model version. |
| 1365 | + * |
| 1366 | + * <p>Sample code: |
| 1367 | + * |
| 1368 | + * <pre>{@code |
| 1369 | + * // This snippet has been automatically generated and should be regarded as a code template only. |
| 1370 | + * // It will require modifications to work: |
| 1371 | + * // - It may require correct/in-range values for request initialization. |
| 1372 | + * // - It may require specifying regional endpoints when creating the service client as shown in |
| 1373 | + * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library |
| 1374 | + * try (ModelServiceClient modelServiceClient = ModelServiceClient.create()) { |
| 1375 | + * ListModelVersionCheckpointsRequest request = |
| 1376 | + * ListModelVersionCheckpointsRequest.newBuilder() |
| 1377 | + * .setName(ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]").toString()) |
| 1378 | + * .setPageSize(883849137) |
| 1379 | + * .setPageToken("pageToken873572522") |
| 1380 | + * .build(); |
| 1381 | + * ApiFuture<ModelVersionCheckpoint> future = |
| 1382 | + * modelServiceClient.listModelVersionCheckpointsPagedCallable().futureCall(request); |
| 1383 | + * // Do something. |
| 1384 | + * for (ModelVersionCheckpoint element : future.get().iterateAll()) { |
| 1385 | + * // doThingsWith(element); |
| 1386 | + * } |
| 1387 | + * } |
| 1388 | + * }</pre> |
| 1389 | + */ |
| 1390 | + public final UnaryCallable< |
| 1391 | + ListModelVersionCheckpointsRequest, ListModelVersionCheckpointsPagedResponse> |
| 1392 | + listModelVersionCheckpointsPagedCallable() { |
| 1393 | + return stub.listModelVersionCheckpointsPagedCallable(); |
| 1394 | + } |
| 1395 | + |
| 1396 | + // AUTO-GENERATED DOCUMENTATION AND METHOD. |
| 1397 | + /** |
| 1398 | + * Lists checkpoints of the specified model version. |
| 1399 | + * |
| 1400 | + * <p>Sample code: |
| 1401 | + * |
| 1402 | + * <pre>{@code |
| 1403 | + * // This snippet has been automatically generated and should be regarded as a code template only. |
| 1404 | + * // It will require modifications to work: |
| 1405 | + * // - It may require correct/in-range values for request initialization. |
| 1406 | + * // - It may require specifying regional endpoints when creating the service client as shown in |
| 1407 | + * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library |
| 1408 | + * try (ModelServiceClient modelServiceClient = ModelServiceClient.create()) { |
| 1409 | + * ListModelVersionCheckpointsRequest request = |
| 1410 | + * ListModelVersionCheckpointsRequest.newBuilder() |
| 1411 | + * .setName(ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]").toString()) |
| 1412 | + * .setPageSize(883849137) |
| 1413 | + * .setPageToken("pageToken873572522") |
| 1414 | + * .build(); |
| 1415 | + * while (true) { |
| 1416 | + * ListModelVersionCheckpointsResponse response = |
| 1417 | + * modelServiceClient.listModelVersionCheckpointsCallable().call(request); |
| 1418 | + * for (ModelVersionCheckpoint element : response.getCheckpointsList()) { |
| 1419 | + * // doThingsWith(element); |
| 1420 | + * } |
| 1421 | + * String nextPageToken = response.getNextPageToken(); |
| 1422 | + * if (!Strings.isNullOrEmpty(nextPageToken)) { |
| 1423 | + * request = request.toBuilder().setPageToken(nextPageToken).build(); |
| 1424 | + * } else { |
| 1425 | + * break; |
| 1426 | + * } |
| 1427 | + * } |
| 1428 | + * } |
| 1429 | + * }</pre> |
| 1430 | + */ |
| 1431 | + public final UnaryCallable< |
| 1432 | + ListModelVersionCheckpointsRequest, ListModelVersionCheckpointsResponse> |
| 1433 | + listModelVersionCheckpointsCallable() { |
| 1434 | + return stub.listModelVersionCheckpointsCallable(); |
| 1435 | + } |
| 1436 | + |
1237 | 1437 | // AUTO-GENERATED DOCUMENTATION AND METHOD. |
1238 | 1438 | /** |
1239 | 1439 | * Updates a Model. |
@@ -3951,6 +4151,103 @@ protected ListModelVersionsFixedSizeCollection createCollection( |
3951 | 4151 | } |
3952 | 4152 | } |
3953 | 4153 |
|
| 4154 | + public static class ListModelVersionCheckpointsPagedResponse |
| 4155 | + extends AbstractPagedListResponse< |
| 4156 | + ListModelVersionCheckpointsRequest, |
| 4157 | + ListModelVersionCheckpointsResponse, |
| 4158 | + ModelVersionCheckpoint, |
| 4159 | + ListModelVersionCheckpointsPage, |
| 4160 | + ListModelVersionCheckpointsFixedSizeCollection> { |
| 4161 | + |
| 4162 | + public static ApiFuture<ListModelVersionCheckpointsPagedResponse> createAsync( |
| 4163 | + PageContext< |
| 4164 | + ListModelVersionCheckpointsRequest, |
| 4165 | + ListModelVersionCheckpointsResponse, |
| 4166 | + ModelVersionCheckpoint> |
| 4167 | + context, |
| 4168 | + ApiFuture<ListModelVersionCheckpointsResponse> futureResponse) { |
| 4169 | + ApiFuture<ListModelVersionCheckpointsPage> futurePage = |
| 4170 | + ListModelVersionCheckpointsPage.createEmptyPage() |
| 4171 | + .createPageAsync(context, futureResponse); |
| 4172 | + return ApiFutures.transform( |
| 4173 | + futurePage, |
| 4174 | + input -> new ListModelVersionCheckpointsPagedResponse(input), |
| 4175 | + MoreExecutors.directExecutor()); |
| 4176 | + } |
| 4177 | + |
| 4178 | + private ListModelVersionCheckpointsPagedResponse(ListModelVersionCheckpointsPage page) { |
| 4179 | + super(page, ListModelVersionCheckpointsFixedSizeCollection.createEmptyCollection()); |
| 4180 | + } |
| 4181 | + } |
| 4182 | + |
| 4183 | + public static class ListModelVersionCheckpointsPage |
| 4184 | + extends AbstractPage< |
| 4185 | + ListModelVersionCheckpointsRequest, |
| 4186 | + ListModelVersionCheckpointsResponse, |
| 4187 | + ModelVersionCheckpoint, |
| 4188 | + ListModelVersionCheckpointsPage> { |
| 4189 | + |
| 4190 | + private ListModelVersionCheckpointsPage( |
| 4191 | + PageContext< |
| 4192 | + ListModelVersionCheckpointsRequest, |
| 4193 | + ListModelVersionCheckpointsResponse, |
| 4194 | + ModelVersionCheckpoint> |
| 4195 | + context, |
| 4196 | + ListModelVersionCheckpointsResponse response) { |
| 4197 | + super(context, response); |
| 4198 | + } |
| 4199 | + |
| 4200 | + private static ListModelVersionCheckpointsPage createEmptyPage() { |
| 4201 | + return new ListModelVersionCheckpointsPage(null, null); |
| 4202 | + } |
| 4203 | + |
| 4204 | + @Override |
| 4205 | + protected ListModelVersionCheckpointsPage createPage( |
| 4206 | + PageContext< |
| 4207 | + ListModelVersionCheckpointsRequest, |
| 4208 | + ListModelVersionCheckpointsResponse, |
| 4209 | + ModelVersionCheckpoint> |
| 4210 | + context, |
| 4211 | + ListModelVersionCheckpointsResponse response) { |
| 4212 | + return new ListModelVersionCheckpointsPage(context, response); |
| 4213 | + } |
| 4214 | + |
| 4215 | + @Override |
| 4216 | + public ApiFuture<ListModelVersionCheckpointsPage> createPageAsync( |
| 4217 | + PageContext< |
| 4218 | + ListModelVersionCheckpointsRequest, |
| 4219 | + ListModelVersionCheckpointsResponse, |
| 4220 | + ModelVersionCheckpoint> |
| 4221 | + context, |
| 4222 | + ApiFuture<ListModelVersionCheckpointsResponse> futureResponse) { |
| 4223 | + return super.createPageAsync(context, futureResponse); |
| 4224 | + } |
| 4225 | + } |
| 4226 | + |
| 4227 | + public static class ListModelVersionCheckpointsFixedSizeCollection |
| 4228 | + extends AbstractFixedSizeCollection< |
| 4229 | + ListModelVersionCheckpointsRequest, |
| 4230 | + ListModelVersionCheckpointsResponse, |
| 4231 | + ModelVersionCheckpoint, |
| 4232 | + ListModelVersionCheckpointsPage, |
| 4233 | + ListModelVersionCheckpointsFixedSizeCollection> { |
| 4234 | + |
| 4235 | + private ListModelVersionCheckpointsFixedSizeCollection( |
| 4236 | + List<ListModelVersionCheckpointsPage> pages, int collectionSize) { |
| 4237 | + super(pages, collectionSize); |
| 4238 | + } |
| 4239 | + |
| 4240 | + private static ListModelVersionCheckpointsFixedSizeCollection createEmptyCollection() { |
| 4241 | + return new ListModelVersionCheckpointsFixedSizeCollection(null, 0); |
| 4242 | + } |
| 4243 | + |
| 4244 | + @Override |
| 4245 | + protected ListModelVersionCheckpointsFixedSizeCollection createCollection( |
| 4246 | + List<ListModelVersionCheckpointsPage> pages, int collectionSize) { |
| 4247 | + return new ListModelVersionCheckpointsFixedSizeCollection(pages, collectionSize); |
| 4248 | + } |
| 4249 | + } |
| 4250 | + |
3954 | 4251 | public static class ListModelEvaluationsPagedResponse |
3955 | 4252 | extends AbstractPagedListResponse< |
3956 | 4253 | ListModelEvaluationsRequest, |
|
0 commit comments