Skip to content

Commit

Permalink
chore: Update generation configuration at Tue Jan 7 02:23:57 UTC 2025 (
Browse files Browse the repository at this point in the history
…#2838)

* chore: update clirr rules

---------

Co-authored-by: BenWhitehead <BenWhitehead@users.noreply.github.com>
  • Loading branch information
cloud-java-bot and BenWhitehead authored Jan 7, 2025
1 parent 1db19b4 commit 34b8ac4
Show file tree
Hide file tree
Showing 158 changed files with 4,379 additions and 868 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ If you are using Maven without the BOM, add this to your dependencies:
If you are using Gradle 5.x or later, add this to your dependencies:

```Groovy
implementation platform('com.google.cloud:libraries-bom:26.51.0')
implementation platform('com.google.cloud:libraries-bom:26.52.0')
implementation 'com.google.cloud:google-cloud-storage'
```
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2024 Google LLC
* Copyright 2025 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -476,6 +476,25 @@
* </ul>
* </td>
* </tr>
* <tr>
* <td><p> MoveObject</td>
* <td><p> Moves the source object to the destination object in the same bucket.</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> moveObject(MoveObjectRequest request)
* </ul>
* <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>
* <ul>
* <li><p> moveObject(BucketName bucket, String sourceObject, String destinationObject)
* <li><p> moveObject(String bucket, String sourceObject, String destinationObject)
* </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> moveObjectCallable()
* </ul>
* </td>
* </tr>
* </table>
*
* <p>See the individual methods for example code.
Expand Down Expand Up @@ -3241,6 +3260,151 @@ public final QueryWriteStatusResponse queryWriteStatus(QueryWriteStatusRequest r
return stub.queryWriteStatusCallable();
}

// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Moves the source object to the destination object in the same bucket.
*
* <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 (StorageClient storageClient = StorageClient.create()) {
* BucketName bucket = BucketName.of("[PROJECT]", "[BUCKET]");
* String sourceObject = "sourceObject1196439354";
* String destinationObject = "destinationObject-1761603347";
* Object response = storageClient.moveObject(bucket, sourceObject, destinationObject);
* }
* }</pre>
*
* @param bucket Required. Name of the bucket in which the object resides.
* @param sourceObject Required. Name of the source object.
* @param destinationObject Required. Name of the destination object.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
public final Object moveObject(BucketName bucket, String sourceObject, String destinationObject) {
MoveObjectRequest request =
MoveObjectRequest.newBuilder()
.setBucket(bucket == null ? null : bucket.toString())
.setSourceObject(sourceObject)
.setDestinationObject(destinationObject)
.build();
return moveObject(request);
}

// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Moves the source object to the destination object in the same bucket.
*
* <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 (StorageClient storageClient = StorageClient.create()) {
* String bucket = BucketName.of("[PROJECT]", "[BUCKET]").toString();
* String sourceObject = "sourceObject1196439354";
* String destinationObject = "destinationObject-1761603347";
* Object response = storageClient.moveObject(bucket, sourceObject, destinationObject);
* }
* }</pre>
*
* @param bucket Required. Name of the bucket in which the object resides.
* @param sourceObject Required. Name of the source object.
* @param destinationObject Required. Name of the destination object.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
public final Object moveObject(String bucket, String sourceObject, String destinationObject) {
MoveObjectRequest request =
MoveObjectRequest.newBuilder()
.setBucket(bucket)
.setSourceObject(sourceObject)
.setDestinationObject(destinationObject)
.build();
return moveObject(request);
}

// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Moves the source object to the destination object in the same bucket.
*
* <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 (StorageClient storageClient = StorageClient.create()) {
* MoveObjectRequest request =
* MoveObjectRequest.newBuilder()
* .setBucket(BucketName.of("[PROJECT]", "[BUCKET]").toString())
* .setSourceObject("sourceObject1196439354")
* .setDestinationObject("destinationObject-1761603347")
* .setIfSourceGenerationMatch(-1427877280)
* .setIfSourceGenerationNotMatch(1575612532)
* .setIfSourceMetagenerationMatch(1143319909)
* .setIfSourceMetagenerationNotMatch(1900822777)
* .setIfGenerationMatch(-1086241088)
* .setIfGenerationNotMatch(1475720404)
* .setIfMetagenerationMatch(1043427781)
* .setIfMetagenerationNotMatch(1025430873)
* .build();
* Object response = storageClient.moveObject(request);
* }
* }</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 Object moveObject(MoveObjectRequest request) {
return moveObjectCallable().call(request);
}

// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Moves the source object to the destination object in the same bucket.
*
* <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 (StorageClient storageClient = StorageClient.create()) {
* MoveObjectRequest request =
* MoveObjectRequest.newBuilder()
* .setBucket(BucketName.of("[PROJECT]", "[BUCKET]").toString())
* .setSourceObject("sourceObject1196439354")
* .setDestinationObject("destinationObject-1761603347")
* .setIfSourceGenerationMatch(-1427877280)
* .setIfSourceGenerationNotMatch(1575612532)
* .setIfSourceMetagenerationMatch(1143319909)
* .setIfSourceMetagenerationNotMatch(1900822777)
* .setIfGenerationMatch(-1086241088)
* .setIfGenerationNotMatch(1475720404)
* .setIfMetagenerationMatch(1043427781)
* .setIfMetagenerationNotMatch(1025430873)
* .build();
* ApiFuture<Object> future = storageClient.moveObjectCallable().futureCall(request);
* // Do something.
* Object response = future.get();
* }
* }</pre>
*/
public final UnaryCallable<MoveObjectRequest, Object> moveObjectCallable() {
return stub.moveObjectCallable();
}

@Override
public final void close() {
stub.close();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2024 Google LLC
* Copyright 2025 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -212,6 +212,11 @@ public UnaryCallSettings<RewriteObjectRequest, RewriteResponse> rewriteObjectSet
return ((StorageStubSettings) getStubSettings()).queryWriteStatusSettings();
}

/** Returns the object with the settings used for calls to moveObject. */
public UnaryCallSettings<MoveObjectRequest, Object> moveObjectSettings() {
return ((StorageStubSettings) getStubSettings()).moveObjectSettings();
}

public static final StorageSettings create(StorageStubSettings stub) throws IOException {
return new StorageSettings.Builder(stub.toBuilder()).build();
}
Expand Down Expand Up @@ -430,6 +435,11 @@ public UnaryCallSettings.Builder<UpdateObjectRequest, Object> updateObjectSettin
return getStubSettingsBuilder().queryWriteStatusSettings();
}

/** Returns the builder for the settings used for calls to moveObject. */
public UnaryCallSettings.Builder<MoveObjectRequest, Object> moveObjectSettings() {
return getStubSettingsBuilder().moveObjectSettings();
}

