|
1 | 1 | /*
|
2 |
| - * Copyright 2024 Google LLC |
| 2 | + * Copyright 2025 Google LLC |
3 | 3 | *
|
4 | 4 | * Licensed under the Apache License, Version 2.0 (the "License");
|
5 | 5 | * you may not use this file except in compliance with the License.
|
|
476 | 476 | * </ul>
|
477 | 477 | * </td>
|
478 | 478 | * </tr>
|
| 479 | + * <tr> |
| 480 | + * <td><p> MoveObject</td> |
| 481 | + * <td><p> Moves the source object to the destination object in the same bucket.</td> |
| 482 | + * <td> |
| 483 | + * <p>Request object method variants only take one parameter, a request object, which must be constructed before the call.</p> |
| 484 | + * <ul> |
| 485 | + * <li><p> moveObject(MoveObjectRequest request) |
| 486 | + * </ul> |
| 487 | + * <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> |
| 488 | + * <ul> |
| 489 | + * <li><p> moveObject(BucketName bucket, String sourceObject, String destinationObject) |
| 490 | + * <li><p> moveObject(String bucket, String sourceObject, String destinationObject) |
| 491 | + * </ul> |
| 492 | + * <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> |
| 493 | + * <ul> |
| 494 | + * <li><p> moveObjectCallable() |
| 495 | + * </ul> |
| 496 | + * </td> |
| 497 | + * </tr> |
479 | 498 | * </table>
|
480 | 499 | *
|
481 | 500 | * <p>See the individual methods for example code.
|
@@ -3241,6 +3260,151 @@ public final QueryWriteStatusResponse queryWriteStatus(QueryWriteStatusRequest r
|
3241 | 3260 | return stub.queryWriteStatusCallable();
|
3242 | 3261 | }
|
3243 | 3262 |
|
| 3263 | + // AUTO-GENERATED DOCUMENTATION AND METHOD. |
| 3264 | + /** |
| 3265 | + * Moves the source object to the destination object in the same bucket. |
| 3266 | + * |
| 3267 | + * <p>Sample code: |
| 3268 | + * |
| 3269 | + * <pre>{@code |
| 3270 | + * // This snippet has been automatically generated and should be regarded as a code template only. |
| 3271 | + * // It will require modifications to work: |
| 3272 | + * // - It may require correct/in-range values for request initialization. |
| 3273 | + * // - It may require specifying regional endpoints when creating the service client as shown in |
| 3274 | + * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library |
| 3275 | + * try (StorageClient storageClient = StorageClient.create()) { |
| 3276 | + * BucketName bucket = BucketName.of("[PROJECT]", "[BUCKET]"); |
| 3277 | + * String sourceObject = "sourceObject1196439354"; |
| 3278 | + * String destinationObject = "destinationObject-1761603347"; |
| 3279 | + * Object response = storageClient.moveObject(bucket, sourceObject, destinationObject); |
| 3280 | + * } |
| 3281 | + * }</pre> |
| 3282 | + * |
| 3283 | + * @param bucket Required. Name of the bucket in which the object resides. |
| 3284 | + * @param sourceObject Required. Name of the source object. |
| 3285 | + * @param destinationObject Required. Name of the destination object. |
| 3286 | + * @throws com.google.api.gax.rpc.ApiException if the remote call fails |
| 3287 | + */ |
| 3288 | + public final Object moveObject(BucketName bucket, String sourceObject, String destinationObject) { |
| 3289 | + MoveObjectRequest request = |
| 3290 | + MoveObjectRequest.newBuilder() |
| 3291 | + .setBucket(bucket == null ? null : bucket.toString()) |
| 3292 | + .setSourceObject(sourceObject) |
| 3293 | + .setDestinationObject(destinationObject) |
| 3294 | + .build(); |
| 3295 | + return moveObject(request); |
| 3296 | + } |
| 3297 | + |
| 3298 | + // AUTO-GENERATED DOCUMENTATION AND METHOD. |
| 3299 | + /** |
| 3300 | + * Moves the source object to the destination object in the same bucket. |
| 3301 | + * |
| 3302 | + * <p>Sample code: |
| 3303 | + * |
| 3304 | + * <pre>{@code |
| 3305 | + * // This snippet has been automatically generated and should be regarded as a code template only. |
| 3306 | + * // It will require modifications to work: |
| 3307 | + * // - It may require correct/in-range values for request initialization. |
| 3308 | + * // - It may require specifying regional endpoints when creating the service client as shown in |
| 3309 | + * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library |
| 3310 | + * try (StorageClient storageClient = StorageClient.create()) { |
| 3311 | + * String bucket = BucketName.of("[PROJECT]", "[BUCKET]").toString(); |
| 3312 | + * String sourceObject = "sourceObject1196439354"; |
| 3313 | + * String destinationObject = "destinationObject-1761603347"; |
| 3314 | + * Object response = storageClient.moveObject(bucket, sourceObject, destinationObject); |
| 3315 | + * } |
| 3316 | + * }</pre> |
| 3317 | + * |
| 3318 | + * @param bucket Required. Name of the bucket in which the object resides. |
| 3319 | + * @param sourceObject Required. Name of the source object. |
| 3320 | + * @param destinationObject Required. Name of the destination object. |
| 3321 | + * @throws com.google.api.gax.rpc.ApiException if the remote call fails |
| 3322 | + */ |
| 3323 | + public final Object moveObject(String bucket, String sourceObject, String destinationObject) { |
| 3324 | + MoveObjectRequest request = |
| 3325 | + MoveObjectRequest.newBuilder() |
| 3326 | + .setBucket(bucket) |
| 3327 | + .setSourceObject(sourceObject) |
| 3328 | + .setDestinationObject(destinationObject) |
| 3329 | + .build(); |
| 3330 | + return moveObject(request); |
| 3331 | + } |
| 3332 | + |
| 3333 | + // AUTO-GENERATED DOCUMENTATION AND METHOD. |
| 3334 | + /** |
| 3335 | + * Moves the source object to the destination object in the same bucket. |
| 3336 | + * |
| 3337 | + * <p>Sample code: |
| 3338 | + * |
| 3339 | + * <pre>{@code |
| 3340 | + * // This snippet has been automatically generated and should be regarded as a code template only. |
| 3341 | + * // It will require modifications to work: |
| 3342 | + * // - It may require correct/in-range values for request initialization. |
| 3343 | + * // - It may require specifying regional endpoints when creating the service client as shown in |
| 3344 | + * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library |
| 3345 | + * try (StorageClient storageClient = StorageClient.create()) { |
| 3346 | + * MoveObjectRequest request = |
| 3347 | + * MoveObjectRequest.newBuilder() |
| 3348 | + * .setBucket(BucketName.of("[PROJECT]", "[BUCKET]").toString()) |
| 3349 | + * .setSourceObject("sourceObject1196439354") |
| 3350 | + * .setDestinationObject("destinationObject-1761603347") |
| 3351 | + * .setIfSourceGenerationMatch(-1427877280) |
| 3352 | + * .setIfSourceGenerationNotMatch(1575612532) |
| 3353 | + * .setIfSourceMetagenerationMatch(1143319909) |
| 3354 | + * .setIfSourceMetagenerationNotMatch(1900822777) |
| 3355 | + * .setIfGenerationMatch(-1086241088) |
| 3356 | + * .setIfGenerationNotMatch(1475720404) |
| 3357 | + * .setIfMetagenerationMatch(1043427781) |
| 3358 | + * .setIfMetagenerationNotMatch(1025430873) |
| 3359 | + * .build(); |
| 3360 | + * Object response = storageClient.moveObject(request); |
| 3361 | + * } |
| 3362 | + * }</pre> |
| 3363 | + * |
| 3364 | + * @param request The request object containing all of the parameters for the API call. |
| 3365 | + * @throws com.google.api.gax.rpc.ApiException if the remote call fails |
| 3366 | + */ |
| 3367 | + public final Object moveObject(MoveObjectRequest request) { |
| 3368 | + return moveObjectCallable().call(request); |
| 3369 | + } |
| 3370 | + |
| 3371 | + // AUTO-GENERATED DOCUMENTATION AND METHOD. |
| 3372 | + /** |
| 3373 | + * Moves the source object to the destination object in the same bucket. |
| 3374 | + * |
| 3375 | + * <p>Sample code: |
| 3376 | + * |
| 3377 | + * <pre>{@code |
| 3378 | + * // This snippet has been automatically generated and should be regarded as a code template only. |
| 3379 | + * // It will require modifications to work: |
| 3380 | + * // - It may require correct/in-range values for request initialization. |
| 3381 | + * // - It may require specifying regional endpoints when creating the service client as shown in |
| 3382 | + * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library |
| 3383 | + * try (StorageClient storageClient = StorageClient.create()) { |
| 3384 | + * MoveObjectRequest request = |
| 3385 | + * MoveObjectRequest.newBuilder() |
| 3386 | + * .setBucket(BucketName.of("[PROJECT]", "[BUCKET]").toString()) |
| 3387 | + * .setSourceObject("sourceObject1196439354") |
| 3388 | + * .setDestinationObject("destinationObject-1761603347") |
| 3389 | + * .setIfSourceGenerationMatch(-1427877280) |
| 3390 | + * .setIfSourceGenerationNotMatch(1575612532) |
| 3391 | + * .setIfSourceMetagenerationMatch(1143319909) |
| 3392 | + * .setIfSourceMetagenerationNotMatch(1900822777) |
| 3393 | + * .setIfGenerationMatch(-1086241088) |
| 3394 | + * .setIfGenerationNotMatch(1475720404) |
| 3395 | + * .setIfMetagenerationMatch(1043427781) |
| 3396 | + * .setIfMetagenerationNotMatch(1025430873) |
| 3397 | + * .build(); |
| 3398 | + * ApiFuture<Object> future = storageClient.moveObjectCallable().futureCall(request); |
| 3399 | + * // Do something. |
| 3400 | + * Object response = future.get(); |
| 3401 | + * } |
| 3402 | + * }</pre> |
| 3403 | + */ |
| 3404 | + public final UnaryCallable<MoveObjectRequest, Object> moveObjectCallable() { |
| 3405 | + return stub.moveObjectCallable(); |
| 3406 | + } |
| 3407 | + |
3244 | 3408 | @Override
|
3245 | 3409 | public final void close() {
|
3246 | 3410 | stub.close();
|
|
0 commit comments