Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: An existing resource pattern value projects/{project}/buckets/{bucket}/managedFolders/{managedFolder=**} to resource definition storage.googleapis.com/ManagedFolder is removed #2524

Merged
merged 2 commits into from
May 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -389,6 +389,8 @@ Samples are in the [`samples/`](https://github.com/googleapis/java-storage/tree/
| Upload Kms Encrypted Object | [source code](https://github.com/googleapis/java-storage/blob/main/samples/snippets/src/main/java/com/example/storage/object/UploadKmsEncryptedObject.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-storage&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/storage/object/UploadKmsEncryptedObject.java) |
| Upload Object | [source code](https://github.com/googleapis/java-storage/blob/main/samples/snippets/src/main/java/com/example/storage/object/UploadObject.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-storage&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/storage/object/UploadObject.java) |
| Upload Object From Memory | [source code](https://github.com/googleapis/java-storage/blob/main/samples/snippets/src/main/java/com/example/storage/object/UploadObjectFromMemory.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-storage&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/storage/object/UploadObjectFromMemory.java) |
| Allow Divide And Conquer Download | [source code](https://github.com/googleapis/java-storage/blob/main/samples/snippets/src/main/java/com/example/storage/transfermanager/AllowDivideAndConquerDownload.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-storage&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/storage/transfermanager/AllowDivideAndConquerDownload.java) |
| Allow Parallel Composite Upload | [source code](https://github.com/googleapis/java-storage/blob/main/samples/snippets/src/main/java/com/example/storage/transfermanager/AllowParallelCompositeUpload.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-storage&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/storage/transfermanager/AllowParallelCompositeUpload.java) |
| Download Bucket | [source code](https://github.com/googleapis/java-storage/blob/main/samples/snippets/src/main/java/com/example/storage/transfermanager/DownloadBucket.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-storage&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/storage/transfermanager/DownloadBucket.java) |
| Download Many | [source code](https://github.com/googleapis/java-storage/blob/main/samples/snippets/src/main/java/com/example/storage/transfermanager/DownloadMany.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-storage&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/storage/transfermanager/DownloadMany.java) |
| Upload Directory | [source code](https://github.com/googleapis/java-storage/blob/main/samples/snippets/src/main/java/com/example/storage/transfermanager/UploadDirectory.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-storage&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/storage/transfermanager/UploadDirectory.java) |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1387,7 +1387,7 @@ public final ManagedFolder createManagedFolder(CreateManagedFolderRequest reques
* // - 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 (StorageControlClient storageControlClient = StorageControlClient.create()) {
* ManagedFolderName name = ManagedFolderName.of("[PROJECT]", "[BUCKET]", "[MANAGEDFOLDER]");
* ManagedFolderName name = ManagedFolderName.of("[PROJECT]", "[BUCKET]", "[MANAGED_FOLDER]");
* storageControlClient.deleteManagedFolder(name);
* }
* }</pre>
Expand Down Expand Up @@ -1417,7 +1417,7 @@ public final void deleteManagedFolder(ManagedFolderName name) {
* // - 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 (StorageControlClient storageControlClient = StorageControlClient.create()) {
* String name = ManagedFolderName.of("[PROJECT]", "[BUCKET]", "[MANAGEDFOLDER]").toString();
* String name = ManagedFolderName.of("[PROJECT]", "[BUCKET]", "[MANAGED_FOLDER]").toString();
* storageControlClient.deleteManagedFolder(name);
* }
* }</pre>
Expand Down Expand Up @@ -1447,7 +1447,7 @@ public final void deleteManagedFolder(String name) {
* try (StorageControlClient storageControlClient = StorageControlClient.create()) {
* DeleteManagedFolderRequest request =
* DeleteManagedFolderRequest.newBuilder()
* .setName(ManagedFolderName.of("[PROJECT]", "[BUCKET]", "[MANAGEDFOLDER]").toString())
* .setName(ManagedFolderName.of("[PROJECT]", "[BUCKET]", "[MANAGED_FOLDER]").toString())
* .setIfMetagenerationMatch(1043427781)
* .setIfMetagenerationNotMatch(1025430873)
* .setAllowNonEmpty(true)
Expand Down Expand Up @@ -1479,7 +1479,7 @@ public final void deleteManagedFolder(DeleteManagedFolderRequest request) {
* try (StorageControlClient storageControlClient = StorageControlClient.create()) {
* DeleteManagedFolderRequest request =
* DeleteManagedFolderRequest.newBuilder()
* .setName(ManagedFolderName.of("[PROJECT]", "[BUCKET]", "[MANAGEDFOLDER]").toString())
* .setName(ManagedFolderName.of("[PROJECT]", "[BUCKET]", "[MANAGED_FOLDER]").toString())
* .setIfMetagenerationMatch(1043427781)
* .setIfMetagenerationNotMatch(1025430873)
* .setAllowNonEmpty(true)
Expand Down Expand Up @@ -1509,7 +1509,7 @@ public final UnaryCallable<DeleteManagedFolderRequest, Empty> deleteManagedFolde
* // - 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 (StorageControlClient storageControlClient = StorageControlClient.create()) {
* ManagedFolderName name = ManagedFolderName.of("[PROJECT]", "[BUCKET]", "[MANAGEDFOLDER]");
* ManagedFolderName name = ManagedFolderName.of("[PROJECT]", "[BUCKET]", "[MANAGED_FOLDER]");
* ManagedFolder response = storageControlClient.getManagedFolder(name);
* }
* }</pre>
Expand Down Expand Up @@ -1537,7 +1537,7 @@ public final ManagedFolder getManagedFolder(ManagedFolderName name) {
* // - 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 (StorageControlClient storageControlClient = StorageControlClient.create()) {
* String name = ManagedFolderName.of("[PROJECT]", "[BUCKET]", "[MANAGEDFOLDER]").toString();
* String name = ManagedFolderName.of("[PROJECT]", "[BUCKET]", "[MANAGED_FOLDER]").toString();
* ManagedFolder response = storageControlClient.getManagedFolder(name);
* }
* }</pre>
Expand Down Expand Up @@ -1566,7 +1566,7 @@ public final ManagedFolder getManagedFolder(String name) {
* try (StorageControlClient storageControlClient = StorageControlClient.create()) {
* GetManagedFolderRequest request =
* GetManagedFolderRequest.newBuilder()
* .setName(ManagedFolderName.of("[PROJECT]", "[BUCKET]", "[MANAGEDFOLDER]").toString())
* .setName(ManagedFolderName.of("[PROJECT]", "[BUCKET]", "[MANAGED_FOLDER]").toString())
* .setIfMetagenerationMatch(1043427781)
* .setIfMetagenerationNotMatch(1025430873)
* .setRequestId("requestId693933066")
Expand Down Expand Up @@ -1597,7 +1597,7 @@ public final ManagedFolder getManagedFolder(GetManagedFolderRequest request) {
* try (StorageControlClient storageControlClient = StorageControlClient.create()) {
* GetManagedFolderRequest request =
* GetManagedFolderRequest.newBuilder()
* .setName(ManagedFolderName.of("[PROJECT]", "[BUCKET]", "[MANAGEDFOLDER]").toString())
* .setName(ManagedFolderName.of("[PROJECT]", "[BUCKET]", "[MANAGED_FOLDER]").toString())
* .setIfMetagenerationMatch(1043427781)
* .setIfMetagenerationNotMatch(1025430873)
* .setRequestId("requestId693933066")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -615,7 +615,7 @@ public void getStorageLayoutExceptionTest2() throws Exception {
public void createManagedFolderTest() throws Exception {
ManagedFolder expectedResponse =
ManagedFolder.newBuilder()
.setName(ManagedFolderName.of("[PROJECT]", "[BUCKET]", "[MANAGEDFOLDER]").toString())
.setName(ManagedFolderName.of("[PROJECT]", "[BUCKET]", "[MANAGED_FOLDER]").toString())
.setMetageneration(1048558813)
.setCreateTime(Timestamp.newBuilder().build())
.setUpdateTime(Timestamp.newBuilder().build())
Expand Down Expand Up @@ -663,7 +663,7 @@ public void createManagedFolderExceptionTest() throws Exception {
public void createManagedFolderTest2() throws Exception {
ManagedFolder expectedResponse =
ManagedFolder.newBuilder()
.setName(ManagedFolderName.of("[PROJECT]", "[BUCKET]", "[MANAGEDFOLDER]").toString())
.setName(ManagedFolderName.of("[PROJECT]", "[BUCKET]", "[MANAGED_FOLDER]").toString())
.setMetageneration(1048558813)
.setCreateTime(Timestamp.newBuilder().build())
.setUpdateTime(Timestamp.newBuilder().build())
Expand Down Expand Up @@ -712,7 +712,7 @@ public void deleteManagedFolderTest() throws Exception {
Empty expectedResponse = Empty.newBuilder().build();
mockStorageControl.addResponse(expectedResponse);

ManagedFolderName name = ManagedFolderName.of("[PROJECT]", "[BUCKET]", "[MANAGEDFOLDER]");
ManagedFolderName name = ManagedFolderName.of("[PROJECT]", "[BUCKET]", "[MANAGED_FOLDER]");

client.deleteManagedFolder(name);

Expand All @@ -733,7 +733,7 @@ public void deleteManagedFolderExceptionTest() throws Exception {
mockStorageControl.addException(exception);

try {
ManagedFolderName name = ManagedFolderName.of("[PROJECT]", "[BUCKET]", "[MANAGEDFOLDER]");
ManagedFolderName name = ManagedFolderName.of("[PROJECT]", "[BUCKET]", "[MANAGED_FOLDER]");
client.deleteManagedFolder(name);
Assert.fail("No exception raised");
} catch (InvalidArgumentException e) {
Expand Down Expand Up @@ -779,14 +779,14 @@ public void deleteManagedFolderExceptionTest2() throws Exception {
public void getManagedFolderTest() throws Exception {
ManagedFolder expectedResponse =
ManagedFolder.newBuilder()
.setName(ManagedFolderName.of("[PROJECT]", "[BUCKET]", "[MANAGEDFOLDER]").toString())
.setName(ManagedFolderName.of("[PROJECT]", "[BUCKET]", "[MANAGED_FOLDER]").toString())
.setMetageneration(1048558813)
.setCreateTime(Timestamp.newBuilder().build())
.setUpdateTime(Timestamp.newBuilder().build())
.build();
mockStorageControl.addResponse(expectedResponse);

ManagedFolderName name = ManagedFolderName.of("[PROJECT]", "[BUCKET]", "[MANAGEDFOLDER]");
ManagedFolderName name = ManagedFolderName.of("[PROJECT]", "[BUCKET]", "[MANAGED_FOLDER]");

ManagedFolder actualResponse = client.getManagedFolder(name);
Assert.assertEquals(expectedResponse, actualResponse);
Expand All @@ -808,7 +808,7 @@ public void getManagedFolderExceptionTest() throws Exception {
mockStorageControl.addException(exception);

try {
ManagedFolderName name = ManagedFolderName.of("[PROJECT]", "[BUCKET]", "[MANAGEDFOLDER]");
ManagedFolderName name = ManagedFolderName.of("[PROJECT]", "[BUCKET]", "[MANAGED_FOLDER]");
client.getManagedFolder(name);
Assert.fail("No exception raised");
} catch (InvalidArgumentException e) {
Expand All @@ -820,7 +820,7 @@ public void getManagedFolderExceptionTest() throws Exception {
public void getManagedFolderTest2() throws Exception {
ManagedFolder expectedResponse =
ManagedFolder.newBuilder()
.setName(ManagedFolderName.of("[PROJECT]", "[BUCKET]", "[MANAGEDFOLDER]").toString())
.setName(ManagedFolderName.of("[PROJECT]", "[BUCKET]", "[MANAGED_FOLDER]").toString())
.setMetageneration(1048558813)
.setCreateTime(Timestamp.newBuilder().build())
.setUpdateTime(Timestamp.newBuilder().build())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@
// AUTO-GENERATED DOCUMENTATION AND CLASS.
@Generated("by gapic-generator-java")
public class ManagedFolderName implements ResourceName {
private static final PathTemplate PROJECT_BUCKET_MANAGEDFOLDER =
private static final PathTemplate PROJECT_BUCKET_MANAGED_FOLDER =
PathTemplate.createWithoutUrlEncoding(
"projects/{project}/buckets/{bucket}/managedFolders/{managedFolder=**}");
"projects/{project}/buckets/{bucket}/managedFolders/{managed_folder=**}");
private volatile Map<String, String> fieldValuesMap;
private final String project;
private final String bucket;
Expand Down Expand Up @@ -92,9 +92,9 @@ public static ManagedFolderName parse(String formattedString) {
return null;
}
Map<String, String> matchMap =
PROJECT_BUCKET_MANAGEDFOLDER.validatedMatch(
PROJECT_BUCKET_MANAGED_FOLDER.validatedMatch(
formattedString, "ManagedFolderName.parse: formattedString not in valid format");
return of(matchMap.get("project"), matchMap.get("bucket"), matchMap.get("managedFolder"));
return of(matchMap.get("project"), matchMap.get("bucket"), matchMap.get("managed_folder"));
}

public static List<ManagedFolderName> parseList(List<String> formattedStrings) {
Expand All @@ -118,7 +118,7 @@ public static List<String> toStringList(List<ManagedFolderName> values) {
}

public static boolean isParsableFrom(String formattedString) {
return PROJECT_BUCKET_MANAGEDFOLDER.matches(formattedString);
return PROJECT_BUCKET_MANAGED_FOLDER.matches(formattedString);
}

@Override
Expand All @@ -134,7 +134,7 @@ public Map<String, String> getFieldValuesMap() {
fieldMapBuilder.put("bucket", bucket);
}
if (managedFolder != null) {
fieldMapBuilder.put("managedFolder", managedFolder);
fieldMapBuilder.put("managed_folder", managedFolder);
}
fieldValuesMap = fieldMapBuilder.build();
}
Expand All @@ -149,8 +149,8 @@ public String getFieldValue(String fieldName) {

@Override
public String toString() {
return PROJECT_BUCKET_MANAGEDFOLDER.instantiate(
"project", project, "bucket", bucket, "managedFolder", managedFolder);
return PROJECT_BUCKET_MANAGED_FOLDER.instantiate(
"project", project, "bucket", bucket, "managed_folder", managedFolder);
}

@Override
Expand Down Expand Up @@ -179,7 +179,7 @@ public int hashCode() {
return h;
}

/** Builder for projects/{project}/buckets/{bucket}/managedFolders/{managedFolder=&#42;&#42;}. */
/** Builder for projects/{project}/buckets/{bucket}/managedFolders/{managed_folder=&#42;&#42;}. */
public static class Builder {
private String project;
private String bucket;
Expand Down
Loading
Loading