@Override
public StorageSettings build() throws IOException {
return new StorageSettings(this);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2024 Google LLC
* Copyright 2025 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2024 Google LLC
* Copyright 2025 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2024 Google LLC
* Copyright 2025 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -53,6 +53,7 @@
import com.google.storage.v2.ListObjectsRequest;
import com.google.storage.v2.ListObjectsResponse;
import com.google.storage.v2.LockBucketRetentionPolicyRequest;
import com.google.storage.v2.MoveObjectRequest;
import com.google.storage.v2.Object;
import com.google.storage.v2.QueryWriteStatusRequest;
import com.google.storage.v2.QueryWriteStatusResponse;
Expand Down Expand Up @@ -287,6 +288,14 @@ public class GrpcStorageStub extends StorageStub {
ProtoUtils.marshaller(QueryWriteStatusResponse.getDefaultInstance()))
.build();

private static final MethodDescriptor<MoveObjectRequest, Object> moveObjectMethodDescriptor =
MethodDescriptor.<MoveObjectRequest, Object>newBuilder()
.setType(MethodDescriptor.MethodType.UNARY)
.setFullMethodName("google.storage.v2.Storage/MoveObject")
.setRequestMarshaller(ProtoUtils.marshaller(MoveObjectRequest.getDefaultInstance()))
.setResponseMarshaller(ProtoUtils.marshaller(Object.getDefaultInstance()))
.build();

private final UnaryCallable<DeleteBucketRequest, Empty> deleteBucketCallable;
private final UnaryCallable<GetBucketRequest, Bucket> getBucketCallable;
private final UnaryCallable<CreateBucketRequest, Bucket> createBucketCallable;
Expand Down Expand Up @@ -320,6 +329,7 @@ public class GrpcStorageStub extends StorageStub {
startResumableWriteCallable;
private final UnaryCallable<QueryWriteStatusRequest, QueryWriteStatusResponse>
queryWriteStatusCallable;
private final UnaryCallable<MoveObjectRequest, Object> moveObjectCallable;

private final BackgroundResource backgroundResources;
private final GrpcOperationsStub operationsStub;
Expand Down Expand Up @@ -371,6 +381,8 @@ public class GrpcStorageStub extends StorageStub {
PathTemplate.create("{bucket=**}");
private static final PathTemplate QUERY_WRITE_STATUS_0_PATH_TEMPLATE =
PathTemplate.create("{bucket=projects/*/buckets/*}/**");
private static final PathTemplate MOVE_OBJECT_0_PATH_TEMPLATE =
PathTemplate.create("{bucket=**}");

public static final GrpcStorageStub create(StorageStubSettings settings) throws IOException {
return new GrpcStorageStub(settings, ClientContext.create(settings));
Expand Down Expand Up @@ -655,6 +667,16 @@ protected GrpcStorageStub(
return builder.build();
})
.build();
GrpcCallSettings<MoveObjectRequest, Object> moveObjectTransportSettings =
GrpcCallSettings.<MoveObjectRequest, Object>newBuilder()
.setMethodDescriptor(moveObjectMethodDescriptor)
.setParamsExtractor(
request -> {
RequestParamsBuilder builder = RequestParamsBuilder.create();
builder.add(request.getBucket(), "bucket", MOVE_OBJECT_0_PATH_TEMPLATE);
return builder.build();
})
.build();

this.deleteBucketCallable =
callableFactory.createUnaryCallable(
Expand Down Expand Up @@ -736,6 +758,9 @@ protected GrpcStorageStub(
this.queryWriteStatusCallable =
callableFactory.createUnaryCallable(
queryWriteStatusTransportSettings, settings.queryWriteStatusSettings(), clientContext);
this.moveObjectCallable =
callableFactory.createUnaryCallable(
moveObjectTransportSettings, settings.moveObjectSettings(), clientContext);

this.backgroundResources =
new BackgroundResourceAggregation(clientContext.getBackgroundResources());
Expand Down Expand Up @@ -871,6 +896,11 @@ public UnaryCallable<RewriteObjectRequest, RewriteResponse> rewriteObjectCallabl
return queryWriteStatusCallable;
}

@Override
public UnaryCallable<MoveObjectRequest, Object> moveObjectCallable() {
return moveObjectCallable;
}

@Override
public final void close() {
try {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2024 Google LLC
* Copyright 2025 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -46,6 +46,7 @@
import com.google.storage.v2.ListObjectsRequest;
import com.google.storage.v2.ListObjectsResponse;
import com.google.storage.v2.LockBucketRetentionPolicyRequest;
import com.google.storage.v2.MoveObjectRequest;
import com.google.storage.v2.Object;
import com.google.storage.v2.QueryWriteStatusRequest;
import com.google.storage.v2.QueryWriteStatusResponse;
Expand Down Expand Up @@ -173,6 +174,10 @@ public UnaryCallable<RewriteObjectRequest, RewriteResponse> rewriteObjectCallabl
throw new UnsupportedOperationException("Not implemented: queryWriteStatusCallable()");
}

public UnaryCallable<MoveObjectRequest, Object> moveObjectCallable() {
throw new UnsupportedOperationException("Not implemented: moveObjectCallable()");
}

@Override
public abstract void close();
}
Loading

0 comments on commit 34b8ac4

Please sign in to comment.