diff --git a/java-filestore/README.md b/java-filestore/README.md index 574795ba2aa1..0c3be8423c51 100644 --- a/java-filestore/README.md +++ b/java-filestore/README.md @@ -19,20 +19,20 @@ If you are using Maven, add this to your pom.xml file: com.google.cloud google-cloud-filestore - 1.6.0 + 1.7.0 ``` If you are using Gradle without BOM, add this to your dependencies: ```Groovy -implementation 'com.google.cloud:google-cloud-filestore:1.6.0' +implementation 'com.google.cloud:google-cloud-filestore:1.7.0' ``` If you are using SBT, add this to your dependencies: ```Scala -libraryDependencies += "com.google.cloud" % "google-cloud-filestore" % "1.6.0" +libraryDependencies += "com.google.cloud" % "google-cloud-filestore" % "1.7.0" ``` ## Authentication @@ -159,16 +159,16 @@ Java is a registered trademark of Oracle and/or its affiliates. [product-docs]: https://cloud.google.com/filestore/docs [javadocs]: https://cloud.google.com/java/docs/reference/google-cloud-filestore/latest/overview -[kokoro-badge-image-1]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-filestore/java7.svg -[kokoro-badge-link-1]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-filestore/java7.html -[kokoro-badge-image-2]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-filestore/java8.svg -[kokoro-badge-link-2]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-filestore/java8.html -[kokoro-badge-image-3]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-filestore/java8-osx.svg -[kokoro-badge-link-3]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-filestore/java8-osx.html -[kokoro-badge-image-4]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-filestore/java8-win.svg -[kokoro-badge-link-4]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-filestore/java8-win.html -[kokoro-badge-image-5]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-filestore/java11.svg -[kokoro-badge-link-5]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-filestore/java11.html +[kokoro-badge-image-1]: http://storage.googleapis.com/cloud-devrel-public/java/badges/google-cloud-java/java7.svg +[kokoro-badge-link-1]: http://storage.googleapis.com/cloud-devrel-public/java/badges/google-cloud-java/java7.html +[kokoro-badge-image-2]: http://storage.googleapis.com/cloud-devrel-public/java/badges/google-cloud-java/java8.svg +[kokoro-badge-link-2]: http://storage.googleapis.com/cloud-devrel-public/java/badges/google-cloud-java/java8.html +[kokoro-badge-image-3]: http://storage.googleapis.com/cloud-devrel-public/java/badges/google-cloud-java/java8-osx.svg +[kokoro-badge-link-3]: http://storage.googleapis.com/cloud-devrel-public/java/badges/google-cloud-java/java8-osx.html +[kokoro-badge-image-4]: http://storage.googleapis.com/cloud-devrel-public/java/badges/google-cloud-java/java8-win.svg +[kokoro-badge-link-4]: http://storage.googleapis.com/cloud-devrel-public/java/badges/google-cloud-java/java8-win.html +[kokoro-badge-image-5]: http://storage.googleapis.com/cloud-devrel-public/java/badges/google-cloud-java/java11.svg +[kokoro-badge-link-5]: http://storage.googleapis.com/cloud-devrel-public/java/badges/google-cloud-java/java11.html [stability-image]: https://img.shields.io/badge/stability-stable-green [maven-version-image]: https://img.shields.io/maven-central/v/com.google.cloud/google-cloud-filestore.svg [maven-version-link]: https://search.maven.org/search?q=g:com.google.cloud%20AND%20a:google-cloud-filestore&core=gav @@ -180,9 +180,9 @@ Java is a registered trademark of Oracle and/or its affiliates. [create-project]: https://cloud.google.com/resource-manager/docs/creating-managing-projects [cloud-sdk]: https://cloud.google.com/sdk/ [troubleshooting]: https://github.com/googleapis/google-cloud-common/blob/main/troubleshooting/readme.md#troubleshooting -[contributing]: https://github.com/googleapis/java-filestore/blob/main/CONTRIBUTING.md -[code-of-conduct]: https://github.com/googleapis/java-filestore/blob/main/CODE_OF_CONDUCT.md#contributor-code-of-conduct -[license]: https://github.com/googleapis/java-filestore/blob/main/LICENSE +[contributing]: https://github.com/googleapis/google-cloud-java/blob/main/CONTRIBUTING.md +[code-of-conduct]: https://github.com/googleapis/google-cloud-java/blob/main/CODE_OF_CONDUCT.md#contributor-code-of-conduct +[license]: https://github.com/googleapis/google-cloud-java/blob/main/LICENSE [enable-billing]: https://cloud.google.com/apis/docs/getting-started#enabling_billing [enable-api]: https://console.cloud.google.com/flows/enableapi?apiid=file.googleapis.com [libraries-bom]: https://github.com/GoogleCloudPlatform/cloud-opensource-java/wiki/The-Google-Cloud-Platform-Libraries-BOM diff --git a/java-filestore/google-cloud-filestore/src/main/java/com/google/cloud/filestore/v1beta1/CloudFilestoreManagerClient.java b/java-filestore/google-cloud-filestore/src/main/java/com/google/cloud/filestore/v1beta1/CloudFilestoreManagerClient.java index 37770e789315..3b997293688e 100644 --- a/java-filestore/google-cloud-filestore/src/main/java/com/google/cloud/filestore/v1beta1/CloudFilestoreManagerClient.java +++ b/java-filestore/google-cloud-filestore/src/main/java/com/google/cloud/filestore/v1beta1/CloudFilestoreManagerClient.java @@ -42,19 +42,19 @@ // AUTO-GENERATED DOCUMENTATION AND CLASS. /** - * Service Description: Configures and manages Cloud Filestore resources. + * Service Description: Configures and manages Filestore resources. * - *

Cloud Filestore Manager v1beta1. + *

Filestore Manager v1beta1. * - *

The `file.googleapis.com` service implements the Cloud Filestore API and defines the following - * model for managing resources: + *

The `file.googleapis.com` service implements the Filestore API and defines the following model + * for managing resources: * *

@@ -554,8 +554,8 @@ public final UnaryCallable getInstanceCallable() { * } * * @param parent Required. The instance's project and location, in the format - * `projects/{project_id}/locations/{location}`. In Cloud Filestore, locations map to GCP - * zones, for example **us-west1-b**. + * `projects/{project_id}/locations/{location}`. In Filestore, locations map to GCP zones, for + * example **us-west1-b**. * @param instance Required. An [instance resource][google.cloud.filestore.v1beta1.Instance] * @param instanceId Required. The ID of the instance to create. The ID must be unique within the * specified project and location. @@ -599,8 +599,8 @@ public final OperationFuture createInstanceAsync( * } * * @param parent Required. The instance's project and location, in the format - * `projects/{project_id}/locations/{location}`. In Cloud Filestore, locations map to GCP - * zones, for example **us-west1-b**. + * `projects/{project_id}/locations/{location}`. In Filestore, locations map to GCP zones, for + * example **us-west1-b**. * @param instance Required. An [instance resource][google.cloud.filestore.v1beta1.Instance] * @param instanceId Required. The ID of the instance to create. The ID must be unique within the * specified project and location. @@ -952,6 +952,98 @@ public final UnaryCallable restoreInstanceCal return stub.restoreInstanceCallable(); } + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Revert an existing instance's file system to a specified snapshot. + * + *

Sample code: + * + *

{@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 (CloudFilestoreManagerClient cloudFilestoreManagerClient =
+   *     CloudFilestoreManagerClient.create()) {
+   *   RevertInstanceRequest request =
+   *       RevertInstanceRequest.newBuilder()
+   *           .setName(InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString())
+   *           .setTargetSnapshotId("targetSnapshotId-2099459472")
+   *           .build();
+   *   Instance response = cloudFilestoreManagerClient.revertInstanceAsync(request).get();
+   * }
+   * }
+ * + * @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 OperationFuture revertInstanceAsync( + RevertInstanceRequest request) { + return revertInstanceOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Revert an existing instance's file system to a specified snapshot. + * + *

Sample code: + * + *

{@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 (CloudFilestoreManagerClient cloudFilestoreManagerClient =
+   *     CloudFilestoreManagerClient.create()) {
+   *   RevertInstanceRequest request =
+   *       RevertInstanceRequest.newBuilder()
+   *           .setName(InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString())
+   *           .setTargetSnapshotId("targetSnapshotId-2099459472")
+   *           .build();
+   *   OperationFuture future =
+   *       cloudFilestoreManagerClient.revertInstanceOperationCallable().futureCall(request);
+   *   // Do something.
+   *   Instance response = future.get();
+   * }
+   * }
+ */ + public final OperationCallable + revertInstanceOperationCallable() { + return stub.revertInstanceOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Revert an existing instance's file system to a specified snapshot. + * + *

Sample code: + * + *

{@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 (CloudFilestoreManagerClient cloudFilestoreManagerClient =
+   *     CloudFilestoreManagerClient.create()) {
+   *   RevertInstanceRequest request =
+   *       RevertInstanceRequest.newBuilder()
+   *           .setName(InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString())
+   *           .setTargetSnapshotId("targetSnapshotId-2099459472")
+   *           .build();
+   *   ApiFuture future =
+   *       cloudFilestoreManagerClient.revertInstanceCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable revertInstanceCallable() { + return stub.revertInstanceCallable(); + } + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Deletes an instance. @@ -1026,6 +1118,7 @@ public final OperationFuture deleteInstanceAsync(Strin * DeleteInstanceRequest request = * DeleteInstanceRequest.newBuilder() * .setName(InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString()) + * .setForce(true) * .build(); * cloudFilestoreManagerClient.deleteInstanceAsync(request).get(); * } @@ -1056,6 +1149,7 @@ public final OperationFuture deleteInstanceAsync( * DeleteInstanceRequest request = * DeleteInstanceRequest.newBuilder() * .setName(InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString()) + * .setForce(true) * .build(); * OperationFuture future = * cloudFilestoreManagerClient.deleteInstanceOperationCallable().futureCall(request); @@ -1086,6 +1180,7 @@ public final OperationFuture deleteInstanceAsync( * DeleteInstanceRequest request = * DeleteInstanceRequest.newBuilder() * .setName(InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString()) + * .setForce(true) * .build(); * ApiFuture future = * cloudFilestoreManagerClient.deleteInstanceCallable().futureCall(request); @@ -1100,7 +1195,7 @@ public final UnaryCallable deleteInstanceCalla // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Lists all backups in a project for either a specified location or for all locations. + * Lists all snapshots in a project for either a specified location or for all locations. * *

Sample code: * @@ -1112,30 +1207,28 @@ public final UnaryCallable deleteInstanceCalla * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library * try (CloudFilestoreManagerClient cloudFilestoreManagerClient = * CloudFilestoreManagerClient.create()) { - * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); - * for (Backup element : cloudFilestoreManagerClient.listBackups(parent).iterateAll()) { + * InstanceName parent = InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]"); + * for (Snapshot element : cloudFilestoreManagerClient.listSnapshots(parent).iterateAll()) { * // doThingsWith(element); * } * } * } * - * @param parent Required. The project and location for which to retrieve backup information, in - * the format `projects/{project_id}/locations/{location}`. In Cloud Filestore, backup - * locations map to GCP regions, for example **us-west1**. To retrieve backup - * information for all locations, use "-" for the `{location}` value. + * @param parent Required. The instance for which to retrieve snapshot information, in the format + * `projects/{project_id}/locations/{location}/instances/{instance_id}`. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final ListBackupsPagedResponse listBackups(LocationName parent) { - ListBackupsRequest request = - ListBackupsRequest.newBuilder() + public final ListSnapshotsPagedResponse listSnapshots(InstanceName parent) { + ListSnapshotsRequest request = + ListSnapshotsRequest.newBuilder() .setParent(parent == null ? null : parent.toString()) .build(); - return listBackups(request); + return listSnapshots(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Lists all backups in a project for either a specified location or for all locations. + * Lists all snapshots in a project for either a specified location or for all locations. * *

Sample code: * @@ -1147,27 +1240,25 @@ public final ListBackupsPagedResponse listBackups(LocationName parent) { * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library * try (CloudFilestoreManagerClient cloudFilestoreManagerClient = * CloudFilestoreManagerClient.create()) { - * String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); - * for (Backup element : cloudFilestoreManagerClient.listBackups(parent).iterateAll()) { + * String parent = InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString(); + * for (Snapshot element : cloudFilestoreManagerClient.listSnapshots(parent).iterateAll()) { * // doThingsWith(element); * } * } * } * - * @param parent Required. The project and location for which to retrieve backup information, in - * the format `projects/{project_id}/locations/{location}`. In Cloud Filestore, backup - * locations map to GCP regions, for example **us-west1**. To retrieve backup - * information for all locations, use "-" for the `{location}` value. + * @param parent Required. The instance for which to retrieve snapshot information, in the format + * `projects/{project_id}/locations/{location}/instances/{instance_id}`. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final ListBackupsPagedResponse listBackups(String parent) { - ListBackupsRequest request = ListBackupsRequest.newBuilder().setParent(parent).build(); - return listBackups(request); + public final ListSnapshotsPagedResponse listSnapshots(String parent) { + ListSnapshotsRequest request = ListSnapshotsRequest.newBuilder().setParent(parent).build(); + return listSnapshots(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Lists all backups in a project for either a specified location or for all locations. + * Lists all snapshots in a project for either a specified location or for all locations. * *

Sample code: * @@ -1179,15 +1270,15 @@ public final ListBackupsPagedResponse listBackups(String parent) { * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library * try (CloudFilestoreManagerClient cloudFilestoreManagerClient = * CloudFilestoreManagerClient.create()) { - * ListBackupsRequest request = - * ListBackupsRequest.newBuilder() - * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + * ListSnapshotsRequest request = + * ListSnapshotsRequest.newBuilder() + * .setParent(InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString()) * .setPageSize(883849137) * .setPageToken("pageToken873572522") * .setOrderBy("orderBy-1207110587") * .setFilter("filter-1274492040") * .build(); - * for (Backup element : cloudFilestoreManagerClient.listBackups(request).iterateAll()) { + * for (Snapshot element : cloudFilestoreManagerClient.listSnapshots(request).iterateAll()) { * // doThingsWith(element); * } * } @@ -1196,13 +1287,13 @@ public final ListBackupsPagedResponse listBackups(String parent) { * @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 ListBackupsPagedResponse listBackups(ListBackupsRequest request) { - return listBackupsPagedCallable().call(request); + public final ListSnapshotsPagedResponse listSnapshots(ListSnapshotsRequest request) { + return listSnapshotsPagedCallable().call(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Lists all backups in a project for either a specified location or for all locations. + * Lists all snapshots in a project for either a specified location or for all locations. * *

Sample code: * @@ -1214,31 +1305,31 @@ public final ListBackupsPagedResponse listBackups(ListBackupsRequest request) { * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library * try (CloudFilestoreManagerClient cloudFilestoreManagerClient = * CloudFilestoreManagerClient.create()) { - * ListBackupsRequest request = - * ListBackupsRequest.newBuilder() - * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + * ListSnapshotsRequest request = + * ListSnapshotsRequest.newBuilder() + * .setParent(InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString()) * .setPageSize(883849137) * .setPageToken("pageToken873572522") * .setOrderBy("orderBy-1207110587") * .setFilter("filter-1274492040") * .build(); - * ApiFuture future = - * cloudFilestoreManagerClient.listBackupsPagedCallable().futureCall(request); + * ApiFuture future = + * cloudFilestoreManagerClient.listSnapshotsPagedCallable().futureCall(request); * // Do something. - * for (Backup element : future.get().iterateAll()) { + * for (Snapshot element : future.get().iterateAll()) { * // doThingsWith(element); * } * } * } */ - public final UnaryCallable - listBackupsPagedCallable() { - return stub.listBackupsPagedCallable(); + public final UnaryCallable + listSnapshotsPagedCallable() { + return stub.listSnapshotsPagedCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Lists all backups in a project for either a specified location or for all locations. + * Lists all snapshots in a project for either a specified location or for all locations. * *

Sample code: * @@ -1250,18 +1341,18 @@ public final ListBackupsPagedResponse listBackups(ListBackupsRequest request) { * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library * try (CloudFilestoreManagerClient cloudFilestoreManagerClient = * CloudFilestoreManagerClient.create()) { - * ListBackupsRequest request = - * ListBackupsRequest.newBuilder() - * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + * ListSnapshotsRequest request = + * ListSnapshotsRequest.newBuilder() + * .setParent(InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString()) * .setPageSize(883849137) * .setPageToken("pageToken873572522") * .setOrderBy("orderBy-1207110587") * .setFilter("filter-1274492040") * .build(); * while (true) { - * ListBackupsResponse response = - * cloudFilestoreManagerClient.listBackupsCallable().call(request); - * for (Backup element : response.getBackupsList()) { + * ListSnapshotsResponse response = + * cloudFilestoreManagerClient.listSnapshotsCallable().call(request); + * for (Snapshot element : response.getSnapshotsList()) { * // doThingsWith(element); * } * String nextPageToken = response.getNextPageToken(); @@ -1274,13 +1365,13 @@ public final ListBackupsPagedResponse listBackups(ListBackupsRequest request) { * } * } */ - public final UnaryCallable listBackupsCallable() { - return stub.listBackupsCallable(); + public final UnaryCallable listSnapshotsCallable() { + return stub.listSnapshotsCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Gets the details of a specific backup. + * Gets the details of a specific snapshot. * *

Sample code: * @@ -1292,24 +1383,24 @@ public final UnaryCallable listBackupsC * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library * try (CloudFilestoreManagerClient cloudFilestoreManagerClient = * CloudFilestoreManagerClient.create()) { - * BackupName name = BackupName.of("[PROJECT]", "[LOCATION]", "[BACKUP]"); - * Backup response = cloudFilestoreManagerClient.getBackup(name); + * SnapshotName name = SnapshotName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]", "[SNAPSHOT]"); + * Snapshot response = cloudFilestoreManagerClient.getSnapshot(name); * } * } * - * @param name Required. The backup resource name, in the format - * `projects/{project_id}/locations/{location}/backups/{backup_id}`. + * @param name Required. The snapshot resource name, in the format + * `projects/{project_id}/locations/{location}/instances/{instance_id}/snapshots/{snapshot_id}` * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final Backup getBackup(BackupName name) { - GetBackupRequest request = - GetBackupRequest.newBuilder().setName(name == null ? null : name.toString()).build(); - return getBackup(request); + public final Snapshot getSnapshot(SnapshotName name) { + GetSnapshotRequest request = + GetSnapshotRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return getSnapshot(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Gets the details of a specific backup. + * Gets the details of a specific snapshot. * *

Sample code: * @@ -1321,23 +1412,24 @@ public final Backup getBackup(BackupName name) { * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library * try (CloudFilestoreManagerClient cloudFilestoreManagerClient = * CloudFilestoreManagerClient.create()) { - * String name = BackupName.of("[PROJECT]", "[LOCATION]", "[BACKUP]").toString(); - * Backup response = cloudFilestoreManagerClient.getBackup(name); + * String name = + * SnapshotName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]", "[SNAPSHOT]").toString(); + * Snapshot response = cloudFilestoreManagerClient.getSnapshot(name); * } * } * - * @param name Required. The backup resource name, in the format - * `projects/{project_id}/locations/{location}/backups/{backup_id}`. + * @param name Required. The snapshot resource name, in the format + * `projects/{project_id}/locations/{location}/instances/{instance_id}/snapshots/{snapshot_id}` * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final Backup getBackup(String name) { - GetBackupRequest request = GetBackupRequest.newBuilder().setName(name).build(); - return getBackup(request); + public final Snapshot getSnapshot(String name) { + GetSnapshotRequest request = GetSnapshotRequest.newBuilder().setName(name).build(); + return getSnapshot(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Gets the details of a specific backup. + * Gets the details of a specific snapshot. * *

Sample code: * @@ -1349,24 +1441,25 @@ public final Backup getBackup(String name) { * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library * try (CloudFilestoreManagerClient cloudFilestoreManagerClient = * CloudFilestoreManagerClient.create()) { - * GetBackupRequest request = - * GetBackupRequest.newBuilder() - * .setName(BackupName.of("[PROJECT]", "[LOCATION]", "[BACKUP]").toString()) + * GetSnapshotRequest request = + * GetSnapshotRequest.newBuilder() + * .setName( + * SnapshotName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]", "[SNAPSHOT]").toString()) * .build(); - * Backup response = cloudFilestoreManagerClient.getBackup(request); + * Snapshot response = cloudFilestoreManagerClient.getSnapshot(request); * } * } * * @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 Backup getBackup(GetBackupRequest request) { - return getBackupCallable().call(request); + public final Snapshot getSnapshot(GetSnapshotRequest request) { + return getSnapshotCallable().call(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Gets the details of a specific backup. + * Gets the details of a specific snapshot. * *

Sample code: * @@ -1378,24 +1471,25 @@ public final Backup getBackup(GetBackupRequest request) { * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library * try (CloudFilestoreManagerClient cloudFilestoreManagerClient = * CloudFilestoreManagerClient.create()) { - * GetBackupRequest request = - * GetBackupRequest.newBuilder() - * .setName(BackupName.of("[PROJECT]", "[LOCATION]", "[BACKUP]").toString()) + * GetSnapshotRequest request = + * GetSnapshotRequest.newBuilder() + * .setName( + * SnapshotName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]", "[SNAPSHOT]").toString()) * .build(); - * ApiFuture future = - * cloudFilestoreManagerClient.getBackupCallable().futureCall(request); + * ApiFuture future = + * cloudFilestoreManagerClient.getSnapshotCallable().futureCall(request); * // Do something. - * Backup response = future.get(); + * Snapshot response = future.get(); * } * } */ - public final UnaryCallable getBackupCallable() { - return stub.getBackupCallable(); + public final UnaryCallable getSnapshotCallable() { + return stub.getSnapshotCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Creates a backup. + * Creates a snapshot. * *

Sample code: * @@ -1407,38 +1501,37 @@ public final UnaryCallable getBackupCallable() { * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library * try (CloudFilestoreManagerClient cloudFilestoreManagerClient = * CloudFilestoreManagerClient.create()) { - * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); - * Backup backup = Backup.newBuilder().build(); - * String backupId = "backupId2121930365"; - * Backup response = - * cloudFilestoreManagerClient.createBackupAsync(parent, backup, backupId).get(); + * InstanceName parent = InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]"); + * Snapshot snapshot = Snapshot.newBuilder().build(); + * String snapshotId = "snapshotId-1113817601"; + * Snapshot response = + * cloudFilestoreManagerClient.createSnapshotAsync(parent, snapshot, snapshotId).get(); * } * } * - * @param parent Required. The backup's project and location, in the format - * `projects/{project_id}/locations/{location}`. In Cloud Filestore, backup locations map to - * GCP regions, for example **us-west1**. - * @param backup Required. A [backup resource][google.cloud.filestore.v1beta1.Backup] - * @param backupId Required. The ID to use for the backup. The ID must be unique within the - * specified project and location. + * @param parent Required. The Filestore Instance to create the snapshots of, in the format + * `projects/{project_id}/locations/{location}/instances/{instance_id}` + * @param snapshot Required. A snapshot resource + * @param snapshotId Required. The ID to use for the snapshot. The ID must be unique within the + * specified instance. *

This value must start with a lowercase letter followed by up to 62 lowercase letters, * numbers, or hyphens, and cannot end with a hyphen. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final OperationFuture createBackupAsync( - LocationName parent, Backup backup, String backupId) { - CreateBackupRequest request = - CreateBackupRequest.newBuilder() + public final OperationFuture createSnapshotAsync( + InstanceName parent, Snapshot snapshot, String snapshotId) { + CreateSnapshotRequest request = + CreateSnapshotRequest.newBuilder() .setParent(parent == null ? null : parent.toString()) - .setBackup(backup) - .setBackupId(backupId) + .setSnapshot(snapshot) + .setSnapshotId(snapshotId) .build(); - return createBackupAsync(request); + return createSnapshotAsync(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Creates a backup. + * Creates a snapshot. * *

Sample code: * @@ -1450,38 +1543,37 @@ public final OperationFuture createBackupAsync( * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library * try (CloudFilestoreManagerClient cloudFilestoreManagerClient = * CloudFilestoreManagerClient.create()) { - * String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); - * Backup backup = Backup.newBuilder().build(); - * String backupId = "backupId2121930365"; - * Backup response = - * cloudFilestoreManagerClient.createBackupAsync(parent, backup, backupId).get(); + * String parent = InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString(); + * Snapshot snapshot = Snapshot.newBuilder().build(); + * String snapshotId = "snapshotId-1113817601"; + * Snapshot response = + * cloudFilestoreManagerClient.createSnapshotAsync(parent, snapshot, snapshotId).get(); * } * } * - * @param parent Required. The backup's project and location, in the format - * `projects/{project_id}/locations/{location}`. In Cloud Filestore, backup locations map to - * GCP regions, for example **us-west1**. - * @param backup Required. A [backup resource][google.cloud.filestore.v1beta1.Backup] - * @param backupId Required. The ID to use for the backup. The ID must be unique within the - * specified project and location. + * @param parent Required. The Filestore Instance to create the snapshots of, in the format + * `projects/{project_id}/locations/{location}/instances/{instance_id}` + * @param snapshot Required. A snapshot resource + * @param snapshotId Required. The ID to use for the snapshot. The ID must be unique within the + * specified instance. *

This value must start with a lowercase letter followed by up to 62 lowercase letters, * numbers, or hyphens, and cannot end with a hyphen. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final OperationFuture createBackupAsync( - String parent, Backup backup, String backupId) { - CreateBackupRequest request = - CreateBackupRequest.newBuilder() + public final OperationFuture createSnapshotAsync( + String parent, Snapshot snapshot, String snapshotId) { + CreateSnapshotRequest request = + CreateSnapshotRequest.newBuilder() .setParent(parent) - .setBackup(backup) - .setBackupId(backupId) + .setSnapshot(snapshot) + .setSnapshotId(snapshotId) .build(); - return createBackupAsync(request); + return createSnapshotAsync(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Creates a backup. + * Creates a snapshot. * *

Sample code: * @@ -1493,27 +1585,27 @@ public final OperationFuture createBackupAsync( * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library * try (CloudFilestoreManagerClient cloudFilestoreManagerClient = * CloudFilestoreManagerClient.create()) { - * CreateBackupRequest request = - * CreateBackupRequest.newBuilder() - * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) - * .setBackup(Backup.newBuilder().build()) - * .setBackupId("backupId2121930365") + * CreateSnapshotRequest request = + * CreateSnapshotRequest.newBuilder() + * .setParent(InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString()) + * .setSnapshotId("snapshotId-1113817601") + * .setSnapshot(Snapshot.newBuilder().build()) * .build(); - * Backup response = cloudFilestoreManagerClient.createBackupAsync(request).get(); + * Snapshot response = cloudFilestoreManagerClient.createSnapshotAsync(request).get(); * } * } * * @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 OperationFuture createBackupAsync( - CreateBackupRequest request) { - return createBackupOperationCallable().futureCall(request); + public final OperationFuture createSnapshotAsync( + CreateSnapshotRequest request) { + return createSnapshotOperationCallable().futureCall(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Creates a backup. + * Creates a snapshot. * *

Sample code: * @@ -1525,27 +1617,27 @@ public final OperationFuture createBackupAsync( * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library * try (CloudFilestoreManagerClient cloudFilestoreManagerClient = * CloudFilestoreManagerClient.create()) { - * CreateBackupRequest request = - * CreateBackupRequest.newBuilder() - * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) - * .setBackup(Backup.newBuilder().build()) - * .setBackupId("backupId2121930365") + * CreateSnapshotRequest request = + * CreateSnapshotRequest.newBuilder() + * .setParent(InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString()) + * .setSnapshotId("snapshotId-1113817601") + * .setSnapshot(Snapshot.newBuilder().build()) * .build(); - * OperationFuture future = - * cloudFilestoreManagerClient.createBackupOperationCallable().futureCall(request); + * OperationFuture future = + * cloudFilestoreManagerClient.createSnapshotOperationCallable().futureCall(request); * // Do something. - * Backup response = future.get(); + * Snapshot response = future.get(); * } * } */ - public final OperationCallable - createBackupOperationCallable() { - return stub.createBackupOperationCallable(); + public final OperationCallable + createSnapshotOperationCallable() { + return stub.createSnapshotOperationCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Creates a backup. + * Creates a snapshot. * *

Sample code: * @@ -1557,26 +1649,26 @@ public final OperationFuture createBackupAsync( * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library * try (CloudFilestoreManagerClient cloudFilestoreManagerClient = * CloudFilestoreManagerClient.create()) { - * CreateBackupRequest request = - * CreateBackupRequest.newBuilder() - * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) - * .setBackup(Backup.newBuilder().build()) - * .setBackupId("backupId2121930365") + * CreateSnapshotRequest request = + * CreateSnapshotRequest.newBuilder() + * .setParent(InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString()) + * .setSnapshotId("snapshotId-1113817601") + * .setSnapshot(Snapshot.newBuilder().build()) * .build(); * ApiFuture future = - * cloudFilestoreManagerClient.createBackupCallable().futureCall(request); + * cloudFilestoreManagerClient.createSnapshotCallable().futureCall(request); * // Do something. * Operation response = future.get(); * } * } */ - public final UnaryCallable createBackupCallable() { - return stub.createBackupCallable(); + public final UnaryCallable createSnapshotCallable() { + return stub.createSnapshotCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Deletes a backup. + * Deletes a snapshot. * *

Sample code: * @@ -1588,24 +1680,24 @@ public final UnaryCallable createBackupCallable( * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library * try (CloudFilestoreManagerClient cloudFilestoreManagerClient = * CloudFilestoreManagerClient.create()) { - * BackupName name = BackupName.of("[PROJECT]", "[LOCATION]", "[BACKUP]"); - * cloudFilestoreManagerClient.deleteBackupAsync(name).get(); + * SnapshotName name = SnapshotName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]", "[SNAPSHOT]"); + * cloudFilestoreManagerClient.deleteSnapshotAsync(name).get(); * } * } * - * @param name Required. The backup resource name, in the format - * `projects/{project_id}/locations/{location}/backups/{backup_id}` + * @param name Required. The snapshot resource name, in the format + * `projects/{project_id}/locations/{location}/instances/{instance_id}/snapshots/{snapshot_id}` * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final OperationFuture deleteBackupAsync(BackupName name) { - DeleteBackupRequest request = - DeleteBackupRequest.newBuilder().setName(name == null ? null : name.toString()).build(); - return deleteBackupAsync(request); + public final OperationFuture deleteSnapshotAsync(SnapshotName name) { + DeleteSnapshotRequest request = + DeleteSnapshotRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return deleteSnapshotAsync(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Deletes a backup. + * Deletes a snapshot. * *

Sample code: * @@ -1617,23 +1709,24 @@ public final OperationFuture deleteBackupAsync(BackupN * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library * try (CloudFilestoreManagerClient cloudFilestoreManagerClient = * CloudFilestoreManagerClient.create()) { - * String name = BackupName.of("[PROJECT]", "[LOCATION]", "[BACKUP]").toString(); - * cloudFilestoreManagerClient.deleteBackupAsync(name).get(); + * String name = + * SnapshotName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]", "[SNAPSHOT]").toString(); + * cloudFilestoreManagerClient.deleteSnapshotAsync(name).get(); * } * } * - * @param name Required. The backup resource name, in the format - * `projects/{project_id}/locations/{location}/backups/{backup_id}` + * @param name Required. The snapshot resource name, in the format + * `projects/{project_id}/locations/{location}/instances/{instance_id}/snapshots/{snapshot_id}` * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final OperationFuture deleteBackupAsync(String name) { - DeleteBackupRequest request = DeleteBackupRequest.newBuilder().setName(name).build(); - return deleteBackupAsync(request); + public final OperationFuture deleteSnapshotAsync(String name) { + DeleteSnapshotRequest request = DeleteSnapshotRequest.newBuilder().setName(name).build(); + return deleteSnapshotAsync(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Deletes a backup. + * Deletes a snapshot. * *

Sample code: * @@ -1645,25 +1738,26 @@ public final OperationFuture deleteBackupAsync(String * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library * try (CloudFilestoreManagerClient cloudFilestoreManagerClient = * CloudFilestoreManagerClient.create()) { - * DeleteBackupRequest request = - * DeleteBackupRequest.newBuilder() - * .setName(BackupName.of("[PROJECT]", "[LOCATION]", "[BACKUP]").toString()) + * DeleteSnapshotRequest request = + * DeleteSnapshotRequest.newBuilder() + * .setName( + * SnapshotName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]", "[SNAPSHOT]").toString()) * .build(); - * cloudFilestoreManagerClient.deleteBackupAsync(request).get(); + * cloudFilestoreManagerClient.deleteSnapshotAsync(request).get(); * } * } * * @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 OperationFuture deleteBackupAsync( - DeleteBackupRequest request) { - return deleteBackupOperationCallable().futureCall(request); + public final OperationFuture deleteSnapshotAsync( + DeleteSnapshotRequest request) { + return deleteSnapshotOperationCallable().futureCall(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Deletes a backup. + * Deletes a snapshot. * *

Sample code: * @@ -1675,25 +1769,26 @@ public final OperationFuture deleteBackupAsync( * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library * try (CloudFilestoreManagerClient cloudFilestoreManagerClient = * CloudFilestoreManagerClient.create()) { - * DeleteBackupRequest request = - * DeleteBackupRequest.newBuilder() - * .setName(BackupName.of("[PROJECT]", "[LOCATION]", "[BACKUP]").toString()) + * DeleteSnapshotRequest request = + * DeleteSnapshotRequest.newBuilder() + * .setName( + * SnapshotName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]", "[SNAPSHOT]").toString()) * .build(); * OperationFuture future = - * cloudFilestoreManagerClient.deleteBackupOperationCallable().futureCall(request); + * cloudFilestoreManagerClient.deleteSnapshotOperationCallable().futureCall(request); * // Do something. * future.get(); * } * } */ - public final OperationCallable - deleteBackupOperationCallable() { - return stub.deleteBackupOperationCallable(); + public final OperationCallable + deleteSnapshotOperationCallable() { + return stub.deleteSnapshotOperationCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Deletes a backup. + * Deletes a snapshot. * *

Sample code: * @@ -1705,24 +1800,25 @@ public final OperationFuture deleteBackupAsync( * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library * try (CloudFilestoreManagerClient cloudFilestoreManagerClient = * CloudFilestoreManagerClient.create()) { - * DeleteBackupRequest request = - * DeleteBackupRequest.newBuilder() - * .setName(BackupName.of("[PROJECT]", "[LOCATION]", "[BACKUP]").toString()) + * DeleteSnapshotRequest request = + * DeleteSnapshotRequest.newBuilder() + * .setName( + * SnapshotName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]", "[SNAPSHOT]").toString()) * .build(); * ApiFuture future = - * cloudFilestoreManagerClient.deleteBackupCallable().futureCall(request); + * cloudFilestoreManagerClient.deleteSnapshotCallable().futureCall(request); * // Do something. * future.get(); * } * } */ - public final UnaryCallable deleteBackupCallable() { - return stub.deleteBackupCallable(); + public final UnaryCallable deleteSnapshotCallable() { + return stub.deleteSnapshotCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Updates the settings of a specific backup. + * Updates the settings of a specific snapshot. * *

Sample code: * @@ -1734,13 +1830,760 @@ public final UnaryCallable deleteBackupCallable( * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library * try (CloudFilestoreManagerClient cloudFilestoreManagerClient = * CloudFilestoreManagerClient.create()) { - * Backup backup = Backup.newBuilder().build(); + * Snapshot snapshot = Snapshot.newBuilder().build(); * FieldMask updateMask = FieldMask.newBuilder().build(); - * Backup response = cloudFilestoreManagerClient.updateBackupAsync(backup, updateMask).get(); + * Snapshot response = + * cloudFilestoreManagerClient.updateSnapshotAsync(snapshot, updateMask).get(); * } * } * - * @param backup Required. A [backup resource][google.cloud.filestore.v1beta1.Backup] + * @param snapshot Required. A snapshot resource + * @param updateMask Required. Mask of fields to update. At least one path must be supplied in + * this field. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture updateSnapshotAsync( + Snapshot snapshot, FieldMask updateMask) { + UpdateSnapshotRequest request = + UpdateSnapshotRequest.newBuilder().setSnapshot(snapshot).setUpdateMask(updateMask).build(); + return updateSnapshotAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates the settings of a specific snapshot. + * + *

Sample code: + * + *

{@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 (CloudFilestoreManagerClient cloudFilestoreManagerClient =
+   *     CloudFilestoreManagerClient.create()) {
+   *   UpdateSnapshotRequest request =
+   *       UpdateSnapshotRequest.newBuilder()
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .setSnapshot(Snapshot.newBuilder().build())
+   *           .build();
+   *   Snapshot response = cloudFilestoreManagerClient.updateSnapshotAsync(request).get();
+   * }
+   * }
+ * + * @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 OperationFuture updateSnapshotAsync( + UpdateSnapshotRequest request) { + return updateSnapshotOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates the settings of a specific snapshot. + * + *

Sample code: + * + *

{@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 (CloudFilestoreManagerClient cloudFilestoreManagerClient =
+   *     CloudFilestoreManagerClient.create()) {
+   *   UpdateSnapshotRequest request =
+   *       UpdateSnapshotRequest.newBuilder()
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .setSnapshot(Snapshot.newBuilder().build())
+   *           .build();
+   *   OperationFuture future =
+   *       cloudFilestoreManagerClient.updateSnapshotOperationCallable().futureCall(request);
+   *   // Do something.
+   *   Snapshot response = future.get();
+   * }
+   * }
+ */ + public final OperationCallable + updateSnapshotOperationCallable() { + return stub.updateSnapshotOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates the settings of a specific snapshot. + * + *

Sample code: + * + *

{@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 (CloudFilestoreManagerClient cloudFilestoreManagerClient =
+   *     CloudFilestoreManagerClient.create()) {
+   *   UpdateSnapshotRequest request =
+   *       UpdateSnapshotRequest.newBuilder()
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .setSnapshot(Snapshot.newBuilder().build())
+   *           .build();
+   *   ApiFuture future =
+   *       cloudFilestoreManagerClient.updateSnapshotCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable updateSnapshotCallable() { + return stub.updateSnapshotCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists all backups in a project for either a specified location or for all locations. + * + *

Sample code: + * + *

{@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 (CloudFilestoreManagerClient cloudFilestoreManagerClient =
+   *     CloudFilestoreManagerClient.create()) {
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   for (Backup element : cloudFilestoreManagerClient.listBackups(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. The project and location for which to retrieve backup information, in + * the format `projects/{project_id}/locations/{location}`. In Filestore, backup locations map + * to GCP regions, for example **us-west1**. To retrieve backup information + * for all locations, use "-" for the `{location}` value. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListBackupsPagedResponse listBackups(LocationName parent) { + ListBackupsRequest request = + ListBackupsRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .build(); + return listBackups(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists all backups in a project for either a specified location or for all locations. + * + *

Sample code: + * + *

{@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 (CloudFilestoreManagerClient cloudFilestoreManagerClient =
+   *     CloudFilestoreManagerClient.create()) {
+   *   String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
+   *   for (Backup element : cloudFilestoreManagerClient.listBackups(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. The project and location for which to retrieve backup information, in + * the format `projects/{project_id}/locations/{location}`. In Filestore, backup locations map + * to GCP regions, for example **us-west1**. To retrieve backup information + * for all locations, use "-" for the `{location}` value. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListBackupsPagedResponse listBackups(String parent) { + ListBackupsRequest request = ListBackupsRequest.newBuilder().setParent(parent).build(); + return listBackups(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists all backups in a project for either a specified location or for all locations. + * + *

Sample code: + * + *

{@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 (CloudFilestoreManagerClient cloudFilestoreManagerClient =
+   *     CloudFilestoreManagerClient.create()) {
+   *   ListBackupsRequest request =
+   *       ListBackupsRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .setOrderBy("orderBy-1207110587")
+   *           .setFilter("filter-1274492040")
+   *           .build();
+   *   for (Backup element : cloudFilestoreManagerClient.listBackups(request).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @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 ListBackupsPagedResponse listBackups(ListBackupsRequest request) { + return listBackupsPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists all backups in a project for either a specified location or for all locations. + * + *

Sample code: + * + *

{@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 (CloudFilestoreManagerClient cloudFilestoreManagerClient =
+   *     CloudFilestoreManagerClient.create()) {
+   *   ListBackupsRequest request =
+   *       ListBackupsRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .setOrderBy("orderBy-1207110587")
+   *           .setFilter("filter-1274492040")
+   *           .build();
+   *   ApiFuture future =
+   *       cloudFilestoreManagerClient.listBackupsPagedCallable().futureCall(request);
+   *   // Do something.
+   *   for (Backup element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable + listBackupsPagedCallable() { + return stub.listBackupsPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists all backups in a project for either a specified location or for all locations. + * + *

Sample code: + * + *

{@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 (CloudFilestoreManagerClient cloudFilestoreManagerClient =
+   *     CloudFilestoreManagerClient.create()) {
+   *   ListBackupsRequest request =
+   *       ListBackupsRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .setOrderBy("orderBy-1207110587")
+   *           .setFilter("filter-1274492040")
+   *           .build();
+   *   while (true) {
+   *     ListBackupsResponse response =
+   *         cloudFilestoreManagerClient.listBackupsCallable().call(request);
+   *     for (Backup element : response.getBackupsList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable listBackupsCallable() { + return stub.listBackupsCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets the details of a specific backup. + * + *

Sample code: + * + *

{@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 (CloudFilestoreManagerClient cloudFilestoreManagerClient =
+   *     CloudFilestoreManagerClient.create()) {
+   *   BackupName name = BackupName.of("[PROJECT]", "[LOCATION]", "[BACKUP]");
+   *   Backup response = cloudFilestoreManagerClient.getBackup(name);
+   * }
+   * }
+ * + * @param name Required. The backup resource name, in the format + * `projects/{project_id}/locations/{location}/backups/{backup_id}`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Backup getBackup(BackupName name) { + GetBackupRequest request = + GetBackupRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return getBackup(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets the details of a specific backup. + * + *

Sample code: + * + *

{@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 (CloudFilestoreManagerClient cloudFilestoreManagerClient =
+   *     CloudFilestoreManagerClient.create()) {
+   *   String name = BackupName.of("[PROJECT]", "[LOCATION]", "[BACKUP]").toString();
+   *   Backup response = cloudFilestoreManagerClient.getBackup(name);
+   * }
+   * }
+ * + * @param name Required. The backup resource name, in the format + * `projects/{project_id}/locations/{location}/backups/{backup_id}`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Backup getBackup(String name) { + GetBackupRequest request = GetBackupRequest.newBuilder().setName(name).build(); + return getBackup(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets the details of a specific backup. + * + *

Sample code: + * + *

{@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 (CloudFilestoreManagerClient cloudFilestoreManagerClient =
+   *     CloudFilestoreManagerClient.create()) {
+   *   GetBackupRequest request =
+   *       GetBackupRequest.newBuilder()
+   *           .setName(BackupName.of("[PROJECT]", "[LOCATION]", "[BACKUP]").toString())
+   *           .build();
+   *   Backup response = cloudFilestoreManagerClient.getBackup(request);
+   * }
+   * }
+ * + * @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 Backup getBackup(GetBackupRequest request) { + return getBackupCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets the details of a specific backup. + * + *

Sample code: + * + *

{@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 (CloudFilestoreManagerClient cloudFilestoreManagerClient =
+   *     CloudFilestoreManagerClient.create()) {
+   *   GetBackupRequest request =
+   *       GetBackupRequest.newBuilder()
+   *           .setName(BackupName.of("[PROJECT]", "[LOCATION]", "[BACKUP]").toString())
+   *           .build();
+   *   ApiFuture future =
+   *       cloudFilestoreManagerClient.getBackupCallable().futureCall(request);
+   *   // Do something.
+   *   Backup response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable getBackupCallable() { + return stub.getBackupCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a backup. + * + *

Sample code: + * + *

{@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 (CloudFilestoreManagerClient cloudFilestoreManagerClient =
+   *     CloudFilestoreManagerClient.create()) {
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   Backup backup = Backup.newBuilder().build();
+   *   String backupId = "backupId2121930365";
+   *   Backup response =
+   *       cloudFilestoreManagerClient.createBackupAsync(parent, backup, backupId).get();
+   * }
+   * }
+ * + * @param parent Required. The backup's project and location, in the format + * `projects/{project_id}/locations/{location}`. In Filestore, backup locations map to GCP + * regions, for example **us-west1**. + * @param backup Required. A [backup resource][google.cloud.filestore.v1beta1.Backup] + * @param backupId Required. The ID to use for the backup. The ID must be unique within the + * specified project and location. + *

This value must start with a lowercase letter followed by up to 62 lowercase letters, + * numbers, or hyphens, and cannot end with a hyphen. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture createBackupAsync( + LocationName parent, Backup backup, String backupId) { + CreateBackupRequest request = + CreateBackupRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .setBackup(backup) + .setBackupId(backupId) + .build(); + return createBackupAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a backup. + * + *

Sample code: + * + *

{@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 (CloudFilestoreManagerClient cloudFilestoreManagerClient =
+   *     CloudFilestoreManagerClient.create()) {
+   *   String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
+   *   Backup backup = Backup.newBuilder().build();
+   *   String backupId = "backupId2121930365";
+   *   Backup response =
+   *       cloudFilestoreManagerClient.createBackupAsync(parent, backup, backupId).get();
+   * }
+   * }
+ * + * @param parent Required. The backup's project and location, in the format + * `projects/{project_id}/locations/{location}`. In Filestore, backup locations map to GCP + * regions, for example **us-west1**. + * @param backup Required. A [backup resource][google.cloud.filestore.v1beta1.Backup] + * @param backupId Required. The ID to use for the backup. The ID must be unique within the + * specified project and location. + *

This value must start with a lowercase letter followed by up to 62 lowercase letters, + * numbers, or hyphens, and cannot end with a hyphen. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture createBackupAsync( + String parent, Backup backup, String backupId) { + CreateBackupRequest request = + CreateBackupRequest.newBuilder() + .setParent(parent) + .setBackup(backup) + .setBackupId(backupId) + .build(); + return createBackupAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a backup. + * + *

Sample code: + * + *

{@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 (CloudFilestoreManagerClient cloudFilestoreManagerClient =
+   *     CloudFilestoreManagerClient.create()) {
+   *   CreateBackupRequest request =
+   *       CreateBackupRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setBackup(Backup.newBuilder().build())
+   *           .setBackupId("backupId2121930365")
+   *           .build();
+   *   Backup response = cloudFilestoreManagerClient.createBackupAsync(request).get();
+   * }
+   * }
+ * + * @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 OperationFuture createBackupAsync( + CreateBackupRequest request) { + return createBackupOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a backup. + * + *

Sample code: + * + *

{@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 (CloudFilestoreManagerClient cloudFilestoreManagerClient =
+   *     CloudFilestoreManagerClient.create()) {
+   *   CreateBackupRequest request =
+   *       CreateBackupRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setBackup(Backup.newBuilder().build())
+   *           .setBackupId("backupId2121930365")
+   *           .build();
+   *   OperationFuture future =
+   *       cloudFilestoreManagerClient.createBackupOperationCallable().futureCall(request);
+   *   // Do something.
+   *   Backup response = future.get();
+   * }
+   * }
+ */ + public final OperationCallable + createBackupOperationCallable() { + return stub.createBackupOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a backup. + * + *

Sample code: + * + *

{@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 (CloudFilestoreManagerClient cloudFilestoreManagerClient =
+   *     CloudFilestoreManagerClient.create()) {
+   *   CreateBackupRequest request =
+   *       CreateBackupRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setBackup(Backup.newBuilder().build())
+   *           .setBackupId("backupId2121930365")
+   *           .build();
+   *   ApiFuture future =
+   *       cloudFilestoreManagerClient.createBackupCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable createBackupCallable() { + return stub.createBackupCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a backup. + * + *

Sample code: + * + *

{@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 (CloudFilestoreManagerClient cloudFilestoreManagerClient =
+   *     CloudFilestoreManagerClient.create()) {
+   *   BackupName name = BackupName.of("[PROJECT]", "[LOCATION]", "[BACKUP]");
+   *   cloudFilestoreManagerClient.deleteBackupAsync(name).get();
+   * }
+   * }
+ * + * @param name Required. The backup resource name, in the format + * `projects/{project_id}/locations/{location}/backups/{backup_id}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture deleteBackupAsync(BackupName name) { + DeleteBackupRequest request = + DeleteBackupRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return deleteBackupAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a backup. + * + *

Sample code: + * + *

{@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 (CloudFilestoreManagerClient cloudFilestoreManagerClient =
+   *     CloudFilestoreManagerClient.create()) {
+   *   String name = BackupName.of("[PROJECT]", "[LOCATION]", "[BACKUP]").toString();
+   *   cloudFilestoreManagerClient.deleteBackupAsync(name).get();
+   * }
+   * }
+ * + * @param name Required. The backup resource name, in the format + * `projects/{project_id}/locations/{location}/backups/{backup_id}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture deleteBackupAsync(String name) { + DeleteBackupRequest request = DeleteBackupRequest.newBuilder().setName(name).build(); + return deleteBackupAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a backup. + * + *

Sample code: + * + *

{@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 (CloudFilestoreManagerClient cloudFilestoreManagerClient =
+   *     CloudFilestoreManagerClient.create()) {
+   *   DeleteBackupRequest request =
+   *       DeleteBackupRequest.newBuilder()
+   *           .setName(BackupName.of("[PROJECT]", "[LOCATION]", "[BACKUP]").toString())
+   *           .build();
+   *   cloudFilestoreManagerClient.deleteBackupAsync(request).get();
+   * }
+   * }
+ * + * @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 OperationFuture deleteBackupAsync( + DeleteBackupRequest request) { + return deleteBackupOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a backup. + * + *

Sample code: + * + *

{@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 (CloudFilestoreManagerClient cloudFilestoreManagerClient =
+   *     CloudFilestoreManagerClient.create()) {
+   *   DeleteBackupRequest request =
+   *       DeleteBackupRequest.newBuilder()
+   *           .setName(BackupName.of("[PROJECT]", "[LOCATION]", "[BACKUP]").toString())
+   *           .build();
+   *   OperationFuture future =
+   *       cloudFilestoreManagerClient.deleteBackupOperationCallable().futureCall(request);
+   *   // Do something.
+   *   future.get();
+   * }
+   * }
+ */ + public final OperationCallable + deleteBackupOperationCallable() { + return stub.deleteBackupOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a backup. + * + *

Sample code: + * + *

{@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 (CloudFilestoreManagerClient cloudFilestoreManagerClient =
+   *     CloudFilestoreManagerClient.create()) {
+   *   DeleteBackupRequest request =
+   *       DeleteBackupRequest.newBuilder()
+   *           .setName(BackupName.of("[PROJECT]", "[LOCATION]", "[BACKUP]").toString())
+   *           .build();
+   *   ApiFuture future =
+   *       cloudFilestoreManagerClient.deleteBackupCallable().futureCall(request);
+   *   // Do something.
+   *   future.get();
+   * }
+   * }
+ */ + public final UnaryCallable deleteBackupCallable() { + return stub.deleteBackupCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates the settings of a specific backup. + * + *

Sample code: + * + *

{@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 (CloudFilestoreManagerClient cloudFilestoreManagerClient =
+   *     CloudFilestoreManagerClient.create()) {
+   *   Backup backup = Backup.newBuilder().build();
+   *   FieldMask updateMask = FieldMask.newBuilder().build();
+   *   Backup response = cloudFilestoreManagerClient.updateBackupAsync(backup, updateMask).get();
+   * }
+   * }
+ * + * @param backup Required. A [backup resource][google.cloud.filestore.v1beta1.Backup] * @param updateMask Required. Mask of fields to update. At least one path must be supplied in * this field. * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -1754,7 +2597,532 @@ public final OperationFuture updateBackupAsync( // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Updates the settings of a specific backup. + * Updates the settings of a specific backup. + * + *

Sample code: + * + *

{@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 (CloudFilestoreManagerClient cloudFilestoreManagerClient =
+   *     CloudFilestoreManagerClient.create()) {
+   *   UpdateBackupRequest request =
+   *       UpdateBackupRequest.newBuilder()
+   *           .setBackup(Backup.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .build();
+   *   Backup response = cloudFilestoreManagerClient.updateBackupAsync(request).get();
+   * }
+   * }
+ * + * @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 OperationFuture updateBackupAsync( + UpdateBackupRequest request) { + return updateBackupOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates the settings of a specific backup. + * + *

Sample code: + * + *

{@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 (CloudFilestoreManagerClient cloudFilestoreManagerClient =
+   *     CloudFilestoreManagerClient.create()) {
+   *   UpdateBackupRequest request =
+   *       UpdateBackupRequest.newBuilder()
+   *           .setBackup(Backup.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .build();
+   *   OperationFuture future =
+   *       cloudFilestoreManagerClient.updateBackupOperationCallable().futureCall(request);
+   *   // Do something.
+   *   Backup response = future.get();
+   * }
+   * }
+ */ + public final OperationCallable + updateBackupOperationCallable() { + return stub.updateBackupOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates the settings of a specific backup. + * + *

Sample code: + * + *

{@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 (CloudFilestoreManagerClient cloudFilestoreManagerClient =
+   *     CloudFilestoreManagerClient.create()) {
+   *   UpdateBackupRequest request =
+   *       UpdateBackupRequest.newBuilder()
+   *           .setBackup(Backup.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .build();
+   *   ApiFuture future =
+   *       cloudFilestoreManagerClient.updateBackupCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable updateBackupCallable() { + return stub.updateBackupCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists all shares for a specified instance. + * + *

Sample code: + * + *

{@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 (CloudFilestoreManagerClient cloudFilestoreManagerClient =
+   *     CloudFilestoreManagerClient.create()) {
+   *   InstanceName parent = InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]");
+   *   for (Share element : cloudFilestoreManagerClient.listShares(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. The instance for which to retrieve share information, in the format + * `projects/{project_id}/locations/{location}/instances/{instance_id}`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListSharesPagedResponse listShares(InstanceName parent) { + ListSharesRequest request = + ListSharesRequest.newBuilder().setParent(parent == null ? null : parent.toString()).build(); + return listShares(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists all shares for a specified instance. + * + *

Sample code: + * + *

{@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 (CloudFilestoreManagerClient cloudFilestoreManagerClient =
+   *     CloudFilestoreManagerClient.create()) {
+   *   String parent = InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString();
+   *   for (Share element : cloudFilestoreManagerClient.listShares(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. The instance for which to retrieve share information, in the format + * `projects/{project_id}/locations/{location}/instances/{instance_id}`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListSharesPagedResponse listShares(String parent) { + ListSharesRequest request = ListSharesRequest.newBuilder().setParent(parent).build(); + return listShares(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists all shares for a specified instance. + * + *

Sample code: + * + *

{@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 (CloudFilestoreManagerClient cloudFilestoreManagerClient =
+   *     CloudFilestoreManagerClient.create()) {
+   *   ListSharesRequest request =
+   *       ListSharesRequest.newBuilder()
+   *           .setParent(InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .setOrderBy("orderBy-1207110587")
+   *           .setFilter("filter-1274492040")
+   *           .build();
+   *   for (Share element : cloudFilestoreManagerClient.listShares(request).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @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 ListSharesPagedResponse listShares(ListSharesRequest request) { + return listSharesPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists all shares for a specified instance. + * + *

Sample code: + * + *

{@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 (CloudFilestoreManagerClient cloudFilestoreManagerClient =
+   *     CloudFilestoreManagerClient.create()) {
+   *   ListSharesRequest request =
+   *       ListSharesRequest.newBuilder()
+   *           .setParent(InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .setOrderBy("orderBy-1207110587")
+   *           .setFilter("filter-1274492040")
+   *           .build();
+   *   ApiFuture future =
+   *       cloudFilestoreManagerClient.listSharesPagedCallable().futureCall(request);
+   *   // Do something.
+   *   for (Share element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable listSharesPagedCallable() { + return stub.listSharesPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists all shares for a specified instance. + * + *

Sample code: + * + *

{@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 (CloudFilestoreManagerClient cloudFilestoreManagerClient =
+   *     CloudFilestoreManagerClient.create()) {
+   *   ListSharesRequest request =
+   *       ListSharesRequest.newBuilder()
+   *           .setParent(InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .setOrderBy("orderBy-1207110587")
+   *           .setFilter("filter-1274492040")
+   *           .build();
+   *   while (true) {
+   *     ListSharesResponse response =
+   *         cloudFilestoreManagerClient.listSharesCallable().call(request);
+   *     for (Share element : response.getSharesList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable listSharesCallable() { + return stub.listSharesCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets the details of a specific share. + * + *

Sample code: + * + *

{@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 (CloudFilestoreManagerClient cloudFilestoreManagerClient =
+   *     CloudFilestoreManagerClient.create()) {
+   *   ShareName name = ShareName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]", "[SHARE]");
+   *   Share response = cloudFilestoreManagerClient.getShare(name);
+   * }
+   * }
+ * + * @param name Required. The share resource name, in the format + * `projects/{project_id}/locations/{location}/instances/{instance_id}/shares/{share_id}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Share getShare(ShareName name) { + GetShareRequest request = + GetShareRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return getShare(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets the details of a specific share. + * + *

Sample code: + * + *

{@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 (CloudFilestoreManagerClient cloudFilestoreManagerClient =
+   *     CloudFilestoreManagerClient.create()) {
+   *   String name = ShareName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]", "[SHARE]").toString();
+   *   Share response = cloudFilestoreManagerClient.getShare(name);
+   * }
+   * }
+ * + * @param name Required. The share resource name, in the format + * `projects/{project_id}/locations/{location}/instances/{instance_id}/shares/{share_id}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Share getShare(String name) { + GetShareRequest request = GetShareRequest.newBuilder().setName(name).build(); + return getShare(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets the details of a specific share. + * + *

Sample code: + * + *

{@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 (CloudFilestoreManagerClient cloudFilestoreManagerClient =
+   *     CloudFilestoreManagerClient.create()) {
+   *   GetShareRequest request =
+   *       GetShareRequest.newBuilder()
+   *           .setName(ShareName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]", "[SHARE]").toString())
+   *           .build();
+   *   Share response = cloudFilestoreManagerClient.getShare(request);
+   * }
+   * }
+ * + * @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 Share getShare(GetShareRequest request) { + return getShareCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets the details of a specific share. + * + *

Sample code: + * + *

{@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 (CloudFilestoreManagerClient cloudFilestoreManagerClient =
+   *     CloudFilestoreManagerClient.create()) {
+   *   GetShareRequest request =
+   *       GetShareRequest.newBuilder()
+   *           .setName(ShareName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]", "[SHARE]").toString())
+   *           .build();
+   *   ApiFuture future = cloudFilestoreManagerClient.getShareCallable().futureCall(request);
+   *   // Do something.
+   *   Share response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable getShareCallable() { + return stub.getShareCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a share. + * + *

Sample code: + * + *

{@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 (CloudFilestoreManagerClient cloudFilestoreManagerClient =
+   *     CloudFilestoreManagerClient.create()) {
+   *   InstanceName parent = InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]");
+   *   Share share = Share.newBuilder().build();
+   *   String shareId = "shareId2054217050";
+   *   Share response = cloudFilestoreManagerClient.createShareAsync(parent, share, shareId).get();
+   * }
+   * }
+ * + * @param parent Required. The Filestore Instance to create the share for, in the format + * `projects/{project_id}/locations/{location}/instances/{instance_id}` + * @param share Required. A share resource + * @param shareId Required. The ID to use for the share. The ID must be unique within the + * specified instance. + *

This value must start with a lowercase letter followed by up to 62 lowercase letters, + * numbers, or hyphens, and cannot end with a hyphen. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture createShareAsync( + InstanceName parent, Share share, String shareId) { + CreateShareRequest request = + CreateShareRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .setShare(share) + .setShareId(shareId) + .build(); + return createShareAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a share. + * + *

Sample code: + * + *

{@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 (CloudFilestoreManagerClient cloudFilestoreManagerClient =
+   *     CloudFilestoreManagerClient.create()) {
+   *   String parent = InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString();
+   *   Share share = Share.newBuilder().build();
+   *   String shareId = "shareId2054217050";
+   *   Share response = cloudFilestoreManagerClient.createShareAsync(parent, share, shareId).get();
+   * }
+   * }
+ * + * @param parent Required. The Filestore Instance to create the share for, in the format + * `projects/{project_id}/locations/{location}/instances/{instance_id}` + * @param share Required. A share resource + * @param shareId Required. The ID to use for the share. The ID must be unique within the + * specified instance. + *

This value must start with a lowercase letter followed by up to 62 lowercase letters, + * numbers, or hyphens, and cannot end with a hyphen. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture createShareAsync( + String parent, Share share, String shareId) { + CreateShareRequest request = + CreateShareRequest.newBuilder() + .setParent(parent) + .setShare(share) + .setShareId(shareId) + .build(); + return createShareAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a share. + * + *

Sample code: + * + *

{@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 (CloudFilestoreManagerClient cloudFilestoreManagerClient =
+   *     CloudFilestoreManagerClient.create()) {
+   *   CreateShareRequest request =
+   *       CreateShareRequest.newBuilder()
+   *           .setParent(InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString())
+   *           .setShareId("shareId2054217050")
+   *           .setShare(Share.newBuilder().build())
+   *           .build();
+   *   Share response = cloudFilestoreManagerClient.createShareAsync(request).get();
+   * }
+   * }
+ * + * @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 OperationFuture createShareAsync( + CreateShareRequest request) { + return createShareOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a share. + * + *

Sample code: + * + *

{@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 (CloudFilestoreManagerClient cloudFilestoreManagerClient =
+   *     CloudFilestoreManagerClient.create()) {
+   *   CreateShareRequest request =
+   *       CreateShareRequest.newBuilder()
+   *           .setParent(InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString())
+   *           .setShareId("shareId2054217050")
+   *           .setShare(Share.newBuilder().build())
+   *           .build();
+   *   OperationFuture future =
+   *       cloudFilestoreManagerClient.createShareOperationCallable().futureCall(request);
+   *   // Do something.
+   *   Share response = future.get();
+   * }
+   * }
+ */ + public final OperationCallable + createShareOperationCallable() { + return stub.createShareOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a share. * *

Sample code: * @@ -1766,26 +3134,242 @@ public final OperationFuture updateBackupAsync( * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library * try (CloudFilestoreManagerClient cloudFilestoreManagerClient = * CloudFilestoreManagerClient.create()) { - * UpdateBackupRequest request = - * UpdateBackupRequest.newBuilder() - * .setBackup(Backup.newBuilder().build()) + * CreateShareRequest request = + * CreateShareRequest.newBuilder() + * .setParent(InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString()) + * .setShareId("shareId2054217050") + * .setShare(Share.newBuilder().build()) + * .build(); + * ApiFuture future = + * cloudFilestoreManagerClient.createShareCallable().futureCall(request); + * // Do something. + * Operation response = future.get(); + * } + * } + */ + public final UnaryCallable createShareCallable() { + return stub.createShareCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a share. + * + *

Sample code: + * + *

{@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 (CloudFilestoreManagerClient cloudFilestoreManagerClient =
+   *     CloudFilestoreManagerClient.create()) {
+   *   ShareName name = ShareName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]", "[SHARE]");
+   *   cloudFilestoreManagerClient.deleteShareAsync(name).get();
+   * }
+   * }
+ * + * @param name Required. The share resource name, in the format + * `projects/{project_id}/locations/{location}/instances/{instance_id}/share/{share_id}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture deleteShareAsync(ShareName name) { + DeleteShareRequest request = + DeleteShareRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return deleteShareAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a share. + * + *

Sample code: + * + *

{@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 (CloudFilestoreManagerClient cloudFilestoreManagerClient =
+   *     CloudFilestoreManagerClient.create()) {
+   *   String name = ShareName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]", "[SHARE]").toString();
+   *   cloudFilestoreManagerClient.deleteShareAsync(name).get();
+   * }
+   * }
+ * + * @param name Required. The share resource name, in the format + * `projects/{project_id}/locations/{location}/instances/{instance_id}/share/{share_id}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture deleteShareAsync(String name) { + DeleteShareRequest request = DeleteShareRequest.newBuilder().setName(name).build(); + return deleteShareAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a share. + * + *

Sample code: + * + *

{@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 (CloudFilestoreManagerClient cloudFilestoreManagerClient =
+   *     CloudFilestoreManagerClient.create()) {
+   *   DeleteShareRequest request =
+   *       DeleteShareRequest.newBuilder()
+   *           .setName(ShareName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]", "[SHARE]").toString())
+   *           .build();
+   *   cloudFilestoreManagerClient.deleteShareAsync(request).get();
+   * }
+   * }
+ * + * @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 OperationFuture deleteShareAsync( + DeleteShareRequest request) { + return deleteShareOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a share. + * + *

Sample code: + * + *

{@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 (CloudFilestoreManagerClient cloudFilestoreManagerClient =
+   *     CloudFilestoreManagerClient.create()) {
+   *   DeleteShareRequest request =
+   *       DeleteShareRequest.newBuilder()
+   *           .setName(ShareName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]", "[SHARE]").toString())
+   *           .build();
+   *   OperationFuture future =
+   *       cloudFilestoreManagerClient.deleteShareOperationCallable().futureCall(request);
+   *   // Do something.
+   *   future.get();
+   * }
+   * }
+ */ + public final OperationCallable + deleteShareOperationCallable() { + return stub.deleteShareOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a share. + * + *

Sample code: + * + *

{@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 (CloudFilestoreManagerClient cloudFilestoreManagerClient =
+   *     CloudFilestoreManagerClient.create()) {
+   *   DeleteShareRequest request =
+   *       DeleteShareRequest.newBuilder()
+   *           .setName(ShareName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]", "[SHARE]").toString())
+   *           .build();
+   *   ApiFuture future =
+   *       cloudFilestoreManagerClient.deleteShareCallable().futureCall(request);
+   *   // Do something.
+   *   future.get();
+   * }
+   * }
+ */ + public final UnaryCallable deleteShareCallable() { + return stub.deleteShareCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates the settings of a specific share. + * + *

Sample code: + * + *

{@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 (CloudFilestoreManagerClient cloudFilestoreManagerClient =
+   *     CloudFilestoreManagerClient.create()) {
+   *   Share share = Share.newBuilder().build();
+   *   FieldMask updateMask = FieldMask.newBuilder().build();
+   *   Share response = cloudFilestoreManagerClient.updateShareAsync(share, updateMask).get();
+   * }
+   * }
+ * + * @param share Required. A share resource. Only fields specified in update_mask are updated. + * @param updateMask Required. Mask of fields to update. At least one path must be supplied in + * this field. The elements of the repeated paths field may only include these fields: + *
    + *
  • "description" + *
  • "capacity_gb" + *
  • "labels" + *
  • "nfs_export_options" + *
+ * + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture updateShareAsync( + Share share, FieldMask updateMask) { + UpdateShareRequest request = + UpdateShareRequest.newBuilder().setShare(share).setUpdateMask(updateMask).build(); + return updateShareAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates the settings of a specific share. + * + *

Sample code: + * + *

{@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 (CloudFilestoreManagerClient cloudFilestoreManagerClient =
+   *     CloudFilestoreManagerClient.create()) {
+   *   UpdateShareRequest request =
+   *       UpdateShareRequest.newBuilder()
+   *           .setShare(Share.newBuilder().build())
    *           .setUpdateMask(FieldMask.newBuilder().build())
    *           .build();
-   *   Backup response = cloudFilestoreManagerClient.updateBackupAsync(request).get();
+   *   Share response = cloudFilestoreManagerClient.updateShareAsync(request).get();
    * }
    * }
* * @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 OperationFuture updateBackupAsync( - UpdateBackupRequest request) { - return updateBackupOperationCallable().futureCall(request); + public final OperationFuture updateShareAsync( + UpdateShareRequest request) { + return updateShareOperationCallable().futureCall(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Updates the settings of a specific backup. + * Updates the settings of a specific share. * *

Sample code: * @@ -1797,26 +3381,26 @@ public final OperationFuture updateBackupAsync( * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library * try (CloudFilestoreManagerClient cloudFilestoreManagerClient = * CloudFilestoreManagerClient.create()) { - * UpdateBackupRequest request = - * UpdateBackupRequest.newBuilder() - * .setBackup(Backup.newBuilder().build()) + * UpdateShareRequest request = + * UpdateShareRequest.newBuilder() + * .setShare(Share.newBuilder().build()) * .setUpdateMask(FieldMask.newBuilder().build()) * .build(); - * OperationFuture future = - * cloudFilestoreManagerClient.updateBackupOperationCallable().futureCall(request); + * OperationFuture future = + * cloudFilestoreManagerClient.updateShareOperationCallable().futureCall(request); * // Do something. - * Backup response = future.get(); + * Share response = future.get(); * } * } */ - public final OperationCallable - updateBackupOperationCallable() { - return stub.updateBackupOperationCallable(); + public final OperationCallable + updateShareOperationCallable() { + return stub.updateShareOperationCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Updates the settings of a specific backup. + * Updates the settings of a specific share. * *

Sample code: * @@ -1828,20 +3412,20 @@ public final OperationFuture updateBackupAsync( * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library * try (CloudFilestoreManagerClient cloudFilestoreManagerClient = * CloudFilestoreManagerClient.create()) { - * UpdateBackupRequest request = - * UpdateBackupRequest.newBuilder() - * .setBackup(Backup.newBuilder().build()) + * UpdateShareRequest request = + * UpdateShareRequest.newBuilder() + * .setShare(Share.newBuilder().build()) * .setUpdateMask(FieldMask.newBuilder().build()) * .build(); * ApiFuture future = - * cloudFilestoreManagerClient.updateBackupCallable().futureCall(request); + * cloudFilestoreManagerClient.updateShareCallable().futureCall(request); * // Do something. * Operation response = future.get(); * } * } */ - public final UnaryCallable updateBackupCallable() { - return stub.updateBackupCallable(); + public final UnaryCallable updateShareCallable() { + return stub.updateShareCallable(); } @Override @@ -1950,6 +3534,82 @@ protected ListInstancesFixedSizeCollection createCollection( } } + public static class ListSnapshotsPagedResponse + extends AbstractPagedListResponse< + ListSnapshotsRequest, + ListSnapshotsResponse, + Snapshot, + ListSnapshotsPage, + ListSnapshotsFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListSnapshotsPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + input -> new ListSnapshotsPagedResponse(input), + MoreExecutors.directExecutor()); + } + + private ListSnapshotsPagedResponse(ListSnapshotsPage page) { + super(page, ListSnapshotsFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListSnapshotsPage + extends AbstractPage< + ListSnapshotsRequest, ListSnapshotsResponse, Snapshot, ListSnapshotsPage> { + + private ListSnapshotsPage( + PageContext context, + ListSnapshotsResponse response) { + super(context, response); + } + + private static ListSnapshotsPage createEmptyPage() { + return new ListSnapshotsPage(null, null); + } + + @Override + protected ListSnapshotsPage createPage( + PageContext context, + ListSnapshotsResponse response) { + return new ListSnapshotsPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListSnapshotsFixedSizeCollection + extends AbstractFixedSizeCollection< + ListSnapshotsRequest, + ListSnapshotsResponse, + Snapshot, + ListSnapshotsPage, + ListSnapshotsFixedSizeCollection> { + + private ListSnapshotsFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListSnapshotsFixedSizeCollection createEmptyCollection() { + return new ListSnapshotsFixedSizeCollection(null, 0); + } + + @Override + protected ListSnapshotsFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListSnapshotsFixedSizeCollection(pages, collectionSize); + } + } + public static class ListBackupsPagedResponse extends AbstractPagedListResponse< ListBackupsRequest, @@ -2022,4 +3682,77 @@ protected ListBackupsFixedSizeCollection createCollection( return new ListBackupsFixedSizeCollection(pages, collectionSize); } } + + public static class ListSharesPagedResponse + extends AbstractPagedListResponse< + ListSharesRequest, + ListSharesResponse, + Share, + ListSharesPage, + ListSharesFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListSharesPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, input -> new ListSharesPagedResponse(input), MoreExecutors.directExecutor()); + } + + private ListSharesPagedResponse(ListSharesPage page) { + super(page, ListSharesFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListSharesPage + extends AbstractPage { + + private ListSharesPage( + PageContext context, + ListSharesResponse response) { + super(context, response); + } + + private static ListSharesPage createEmptyPage() { + return new ListSharesPage(null, null); + } + + @Override + protected ListSharesPage createPage( + PageContext context, + ListSharesResponse response) { + return new ListSharesPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListSharesFixedSizeCollection + extends AbstractFixedSizeCollection< + ListSharesRequest, + ListSharesResponse, + Share, + ListSharesPage, + ListSharesFixedSizeCollection> { + + private ListSharesFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListSharesFixedSizeCollection createEmptyCollection() { + return new ListSharesFixedSizeCollection(null, 0); + } + + @Override + protected ListSharesFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListSharesFixedSizeCollection(pages, collectionSize); + } + } } diff --git a/java-filestore/google-cloud-filestore/src/main/java/com/google/cloud/filestore/v1beta1/CloudFilestoreManagerSettings.java b/java-filestore/google-cloud-filestore/src/main/java/com/google/cloud/filestore/v1beta1/CloudFilestoreManagerSettings.java index 298f570d621b..6fb19ae23df9 100644 --- a/java-filestore/google-cloud-filestore/src/main/java/com/google/cloud/filestore/v1beta1/CloudFilestoreManagerSettings.java +++ b/java-filestore/google-cloud-filestore/src/main/java/com/google/cloud/filestore/v1beta1/CloudFilestoreManagerSettings.java @@ -18,6 +18,8 @@ import static com.google.cloud.filestore.v1beta1.CloudFilestoreManagerClient.ListBackupsPagedResponse; import static com.google.cloud.filestore.v1beta1.CloudFilestoreManagerClient.ListInstancesPagedResponse; +import static com.google.cloud.filestore.v1beta1.CloudFilestoreManagerClient.ListSharesPagedResponse; +import static com.google.cloud.filestore.v1beta1.CloudFilestoreManagerClient.ListSnapshotsPagedResponse; import com.google.api.core.ApiFunction; import com.google.api.core.BetaApi; @@ -129,6 +131,18 @@ public UnaryCallSettings restoreInstanceSetti .restoreInstanceOperationSettings(); } + /** Returns the object with the settings used for calls to revertInstance. */ + public UnaryCallSettings revertInstanceSettings() { + return ((CloudFilestoreManagerStubSettings) getStubSettings()).revertInstanceSettings(); + } + + /** Returns the object with the settings used for calls to revertInstance. */ + public OperationCallSettings + revertInstanceOperationSettings() { + return ((CloudFilestoreManagerStubSettings) getStubSettings()) + .revertInstanceOperationSettings(); + } + /** Returns the object with the settings used for calls to deleteInstance. */ public UnaryCallSettings deleteInstanceSettings() { return ((CloudFilestoreManagerStubSettings) getStubSettings()).deleteInstanceSettings(); @@ -141,6 +155,53 @@ public UnaryCallSettings deleteInstanceSetting .deleteInstanceOperationSettings(); } + /** Returns the object with the settings used for calls to listSnapshots. */ + public PagedCallSettings + listSnapshotsSettings() { + return ((CloudFilestoreManagerStubSettings) getStubSettings()).listSnapshotsSettings(); + } + + /** Returns the object with the settings used for calls to getSnapshot. */ + public UnaryCallSettings getSnapshotSettings() { + return ((CloudFilestoreManagerStubSettings) getStubSettings()).getSnapshotSettings(); + } + + /** Returns the object with the settings used for calls to createSnapshot. */ + public UnaryCallSettings createSnapshotSettings() { + return ((CloudFilestoreManagerStubSettings) getStubSettings()).createSnapshotSettings(); + } + + /** Returns the object with the settings used for calls to createSnapshot. */ + public OperationCallSettings + createSnapshotOperationSettings() { + return ((CloudFilestoreManagerStubSettings) getStubSettings()) + .createSnapshotOperationSettings(); + } + + /** Returns the object with the settings used for calls to deleteSnapshot. */ + public UnaryCallSettings deleteSnapshotSettings() { + return ((CloudFilestoreManagerStubSettings) getStubSettings()).deleteSnapshotSettings(); + } + + /** Returns the object with the settings used for calls to deleteSnapshot. */ + public OperationCallSettings + deleteSnapshotOperationSettings() { + return ((CloudFilestoreManagerStubSettings) getStubSettings()) + .deleteSnapshotOperationSettings(); + } + + /** Returns the object with the settings used for calls to updateSnapshot. */ + public UnaryCallSettings updateSnapshotSettings() { + return ((CloudFilestoreManagerStubSettings) getStubSettings()).updateSnapshotSettings(); + } + + /** Returns the object with the settings used for calls to updateSnapshot. */ + public OperationCallSettings + updateSnapshotOperationSettings() { + return ((CloudFilestoreManagerStubSettings) getStubSettings()) + .updateSnapshotOperationSettings(); + } + /** Returns the object with the settings used for calls to listBackups. */ public PagedCallSettings listBackupsSettings() { @@ -185,6 +246,50 @@ public UnaryCallSettings updateBackupSettings() return ((CloudFilestoreManagerStubSettings) getStubSettings()).updateBackupOperationSettings(); } + /** Returns the object with the settings used for calls to listShares. */ + public PagedCallSettings + listSharesSettings() { + return ((CloudFilestoreManagerStubSettings) getStubSettings()).listSharesSettings(); + } + + /** Returns the object with the settings used for calls to getShare. */ + public UnaryCallSettings getShareSettings() { + return ((CloudFilestoreManagerStubSettings) getStubSettings()).getShareSettings(); + } + + /** Returns the object with the settings used for calls to createShare. */ + public UnaryCallSettings createShareSettings() { + return ((CloudFilestoreManagerStubSettings) getStubSettings()).createShareSettings(); + } + + /** Returns the object with the settings used for calls to createShare. */ + public OperationCallSettings + createShareOperationSettings() { + return ((CloudFilestoreManagerStubSettings) getStubSettings()).createShareOperationSettings(); + } + + /** Returns the object with the settings used for calls to deleteShare. */ + public UnaryCallSettings deleteShareSettings() { + return ((CloudFilestoreManagerStubSettings) getStubSettings()).deleteShareSettings(); + } + + /** Returns the object with the settings used for calls to deleteShare. */ + public OperationCallSettings + deleteShareOperationSettings() { + return ((CloudFilestoreManagerStubSettings) getStubSettings()).deleteShareOperationSettings(); + } + + /** Returns the object with the settings used for calls to updateShare. */ + public UnaryCallSettings updateShareSettings() { + return ((CloudFilestoreManagerStubSettings) getStubSettings()).updateShareSettings(); + } + + /** Returns the object with the settings used for calls to updateShare. */ + public OperationCallSettings + updateShareOperationSettings() { + return ((CloudFilestoreManagerStubSettings) getStubSettings()).updateShareOperationSettings(); + } + public static final CloudFilestoreManagerSettings create(CloudFilestoreManagerStubSettings stub) throws IOException { return new CloudFilestoreManagerSettings.Builder(stub.toBuilder()).build(); @@ -346,6 +451,17 @@ public UnaryCallSettings.Builder restoreInsta return getStubSettingsBuilder().restoreInstanceOperationSettings(); } + /** Returns the builder for the settings used for calls to revertInstance. */ + public UnaryCallSettings.Builder revertInstanceSettings() { + return getStubSettingsBuilder().revertInstanceSettings(); + } + + /** Returns the builder for the settings used for calls to revertInstance. */ + public OperationCallSettings.Builder + revertInstanceOperationSettings() { + return getStubSettingsBuilder().revertInstanceOperationSettings(); + } + /** Returns the builder for the settings used for calls to deleteInstance. */ public UnaryCallSettings.Builder deleteInstanceSettings() { return getStubSettingsBuilder().deleteInstanceSettings(); @@ -357,6 +473,51 @@ public UnaryCallSettings.Builder deleteInstanc return getStubSettingsBuilder().deleteInstanceOperationSettings(); } + /** Returns the builder for the settings used for calls to listSnapshots. */ + public PagedCallSettings.Builder< + ListSnapshotsRequest, ListSnapshotsResponse, ListSnapshotsPagedResponse> + listSnapshotsSettings() { + return getStubSettingsBuilder().listSnapshotsSettings(); + } + + /** Returns the builder for the settings used for calls to getSnapshot. */ + public UnaryCallSettings.Builder getSnapshotSettings() { + return getStubSettingsBuilder().getSnapshotSettings(); + } + + /** Returns the builder for the settings used for calls to createSnapshot. */ + public UnaryCallSettings.Builder createSnapshotSettings() { + return getStubSettingsBuilder().createSnapshotSettings(); + } + + /** Returns the builder for the settings used for calls to createSnapshot. */ + public OperationCallSettings.Builder + createSnapshotOperationSettings() { + return getStubSettingsBuilder().createSnapshotOperationSettings(); + } + + /** Returns the builder for the settings used for calls to deleteSnapshot. */ + public UnaryCallSettings.Builder deleteSnapshotSettings() { + return getStubSettingsBuilder().deleteSnapshotSettings(); + } + + /** Returns the builder for the settings used for calls to deleteSnapshot. */ + public OperationCallSettings.Builder + deleteSnapshotOperationSettings() { + return getStubSettingsBuilder().deleteSnapshotOperationSettings(); + } + + /** Returns the builder for the settings used for calls to updateSnapshot. */ + public UnaryCallSettings.Builder updateSnapshotSettings() { + return getStubSettingsBuilder().updateSnapshotSettings(); + } + + /** Returns the builder for the settings used for calls to updateSnapshot. */ + public OperationCallSettings.Builder + updateSnapshotOperationSettings() { + return getStubSettingsBuilder().updateSnapshotOperationSettings(); + } + /** Returns the builder for the settings used for calls to listBackups. */ public PagedCallSettings.Builder< ListBackupsRequest, ListBackupsResponse, ListBackupsPagedResponse> @@ -402,6 +563,50 @@ public UnaryCallSettings.Builder updateBackupSet return getStubSettingsBuilder().updateBackupOperationSettings(); } + /** Returns the builder for the settings used for calls to listShares. */ + public PagedCallSettings.Builder + listSharesSettings() { + return getStubSettingsBuilder().listSharesSettings(); + } + + /** Returns the builder for the settings used for calls to getShare. */ + public UnaryCallSettings.Builder getShareSettings() { + return getStubSettingsBuilder().getShareSettings(); + } + + /** Returns the builder for the settings used for calls to createShare. */ + public UnaryCallSettings.Builder createShareSettings() { + return getStubSettingsBuilder().createShareSettings(); + } + + /** Returns the builder for the settings used for calls to createShare. */ + public OperationCallSettings.Builder + createShareOperationSettings() { + return getStubSettingsBuilder().createShareOperationSettings(); + } + + /** Returns the builder for the settings used for calls to deleteShare. */ + public UnaryCallSettings.Builder deleteShareSettings() { + return getStubSettingsBuilder().deleteShareSettings(); + } + + /** Returns the builder for the settings used for calls to deleteShare. */ + public OperationCallSettings.Builder + deleteShareOperationSettings() { + return getStubSettingsBuilder().deleteShareOperationSettings(); + } + + /** Returns the builder for the settings used for calls to updateShare. */ + public UnaryCallSettings.Builder updateShareSettings() { + return getStubSettingsBuilder().updateShareSettings(); + } + + /** Returns the builder for the settings used for calls to updateShare. */ + public OperationCallSettings.Builder + updateShareOperationSettings() { + return getStubSettingsBuilder().updateShareOperationSettings(); + } + @Override public CloudFilestoreManagerSettings build() throws IOException { return new CloudFilestoreManagerSettings(this); diff --git a/java-filestore/google-cloud-filestore/src/main/java/com/google/cloud/filestore/v1beta1/gapic_metadata.json b/java-filestore/google-cloud-filestore/src/main/java/com/google/cloud/filestore/v1beta1/gapic_metadata.json index 6cac37774ee6..df77b00f598a 100644 --- a/java-filestore/google-cloud-filestore/src/main/java/com/google/cloud/filestore/v1beta1/gapic_metadata.json +++ b/java-filestore/google-cloud-filestore/src/main/java/com/google/cloud/filestore/v1beta1/gapic_metadata.json @@ -16,32 +16,65 @@ "CreateInstance": { "methods": ["createInstanceAsync", "createInstanceAsync", "createInstanceAsync", "createInstanceOperationCallable", "createInstanceCallable"] }, + "CreateShare": { + "methods": ["createShareAsync", "createShareAsync", "createShareAsync", "createShareOperationCallable", "createShareCallable"] + }, + "CreateSnapshot": { + "methods": ["createSnapshotAsync", "createSnapshotAsync", "createSnapshotAsync", "createSnapshotOperationCallable", "createSnapshotCallable"] + }, "DeleteBackup": { "methods": ["deleteBackupAsync", "deleteBackupAsync", "deleteBackupAsync", "deleteBackupOperationCallable", "deleteBackupCallable"] }, "DeleteInstance": { "methods": ["deleteInstanceAsync", "deleteInstanceAsync", "deleteInstanceAsync", "deleteInstanceOperationCallable", "deleteInstanceCallable"] }, + "DeleteShare": { + "methods": ["deleteShareAsync", "deleteShareAsync", "deleteShareAsync", "deleteShareOperationCallable", "deleteShareCallable"] + }, + "DeleteSnapshot": { + "methods": ["deleteSnapshotAsync", "deleteSnapshotAsync", "deleteSnapshotAsync", "deleteSnapshotOperationCallable", "deleteSnapshotCallable"] + }, "GetBackup": { "methods": ["getBackup", "getBackup", "getBackup", "getBackupCallable"] }, "GetInstance": { "methods": ["getInstance", "getInstance", "getInstance", "getInstanceCallable"] }, + "GetShare": { + "methods": ["getShare", "getShare", "getShare", "getShareCallable"] + }, + "GetSnapshot": { + "methods": ["getSnapshot", "getSnapshot", "getSnapshot", "getSnapshotCallable"] + }, "ListBackups": { "methods": ["listBackups", "listBackups", "listBackups", "listBackupsPagedCallable", "listBackupsCallable"] }, "ListInstances": { "methods": ["listInstances", "listInstances", "listInstances", "listInstancesPagedCallable", "listInstancesCallable"] }, + "ListShares": { + "methods": ["listShares", "listShares", "listShares", "listSharesPagedCallable", "listSharesCallable"] + }, + "ListSnapshots": { + "methods": ["listSnapshots", "listSnapshots", "listSnapshots", "listSnapshotsPagedCallable", "listSnapshotsCallable"] + }, "RestoreInstance": { "methods": ["restoreInstanceAsync", "restoreInstanceOperationCallable", "restoreInstanceCallable"] }, + "RevertInstance": { + "methods": ["revertInstanceAsync", "revertInstanceOperationCallable", "revertInstanceCallable"] + }, "UpdateBackup": { "methods": ["updateBackupAsync", "updateBackupAsync", "updateBackupOperationCallable", "updateBackupCallable"] }, "UpdateInstance": { "methods": ["updateInstanceAsync", "updateInstanceAsync", "updateInstanceOperationCallable", "updateInstanceCallable"] + }, + "UpdateShare": { + "methods": ["updateShareAsync", "updateShareAsync", "updateShareOperationCallable", "updateShareCallable"] + }, + "UpdateSnapshot": { + "methods": ["updateSnapshotAsync", "updateSnapshotAsync", "updateSnapshotOperationCallable", "updateSnapshotCallable"] } } } diff --git a/java-filestore/google-cloud-filestore/src/main/java/com/google/cloud/filestore/v1beta1/package-info.java b/java-filestore/google-cloud-filestore/src/main/java/com/google/cloud/filestore/v1beta1/package-info.java index 58559df5759f..33a3a156d491 100644 --- a/java-filestore/google-cloud-filestore/src/main/java/com/google/cloud/filestore/v1beta1/package-info.java +++ b/java-filestore/google-cloud-filestore/src/main/java/com/google/cloud/filestore/v1beta1/package-info.java @@ -19,19 +19,19 @@ * *

======================= CloudFilestoreManagerClient ======================= * - *

Service Description: Configures and manages Cloud Filestore resources. + *

Service Description: Configures and manages Filestore resources. * - *

Cloud Filestore Manager v1beta1. + *

Filestore Manager v1beta1. * - *

The `file.googleapis.com` service implements the Cloud Filestore API and defines the following - * model for managing resources: + *

The `file.googleapis.com` service implements the Filestore API and defines the following model + * for managing resources: * *

    *
  • The service works with a collection of cloud projects, named: `/projects/*` *
  • Each project has a collection of available locations, named: `/locations/*` *
  • Each location has a collection of instances and backups, named: `/instances/*` and * `/backups/*` respectively. - *
  • As such, Cloud Filestore instances are resources of the form: + *
  • As such, Filestore instances are resources of the form: * `/projects/{project_id}/locations/{location_id}/instances/{instance_id}` backups are * resources of the form: `/projects/{project_id}/locations/{location_id}/backup/{backup_id}` *
diff --git a/java-filestore/google-cloud-filestore/src/main/java/com/google/cloud/filestore/v1beta1/stub/CloudFilestoreManagerStub.java b/java-filestore/google-cloud-filestore/src/main/java/com/google/cloud/filestore/v1beta1/stub/CloudFilestoreManagerStub.java index 22e27ef5ad94..5bb08eca11f4 100644 --- a/java-filestore/google-cloud-filestore/src/main/java/com/google/cloud/filestore/v1beta1/stub/CloudFilestoreManagerStub.java +++ b/java-filestore/google-cloud-filestore/src/main/java/com/google/cloud/filestore/v1beta1/stub/CloudFilestoreManagerStub.java @@ -18,6 +18,8 @@ import static com.google.cloud.filestore.v1beta1.CloudFilestoreManagerClient.ListBackupsPagedResponse; import static com.google.cloud.filestore.v1beta1.CloudFilestoreManagerClient.ListInstancesPagedResponse; +import static com.google.cloud.filestore.v1beta1.CloudFilestoreManagerClient.ListSharesPagedResponse; +import static com.google.cloud.filestore.v1beta1.CloudFilestoreManagerClient.ListSnapshotsPagedResponse; import com.google.api.core.BetaApi; import com.google.api.gax.core.BackgroundResource; @@ -27,18 +29,33 @@ import com.google.cloud.filestore.v1beta1.Backup; import com.google.cloud.filestore.v1beta1.CreateBackupRequest; import com.google.cloud.filestore.v1beta1.CreateInstanceRequest; +import com.google.cloud.filestore.v1beta1.CreateShareRequest; +import com.google.cloud.filestore.v1beta1.CreateSnapshotRequest; import com.google.cloud.filestore.v1beta1.DeleteBackupRequest; import com.google.cloud.filestore.v1beta1.DeleteInstanceRequest; +import com.google.cloud.filestore.v1beta1.DeleteShareRequest; +import com.google.cloud.filestore.v1beta1.DeleteSnapshotRequest; import com.google.cloud.filestore.v1beta1.GetBackupRequest; import com.google.cloud.filestore.v1beta1.GetInstanceRequest; +import com.google.cloud.filestore.v1beta1.GetShareRequest; +import com.google.cloud.filestore.v1beta1.GetSnapshotRequest; import com.google.cloud.filestore.v1beta1.Instance; import com.google.cloud.filestore.v1beta1.ListBackupsRequest; import com.google.cloud.filestore.v1beta1.ListBackupsResponse; import com.google.cloud.filestore.v1beta1.ListInstancesRequest; import com.google.cloud.filestore.v1beta1.ListInstancesResponse; +import com.google.cloud.filestore.v1beta1.ListSharesRequest; +import com.google.cloud.filestore.v1beta1.ListSharesResponse; +import com.google.cloud.filestore.v1beta1.ListSnapshotsRequest; +import com.google.cloud.filestore.v1beta1.ListSnapshotsResponse; import com.google.cloud.filestore.v1beta1.RestoreInstanceRequest; +import com.google.cloud.filestore.v1beta1.RevertInstanceRequest; +import com.google.cloud.filestore.v1beta1.Share; +import com.google.cloud.filestore.v1beta1.Snapshot; import com.google.cloud.filestore.v1beta1.UpdateBackupRequest; import com.google.cloud.filestore.v1beta1.UpdateInstanceRequest; +import com.google.cloud.filestore.v1beta1.UpdateShareRequest; +import com.google.cloud.filestore.v1beta1.UpdateSnapshotRequest; import com.google.longrunning.Operation; import com.google.longrunning.stub.OperationsStub; import com.google.protobuf.Empty; @@ -102,6 +119,15 @@ public UnaryCallable restoreInstanceCallable( throw new UnsupportedOperationException("Not implemented: restoreInstanceCallable()"); } + public OperationCallable + revertInstanceOperationCallable() { + throw new UnsupportedOperationException("Not implemented: revertInstanceOperationCallable()"); + } + + public UnaryCallable revertInstanceCallable() { + throw new UnsupportedOperationException("Not implemented: revertInstanceCallable()"); + } + public OperationCallable deleteInstanceOperationCallable() { throw new UnsupportedOperationException("Not implemented: deleteInstanceOperationCallable()"); @@ -111,6 +137,46 @@ public UnaryCallable deleteInstanceCallable() throw new UnsupportedOperationException("Not implemented: deleteInstanceCallable()"); } + public UnaryCallable + listSnapshotsPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listSnapshotsPagedCallable()"); + } + + public UnaryCallable listSnapshotsCallable() { + throw new UnsupportedOperationException("Not implemented: listSnapshotsCallable()"); + } + + public UnaryCallable getSnapshotCallable() { + throw new UnsupportedOperationException("Not implemented: getSnapshotCallable()"); + } + + public OperationCallable + createSnapshotOperationCallable() { + throw new UnsupportedOperationException("Not implemented: createSnapshotOperationCallable()"); + } + + public UnaryCallable createSnapshotCallable() { + throw new UnsupportedOperationException("Not implemented: createSnapshotCallable()"); + } + + public OperationCallable + deleteSnapshotOperationCallable() { + throw new UnsupportedOperationException("Not implemented: deleteSnapshotOperationCallable()"); + } + + public UnaryCallable deleteSnapshotCallable() { + throw new UnsupportedOperationException("Not implemented: deleteSnapshotCallable()"); + } + + public OperationCallable + updateSnapshotOperationCallable() { + throw new UnsupportedOperationException("Not implemented: updateSnapshotOperationCallable()"); + } + + public UnaryCallable updateSnapshotCallable() { + throw new UnsupportedOperationException("Not implemented: updateSnapshotCallable()"); + } + public UnaryCallable listBackupsPagedCallable() { throw new UnsupportedOperationException("Not implemented: listBackupsPagedCallable()"); } @@ -150,6 +216,45 @@ public UnaryCallable updateBackupCallable() { throw new UnsupportedOperationException("Not implemented: updateBackupCallable()"); } + public UnaryCallable listSharesPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listSharesPagedCallable()"); + } + + public UnaryCallable listSharesCallable() { + throw new UnsupportedOperationException("Not implemented: listSharesCallable()"); + } + + public UnaryCallable getShareCallable() { + throw new UnsupportedOperationException("Not implemented: getShareCallable()"); + } + + public OperationCallable + createShareOperationCallable() { + throw new UnsupportedOperationException("Not implemented: createShareOperationCallable()"); + } + + public UnaryCallable createShareCallable() { + throw new UnsupportedOperationException("Not implemented: createShareCallable()"); + } + + public OperationCallable + deleteShareOperationCallable() { + throw new UnsupportedOperationException("Not implemented: deleteShareOperationCallable()"); + } + + public UnaryCallable deleteShareCallable() { + throw new UnsupportedOperationException("Not implemented: deleteShareCallable()"); + } + + public OperationCallable + updateShareOperationCallable() { + throw new UnsupportedOperationException("Not implemented: updateShareOperationCallable()"); + } + + public UnaryCallable updateShareCallable() { + throw new UnsupportedOperationException("Not implemented: updateShareCallable()"); + } + @Override public abstract void close(); } diff --git a/java-filestore/google-cloud-filestore/src/main/java/com/google/cloud/filestore/v1beta1/stub/CloudFilestoreManagerStubSettings.java b/java-filestore/google-cloud-filestore/src/main/java/com/google/cloud/filestore/v1beta1/stub/CloudFilestoreManagerStubSettings.java index a5cb5a2990dd..807cd2f25e36 100644 --- a/java-filestore/google-cloud-filestore/src/main/java/com/google/cloud/filestore/v1beta1/stub/CloudFilestoreManagerStubSettings.java +++ b/java-filestore/google-cloud-filestore/src/main/java/com/google/cloud/filestore/v1beta1/stub/CloudFilestoreManagerStubSettings.java @@ -18,6 +18,8 @@ import static com.google.cloud.filestore.v1beta1.CloudFilestoreManagerClient.ListBackupsPagedResponse; import static com.google.cloud.filestore.v1beta1.CloudFilestoreManagerClient.ListInstancesPagedResponse; +import static com.google.cloud.filestore.v1beta1.CloudFilestoreManagerClient.ListSharesPagedResponse; +import static com.google.cloud.filestore.v1beta1.CloudFilestoreManagerClient.ListSnapshotsPagedResponse; import com.google.api.core.ApiFunction; import com.google.api.core.ApiFuture; @@ -52,18 +54,33 @@ import com.google.cloud.filestore.v1beta1.Backup; import com.google.cloud.filestore.v1beta1.CreateBackupRequest; import com.google.cloud.filestore.v1beta1.CreateInstanceRequest; +import com.google.cloud.filestore.v1beta1.CreateShareRequest; +import com.google.cloud.filestore.v1beta1.CreateSnapshotRequest; import com.google.cloud.filestore.v1beta1.DeleteBackupRequest; import com.google.cloud.filestore.v1beta1.DeleteInstanceRequest; +import com.google.cloud.filestore.v1beta1.DeleteShareRequest; +import com.google.cloud.filestore.v1beta1.DeleteSnapshotRequest; import com.google.cloud.filestore.v1beta1.GetBackupRequest; import com.google.cloud.filestore.v1beta1.GetInstanceRequest; +import com.google.cloud.filestore.v1beta1.GetShareRequest; +import com.google.cloud.filestore.v1beta1.GetSnapshotRequest; import com.google.cloud.filestore.v1beta1.Instance; import com.google.cloud.filestore.v1beta1.ListBackupsRequest; import com.google.cloud.filestore.v1beta1.ListBackupsResponse; import com.google.cloud.filestore.v1beta1.ListInstancesRequest; import com.google.cloud.filestore.v1beta1.ListInstancesResponse; +import com.google.cloud.filestore.v1beta1.ListSharesRequest; +import com.google.cloud.filestore.v1beta1.ListSharesResponse; +import com.google.cloud.filestore.v1beta1.ListSnapshotsRequest; +import com.google.cloud.filestore.v1beta1.ListSnapshotsResponse; import com.google.cloud.filestore.v1beta1.RestoreInstanceRequest; +import com.google.cloud.filestore.v1beta1.RevertInstanceRequest; +import com.google.cloud.filestore.v1beta1.Share; +import com.google.cloud.filestore.v1beta1.Snapshot; import com.google.cloud.filestore.v1beta1.UpdateBackupRequest; import com.google.cloud.filestore.v1beta1.UpdateInstanceRequest; +import com.google.cloud.filestore.v1beta1.UpdateShareRequest; +import com.google.cloud.filestore.v1beta1.UpdateSnapshotRequest; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableSet; @@ -134,9 +151,25 @@ public class CloudFilestoreManagerStubSettings private final UnaryCallSettings restoreInstanceSettings; private final OperationCallSettings restoreInstanceOperationSettings; + private final UnaryCallSettings revertInstanceSettings; + private final OperationCallSettings + revertInstanceOperationSettings; private final UnaryCallSettings deleteInstanceSettings; private final OperationCallSettings deleteInstanceOperationSettings; + private final PagedCallSettings< + ListSnapshotsRequest, ListSnapshotsResponse, ListSnapshotsPagedResponse> + listSnapshotsSettings; + private final UnaryCallSettings getSnapshotSettings; + private final UnaryCallSettings createSnapshotSettings; + private final OperationCallSettings + createSnapshotOperationSettings; + private final UnaryCallSettings deleteSnapshotSettings; + private final OperationCallSettings + deleteSnapshotOperationSettings; + private final UnaryCallSettings updateSnapshotSettings; + private final OperationCallSettings + updateSnapshotOperationSettings; private final PagedCallSettings listBackupsSettings; private final UnaryCallSettings getBackupSettings; @@ -149,6 +182,18 @@ public class CloudFilestoreManagerStubSettings private final UnaryCallSettings updateBackupSettings; private final OperationCallSettings updateBackupOperationSettings; + private final PagedCallSettings + listSharesSettings; + private final UnaryCallSettings getShareSettings; + private final UnaryCallSettings createShareSettings; + private final OperationCallSettings + createShareOperationSettings; + private final UnaryCallSettings deleteShareSettings; + private final OperationCallSettings + deleteShareOperationSettings; + private final UnaryCallSettings updateShareSettings; + private final OperationCallSettings + updateShareOperationSettings; private static final PagedListDescriptor LIST_INSTANCES_PAGE_STR_DESC = @@ -186,6 +231,42 @@ public Iterable extractResources(ListInstancesResponse payload) { } }; + private static final PagedListDescriptor + LIST_SNAPSHOTS_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListSnapshotsRequest injectToken(ListSnapshotsRequest payload, String token) { + return ListSnapshotsRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListSnapshotsRequest injectPageSize(ListSnapshotsRequest payload, int pageSize) { + return ListSnapshotsRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListSnapshotsRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListSnapshotsResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListSnapshotsResponse payload) { + return payload.getSnapshotsList() == null + ? ImmutableList.of() + : payload.getSnapshotsList(); + } + }; + private static final PagedListDescriptor LIST_BACKUPS_PAGE_STR_DESC = new PagedListDescriptor() { @@ -222,6 +303,42 @@ public Iterable extractResources(ListBackupsResponse payload) { } }; + private static final PagedListDescriptor + LIST_SHARES_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListSharesRequest injectToken(ListSharesRequest payload, String token) { + return ListSharesRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListSharesRequest injectPageSize(ListSharesRequest payload, int pageSize) { + return ListSharesRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListSharesRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListSharesResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListSharesResponse payload) { + return payload.getSharesList() == null + ? ImmutableList.of() + : payload.getSharesList(); + } + }; + private static final PagedListResponseFactory< ListInstancesRequest, ListInstancesResponse, ListInstancesPagedResponse> LIST_INSTANCES_PAGE_STR_FACT = @@ -239,6 +356,23 @@ public ApiFuture getFuturePagedResponse( } }; + private static final PagedListResponseFactory< + ListSnapshotsRequest, ListSnapshotsResponse, ListSnapshotsPagedResponse> + LIST_SNAPSHOTS_PAGE_STR_FACT = + new PagedListResponseFactory< + ListSnapshotsRequest, ListSnapshotsResponse, ListSnapshotsPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListSnapshotsRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_SNAPSHOTS_PAGE_STR_DESC, request, context); + return ListSnapshotsPagedResponse.createAsync(pageContext, futureResponse); + } + }; + private static final PagedListResponseFactory< ListBackupsRequest, ListBackupsResponse, ListBackupsPagedResponse> LIST_BACKUPS_PAGE_STR_FACT = @@ -256,6 +390,23 @@ public ApiFuture getFuturePagedResponse( } }; + private static final PagedListResponseFactory< + ListSharesRequest, ListSharesResponse, ListSharesPagedResponse> + LIST_SHARES_PAGE_STR_FACT = + new PagedListResponseFactory< + ListSharesRequest, ListSharesResponse, ListSharesPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListSharesRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_SHARES_PAGE_STR_DESC, request, context); + return ListSharesPagedResponse.createAsync(pageContext, futureResponse); + } + }; + /** Returns the object with the settings used for calls to listInstances. */ public PagedCallSettings listInstancesSettings() { @@ -300,6 +451,17 @@ public UnaryCallSettings restoreInstanceSetti return restoreInstanceOperationSettings; } + /** Returns the object with the settings used for calls to revertInstance. */ + public UnaryCallSettings revertInstanceSettings() { + return revertInstanceSettings; + } + + /** Returns the object with the settings used for calls to revertInstance. */ + public OperationCallSettings + revertInstanceOperationSettings() { + return revertInstanceOperationSettings; + } + /** Returns the object with the settings used for calls to deleteInstance. */ public UnaryCallSettings deleteInstanceSettings() { return deleteInstanceSettings; @@ -311,6 +473,50 @@ public UnaryCallSettings deleteInstanceSetting return deleteInstanceOperationSettings; } + /** Returns the object with the settings used for calls to listSnapshots. */ + public PagedCallSettings + listSnapshotsSettings() { + return listSnapshotsSettings; + } + + /** Returns the object with the settings used for calls to getSnapshot. */ + public UnaryCallSettings getSnapshotSettings() { + return getSnapshotSettings; + } + + /** Returns the object with the settings used for calls to createSnapshot. */ + public UnaryCallSettings createSnapshotSettings() { + return createSnapshotSettings; + } + + /** Returns the object with the settings used for calls to createSnapshot. */ + public OperationCallSettings + createSnapshotOperationSettings() { + return createSnapshotOperationSettings; + } + + /** Returns the object with the settings used for calls to deleteSnapshot. */ + public UnaryCallSettings deleteSnapshotSettings() { + return deleteSnapshotSettings; + } + + /** Returns the object with the settings used for calls to deleteSnapshot. */ + public OperationCallSettings + deleteSnapshotOperationSettings() { + return deleteSnapshotOperationSettings; + } + + /** Returns the object with the settings used for calls to updateSnapshot. */ + public UnaryCallSettings updateSnapshotSettings() { + return updateSnapshotSettings; + } + + /** Returns the object with the settings used for calls to updateSnapshot. */ + public OperationCallSettings + updateSnapshotOperationSettings() { + return updateSnapshotOperationSettings; + } + /** Returns the object with the settings used for calls to listBackups. */ public PagedCallSettings listBackupsSettings() { @@ -355,6 +561,50 @@ public UnaryCallSettings updateBackupSettings() return updateBackupOperationSettings; } + /** Returns the object with the settings used for calls to listShares. */ + public PagedCallSettings + listSharesSettings() { + return listSharesSettings; + } + + /** Returns the object with the settings used for calls to getShare. */ + public UnaryCallSettings getShareSettings() { + return getShareSettings; + } + + /** Returns the object with the settings used for calls to createShare. */ + public UnaryCallSettings createShareSettings() { + return createShareSettings; + } + + /** Returns the object with the settings used for calls to createShare. */ + public OperationCallSettings + createShareOperationSettings() { + return createShareOperationSettings; + } + + /** Returns the object with the settings used for calls to deleteShare. */ + public UnaryCallSettings deleteShareSettings() { + return deleteShareSettings; + } + + /** Returns the object with the settings used for calls to deleteShare. */ + public OperationCallSettings + deleteShareOperationSettings() { + return deleteShareOperationSettings; + } + + /** Returns the object with the settings used for calls to updateShare. */ + public UnaryCallSettings updateShareSettings() { + return updateShareSettings; + } + + /** Returns the object with the settings used for calls to updateShare. */ + public OperationCallSettings + updateShareOperationSettings() { + return updateShareOperationSettings; + } + public CloudFilestoreManagerStub createStub() throws IOException { if (getTransportChannelProvider() .getTransportName() @@ -469,8 +719,18 @@ protected CloudFilestoreManagerStubSettings(Builder settingsBuilder) throws IOEx updateInstanceOperationSettings = settingsBuilder.updateInstanceOperationSettings().build(); restoreInstanceSettings = settingsBuilder.restoreInstanceSettings().build(); restoreInstanceOperationSettings = settingsBuilder.restoreInstanceOperationSettings().build(); + revertInstanceSettings = settingsBuilder.revertInstanceSettings().build(); + revertInstanceOperationSettings = settingsBuilder.revertInstanceOperationSettings().build(); deleteInstanceSettings = settingsBuilder.deleteInstanceSettings().build(); deleteInstanceOperationSettings = settingsBuilder.deleteInstanceOperationSettings().build(); + listSnapshotsSettings = settingsBuilder.listSnapshotsSettings().build(); + getSnapshotSettings = settingsBuilder.getSnapshotSettings().build(); + createSnapshotSettings = settingsBuilder.createSnapshotSettings().build(); + createSnapshotOperationSettings = settingsBuilder.createSnapshotOperationSettings().build(); + deleteSnapshotSettings = settingsBuilder.deleteSnapshotSettings().build(); + deleteSnapshotOperationSettings = settingsBuilder.deleteSnapshotOperationSettings().build(); + updateSnapshotSettings = settingsBuilder.updateSnapshotSettings().build(); + updateSnapshotOperationSettings = settingsBuilder.updateSnapshotOperationSettings().build(); listBackupsSettings = settingsBuilder.listBackupsSettings().build(); getBackupSettings = settingsBuilder.getBackupSettings().build(); createBackupSettings = settingsBuilder.createBackupSettings().build(); @@ -479,6 +739,14 @@ protected CloudFilestoreManagerStubSettings(Builder settingsBuilder) throws IOEx deleteBackupOperationSettings = settingsBuilder.deleteBackupOperationSettings().build(); updateBackupSettings = settingsBuilder.updateBackupSettings().build(); updateBackupOperationSettings = settingsBuilder.updateBackupOperationSettings().build(); + listSharesSettings = settingsBuilder.listSharesSettings().build(); + getShareSettings = settingsBuilder.getShareSettings().build(); + createShareSettings = settingsBuilder.createShareSettings().build(); + createShareOperationSettings = settingsBuilder.createShareOperationSettings().build(); + deleteShareSettings = settingsBuilder.deleteShareSettings().build(); + deleteShareOperationSettings = settingsBuilder.deleteShareOperationSettings().build(); + updateShareSettings = settingsBuilder.updateShareSettings().build(); + updateShareOperationSettings = settingsBuilder.updateShareOperationSettings().build(); } /** Builder for CloudFilestoreManagerStubSettings. */ @@ -501,10 +769,30 @@ public static class Builder restoreInstanceSettings; private final OperationCallSettings.Builder restoreInstanceOperationSettings; + private final UnaryCallSettings.Builder + revertInstanceSettings; + private final OperationCallSettings.Builder + revertInstanceOperationSettings; private final UnaryCallSettings.Builder deleteInstanceSettings; private final OperationCallSettings.Builder deleteInstanceOperationSettings; + private final PagedCallSettings.Builder< + ListSnapshotsRequest, ListSnapshotsResponse, ListSnapshotsPagedResponse> + listSnapshotsSettings; + private final UnaryCallSettings.Builder getSnapshotSettings; + private final UnaryCallSettings.Builder + createSnapshotSettings; + private final OperationCallSettings.Builder + createSnapshotOperationSettings; + private final UnaryCallSettings.Builder + deleteSnapshotSettings; + private final OperationCallSettings.Builder + deleteSnapshotOperationSettings; + private final UnaryCallSettings.Builder + updateSnapshotSettings; + private final OperationCallSettings.Builder + updateSnapshotOperationSettings; private final PagedCallSettings.Builder< ListBackupsRequest, ListBackupsResponse, ListBackupsPagedResponse> listBackupsSettings; @@ -518,6 +806,19 @@ public static class Builder private final UnaryCallSettings.Builder updateBackupSettings; private final OperationCallSettings.Builder updateBackupOperationSettings; + private final PagedCallSettings.Builder< + ListSharesRequest, ListSharesResponse, ListSharesPagedResponse> + listSharesSettings; + private final UnaryCallSettings.Builder getShareSettings; + private final UnaryCallSettings.Builder createShareSettings; + private final OperationCallSettings.Builder + createShareOperationSettings; + private final UnaryCallSettings.Builder deleteShareSettings; + private final OperationCallSettings.Builder + deleteShareOperationSettings; + private final UnaryCallSettings.Builder updateShareSettings; + private final OperationCallSettings.Builder + updateShareOperationSettings; private static final ImmutableMap> RETRYABLE_CODE_DEFINITIONS; @@ -531,6 +832,7 @@ public static class Builder "no_retry_1_codes", ImmutableSet.copyOf(Lists.newArrayList())); definitions.put( "no_retry_2_codes", ImmutableSet.copyOf(Lists.newArrayList())); + definitions.put("no_retry_codes", ImmutableSet.copyOf(Lists.newArrayList())); definitions.put( "no_retry_3_codes", ImmutableSet.copyOf(Lists.newArrayList())); RETRYABLE_CODE_DEFINITIONS = definitions.build(); @@ -568,6 +870,8 @@ public static class Builder .setTotalTimeout(Duration.ofMillis(14400000L)) .build(); definitions.put("no_retry_2_params", settings); + settings = RetrySettings.newBuilder().setRpcTimeoutMultiplier(1.0).build(); + definitions.put("no_retry_params", settings); settings = RetrySettings.newBuilder() .setInitialRpcTimeout(Duration.ofMillis(600000L)) @@ -594,8 +898,18 @@ protected Builder(ClientContext clientContext) { updateInstanceOperationSettings = OperationCallSettings.newBuilder(); restoreInstanceSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); restoreInstanceOperationSettings = OperationCallSettings.newBuilder(); + revertInstanceSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + revertInstanceOperationSettings = OperationCallSettings.newBuilder(); deleteInstanceSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); deleteInstanceOperationSettings = OperationCallSettings.newBuilder(); + listSnapshotsSettings = PagedCallSettings.newBuilder(LIST_SNAPSHOTS_PAGE_STR_FACT); + getSnapshotSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + createSnapshotSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + createSnapshotOperationSettings = OperationCallSettings.newBuilder(); + deleteSnapshotSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + deleteSnapshotOperationSettings = OperationCallSettings.newBuilder(); + updateSnapshotSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + updateSnapshotOperationSettings = OperationCallSettings.newBuilder(); listBackupsSettings = PagedCallSettings.newBuilder(LIST_BACKUPS_PAGE_STR_FACT); getBackupSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); createBackupSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); @@ -604,6 +918,14 @@ protected Builder(ClientContext clientContext) { deleteBackupOperationSettings = OperationCallSettings.newBuilder(); updateBackupSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); updateBackupOperationSettings = OperationCallSettings.newBuilder(); + listSharesSettings = PagedCallSettings.newBuilder(LIST_SHARES_PAGE_STR_FACT); + getShareSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + createShareSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + createShareOperationSettings = OperationCallSettings.newBuilder(); + deleteShareSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + deleteShareOperationSettings = OperationCallSettings.newBuilder(); + updateShareSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + updateShareOperationSettings = OperationCallSettings.newBuilder(); unaryMethodSettingsBuilders = ImmutableList.>of( @@ -612,12 +934,23 @@ protected Builder(ClientContext clientContext) { createInstanceSettings, updateInstanceSettings, restoreInstanceSettings, + revertInstanceSettings, deleteInstanceSettings, + listSnapshotsSettings, + getSnapshotSettings, + createSnapshotSettings, + deleteSnapshotSettings, + updateSnapshotSettings, listBackupsSettings, getBackupSettings, createBackupSettings, deleteBackupSettings, - updateBackupSettings); + updateBackupSettings, + listSharesSettings, + getShareSettings, + createShareSettings, + deleteShareSettings, + updateShareSettings); initDefaults(this); } @@ -632,8 +965,18 @@ protected Builder(CloudFilestoreManagerStubSettings settings) { updateInstanceOperationSettings = settings.updateInstanceOperationSettings.toBuilder(); restoreInstanceSettings = settings.restoreInstanceSettings.toBuilder(); restoreInstanceOperationSettings = settings.restoreInstanceOperationSettings.toBuilder(); + revertInstanceSettings = settings.revertInstanceSettings.toBuilder(); + revertInstanceOperationSettings = settings.revertInstanceOperationSettings.toBuilder(); deleteInstanceSettings = settings.deleteInstanceSettings.toBuilder(); deleteInstanceOperationSettings = settings.deleteInstanceOperationSettings.toBuilder(); + listSnapshotsSettings = settings.listSnapshotsSettings.toBuilder(); + getSnapshotSettings = settings.getSnapshotSettings.toBuilder(); + createSnapshotSettings = settings.createSnapshotSettings.toBuilder(); + createSnapshotOperationSettings = settings.createSnapshotOperationSettings.toBuilder(); + deleteSnapshotSettings = settings.deleteSnapshotSettings.toBuilder(); + deleteSnapshotOperationSettings = settings.deleteSnapshotOperationSettings.toBuilder(); + updateSnapshotSettings = settings.updateSnapshotSettings.toBuilder(); + updateSnapshotOperationSettings = settings.updateSnapshotOperationSettings.toBuilder(); listBackupsSettings = settings.listBackupsSettings.toBuilder(); getBackupSettings = settings.getBackupSettings.toBuilder(); createBackupSettings = settings.createBackupSettings.toBuilder(); @@ -642,6 +985,14 @@ protected Builder(CloudFilestoreManagerStubSettings settings) { deleteBackupOperationSettings = settings.deleteBackupOperationSettings.toBuilder(); updateBackupSettings = settings.updateBackupSettings.toBuilder(); updateBackupOperationSettings = settings.updateBackupOperationSettings.toBuilder(); + listSharesSettings = settings.listSharesSettings.toBuilder(); + getShareSettings = settings.getShareSettings.toBuilder(); + createShareSettings = settings.createShareSettings.toBuilder(); + createShareOperationSettings = settings.createShareOperationSettings.toBuilder(); + deleteShareSettings = settings.deleteShareSettings.toBuilder(); + deleteShareOperationSettings = settings.deleteShareOperationSettings.toBuilder(); + updateShareSettings = settings.updateShareSettings.toBuilder(); + updateShareOperationSettings = settings.updateShareOperationSettings.toBuilder(); unaryMethodSettingsBuilders = ImmutableList.>of( @@ -650,12 +1001,23 @@ protected Builder(CloudFilestoreManagerStubSettings settings) { createInstanceSettings, updateInstanceSettings, restoreInstanceSettings, + revertInstanceSettings, deleteInstanceSettings, + listSnapshotsSettings, + getSnapshotSettings, + createSnapshotSettings, + deleteSnapshotSettings, + updateSnapshotSettings, listBackupsSettings, getBackupSettings, createBackupSettings, deleteBackupSettings, - updateBackupSettings); + updateBackupSettings, + listSharesSettings, + getShareSettings, + createShareSettings, + deleteShareSettings, + updateShareSettings); } private static Builder createDefault() { @@ -710,11 +1072,41 @@ private static Builder initDefaults(Builder builder) { .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")); + builder + .revertInstanceSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + builder .deleteInstanceSettings() .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_3_codes")) .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_3_params")); + builder + .listSnapshotsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .getSnapshotSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .createSnapshotSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_3_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_3_params")); + + builder + .deleteSnapshotSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_3_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_3_params")); + + builder + .updateSnapshotSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_3_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_3_params")); + builder .listBackupsSettings() .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) @@ -740,6 +1132,31 @@ private static Builder initDefaults(Builder builder) { .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_3_codes")) .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_3_params")); + builder + .listSharesSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .getShareSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .createShareSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .deleteShareSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .updateShareSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + builder .createInstanceOperationSettings() .setInitialCallSettings( @@ -812,6 +1229,30 @@ private static Builder initDefaults(Builder builder) { .setTotalTimeout(Duration.ofMillis(7200000L)) .build())); + builder + .revertInstanceOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + .newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create(Instance.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create(OperationMetadata.class)) + .setPollingAlgorithm( + OperationTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(5000L)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelay(Duration.ofMillis(45000L)) + .setInitialRpcTimeout(Duration.ZERO) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ZERO) + .setTotalTimeout(Duration.ofMillis(300000L)) + .build())); + builder .deleteInstanceOperationSettings() .setInitialCallSettings( @@ -836,6 +1277,78 @@ private static Builder initDefaults(Builder builder) { .setTotalTimeout(Duration.ofMillis(1200000L)) .build())); + builder + .createSnapshotOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + .newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_3_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_3_params")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create(Snapshot.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create(OperationMetadata.class)) + .setPollingAlgorithm( + OperationTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(10000L)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelay(Duration.ofMillis(60000L)) + .setInitialRpcTimeout(Duration.ZERO) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ZERO) + .setTotalTimeout(Duration.ofMillis(660000L)) + .build())); + + builder + .deleteSnapshotOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + .newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_3_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_3_params")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create(Empty.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create(OperationMetadata.class)) + .setPollingAlgorithm( + OperationTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(30000L)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelay(Duration.ofMillis(60000L)) + .setInitialRpcTimeout(Duration.ZERO) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ZERO) + .setTotalTimeout(Duration.ofMillis(7200000L)) + .build())); + + builder + .updateSnapshotOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + .newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_3_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_3_params")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create(Snapshot.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create(OperationMetadata.class)) + .setPollingAlgorithm( + OperationTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(10000L)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelay(Duration.ofMillis(60000L)) + .setInitialRpcTimeout(Duration.ZERO) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ZERO) + .setTotalTimeout(Duration.ofMillis(660000L)) + .build())); + builder .createBackupOperationSettings() .setInitialCallSettings( @@ -908,6 +1421,75 @@ private static Builder initDefaults(Builder builder) { .setTotalTimeout(Duration.ofMillis(660000L)) .build())); + builder + .createShareOperationSettings() + .setInitialCallSettings( + UnaryCallSettings.newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create(Share.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create(OperationMetadata.class)) + .setPollingAlgorithm( + OperationTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(5000L)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelay(Duration.ofMillis(45000L)) + .setInitialRpcTimeout(Duration.ZERO) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ZERO) + .setTotalTimeout(Duration.ofMillis(300000L)) + .build())); + + builder + .deleteShareOperationSettings() + .setInitialCallSettings( + UnaryCallSettings.newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create(Empty.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create(OperationMetadata.class)) + .setPollingAlgorithm( + OperationTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(5000L)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelay(Duration.ofMillis(45000L)) + .setInitialRpcTimeout(Duration.ZERO) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ZERO) + .setTotalTimeout(Duration.ofMillis(300000L)) + .build())); + + builder + .updateShareOperationSettings() + .setInitialCallSettings( + UnaryCallSettings.newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create(Share.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create(OperationMetadata.class)) + .setPollingAlgorithm( + OperationTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(5000L)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelay(Duration.ofMillis(45000L)) + .setInitialRpcTimeout(Duration.ZERO) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ZERO) + .setTotalTimeout(Duration.ofMillis(300000L)) + .build())); + return builder; } @@ -977,6 +1559,19 @@ public UnaryCallSettings.Builder restoreInsta return restoreInstanceOperationSettings; } + /** Returns the builder for the settings used for calls to revertInstance. */ + public UnaryCallSettings.Builder revertInstanceSettings() { + return revertInstanceSettings; + } + + /** Returns the builder for the settings used for calls to revertInstance. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder + revertInstanceOperationSettings() { + return revertInstanceOperationSettings; + } + /** Returns the builder for the settings used for calls to deleteInstance. */ public UnaryCallSettings.Builder deleteInstanceSettings() { return deleteInstanceSettings; @@ -990,6 +1585,57 @@ public UnaryCallSettings.Builder deleteInstanc return deleteInstanceOperationSettings; } + /** Returns the builder for the settings used for calls to listSnapshots. */ + public PagedCallSettings.Builder< + ListSnapshotsRequest, ListSnapshotsResponse, ListSnapshotsPagedResponse> + listSnapshotsSettings() { + return listSnapshotsSettings; + } + + /** Returns the builder for the settings used for calls to getSnapshot. */ + public UnaryCallSettings.Builder getSnapshotSettings() { + return getSnapshotSettings; + } + + /** Returns the builder for the settings used for calls to createSnapshot. */ + public UnaryCallSettings.Builder createSnapshotSettings() { + return createSnapshotSettings; + } + + /** Returns the builder for the settings used for calls to createSnapshot. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder + createSnapshotOperationSettings() { + return createSnapshotOperationSettings; + } + + /** Returns the builder for the settings used for calls to deleteSnapshot. */ + public UnaryCallSettings.Builder deleteSnapshotSettings() { + return deleteSnapshotSettings; + } + + /** Returns the builder for the settings used for calls to deleteSnapshot. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder + deleteSnapshotOperationSettings() { + return deleteSnapshotOperationSettings; + } + + /** Returns the builder for the settings used for calls to updateSnapshot. */ + public UnaryCallSettings.Builder updateSnapshotSettings() { + return updateSnapshotSettings; + } + + /** Returns the builder for the settings used for calls to updateSnapshot. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder + updateSnapshotOperationSettings() { + return updateSnapshotOperationSettings; + } + /** Returns the builder for the settings used for calls to listBackups. */ public PagedCallSettings.Builder< ListBackupsRequest, ListBackupsResponse, ListBackupsPagedResponse> @@ -1041,6 +1687,56 @@ public UnaryCallSettings.Builder updateBackupSet return updateBackupOperationSettings; } + /** Returns the builder for the settings used for calls to listShares. */ + public PagedCallSettings.Builder + listSharesSettings() { + return listSharesSettings; + } + + /** Returns the builder for the settings used for calls to getShare. */ + public UnaryCallSettings.Builder getShareSettings() { + return getShareSettings; + } + + /** Returns the builder for the settings used for calls to createShare. */ + public UnaryCallSettings.Builder createShareSettings() { + return createShareSettings; + } + + /** Returns the builder for the settings used for calls to createShare. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder + createShareOperationSettings() { + return createShareOperationSettings; + } + + /** Returns the builder for the settings used for calls to deleteShare. */ + public UnaryCallSettings.Builder deleteShareSettings() { + return deleteShareSettings; + } + + /** Returns the builder for the settings used for calls to deleteShare. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder + deleteShareOperationSettings() { + return deleteShareOperationSettings; + } + + /** Returns the builder for the settings used for calls to updateShare. */ + public UnaryCallSettings.Builder updateShareSettings() { + return updateShareSettings; + } + + /** Returns the builder for the settings used for calls to updateShare. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder + updateShareOperationSettings() { + return updateShareOperationSettings; + } + @Override public CloudFilestoreManagerStubSettings build() throws IOException { return new CloudFilestoreManagerStubSettings(this); diff --git a/java-filestore/google-cloud-filestore/src/main/java/com/google/cloud/filestore/v1beta1/stub/GrpcCloudFilestoreManagerStub.java b/java-filestore/google-cloud-filestore/src/main/java/com/google/cloud/filestore/v1beta1/stub/GrpcCloudFilestoreManagerStub.java index d2ddff1d7418..d67d152aa3a9 100644 --- a/java-filestore/google-cloud-filestore/src/main/java/com/google/cloud/filestore/v1beta1/stub/GrpcCloudFilestoreManagerStub.java +++ b/java-filestore/google-cloud-filestore/src/main/java/com/google/cloud/filestore/v1beta1/stub/GrpcCloudFilestoreManagerStub.java @@ -18,6 +18,8 @@ import static com.google.cloud.filestore.v1beta1.CloudFilestoreManagerClient.ListBackupsPagedResponse; import static com.google.cloud.filestore.v1beta1.CloudFilestoreManagerClient.ListInstancesPagedResponse; +import static com.google.cloud.filestore.v1beta1.CloudFilestoreManagerClient.ListSharesPagedResponse; +import static com.google.cloud.filestore.v1beta1.CloudFilestoreManagerClient.ListSnapshotsPagedResponse; import com.google.api.core.BetaApi; import com.google.api.gax.core.BackgroundResource; @@ -31,18 +33,33 @@ import com.google.cloud.filestore.v1beta1.Backup; import com.google.cloud.filestore.v1beta1.CreateBackupRequest; import com.google.cloud.filestore.v1beta1.CreateInstanceRequest; +import com.google.cloud.filestore.v1beta1.CreateShareRequest; +import com.google.cloud.filestore.v1beta1.CreateSnapshotRequest; import com.google.cloud.filestore.v1beta1.DeleteBackupRequest; import com.google.cloud.filestore.v1beta1.DeleteInstanceRequest; +import com.google.cloud.filestore.v1beta1.DeleteShareRequest; +import com.google.cloud.filestore.v1beta1.DeleteSnapshotRequest; import com.google.cloud.filestore.v1beta1.GetBackupRequest; import com.google.cloud.filestore.v1beta1.GetInstanceRequest; +import com.google.cloud.filestore.v1beta1.GetShareRequest; +import com.google.cloud.filestore.v1beta1.GetSnapshotRequest; import com.google.cloud.filestore.v1beta1.Instance; import com.google.cloud.filestore.v1beta1.ListBackupsRequest; import com.google.cloud.filestore.v1beta1.ListBackupsResponse; import com.google.cloud.filestore.v1beta1.ListInstancesRequest; import com.google.cloud.filestore.v1beta1.ListInstancesResponse; +import com.google.cloud.filestore.v1beta1.ListSharesRequest; +import com.google.cloud.filestore.v1beta1.ListSharesResponse; +import com.google.cloud.filestore.v1beta1.ListSnapshotsRequest; +import com.google.cloud.filestore.v1beta1.ListSnapshotsResponse; import com.google.cloud.filestore.v1beta1.RestoreInstanceRequest; +import com.google.cloud.filestore.v1beta1.RevertInstanceRequest; +import com.google.cloud.filestore.v1beta1.Share; +import com.google.cloud.filestore.v1beta1.Snapshot; import com.google.cloud.filestore.v1beta1.UpdateBackupRequest; import com.google.cloud.filestore.v1beta1.UpdateInstanceRequest; +import com.google.cloud.filestore.v1beta1.UpdateShareRequest; +import com.google.cloud.filestore.v1beta1.UpdateSnapshotRequest; import com.google.common.collect.ImmutableMap; import com.google.longrunning.Operation; import com.google.longrunning.stub.GrpcOperationsStub; @@ -115,6 +132,17 @@ public class GrpcCloudFilestoreManagerStub extends CloudFilestoreManagerStub { .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) .build(); + private static final MethodDescriptor + revertInstanceMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.filestore.v1beta1.CloudFilestoreManager/RevertInstance") + .setRequestMarshaller( + ProtoUtils.marshaller(RevertInstanceRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + private static final MethodDescriptor deleteInstanceMethodDescriptor = MethodDescriptor.newBuilder() @@ -126,6 +154,59 @@ public class GrpcCloudFilestoreManagerStub extends CloudFilestoreManagerStub { .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) .build(); + private static final MethodDescriptor + listSnapshotsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.filestore.v1beta1.CloudFilestoreManager/ListSnapshots") + .setRequestMarshaller( + ProtoUtils.marshaller(ListSnapshotsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListSnapshotsResponse.getDefaultInstance())) + .build(); + + private static final MethodDescriptor getSnapshotMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.filestore.v1beta1.CloudFilestoreManager/GetSnapshot") + .setRequestMarshaller(ProtoUtils.marshaller(GetSnapshotRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Snapshot.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + createSnapshotMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.filestore.v1beta1.CloudFilestoreManager/CreateSnapshot") + .setRequestMarshaller( + ProtoUtils.marshaller(CreateSnapshotRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + deleteSnapshotMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.filestore.v1beta1.CloudFilestoreManager/DeleteSnapshot") + .setRequestMarshaller( + ProtoUtils.marshaller(DeleteSnapshotRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + updateSnapshotMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.filestore.v1beta1.CloudFilestoreManager/UpdateSnapshot") + .setRequestMarshaller( + ProtoUtils.marshaller(UpdateSnapshotRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + private static final MethodDescriptor listBackupsMethodDescriptor = MethodDescriptor.newBuilder() @@ -174,6 +255,47 @@ public class GrpcCloudFilestoreManagerStub extends CloudFilestoreManagerStub { .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) .build(); + private static final MethodDescriptor + listSharesMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.filestore.v1beta1.CloudFilestoreManager/ListShares") + .setRequestMarshaller(ProtoUtils.marshaller(ListSharesRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(ListSharesResponse.getDefaultInstance())) + .build(); + + private static final MethodDescriptor getShareMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.filestore.v1beta1.CloudFilestoreManager/GetShare") + .setRequestMarshaller(ProtoUtils.marshaller(GetShareRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Share.getDefaultInstance())) + .build(); + + private static final MethodDescriptor createShareMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.filestore.v1beta1.CloudFilestoreManager/CreateShare") + .setRequestMarshaller(ProtoUtils.marshaller(CreateShareRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + + private static final MethodDescriptor deleteShareMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.filestore.v1beta1.CloudFilestoreManager/DeleteShare") + .setRequestMarshaller(ProtoUtils.marshaller(DeleteShareRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + + private static final MethodDescriptor updateShareMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.filestore.v1beta1.CloudFilestoreManager/UpdateShare") + .setRequestMarshaller(ProtoUtils.marshaller(UpdateShareRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + private final UnaryCallable listInstancesCallable; private final UnaryCallable listInstancesPagedCallable; @@ -187,9 +309,25 @@ public class GrpcCloudFilestoreManagerStub extends CloudFilestoreManagerStub { private final UnaryCallable restoreInstanceCallable; private final OperationCallable restoreInstanceOperationCallable; + private final UnaryCallable revertInstanceCallable; + private final OperationCallable + revertInstanceOperationCallable; private final UnaryCallable deleteInstanceCallable; private final OperationCallable deleteInstanceOperationCallable; + private final UnaryCallable listSnapshotsCallable; + private final UnaryCallable + listSnapshotsPagedCallable; + private final UnaryCallable getSnapshotCallable; + private final UnaryCallable createSnapshotCallable; + private final OperationCallable + createSnapshotOperationCallable; + private final UnaryCallable deleteSnapshotCallable; + private final OperationCallable + deleteSnapshotOperationCallable; + private final UnaryCallable updateSnapshotCallable; + private final OperationCallable + updateSnapshotOperationCallable; private final UnaryCallable listBackupsCallable; private final UnaryCallable listBackupsPagedCallable; @@ -203,6 +341,18 @@ public class GrpcCloudFilestoreManagerStub extends CloudFilestoreManagerStub { private final UnaryCallable updateBackupCallable; private final OperationCallable updateBackupOperationCallable; + private final UnaryCallable listSharesCallable; + private final UnaryCallable listSharesPagedCallable; + private final UnaryCallable getShareCallable; + private final UnaryCallable createShareCallable; + private final OperationCallable + createShareOperationCallable; + private final UnaryCallable deleteShareCallable; + private final OperationCallable + deleteShareOperationCallable; + private final UnaryCallable updateShareCallable; + private final OperationCallable + updateShareOperationCallable; private final BackgroundResource backgroundResources; private final GrpcOperationsStub operationsStub; @@ -298,6 +448,16 @@ protected GrpcCloudFilestoreManagerStub( return params.build(); }) .build(); + GrpcCallSettings revertInstanceTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(revertInstanceMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + }) + .build(); GrpcCallSettings deleteInstanceTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(deleteInstanceMethodDescriptor) @@ -308,6 +468,56 @@ protected GrpcCloudFilestoreManagerStub( return params.build(); }) .build(); + GrpcCallSettings listSnapshotsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listSnapshotsMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + }) + .build(); + GrpcCallSettings getSnapshotTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getSnapshotMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + }) + .build(); + GrpcCallSettings createSnapshotTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(createSnapshotMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + }) + .build(); + GrpcCallSettings deleteSnapshotTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(deleteSnapshotMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + }) + .build(); + GrpcCallSettings updateSnapshotTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(updateSnapshotMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("snapshot.name", String.valueOf(request.getSnapshot().getName())); + return params.build(); + }) + .build(); GrpcCallSettings listBackupsTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(listBackupsMethodDescriptor) @@ -358,6 +568,56 @@ protected GrpcCloudFilestoreManagerStub( return params.build(); }) .build(); + GrpcCallSettings listSharesTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listSharesMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + }) + .build(); + GrpcCallSettings getShareTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getShareMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + }) + .build(); + GrpcCallSettings createShareTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(createShareMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + }) + .build(); + GrpcCallSettings deleteShareTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(deleteShareMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + }) + .build(); + GrpcCallSettings updateShareTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(updateShareMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("share.name", String.valueOf(request.getShare().getName())); + return params.build(); + }) + .build(); this.listInstancesCallable = callableFactory.createUnaryCallable( @@ -395,6 +655,15 @@ protected GrpcCloudFilestoreManagerStub( settings.restoreInstanceOperationSettings(), clientContext, operationsStub); + this.revertInstanceCallable = + callableFactory.createUnaryCallable( + revertInstanceTransportSettings, settings.revertInstanceSettings(), clientContext); + this.revertInstanceOperationCallable = + callableFactory.createOperationCallable( + revertInstanceTransportSettings, + settings.revertInstanceOperationSettings(), + clientContext, + operationsStub); this.deleteInstanceCallable = callableFactory.createUnaryCallable( deleteInstanceTransportSettings, settings.deleteInstanceSettings(), clientContext); @@ -404,6 +673,42 @@ protected GrpcCloudFilestoreManagerStub( settings.deleteInstanceOperationSettings(), clientContext, operationsStub); + this.listSnapshotsCallable = + callableFactory.createUnaryCallable( + listSnapshotsTransportSettings, settings.listSnapshotsSettings(), clientContext); + this.listSnapshotsPagedCallable = + callableFactory.createPagedCallable( + listSnapshotsTransportSettings, settings.listSnapshotsSettings(), clientContext); + this.getSnapshotCallable = + callableFactory.createUnaryCallable( + getSnapshotTransportSettings, settings.getSnapshotSettings(), clientContext); + this.createSnapshotCallable = + callableFactory.createUnaryCallable( + createSnapshotTransportSettings, settings.createSnapshotSettings(), clientContext); + this.createSnapshotOperationCallable = + callableFactory.createOperationCallable( + createSnapshotTransportSettings, + settings.createSnapshotOperationSettings(), + clientContext, + operationsStub); + this.deleteSnapshotCallable = + callableFactory.createUnaryCallable( + deleteSnapshotTransportSettings, settings.deleteSnapshotSettings(), clientContext); + this.deleteSnapshotOperationCallable = + callableFactory.createOperationCallable( + deleteSnapshotTransportSettings, + settings.deleteSnapshotOperationSettings(), + clientContext, + operationsStub); + this.updateSnapshotCallable = + callableFactory.createUnaryCallable( + updateSnapshotTransportSettings, settings.updateSnapshotSettings(), clientContext); + this.updateSnapshotOperationCallable = + callableFactory.createOperationCallable( + updateSnapshotTransportSettings, + settings.updateSnapshotOperationSettings(), + clientContext, + operationsStub); this.listBackupsCallable = callableFactory.createUnaryCallable( listBackupsTransportSettings, settings.listBackupsSettings(), clientContext); @@ -440,6 +745,42 @@ protected GrpcCloudFilestoreManagerStub( settings.updateBackupOperationSettings(), clientContext, operationsStub); + this.listSharesCallable = + callableFactory.createUnaryCallable( + listSharesTransportSettings, settings.listSharesSettings(), clientContext); + this.listSharesPagedCallable = + callableFactory.createPagedCallable( + listSharesTransportSettings, settings.listSharesSettings(), clientContext); + this.getShareCallable = + callableFactory.createUnaryCallable( + getShareTransportSettings, settings.getShareSettings(), clientContext); + this.createShareCallable = + callableFactory.createUnaryCallable( + createShareTransportSettings, settings.createShareSettings(), clientContext); + this.createShareOperationCallable = + callableFactory.createOperationCallable( + createShareTransportSettings, + settings.createShareOperationSettings(), + clientContext, + operationsStub); + this.deleteShareCallable = + callableFactory.createUnaryCallable( + deleteShareTransportSettings, settings.deleteShareSettings(), clientContext); + this.deleteShareOperationCallable = + callableFactory.createOperationCallable( + deleteShareTransportSettings, + settings.deleteShareOperationSettings(), + clientContext, + operationsStub); + this.updateShareCallable = + callableFactory.createUnaryCallable( + updateShareTransportSettings, settings.updateShareSettings(), clientContext); + this.updateShareOperationCallable = + callableFactory.createOperationCallable( + updateShareTransportSettings, + settings.updateShareOperationSettings(), + clientContext, + operationsStub); this.backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources()); @@ -498,6 +839,17 @@ public UnaryCallable restoreInstanceCallable( return restoreInstanceOperationCallable; } + @Override + public UnaryCallable revertInstanceCallable() { + return revertInstanceCallable; + } + + @Override + public OperationCallable + revertInstanceOperationCallable() { + return revertInstanceOperationCallable; + } + @Override public UnaryCallable deleteInstanceCallable() { return deleteInstanceCallable; @@ -509,6 +861,55 @@ public UnaryCallable deleteInstanceCallable() return deleteInstanceOperationCallable; } + @Override + public UnaryCallable listSnapshotsCallable() { + return listSnapshotsCallable; + } + + @Override + public UnaryCallable + listSnapshotsPagedCallable() { + return listSnapshotsPagedCallable; + } + + @Override + public UnaryCallable getSnapshotCallable() { + return getSnapshotCallable; + } + + @Override + public UnaryCallable createSnapshotCallable() { + return createSnapshotCallable; + } + + @Override + public OperationCallable + createSnapshotOperationCallable() { + return createSnapshotOperationCallable; + } + + @Override + public UnaryCallable deleteSnapshotCallable() { + return deleteSnapshotCallable; + } + + @Override + public OperationCallable + deleteSnapshotOperationCallable() { + return deleteSnapshotOperationCallable; + } + + @Override + public UnaryCallable updateSnapshotCallable() { + return updateSnapshotCallable; + } + + @Override + public OperationCallable + updateSnapshotOperationCallable() { + return updateSnapshotOperationCallable; + } + @Override public UnaryCallable listBackupsCallable() { return listBackupsCallable; @@ -557,6 +958,54 @@ public UnaryCallable updateBackupCallable() { return updateBackupOperationCallable; } + @Override + public UnaryCallable listSharesCallable() { + return listSharesCallable; + } + + @Override + public UnaryCallable listSharesPagedCallable() { + return listSharesPagedCallable; + } + + @Override + public UnaryCallable getShareCallable() { + return getShareCallable; + } + + @Override + public UnaryCallable createShareCallable() { + return createShareCallable; + } + + @Override + public OperationCallable + createShareOperationCallable() { + return createShareOperationCallable; + } + + @Override + public UnaryCallable deleteShareCallable() { + return deleteShareCallable; + } + + @Override + public OperationCallable + deleteShareOperationCallable() { + return deleteShareOperationCallable; + } + + @Override + public UnaryCallable updateShareCallable() { + return updateShareCallable; + } + + @Override + public OperationCallable + updateShareOperationCallable() { + return updateShareOperationCallable; + } + @Override public final void close() { try { diff --git a/java-filestore/google-cloud-filestore/src/main/java/com/google/cloud/filestore/v1beta1/stub/HttpJsonCloudFilestoreManagerStub.java b/java-filestore/google-cloud-filestore/src/main/java/com/google/cloud/filestore/v1beta1/stub/HttpJsonCloudFilestoreManagerStub.java index a5583d065fc7..4243c6d5ee51 100644 --- a/java-filestore/google-cloud-filestore/src/main/java/com/google/cloud/filestore/v1beta1/stub/HttpJsonCloudFilestoreManagerStub.java +++ b/java-filestore/google-cloud-filestore/src/main/java/com/google/cloud/filestore/v1beta1/stub/HttpJsonCloudFilestoreManagerStub.java @@ -18,6 +18,8 @@ import static com.google.cloud.filestore.v1beta1.CloudFilestoreManagerClient.ListBackupsPagedResponse; import static com.google.cloud.filestore.v1beta1.CloudFilestoreManagerClient.ListInstancesPagedResponse; +import static com.google.cloud.filestore.v1beta1.CloudFilestoreManagerClient.ListSharesPagedResponse; +import static com.google.cloud.filestore.v1beta1.CloudFilestoreManagerClient.ListSnapshotsPagedResponse; import com.google.api.core.BetaApi; import com.google.api.core.InternalApi; @@ -38,18 +40,33 @@ import com.google.cloud.filestore.v1beta1.Backup; import com.google.cloud.filestore.v1beta1.CreateBackupRequest; import com.google.cloud.filestore.v1beta1.CreateInstanceRequest; +import com.google.cloud.filestore.v1beta1.CreateShareRequest; +import com.google.cloud.filestore.v1beta1.CreateSnapshotRequest; import com.google.cloud.filestore.v1beta1.DeleteBackupRequest; import com.google.cloud.filestore.v1beta1.DeleteInstanceRequest; +import com.google.cloud.filestore.v1beta1.DeleteShareRequest; +import com.google.cloud.filestore.v1beta1.DeleteSnapshotRequest; import com.google.cloud.filestore.v1beta1.GetBackupRequest; import com.google.cloud.filestore.v1beta1.GetInstanceRequest; +import com.google.cloud.filestore.v1beta1.GetShareRequest; +import com.google.cloud.filestore.v1beta1.GetSnapshotRequest; import com.google.cloud.filestore.v1beta1.Instance; import com.google.cloud.filestore.v1beta1.ListBackupsRequest; import com.google.cloud.filestore.v1beta1.ListBackupsResponse; import com.google.cloud.filestore.v1beta1.ListInstancesRequest; import com.google.cloud.filestore.v1beta1.ListInstancesResponse; +import com.google.cloud.filestore.v1beta1.ListSharesRequest; +import com.google.cloud.filestore.v1beta1.ListSharesResponse; +import com.google.cloud.filestore.v1beta1.ListSnapshotsRequest; +import com.google.cloud.filestore.v1beta1.ListSnapshotsResponse; import com.google.cloud.filestore.v1beta1.RestoreInstanceRequest; +import com.google.cloud.filestore.v1beta1.RevertInstanceRequest; +import com.google.cloud.filestore.v1beta1.Share; +import com.google.cloud.filestore.v1beta1.Snapshot; import com.google.cloud.filestore.v1beta1.UpdateBackupRequest; import com.google.cloud.filestore.v1beta1.UpdateInstanceRequest; +import com.google.cloud.filestore.v1beta1.UpdateShareRequest; +import com.google.cloud.filestore.v1beta1.UpdateSnapshotRequest; import com.google.longrunning.Operation; import com.google.protobuf.Empty; import com.google.protobuf.TypeRegistry; @@ -73,7 +90,9 @@ public class HttpJsonCloudFilestoreManagerStub extends CloudFilestoreManagerStub private static final TypeRegistry typeRegistry = TypeRegistry.newBuilder() .add(Empty.getDescriptor()) + .add(Share.getDescriptor()) .add(OperationMetadata.getDescriptor()) + .add(Snapshot.getDescriptor()) .add(Instance.getDescriptor()) .add(Backup.getDescriptor()) .build(); @@ -272,6 +291,46 @@ public class HttpJsonCloudFilestoreManagerStub extends CloudFilestoreManagerStub HttpJsonOperationSnapshot.create(response)) .build(); + private static final ApiMethodDescriptor + revertInstanceMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName( + "google.cloud.filestore.v1beta1.CloudFilestoreManager/RevertInstance") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{name=projects/*/locations/*/instances/*}:revert", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().clearName().build(), false)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .setOperationSnapshotFactory( + (RevertInstanceRequest request, Operation response) -> + HttpJsonOperationSnapshot.create(response)) + .build(); + private static final ApiMethodDescriptor deleteInstanceMethodDescriptor = ApiMethodDescriptor.newBuilder() @@ -295,6 +354,7 @@ public class HttpJsonCloudFilestoreManagerStub extends CloudFilestoreManagerStub Map> fields = new HashMap<>(); ProtoRestSerializer serializer = ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "force", request.getForce()); return fields; }) .setRequestBodyExtractor(request -> null) @@ -309,6 +369,197 @@ public class HttpJsonCloudFilestoreManagerStub extends CloudFilestoreManagerStub HttpJsonOperationSnapshot.create(response)) .build(); + private static final ApiMethodDescriptor + listSnapshotsMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName( + "google.cloud.filestore.v1beta1.CloudFilestoreManager/ListSnapshots") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{parent=projects/*/locations/*/instances/*}/snapshots", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "parent", request.getParent()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "filter", request.getFilter()); + serializer.putQueryParam(fields, "orderBy", request.getOrderBy()); + serializer.putQueryParam(fields, "pageSize", request.getPageSize()); + serializer.putQueryParam(fields, "pageToken", request.getPageToken()); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(ListSnapshotsResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + getSnapshotMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.filestore.v1beta1.CloudFilestoreManager/GetSnapshot") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{name=projects/*/locations/*/instances/*/snapshots/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Snapshot.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + createSnapshotMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName( + "google.cloud.filestore.v1beta1.CloudFilestoreManager/CreateSnapshot") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{parent=projects/*/locations/*/instances/*}/snapshots", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "parent", request.getParent()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "snapshotId", request.getSnapshotId()); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("snapshot", request.getSnapshot(), false)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .setOperationSnapshotFactory( + (CreateSnapshotRequest request, Operation response) -> + HttpJsonOperationSnapshot.create(response)) + .build(); + + private static final ApiMethodDescriptor + deleteSnapshotMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName( + "google.cloud.filestore.v1beta1.CloudFilestoreManager/DeleteSnapshot") + .setHttpMethod("DELETE") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{name=projects/*/locations/*/instances/*/snapshots/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .setOperationSnapshotFactory( + (DeleteSnapshotRequest request, Operation response) -> + HttpJsonOperationSnapshot.create(response)) + .build(); + + private static final ApiMethodDescriptor + updateSnapshotMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName( + "google.cloud.filestore.v1beta1.CloudFilestoreManager/UpdateSnapshot") + .setHttpMethod("PATCH") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{snapshot.name=projects/*/locations/*/instances/*/snapshots/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam( + fields, "snapshot.name", request.getSnapshot().getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "updateMask", request.getUpdateMask()); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("snapshot", request.getSnapshot(), false)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .setOperationSnapshotFactory( + (UpdateSnapshotRequest request, Operation response) -> + HttpJsonOperationSnapshot.create(response)) + .build(); + private static final ApiMethodDescriptor listBackupsMethodDescriptor = ApiMethodDescriptor.newBuilder() @@ -498,6 +749,192 @@ public class HttpJsonCloudFilestoreManagerStub extends CloudFilestoreManagerStub HttpJsonOperationSnapshot.create(response)) .build(); + private static final ApiMethodDescriptor + listSharesMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.filestore.v1beta1.CloudFilestoreManager/ListShares") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{parent=projects/*/locations/*/instances/*}/shares", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "parent", request.getParent()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "filter", request.getFilter()); + serializer.putQueryParam(fields, "orderBy", request.getOrderBy()); + serializer.putQueryParam(fields, "pageSize", request.getPageSize()); + serializer.putQueryParam(fields, "pageToken", request.getPageToken()); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(ListSharesResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor getShareMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.filestore.v1beta1.CloudFilestoreManager/GetShare") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{name=projects/*/locations/*/instances/*/shares/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Share.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + createShareMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.filestore.v1beta1.CloudFilestoreManager/CreateShare") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{parent=projects/*/locations/*/instances/*}/shares", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "parent", request.getParent()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "shareId", request.getShareId()); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("share", request.getShare(), false)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .setOperationSnapshotFactory( + (CreateShareRequest request, Operation response) -> + HttpJsonOperationSnapshot.create(response)) + .build(); + + private static final ApiMethodDescriptor + deleteShareMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.filestore.v1beta1.CloudFilestoreManager/DeleteShare") + .setHttpMethod("DELETE") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{name=projects/*/locations/*/instances/*/shares/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .setOperationSnapshotFactory( + (DeleteShareRequest request, Operation response) -> + HttpJsonOperationSnapshot.create(response)) + .build(); + + private static final ApiMethodDescriptor + updateShareMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.filestore.v1beta1.CloudFilestoreManager/UpdateShare") + .setHttpMethod("PATCH") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{share.name=projects/*/locations/*/instances/*/shares/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam( + fields, "share.name", request.getShare().getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "updateMask", request.getUpdateMask()); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("share", request.getShare(), false)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .setOperationSnapshotFactory( + (UpdateShareRequest request, Operation response) -> + HttpJsonOperationSnapshot.create(response)) + .build(); + private final UnaryCallable listInstancesCallable; private final UnaryCallable listInstancesPagedCallable; @@ -511,9 +948,25 @@ public class HttpJsonCloudFilestoreManagerStub extends CloudFilestoreManagerStub private final UnaryCallable restoreInstanceCallable; private final OperationCallable restoreInstanceOperationCallable; + private final UnaryCallable revertInstanceCallable; + private final OperationCallable + revertInstanceOperationCallable; private final UnaryCallable deleteInstanceCallable; private final OperationCallable deleteInstanceOperationCallable; + private final UnaryCallable listSnapshotsCallable; + private final UnaryCallable + listSnapshotsPagedCallable; + private final UnaryCallable getSnapshotCallable; + private final UnaryCallable createSnapshotCallable; + private final OperationCallable + createSnapshotOperationCallable; + private final UnaryCallable deleteSnapshotCallable; + private final OperationCallable + deleteSnapshotOperationCallable; + private final UnaryCallable updateSnapshotCallable; + private final OperationCallable + updateSnapshotOperationCallable; private final UnaryCallable listBackupsCallable; private final UnaryCallable listBackupsPagedCallable; @@ -527,6 +980,18 @@ public class HttpJsonCloudFilestoreManagerStub extends CloudFilestoreManagerStub private final UnaryCallable updateBackupCallable; private final OperationCallable updateBackupOperationCallable; + private final UnaryCallable listSharesCallable; + private final UnaryCallable listSharesPagedCallable; + private final UnaryCallable getShareCallable; + private final UnaryCallable createShareCallable; + private final OperationCallable + createShareOperationCallable; + private final UnaryCallable deleteShareCallable; + private final OperationCallable + deleteShareOperationCallable; + private final UnaryCallable updateShareCallable; + private final OperationCallable + updateShareOperationCallable; private final BackgroundResource backgroundResources; private final HttpJsonOperationsStub httpJsonOperationsStub; @@ -601,11 +1066,42 @@ protected HttpJsonCloudFilestoreManagerStub( .setMethodDescriptor(restoreInstanceMethodDescriptor) .setTypeRegistry(typeRegistry) .build(); + HttpJsonCallSettings revertInstanceTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(revertInstanceMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); HttpJsonCallSettings deleteInstanceTransportSettings = HttpJsonCallSettings.newBuilder() .setMethodDescriptor(deleteInstanceMethodDescriptor) .setTypeRegistry(typeRegistry) .build(); + HttpJsonCallSettings + listSnapshotsTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listSnapshotsMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings getSnapshotTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getSnapshotMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings createSnapshotTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(createSnapshotMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings deleteSnapshotTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(deleteSnapshotMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings updateSnapshotTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(updateSnapshotMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); HttpJsonCallSettings listBackupsTransportSettings = HttpJsonCallSettings.newBuilder() .setMethodDescriptor(listBackupsMethodDescriptor) @@ -631,6 +1127,31 @@ protected HttpJsonCloudFilestoreManagerStub( .setMethodDescriptor(updateBackupMethodDescriptor) .setTypeRegistry(typeRegistry) .build(); + HttpJsonCallSettings listSharesTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listSharesMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings getShareTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getShareMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings createShareTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(createShareMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings deleteShareTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(deleteShareMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings updateShareTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(updateShareMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); this.listInstancesCallable = callableFactory.createUnaryCallable( @@ -668,6 +1189,15 @@ protected HttpJsonCloudFilestoreManagerStub( settings.restoreInstanceOperationSettings(), clientContext, httpJsonOperationsStub); + this.revertInstanceCallable = + callableFactory.createUnaryCallable( + revertInstanceTransportSettings, settings.revertInstanceSettings(), clientContext); + this.revertInstanceOperationCallable = + callableFactory.createOperationCallable( + revertInstanceTransportSettings, + settings.revertInstanceOperationSettings(), + clientContext, + httpJsonOperationsStub); this.deleteInstanceCallable = callableFactory.createUnaryCallable( deleteInstanceTransportSettings, settings.deleteInstanceSettings(), clientContext); @@ -677,6 +1207,42 @@ protected HttpJsonCloudFilestoreManagerStub( settings.deleteInstanceOperationSettings(), clientContext, httpJsonOperationsStub); + this.listSnapshotsCallable = + callableFactory.createUnaryCallable( + listSnapshotsTransportSettings, settings.listSnapshotsSettings(), clientContext); + this.listSnapshotsPagedCallable = + callableFactory.createPagedCallable( + listSnapshotsTransportSettings, settings.listSnapshotsSettings(), clientContext); + this.getSnapshotCallable = + callableFactory.createUnaryCallable( + getSnapshotTransportSettings, settings.getSnapshotSettings(), clientContext); + this.createSnapshotCallable = + callableFactory.createUnaryCallable( + createSnapshotTransportSettings, settings.createSnapshotSettings(), clientContext); + this.createSnapshotOperationCallable = + callableFactory.createOperationCallable( + createSnapshotTransportSettings, + settings.createSnapshotOperationSettings(), + clientContext, + httpJsonOperationsStub); + this.deleteSnapshotCallable = + callableFactory.createUnaryCallable( + deleteSnapshotTransportSettings, settings.deleteSnapshotSettings(), clientContext); + this.deleteSnapshotOperationCallable = + callableFactory.createOperationCallable( + deleteSnapshotTransportSettings, + settings.deleteSnapshotOperationSettings(), + clientContext, + httpJsonOperationsStub); + this.updateSnapshotCallable = + callableFactory.createUnaryCallable( + updateSnapshotTransportSettings, settings.updateSnapshotSettings(), clientContext); + this.updateSnapshotOperationCallable = + callableFactory.createOperationCallable( + updateSnapshotTransportSettings, + settings.updateSnapshotOperationSettings(), + clientContext, + httpJsonOperationsStub); this.listBackupsCallable = callableFactory.createUnaryCallable( listBackupsTransportSettings, settings.listBackupsSettings(), clientContext); @@ -713,6 +1279,42 @@ protected HttpJsonCloudFilestoreManagerStub( settings.updateBackupOperationSettings(), clientContext, httpJsonOperationsStub); + this.listSharesCallable = + callableFactory.createUnaryCallable( + listSharesTransportSettings, settings.listSharesSettings(), clientContext); + this.listSharesPagedCallable = + callableFactory.createPagedCallable( + listSharesTransportSettings, settings.listSharesSettings(), clientContext); + this.getShareCallable = + callableFactory.createUnaryCallable( + getShareTransportSettings, settings.getShareSettings(), clientContext); + this.createShareCallable = + callableFactory.createUnaryCallable( + createShareTransportSettings, settings.createShareSettings(), clientContext); + this.createShareOperationCallable = + callableFactory.createOperationCallable( + createShareTransportSettings, + settings.createShareOperationSettings(), + clientContext, + httpJsonOperationsStub); + this.deleteShareCallable = + callableFactory.createUnaryCallable( + deleteShareTransportSettings, settings.deleteShareSettings(), clientContext); + this.deleteShareOperationCallable = + callableFactory.createOperationCallable( + deleteShareTransportSettings, + settings.deleteShareOperationSettings(), + clientContext, + httpJsonOperationsStub); + this.updateShareCallable = + callableFactory.createUnaryCallable( + updateShareTransportSettings, settings.updateShareSettings(), clientContext); + this.updateShareOperationCallable = + callableFactory.createOperationCallable( + updateShareTransportSettings, + settings.updateShareOperationSettings(), + clientContext, + httpJsonOperationsStub); this.backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources()); @@ -726,12 +1328,23 @@ public static List getMethodDescriptors() { methodDescriptors.add(createInstanceMethodDescriptor); methodDescriptors.add(updateInstanceMethodDescriptor); methodDescriptors.add(restoreInstanceMethodDescriptor); + methodDescriptors.add(revertInstanceMethodDescriptor); methodDescriptors.add(deleteInstanceMethodDescriptor); + methodDescriptors.add(listSnapshotsMethodDescriptor); + methodDescriptors.add(getSnapshotMethodDescriptor); + methodDescriptors.add(createSnapshotMethodDescriptor); + methodDescriptors.add(deleteSnapshotMethodDescriptor); + methodDescriptors.add(updateSnapshotMethodDescriptor); methodDescriptors.add(listBackupsMethodDescriptor); methodDescriptors.add(getBackupMethodDescriptor); methodDescriptors.add(createBackupMethodDescriptor); methodDescriptors.add(deleteBackupMethodDescriptor); methodDescriptors.add(updateBackupMethodDescriptor); + methodDescriptors.add(listSharesMethodDescriptor); + methodDescriptors.add(getShareMethodDescriptor); + methodDescriptors.add(createShareMethodDescriptor); + methodDescriptors.add(deleteShareMethodDescriptor); + methodDescriptors.add(updateShareMethodDescriptor); return methodDescriptors; } @@ -788,6 +1401,17 @@ public UnaryCallable restoreInstanceCallable( return restoreInstanceOperationCallable; } + @Override + public UnaryCallable revertInstanceCallable() { + return revertInstanceCallable; + } + + @Override + public OperationCallable + revertInstanceOperationCallable() { + return revertInstanceOperationCallable; + } + @Override public UnaryCallable deleteInstanceCallable() { return deleteInstanceCallable; @@ -799,6 +1423,55 @@ public UnaryCallable deleteInstanceCallable() return deleteInstanceOperationCallable; } + @Override + public UnaryCallable listSnapshotsCallable() { + return listSnapshotsCallable; + } + + @Override + public UnaryCallable + listSnapshotsPagedCallable() { + return listSnapshotsPagedCallable; + } + + @Override + public UnaryCallable getSnapshotCallable() { + return getSnapshotCallable; + } + + @Override + public UnaryCallable createSnapshotCallable() { + return createSnapshotCallable; + } + + @Override + public OperationCallable + createSnapshotOperationCallable() { + return createSnapshotOperationCallable; + } + + @Override + public UnaryCallable deleteSnapshotCallable() { + return deleteSnapshotCallable; + } + + @Override + public OperationCallable + deleteSnapshotOperationCallable() { + return deleteSnapshotOperationCallable; + } + + @Override + public UnaryCallable updateSnapshotCallable() { + return updateSnapshotCallable; + } + + @Override + public OperationCallable + updateSnapshotOperationCallable() { + return updateSnapshotOperationCallable; + } + @Override public UnaryCallable listBackupsCallable() { return listBackupsCallable; @@ -847,6 +1520,54 @@ public UnaryCallable updateBackupCallable() { return updateBackupOperationCallable; } + @Override + public UnaryCallable listSharesCallable() { + return listSharesCallable; + } + + @Override + public UnaryCallable listSharesPagedCallable() { + return listSharesPagedCallable; + } + + @Override + public UnaryCallable getShareCallable() { + return getShareCallable; + } + + @Override + public UnaryCallable createShareCallable() { + return createShareCallable; + } + + @Override + public OperationCallable + createShareOperationCallable() { + return createShareOperationCallable; + } + + @Override + public UnaryCallable deleteShareCallable() { + return deleteShareCallable; + } + + @Override + public OperationCallable + deleteShareOperationCallable() { + return deleteShareOperationCallable; + } + + @Override + public UnaryCallable updateShareCallable() { + return updateShareCallable; + } + + @Override + public OperationCallable + updateShareOperationCallable() { + return updateShareOperationCallable; + } + @Override public final void close() { try { diff --git a/java-filestore/google-cloud-filestore/src/test/java/com/google/cloud/filestore/v1beta1/CloudFilestoreManagerClientHttpJsonTest.java b/java-filestore/google-cloud-filestore/src/test/java/com/google/cloud/filestore/v1beta1/CloudFilestoreManagerClientHttpJsonTest.java index 980eca1d9a83..a51489964af7 100644 --- a/java-filestore/google-cloud-filestore/src/test/java/com/google/cloud/filestore/v1beta1/CloudFilestoreManagerClientHttpJsonTest.java +++ b/java-filestore/google-cloud-filestore/src/test/java/com/google/cloud/filestore/v1beta1/CloudFilestoreManagerClientHttpJsonTest.java @@ -18,6 +18,8 @@ import static com.google.cloud.filestore.v1beta1.CloudFilestoreManagerClient.ListBackupsPagedResponse; import static com.google.cloud.filestore.v1beta1.CloudFilestoreManagerClient.ListInstancesPagedResponse; +import static com.google.cloud.filestore.v1beta1.CloudFilestoreManagerClient.ListSharesPagedResponse; +import static com.google.cloud.filestore.v1beta1.CloudFilestoreManagerClient.ListSnapshotsPagedResponse; import com.google.api.gax.core.NoCredentialsProvider; import com.google.api.gax.httpjson.GaxHttpJsonProperties; @@ -198,6 +200,13 @@ public void getInstanceTest() throws Exception { .addAllNetworks(new ArrayList()) .setEtag("etag3123477") .setSatisfiesPzs(BoolValue.newBuilder().build()) + .setKmsKeyName("kmsKeyName412586233") + .addAllSuspensionReasons(new ArrayList()) + .setMaxCapacityGb(220559397) + .setCapacityStepSizeGb(18315979) + .setMaxShareCount(-1758695852) + .setCapacityGb(-1923585408) + .setMultiShareEnabled(true) .build(); mockService.addResponse(expectedResponse); @@ -250,6 +259,13 @@ public void getInstanceTest2() throws Exception { .addAllNetworks(new ArrayList()) .setEtag("etag3123477") .setSatisfiesPzs(BoolValue.newBuilder().build()) + .setKmsKeyName("kmsKeyName412586233") + .addAllSuspensionReasons(new ArrayList()) + .setMaxCapacityGb(220559397) + .setCapacityStepSizeGb(18315979) + .setMaxShareCount(-1758695852) + .setCapacityGb(-1923585408) + .setMultiShareEnabled(true) .build(); mockService.addResponse(expectedResponse); @@ -302,6 +318,13 @@ public void createInstanceTest() throws Exception { .addAllNetworks(new ArrayList()) .setEtag("etag3123477") .setSatisfiesPzs(BoolValue.newBuilder().build()) + .setKmsKeyName("kmsKeyName412586233") + .addAllSuspensionReasons(new ArrayList()) + .setMaxCapacityGb(220559397) + .setCapacityStepSizeGb(18315979) + .setMaxShareCount(-1758695852) + .setCapacityGb(-1923585408) + .setMultiShareEnabled(true) .build(); Operation resultOperation = Operation.newBuilder() @@ -363,6 +386,13 @@ public void createInstanceTest2() throws Exception { .addAllNetworks(new ArrayList()) .setEtag("etag3123477") .setSatisfiesPzs(BoolValue.newBuilder().build()) + .setKmsKeyName("kmsKeyName412586233") + .addAllSuspensionReasons(new ArrayList()) + .setMaxCapacityGb(220559397) + .setCapacityStepSizeGb(18315979) + .setMaxShareCount(-1758695852) + .setCapacityGb(-1923585408) + .setMultiShareEnabled(true) .build(); Operation resultOperation = Operation.newBuilder() @@ -424,6 +454,13 @@ public void updateInstanceTest() throws Exception { .addAllNetworks(new ArrayList()) .setEtag("etag3123477") .setSatisfiesPzs(BoolValue.newBuilder().build()) + .setKmsKeyName("kmsKeyName412586233") + .addAllSuspensionReasons(new ArrayList()) + .setMaxCapacityGb(220559397) + .setCapacityStepSizeGb(18315979) + .setMaxShareCount(-1758695852) + .setCapacityGb(-1923585408) + .setMultiShareEnabled(true) .build(); Operation resultOperation = Operation.newBuilder() @@ -444,6 +481,13 @@ public void updateInstanceTest() throws Exception { .addAllNetworks(new ArrayList()) .setEtag("etag3123477") .setSatisfiesPzs(BoolValue.newBuilder().build()) + .setKmsKeyName("kmsKeyName412586233") + .addAllSuspensionReasons(new ArrayList()) + .setMaxCapacityGb(220559397) + .setCapacityStepSizeGb(18315979) + .setMaxShareCount(-1758695852) + .setCapacityGb(-1923585408) + .setMultiShareEnabled(true) .build(); FieldMask updateMask = FieldMask.newBuilder().build(); @@ -484,6 +528,13 @@ public void updateInstanceExceptionTest() throws Exception { .addAllNetworks(new ArrayList()) .setEtag("etag3123477") .setSatisfiesPzs(BoolValue.newBuilder().build()) + .setKmsKeyName("kmsKeyName412586233") + .addAllSuspensionReasons(new ArrayList()) + .setMaxCapacityGb(220559397) + .setCapacityStepSizeGb(18315979) + .setMaxShareCount(-1758695852) + .setCapacityGb(-1923585408) + .setMultiShareEnabled(true) .build(); FieldMask updateMask = FieldMask.newBuilder().build(); client.updateInstanceAsync(instance, updateMask).get(); @@ -505,6 +556,13 @@ public void restoreInstanceTest() throws Exception { .addAllNetworks(new ArrayList()) .setEtag("etag3123477") .setSatisfiesPzs(BoolValue.newBuilder().build()) + .setKmsKeyName("kmsKeyName412586233") + .addAllSuspensionReasons(new ArrayList()) + .setMaxCapacityGb(220559397) + .setCapacityStepSizeGb(18315979) + .setMaxShareCount(-1758695852) + .setCapacityGb(-1923585408) + .setMultiShareEnabled(true) .build(); Operation resultOperation = Operation.newBuilder() @@ -557,6 +615,78 @@ public void restoreInstanceExceptionTest() throws Exception { } } + @Test + public void revertInstanceTest() throws Exception { + Instance expectedResponse = + Instance.newBuilder() + .setName(InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString()) + .setDescription("description-1724546052") + .setStatusMessage("statusMessage-958704715") + .setCreateTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .addAllFileShares(new ArrayList()) + .addAllNetworks(new ArrayList()) + .setEtag("etag3123477") + .setSatisfiesPzs(BoolValue.newBuilder().build()) + .setKmsKeyName("kmsKeyName412586233") + .addAllSuspensionReasons(new ArrayList()) + .setMaxCapacityGb(220559397) + .setCapacityStepSizeGb(18315979) + .setMaxShareCount(-1758695852) + .setCapacityGb(-1923585408) + .setMultiShareEnabled(true) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("revertInstanceTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + RevertInstanceRequest request = + RevertInstanceRequest.newBuilder() + .setName(InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString()) + .setTargetSnapshotId("targetSnapshotId-2099459472") + .build(); + + Instance actualResponse = client.revertInstanceAsync(request).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void revertInstanceExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + RevertInstanceRequest request = + RevertInstanceRequest.newBuilder() + .setName(InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString()) + .setTargetSnapshotId("targetSnapshotId-2099459472") + .build(); + client.revertInstanceAsync(request).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + @Test public void deleteInstanceTest() throws Exception { Empty expectedResponse = Empty.newBuilder().build(); @@ -648,23 +778,23 @@ public void deleteInstanceExceptionTest2() throws Exception { } @Test - public void listBackupsTest() throws Exception { - Backup responsesElement = Backup.newBuilder().build(); - ListBackupsResponse expectedResponse = - ListBackupsResponse.newBuilder() + public void listSnapshotsTest() throws Exception { + Snapshot responsesElement = Snapshot.newBuilder().build(); + ListSnapshotsResponse expectedResponse = + ListSnapshotsResponse.newBuilder() .setNextPageToken("") - .addAllBackups(Arrays.asList(responsesElement)) + .addAllSnapshots(Arrays.asList(responsesElement)) .build(); mockService.addResponse(expectedResponse); - LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + InstanceName parent = InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]"); - ListBackupsPagedResponse pagedListResponse = client.listBackups(parent); + ListSnapshotsPagedResponse pagedListResponse = client.listSnapshots(parent); - List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); Assert.assertEquals(1, resources.size()); - Assert.assertEquals(expectedResponse.getBackupsList().get(0), resources.get(0)); + Assert.assertEquals(expectedResponse.getSnapshotsList().get(0), resources.get(0)); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); @@ -682,15 +812,15 @@ public void listBackupsTest() throws Exception { } @Test - public void listBackupsExceptionTest() throws Exception { + public void listSnapshotsExceptionTest() throws Exception { ApiException exception = ApiExceptionFactory.createException( new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { - LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); - client.listBackups(parent); + InstanceName parent = InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]"); + client.listSnapshots(parent); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception. @@ -698,23 +828,23 @@ public void listBackupsExceptionTest() throws Exception { } @Test - public void listBackupsTest2() throws Exception { - Backup responsesElement = Backup.newBuilder().build(); - ListBackupsResponse expectedResponse = - ListBackupsResponse.newBuilder() + public void listSnapshotsTest2() throws Exception { + Snapshot responsesElement = Snapshot.newBuilder().build(); + ListSnapshotsResponse expectedResponse = + ListSnapshotsResponse.newBuilder() .setNextPageToken("") - .addAllBackups(Arrays.asList(responsesElement)) + .addAllSnapshots(Arrays.asList(responsesElement)) .build(); mockService.addResponse(expectedResponse); - String parent = "projects/project-5833/locations/location-5833"; + String parent = "projects/project-5197/locations/location-5197/instances/instance-5197"; - ListBackupsPagedResponse pagedListResponse = client.listBackups(parent); + ListSnapshotsPagedResponse pagedListResponse = client.listSnapshots(parent); - List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); Assert.assertEquals(1, resources.size()); - Assert.assertEquals(expectedResponse.getBackupsList().get(0), resources.get(0)); + Assert.assertEquals(expectedResponse.getSnapshotsList().get(0), resources.get(0)); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); @@ -732,15 +862,15 @@ public void listBackupsTest2() throws Exception { } @Test - public void listBackupsExceptionTest2() throws Exception { + public void listSnapshotsExceptionTest2() throws Exception { ApiException exception = ApiExceptionFactory.createException( new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { - String parent = "projects/project-5833/locations/location-5833"; - client.listBackups(parent); + String parent = "projects/project-5197/locations/location-5197/instances/instance-5197"; + client.listSnapshots(parent); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception. @@ -748,25 +878,21 @@ public void listBackupsExceptionTest2() throws Exception { } @Test - public void getBackupTest() throws Exception { - Backup expectedResponse = - Backup.newBuilder() - .setName(BackupName.of("[PROJECT]", "[LOCATION]", "[BACKUP]").toString()) + public void getSnapshotTest() throws Exception { + Snapshot expectedResponse = + Snapshot.newBuilder() + .setName( + SnapshotName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]", "[SNAPSHOT]").toString()) .setDescription("description-1724546052") .setCreateTime(Timestamp.newBuilder().build()) .putAllLabels(new HashMap()) - .setCapacityGb(-1923585408) - .setStorageBytes(2035244455) - .setSourceInstance(InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString()) - .setSourceFileShare("sourceFileShare-646832664") - .setDownloadBytes(971924980) - .setSatisfiesPzs(BoolValue.newBuilder().build()) + .setFilesystemUsedBytes(387235709) .build(); mockService.addResponse(expectedResponse); - BackupName name = BackupName.of("[PROJECT]", "[LOCATION]", "[BACKUP]"); + SnapshotName name = SnapshotName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]", "[SNAPSHOT]"); - Backup actualResponse = client.getBackup(name); + Snapshot actualResponse = client.getSnapshot(name); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -785,15 +911,15 @@ public void getBackupTest() throws Exception { } @Test - public void getBackupExceptionTest() throws Exception { + public void getSnapshotExceptionTest() throws Exception { ApiException exception = ApiExceptionFactory.createException( new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { - BackupName name = BackupName.of("[PROJECT]", "[LOCATION]", "[BACKUP]"); - client.getBackup(name); + SnapshotName name = SnapshotName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]", "[SNAPSHOT]"); + client.getSnapshot(name); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception. @@ -801,25 +927,22 @@ public void getBackupExceptionTest() throws Exception { } @Test - public void getBackupTest2() throws Exception { - Backup expectedResponse = - Backup.newBuilder() - .setName(BackupName.of("[PROJECT]", "[LOCATION]", "[BACKUP]").toString()) + public void getSnapshotTest2() throws Exception { + Snapshot expectedResponse = + Snapshot.newBuilder() + .setName( + SnapshotName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]", "[SNAPSHOT]").toString()) .setDescription("description-1724546052") .setCreateTime(Timestamp.newBuilder().build()) .putAllLabels(new HashMap()) - .setCapacityGb(-1923585408) - .setStorageBytes(2035244455) - .setSourceInstance(InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString()) - .setSourceFileShare("sourceFileShare-646832664") - .setDownloadBytes(971924980) - .setSatisfiesPzs(BoolValue.newBuilder().build()) + .setFilesystemUsedBytes(387235709) .build(); mockService.addResponse(expectedResponse); - String name = "projects/project-1607/locations/location-1607/backups/backup-1607"; + String name = + "projects/project-2497/locations/location-2497/instances/instance-2497/snapshots/snapshot-2497"; - Backup actualResponse = client.getBackup(name); + Snapshot actualResponse = client.getSnapshot(name); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -838,15 +961,16 @@ public void getBackupTest2() throws Exception { } @Test - public void getBackupExceptionTest2() throws Exception { + public void getSnapshotExceptionTest2() throws Exception { ApiException exception = ApiExceptionFactory.createException( new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { - String name = "projects/project-1607/locations/location-1607/backups/backup-1607"; - client.getBackup(name); + String name = + "projects/project-2497/locations/location-2497/instances/instance-2497/snapshots/snapshot-2497"; + client.getSnapshot(name); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception. @@ -854,33 +978,29 @@ public void getBackupExceptionTest2() throws Exception { } @Test - public void createBackupTest() throws Exception { - Backup expectedResponse = - Backup.newBuilder() - .setName(BackupName.of("[PROJECT]", "[LOCATION]", "[BACKUP]").toString()) + public void createSnapshotTest() throws Exception { + Snapshot expectedResponse = + Snapshot.newBuilder() + .setName( + SnapshotName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]", "[SNAPSHOT]").toString()) .setDescription("description-1724546052") .setCreateTime(Timestamp.newBuilder().build()) .putAllLabels(new HashMap()) - .setCapacityGb(-1923585408) - .setStorageBytes(2035244455) - .setSourceInstance(InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString()) - .setSourceFileShare("sourceFileShare-646832664") - .setDownloadBytes(971924980) - .setSatisfiesPzs(BoolValue.newBuilder().build()) + .setFilesystemUsedBytes(387235709) .build(); Operation resultOperation = Operation.newBuilder() - .setName("createBackupTest") + .setName("createSnapshotTest") .setDone(true) .setResponse(Any.pack(expectedResponse)) .build(); mockService.addResponse(resultOperation); - LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); - Backup backup = Backup.newBuilder().build(); - String backupId = "backupId2121930365"; + InstanceName parent = InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]"); + Snapshot snapshot = Snapshot.newBuilder().build(); + String snapshotId = "snapshotId-1113817601"; - Backup actualResponse = client.createBackupAsync(parent, backup, backupId).get(); + Snapshot actualResponse = client.createSnapshotAsync(parent, snapshot, snapshotId).get(); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -899,50 +1019,46 @@ public void createBackupTest() throws Exception { } @Test - public void createBackupExceptionTest() throws Exception { + public void createSnapshotExceptionTest() throws Exception { ApiException exception = ApiExceptionFactory.createException( new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { - LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); - Backup backup = Backup.newBuilder().build(); - String backupId = "backupId2121930365"; - client.createBackupAsync(parent, backup, backupId).get(); + InstanceName parent = InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]"); + Snapshot snapshot = Snapshot.newBuilder().build(); + String snapshotId = "snapshotId-1113817601"; + client.createSnapshotAsync(parent, snapshot, snapshotId).get(); Assert.fail("No exception raised"); } catch (ExecutionException e) { } } @Test - public void createBackupTest2() throws Exception { - Backup expectedResponse = - Backup.newBuilder() - .setName(BackupName.of("[PROJECT]", "[LOCATION]", "[BACKUP]").toString()) + public void createSnapshotTest2() throws Exception { + Snapshot expectedResponse = + Snapshot.newBuilder() + .setName( + SnapshotName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]", "[SNAPSHOT]").toString()) .setDescription("description-1724546052") .setCreateTime(Timestamp.newBuilder().build()) .putAllLabels(new HashMap()) - .setCapacityGb(-1923585408) - .setStorageBytes(2035244455) - .setSourceInstance(InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString()) - .setSourceFileShare("sourceFileShare-646832664") - .setDownloadBytes(971924980) - .setSatisfiesPzs(BoolValue.newBuilder().build()) + .setFilesystemUsedBytes(387235709) .build(); Operation resultOperation = Operation.newBuilder() - .setName("createBackupTest") + .setName("createSnapshotTest") .setDone(true) .setResponse(Any.pack(expectedResponse)) .build(); mockService.addResponse(resultOperation); - String parent = "projects/project-5833/locations/location-5833"; - Backup backup = Backup.newBuilder().build(); - String backupId = "backupId2121930365"; + String parent = "projects/project-5197/locations/location-5197/instances/instance-5197"; + Snapshot snapshot = Snapshot.newBuilder().build(); + String snapshotId = "snapshotId-1113817601"; - Backup actualResponse = client.createBackupAsync(parent, backup, backupId).get(); + Snapshot actualResponse = client.createSnapshotAsync(parent, snapshot, snapshotId).get(); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -961,36 +1077,36 @@ public void createBackupTest2() throws Exception { } @Test - public void createBackupExceptionTest2() throws Exception { + public void createSnapshotExceptionTest2() throws Exception { ApiException exception = ApiExceptionFactory.createException( new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { - String parent = "projects/project-5833/locations/location-5833"; - Backup backup = Backup.newBuilder().build(); - String backupId = "backupId2121930365"; - client.createBackupAsync(parent, backup, backupId).get(); + String parent = "projects/project-5197/locations/location-5197/instances/instance-5197"; + Snapshot snapshot = Snapshot.newBuilder().build(); + String snapshotId = "snapshotId-1113817601"; + client.createSnapshotAsync(parent, snapshot, snapshotId).get(); Assert.fail("No exception raised"); } catch (ExecutionException e) { } } @Test - public void deleteBackupTest() throws Exception { + public void deleteSnapshotTest() throws Exception { Empty expectedResponse = Empty.newBuilder().build(); Operation resultOperation = Operation.newBuilder() - .setName("deleteBackupTest") + .setName("deleteSnapshotTest") .setDone(true) .setResponse(Any.pack(expectedResponse)) .build(); mockService.addResponse(resultOperation); - BackupName name = BackupName.of("[PROJECT]", "[LOCATION]", "[BACKUP]"); + SnapshotName name = SnapshotName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]", "[SNAPSHOT]"); - client.deleteBackupAsync(name).get(); + client.deleteSnapshotAsync(name).get(); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); @@ -1008,34 +1124,35 @@ public void deleteBackupTest() throws Exception { } @Test - public void deleteBackupExceptionTest() throws Exception { + public void deleteSnapshotExceptionTest() throws Exception { ApiException exception = ApiExceptionFactory.createException( new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { - BackupName name = BackupName.of("[PROJECT]", "[LOCATION]", "[BACKUP]"); - client.deleteBackupAsync(name).get(); + SnapshotName name = SnapshotName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]", "[SNAPSHOT]"); + client.deleteSnapshotAsync(name).get(); Assert.fail("No exception raised"); } catch (ExecutionException e) { } } @Test - public void deleteBackupTest2() throws Exception { + public void deleteSnapshotTest2() throws Exception { Empty expectedResponse = Empty.newBuilder().build(); Operation resultOperation = Operation.newBuilder() - .setName("deleteBackupTest") + .setName("deleteSnapshotTest") .setDone(true) .setResponse(Any.pack(expectedResponse)) .build(); mockService.addResponse(resultOperation); - String name = "projects/project-1607/locations/location-1607/backups/backup-1607"; + String name = + "projects/project-2497/locations/location-2497/instances/instance-2497/snapshots/snapshot-2497"; - client.deleteBackupAsync(name).get(); + client.deleteSnapshotAsync(name).get(); List actualRequests = mockService.getRequestPaths(); Assert.assertEquals(1, actualRequests.size()); @@ -1053,59 +1170,52 @@ public void deleteBackupTest2() throws Exception { } @Test - public void deleteBackupExceptionTest2() throws Exception { + public void deleteSnapshotExceptionTest2() throws Exception { ApiException exception = ApiExceptionFactory.createException( new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { - String name = "projects/project-1607/locations/location-1607/backups/backup-1607"; - client.deleteBackupAsync(name).get(); + String name = + "projects/project-2497/locations/location-2497/instances/instance-2497/snapshots/snapshot-2497"; + client.deleteSnapshotAsync(name).get(); Assert.fail("No exception raised"); } catch (ExecutionException e) { } } @Test - public void updateBackupTest() throws Exception { - Backup expectedResponse = - Backup.newBuilder() - .setName(BackupName.of("[PROJECT]", "[LOCATION]", "[BACKUP]").toString()) + public void updateSnapshotTest() throws Exception { + Snapshot expectedResponse = + Snapshot.newBuilder() + .setName( + SnapshotName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]", "[SNAPSHOT]").toString()) .setDescription("description-1724546052") .setCreateTime(Timestamp.newBuilder().build()) .putAllLabels(new HashMap()) - .setCapacityGb(-1923585408) - .setStorageBytes(2035244455) - .setSourceInstance(InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString()) - .setSourceFileShare("sourceFileShare-646832664") - .setDownloadBytes(971924980) - .setSatisfiesPzs(BoolValue.newBuilder().build()) + .setFilesystemUsedBytes(387235709) .build(); Operation resultOperation = Operation.newBuilder() - .setName("updateBackupTest") + .setName("updateSnapshotTest") .setDone(true) .setResponse(Any.pack(expectedResponse)) .build(); mockService.addResponse(resultOperation); - Backup backup = - Backup.newBuilder() - .setName(BackupName.of("[PROJECT]", "[LOCATION]", "[BACKUP]").toString()) + Snapshot snapshot = + Snapshot.newBuilder() + .setName( + SnapshotName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]", "[SNAPSHOT]").toString()) .setDescription("description-1724546052") .setCreateTime(Timestamp.newBuilder().build()) .putAllLabels(new HashMap()) - .setCapacityGb(-1923585408) - .setStorageBytes(2035244455) - .setSourceInstance(InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString()) - .setSourceFileShare("sourceFileShare-646832664") - .setDownloadBytes(971924980) - .setSatisfiesPzs(BoolValue.newBuilder().build()) + .setFilesystemUsedBytes(387235709) .build(); FieldMask updateMask = FieldMask.newBuilder().build(); - Backup actualResponse = client.updateBackupAsync(backup, updateMask).get(); + Snapshot actualResponse = client.updateSnapshotAsync(snapshot, updateMask).get(); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockService.getRequestPaths(); @@ -1124,29 +1234,1023 @@ public void updateBackupTest() throws Exception { } @Test - public void updateBackupExceptionTest() throws Exception { + public void updateSnapshotExceptionTest() throws Exception { ApiException exception = ApiExceptionFactory.createException( new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); mockService.addException(exception); try { - Backup backup = - Backup.newBuilder() - .setName(BackupName.of("[PROJECT]", "[LOCATION]", "[BACKUP]").toString()) + Snapshot snapshot = + Snapshot.newBuilder() + .setName( + SnapshotName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]", "[SNAPSHOT]").toString()) .setDescription("description-1724546052") .setCreateTime(Timestamp.newBuilder().build()) .putAllLabels(new HashMap()) - .setCapacityGb(-1923585408) - .setStorageBytes(2035244455) - .setSourceInstance( - InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString()) - .setSourceFileShare("sourceFileShare-646832664") - .setDownloadBytes(971924980) - .setSatisfiesPzs(BoolValue.newBuilder().build()) + .setFilesystemUsedBytes(387235709) .build(); FieldMask updateMask = FieldMask.newBuilder().build(); - client.updateBackupAsync(backup, updateMask).get(); + client.updateSnapshotAsync(snapshot, updateMask).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void listBackupsTest() throws Exception { + Backup responsesElement = Backup.newBuilder().build(); + ListBackupsResponse expectedResponse = + ListBackupsResponse.newBuilder() + .setNextPageToken("") + .addAllBackups(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + + ListBackupsPagedResponse pagedListResponse = client.listBackups(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getBackupsList().get(0), resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void listBackupsExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + client.listBackups(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listBackupsTest2() throws Exception { + Backup responsesElement = Backup.newBuilder().build(); + ListBackupsResponse expectedResponse = + ListBackupsResponse.newBuilder() + .setNextPageToken("") + .addAllBackups(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + String parent = "projects/project-5833/locations/location-5833"; + + ListBackupsPagedResponse pagedListResponse = client.listBackups(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getBackupsList().get(0), resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void listBackupsExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String parent = "projects/project-5833/locations/location-5833"; + client.listBackups(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getBackupTest() throws Exception { + Backup expectedResponse = + Backup.newBuilder() + .setName(BackupName.of("[PROJECT]", "[LOCATION]", "[BACKUP]").toString()) + .setDescription("description-1724546052") + .setCreateTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setCapacityGb(-1923585408) + .setStorageBytes(2035244455) + .setSourceInstance(InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString()) + .setSourceFileShare("sourceFileShare-646832664") + .setDownloadBytes(971924980) + .setSatisfiesPzs(BoolValue.newBuilder().build()) + .setKmsKeyName("kmsKeyName412586233") + .build(); + mockService.addResponse(expectedResponse); + + BackupName name = BackupName.of("[PROJECT]", "[LOCATION]", "[BACKUP]"); + + Backup actualResponse = client.getBackup(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getBackupExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + BackupName name = BackupName.of("[PROJECT]", "[LOCATION]", "[BACKUP]"); + client.getBackup(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getBackupTest2() throws Exception { + Backup expectedResponse = + Backup.newBuilder() + .setName(BackupName.of("[PROJECT]", "[LOCATION]", "[BACKUP]").toString()) + .setDescription("description-1724546052") + .setCreateTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setCapacityGb(-1923585408) + .setStorageBytes(2035244455) + .setSourceInstance(InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString()) + .setSourceFileShare("sourceFileShare-646832664") + .setDownloadBytes(971924980) + .setSatisfiesPzs(BoolValue.newBuilder().build()) + .setKmsKeyName("kmsKeyName412586233") + .build(); + mockService.addResponse(expectedResponse); + + String name = "projects/project-1607/locations/location-1607/backups/backup-1607"; + + Backup actualResponse = client.getBackup(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getBackupExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = "projects/project-1607/locations/location-1607/backups/backup-1607"; + client.getBackup(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createBackupTest() throws Exception { + Backup expectedResponse = + Backup.newBuilder() + .setName(BackupName.of("[PROJECT]", "[LOCATION]", "[BACKUP]").toString()) + .setDescription("description-1724546052") + .setCreateTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setCapacityGb(-1923585408) + .setStorageBytes(2035244455) + .setSourceInstance(InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString()) + .setSourceFileShare("sourceFileShare-646832664") + .setDownloadBytes(971924980) + .setSatisfiesPzs(BoolValue.newBuilder().build()) + .setKmsKeyName("kmsKeyName412586233") + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("createBackupTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + Backup backup = Backup.newBuilder().build(); + String backupId = "backupId2121930365"; + + Backup actualResponse = client.createBackupAsync(parent, backup, backupId).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void createBackupExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + Backup backup = Backup.newBuilder().build(); + String backupId = "backupId2121930365"; + client.createBackupAsync(parent, backup, backupId).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void createBackupTest2() throws Exception { + Backup expectedResponse = + Backup.newBuilder() + .setName(BackupName.of("[PROJECT]", "[LOCATION]", "[BACKUP]").toString()) + .setDescription("description-1724546052") + .setCreateTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setCapacityGb(-1923585408) + .setStorageBytes(2035244455) + .setSourceInstance(InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString()) + .setSourceFileShare("sourceFileShare-646832664") + .setDownloadBytes(971924980) + .setSatisfiesPzs(BoolValue.newBuilder().build()) + .setKmsKeyName("kmsKeyName412586233") + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("createBackupTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + String parent = "projects/project-5833/locations/location-5833"; + Backup backup = Backup.newBuilder().build(); + String backupId = "backupId2121930365"; + + Backup actualResponse = client.createBackupAsync(parent, backup, backupId).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void createBackupExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String parent = "projects/project-5833/locations/location-5833"; + Backup backup = Backup.newBuilder().build(); + String backupId = "backupId2121930365"; + client.createBackupAsync(parent, backup, backupId).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void deleteBackupTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + Operation resultOperation = + Operation.newBuilder() + .setName("deleteBackupTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + BackupName name = BackupName.of("[PROJECT]", "[LOCATION]", "[BACKUP]"); + + client.deleteBackupAsync(name).get(); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void deleteBackupExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + BackupName name = BackupName.of("[PROJECT]", "[LOCATION]", "[BACKUP]"); + client.deleteBackupAsync(name).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void deleteBackupTest2() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + Operation resultOperation = + Operation.newBuilder() + .setName("deleteBackupTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + String name = "projects/project-1607/locations/location-1607/backups/backup-1607"; + + client.deleteBackupAsync(name).get(); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void deleteBackupExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = "projects/project-1607/locations/location-1607/backups/backup-1607"; + client.deleteBackupAsync(name).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void updateBackupTest() throws Exception { + Backup expectedResponse = + Backup.newBuilder() + .setName(BackupName.of("[PROJECT]", "[LOCATION]", "[BACKUP]").toString()) + .setDescription("description-1724546052") + .setCreateTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setCapacityGb(-1923585408) + .setStorageBytes(2035244455) + .setSourceInstance(InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString()) + .setSourceFileShare("sourceFileShare-646832664") + .setDownloadBytes(971924980) + .setSatisfiesPzs(BoolValue.newBuilder().build()) + .setKmsKeyName("kmsKeyName412586233") + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("updateBackupTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + Backup backup = + Backup.newBuilder() + .setName(BackupName.of("[PROJECT]", "[LOCATION]", "[BACKUP]").toString()) + .setDescription("description-1724546052") + .setCreateTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setCapacityGb(-1923585408) + .setStorageBytes(2035244455) + .setSourceInstance(InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString()) + .setSourceFileShare("sourceFileShare-646832664") + .setDownloadBytes(971924980) + .setSatisfiesPzs(BoolValue.newBuilder().build()) + .setKmsKeyName("kmsKeyName412586233") + .build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + + Backup actualResponse = client.updateBackupAsync(backup, updateMask).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void updateBackupExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + Backup backup = + Backup.newBuilder() + .setName(BackupName.of("[PROJECT]", "[LOCATION]", "[BACKUP]").toString()) + .setDescription("description-1724546052") + .setCreateTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setCapacityGb(-1923585408) + .setStorageBytes(2035244455) + .setSourceInstance( + InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString()) + .setSourceFileShare("sourceFileShare-646832664") + .setDownloadBytes(971924980) + .setSatisfiesPzs(BoolValue.newBuilder().build()) + .setKmsKeyName("kmsKeyName412586233") + .build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + client.updateBackupAsync(backup, updateMask).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void listSharesTest() throws Exception { + Share responsesElement = Share.newBuilder().build(); + ListSharesResponse expectedResponse = + ListSharesResponse.newBuilder() + .setNextPageToken("") + .addAllShares(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + InstanceName parent = InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]"); + + ListSharesPagedResponse pagedListResponse = client.listShares(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getSharesList().get(0), resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void listSharesExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + InstanceName parent = InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]"); + client.listShares(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listSharesTest2() throws Exception { + Share responsesElement = Share.newBuilder().build(); + ListSharesResponse expectedResponse = + ListSharesResponse.newBuilder() + .setNextPageToken("") + .addAllShares(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + String parent = "projects/project-5197/locations/location-5197/instances/instance-5197"; + + ListSharesPagedResponse pagedListResponse = client.listShares(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getSharesList().get(0), resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void listSharesExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String parent = "projects/project-5197/locations/location-5197/instances/instance-5197"; + client.listShares(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getShareTest() throws Exception { + Share expectedResponse = + Share.newBuilder() + .setName(ShareName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]", "[SHARE]").toString()) + .setMountName("mountName456881732") + .setDescription("description-1724546052") + .setCapacityGb(-1923585408) + .addAllNfsExportOptions(new ArrayList()) + .setCreateTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .build(); + mockService.addResponse(expectedResponse); + + ShareName name = ShareName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]", "[SHARE]"); + + Share actualResponse = client.getShare(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getShareExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ShareName name = ShareName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]", "[SHARE]"); + client.getShare(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getShareTest2() throws Exception { + Share expectedResponse = + Share.newBuilder() + .setName(ShareName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]", "[SHARE]").toString()) + .setMountName("mountName456881732") + .setDescription("description-1724546052") + .setCapacityGb(-1923585408) + .addAllNfsExportOptions(new ArrayList()) + .setCreateTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .build(); + mockService.addResponse(expectedResponse); + + String name = + "projects/project-8454/locations/location-8454/instances/instance-8454/shares/share-8454"; + + Share actualResponse = client.getShare(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getShareExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = + "projects/project-8454/locations/location-8454/instances/instance-8454/shares/share-8454"; + client.getShare(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createShareTest() throws Exception { + Share expectedResponse = + Share.newBuilder() + .setName(ShareName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]", "[SHARE]").toString()) + .setMountName("mountName456881732") + .setDescription("description-1724546052") + .setCapacityGb(-1923585408) + .addAllNfsExportOptions(new ArrayList()) + .setCreateTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("createShareTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + InstanceName parent = InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]"); + Share share = Share.newBuilder().build(); + String shareId = "shareId2054217050"; + + Share actualResponse = client.createShareAsync(parent, share, shareId).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void createShareExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + InstanceName parent = InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]"); + Share share = Share.newBuilder().build(); + String shareId = "shareId2054217050"; + client.createShareAsync(parent, share, shareId).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void createShareTest2() throws Exception { + Share expectedResponse = + Share.newBuilder() + .setName(ShareName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]", "[SHARE]").toString()) + .setMountName("mountName456881732") + .setDescription("description-1724546052") + .setCapacityGb(-1923585408) + .addAllNfsExportOptions(new ArrayList()) + .setCreateTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("createShareTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + String parent = "projects/project-5197/locations/location-5197/instances/instance-5197"; + Share share = Share.newBuilder().build(); + String shareId = "shareId2054217050"; + + Share actualResponse = client.createShareAsync(parent, share, shareId).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void createShareExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String parent = "projects/project-5197/locations/location-5197/instances/instance-5197"; + Share share = Share.newBuilder().build(); + String shareId = "shareId2054217050"; + client.createShareAsync(parent, share, shareId).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void deleteShareTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + Operation resultOperation = + Operation.newBuilder() + .setName("deleteShareTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + ShareName name = ShareName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]", "[SHARE]"); + + client.deleteShareAsync(name).get(); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void deleteShareExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ShareName name = ShareName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]", "[SHARE]"); + client.deleteShareAsync(name).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void deleteShareTest2() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + Operation resultOperation = + Operation.newBuilder() + .setName("deleteShareTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + String name = + "projects/project-8454/locations/location-8454/instances/instance-8454/shares/share-8454"; + + client.deleteShareAsync(name).get(); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void deleteShareExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = + "projects/project-8454/locations/location-8454/instances/instance-8454/shares/share-8454"; + client.deleteShareAsync(name).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void updateShareTest() throws Exception { + Share expectedResponse = + Share.newBuilder() + .setName(ShareName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]", "[SHARE]").toString()) + .setMountName("mountName456881732") + .setDescription("description-1724546052") + .setCapacityGb(-1923585408) + .addAllNfsExportOptions(new ArrayList()) + .setCreateTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("updateShareTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + Share share = + Share.newBuilder() + .setName(ShareName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]", "[SHARE]").toString()) + .setMountName("mountName456881732") + .setDescription("description-1724546052") + .setCapacityGb(-1923585408) + .addAllNfsExportOptions(new ArrayList()) + .setCreateTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + + Share actualResponse = client.updateShareAsync(share, updateMask).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void updateShareExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + Share share = + Share.newBuilder() + .setName(ShareName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]", "[SHARE]").toString()) + .setMountName("mountName456881732") + .setDescription("description-1724546052") + .setCapacityGb(-1923585408) + .addAllNfsExportOptions(new ArrayList()) + .setCreateTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + client.updateShareAsync(share, updateMask).get(); Assert.fail("No exception raised"); } catch (ExecutionException e) { } diff --git a/java-filestore/google-cloud-filestore/src/test/java/com/google/cloud/filestore/v1beta1/CloudFilestoreManagerClientTest.java b/java-filestore/google-cloud-filestore/src/test/java/com/google/cloud/filestore/v1beta1/CloudFilestoreManagerClientTest.java index 1ba3101b33f7..248c89a0a755 100644 --- a/java-filestore/google-cloud-filestore/src/test/java/com/google/cloud/filestore/v1beta1/CloudFilestoreManagerClientTest.java +++ b/java-filestore/google-cloud-filestore/src/test/java/com/google/cloud/filestore/v1beta1/CloudFilestoreManagerClientTest.java @@ -18,6 +18,8 @@ import static com.google.cloud.filestore.v1beta1.CloudFilestoreManagerClient.ListBackupsPagedResponse; import static com.google.cloud.filestore.v1beta1.CloudFilestoreManagerClient.ListInstancesPagedResponse; +import static com.google.cloud.filestore.v1beta1.CloudFilestoreManagerClient.ListSharesPagedResponse; +import static com.google.cloud.filestore.v1beta1.CloudFilestoreManagerClient.ListSnapshotsPagedResponse; import com.google.api.gax.core.NoCredentialsProvider; import com.google.api.gax.grpc.GaxGrpcProperties; @@ -191,6 +193,13 @@ public void getInstanceTest() throws Exception { .addAllNetworks(new ArrayList()) .setEtag("etag3123477") .setSatisfiesPzs(BoolValue.newBuilder().build()) + .setKmsKeyName("kmsKeyName412586233") + .addAllSuspensionReasons(new ArrayList()) + .setMaxCapacityGb(220559397) + .setCapacityStepSizeGb(18315979) + .setMaxShareCount(-1758695852) + .setCapacityGb(-1923585408) + .setMultiShareEnabled(true) .build(); mockCloudFilestoreManager.addResponse(expectedResponse); @@ -237,6 +246,13 @@ public void getInstanceTest2() throws Exception { .addAllNetworks(new ArrayList()) .setEtag("etag3123477") .setSatisfiesPzs(BoolValue.newBuilder().build()) + .setKmsKeyName("kmsKeyName412586233") + .addAllSuspensionReasons(new ArrayList()) + .setMaxCapacityGb(220559397) + .setCapacityStepSizeGb(18315979) + .setMaxShareCount(-1758695852) + .setCapacityGb(-1923585408) + .setMultiShareEnabled(true) .build(); mockCloudFilestoreManager.addResponse(expectedResponse); @@ -283,6 +299,13 @@ public void createInstanceTest() throws Exception { .addAllNetworks(new ArrayList()) .setEtag("etag3123477") .setSatisfiesPzs(BoolValue.newBuilder().build()) + .setKmsKeyName("kmsKeyName412586233") + .addAllSuspensionReasons(new ArrayList()) + .setMaxCapacityGb(220559397) + .setCapacityStepSizeGb(18315979) + .setMaxShareCount(-1758695852) + .setCapacityGb(-1923585408) + .setMultiShareEnabled(true) .build(); Operation resultOperation = Operation.newBuilder() @@ -343,6 +366,13 @@ public void createInstanceTest2() throws Exception { .addAllNetworks(new ArrayList()) .setEtag("etag3123477") .setSatisfiesPzs(BoolValue.newBuilder().build()) + .setKmsKeyName("kmsKeyName412586233") + .addAllSuspensionReasons(new ArrayList()) + .setMaxCapacityGb(220559397) + .setCapacityStepSizeGb(18315979) + .setMaxShareCount(-1758695852) + .setCapacityGb(-1923585408) + .setMultiShareEnabled(true) .build(); Operation resultOperation = Operation.newBuilder() @@ -403,6 +433,13 @@ public void updateInstanceTest() throws Exception { .addAllNetworks(new ArrayList()) .setEtag("etag3123477") .setSatisfiesPzs(BoolValue.newBuilder().build()) + .setKmsKeyName("kmsKeyName412586233") + .addAllSuspensionReasons(new ArrayList()) + .setMaxCapacityGb(220559397) + .setCapacityStepSizeGb(18315979) + .setMaxShareCount(-1758695852) + .setCapacityGb(-1923585408) + .setMultiShareEnabled(true) .build(); Operation resultOperation = Operation.newBuilder() @@ -460,6 +497,13 @@ public void restoreInstanceTest() throws Exception { .addAllNetworks(new ArrayList()) .setEtag("etag3123477") .setSatisfiesPzs(BoolValue.newBuilder().build()) + .setKmsKeyName("kmsKeyName412586233") + .addAllSuspensionReasons(new ArrayList()) + .setMaxCapacityGb(220559397) + .setCapacityStepSizeGb(18315979) + .setMaxShareCount(-1758695852) + .setCapacityGb(-1923585408) + .setMultiShareEnabled(true) .build(); Operation resultOperation = Operation.newBuilder() @@ -512,6 +556,76 @@ public void restoreInstanceExceptionTest() throws Exception { } } + @Test + public void revertInstanceTest() throws Exception { + Instance expectedResponse = + Instance.newBuilder() + .setName(InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString()) + .setDescription("description-1724546052") + .setStatusMessage("statusMessage-958704715") + .setCreateTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .addAllFileShares(new ArrayList()) + .addAllNetworks(new ArrayList()) + .setEtag("etag3123477") + .setSatisfiesPzs(BoolValue.newBuilder().build()) + .setKmsKeyName("kmsKeyName412586233") + .addAllSuspensionReasons(new ArrayList()) + .setMaxCapacityGb(220559397) + .setCapacityStepSizeGb(18315979) + .setMaxShareCount(-1758695852) + .setCapacityGb(-1923585408) + .setMultiShareEnabled(true) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("revertInstanceTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockCloudFilestoreManager.addResponse(resultOperation); + + RevertInstanceRequest request = + RevertInstanceRequest.newBuilder() + .setName(InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString()) + .setTargetSnapshotId("targetSnapshotId-2099459472") + .build(); + + Instance actualResponse = client.revertInstanceAsync(request).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockCloudFilestoreManager.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + RevertInstanceRequest actualRequest = ((RevertInstanceRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getName(), actualRequest.getName()); + Assert.assertEquals(request.getTargetSnapshotId(), actualRequest.getTargetSnapshotId()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void revertInstanceExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockCloudFilestoreManager.addException(exception); + + try { + RevertInstanceRequest request = + RevertInstanceRequest.newBuilder() + .setName(InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString()) + .setTargetSnapshotId("targetSnapshotId-2099459472") + .build(); + client.revertInstanceAsync(request).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + @Test public void deleteInstanceTest() throws Exception { Empty expectedResponse = Empty.newBuilder().build(); @@ -597,27 +711,27 @@ public void deleteInstanceExceptionTest2() throws Exception { } @Test - public void listBackupsTest() throws Exception { - Backup responsesElement = Backup.newBuilder().build(); - ListBackupsResponse expectedResponse = - ListBackupsResponse.newBuilder() + public void listSnapshotsTest() throws Exception { + Snapshot responsesElement = Snapshot.newBuilder().build(); + ListSnapshotsResponse expectedResponse = + ListSnapshotsResponse.newBuilder() .setNextPageToken("") - .addAllBackups(Arrays.asList(responsesElement)) + .addAllSnapshots(Arrays.asList(responsesElement)) .build(); mockCloudFilestoreManager.addResponse(expectedResponse); - LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + InstanceName parent = InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]"); - ListBackupsPagedResponse pagedListResponse = client.listBackups(parent); + ListSnapshotsPagedResponse pagedListResponse = client.listSnapshots(parent); - List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); Assert.assertEquals(1, resources.size()); - Assert.assertEquals(expectedResponse.getBackupsList().get(0), resources.get(0)); + Assert.assertEquals(expectedResponse.getSnapshotsList().get(0), resources.get(0)); List actualRequests = mockCloudFilestoreManager.getRequests(); Assert.assertEquals(1, actualRequests.size()); - ListBackupsRequest actualRequest = ((ListBackupsRequest) actualRequests.get(0)); + ListSnapshotsRequest actualRequest = ((ListSnapshotsRequest) actualRequests.get(0)); Assert.assertEquals(parent.toString(), actualRequest.getParent()); Assert.assertTrue( @@ -627,13 +741,13 @@ public void listBackupsTest() throws Exception { } @Test - public void listBackupsExceptionTest() throws Exception { + public void listSnapshotsExceptionTest() throws Exception { StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); mockCloudFilestoreManager.addException(exception); try { - LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); - client.listBackups(parent); + InstanceName parent = InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]"); + client.listSnapshots(parent); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception. @@ -641,27 +755,27 @@ public void listBackupsExceptionTest() throws Exception { } @Test - public void listBackupsTest2() throws Exception { - Backup responsesElement = Backup.newBuilder().build(); - ListBackupsResponse expectedResponse = - ListBackupsResponse.newBuilder() + public void listSnapshotsTest2() throws Exception { + Snapshot responsesElement = Snapshot.newBuilder().build(); + ListSnapshotsResponse expectedResponse = + ListSnapshotsResponse.newBuilder() .setNextPageToken("") - .addAllBackups(Arrays.asList(responsesElement)) + .addAllSnapshots(Arrays.asList(responsesElement)) .build(); mockCloudFilestoreManager.addResponse(expectedResponse); String parent = "parent-995424086"; - ListBackupsPagedResponse pagedListResponse = client.listBackups(parent); + ListSnapshotsPagedResponse pagedListResponse = client.listSnapshots(parent); - List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); Assert.assertEquals(1, resources.size()); - Assert.assertEquals(expectedResponse.getBackupsList().get(0), resources.get(0)); + Assert.assertEquals(expectedResponse.getSnapshotsList().get(0), resources.get(0)); List actualRequests = mockCloudFilestoreManager.getRequests(); Assert.assertEquals(1, actualRequests.size()); - ListBackupsRequest actualRequest = ((ListBackupsRequest) actualRequests.get(0)); + ListSnapshotsRequest actualRequest = ((ListSnapshotsRequest) actualRequests.get(0)); Assert.assertEquals(parent, actualRequest.getParent()); Assert.assertTrue( @@ -671,13 +785,13 @@ public void listBackupsTest2() throws Exception { } @Test - public void listBackupsExceptionTest2() throws Exception { + public void listSnapshotsExceptionTest2() throws Exception { StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); mockCloudFilestoreManager.addException(exception); try { String parent = "parent-995424086"; - client.listBackups(parent); + client.listSnapshots(parent); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception. @@ -685,30 +799,26 @@ public void listBackupsExceptionTest2() throws Exception { } @Test - public void getBackupTest() throws Exception { - Backup expectedResponse = - Backup.newBuilder() - .setName(BackupName.of("[PROJECT]", "[LOCATION]", "[BACKUP]").toString()) + public void getSnapshotTest() throws Exception { + Snapshot expectedResponse = + Snapshot.newBuilder() + .setName( + SnapshotName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]", "[SNAPSHOT]").toString()) .setDescription("description-1724546052") .setCreateTime(Timestamp.newBuilder().build()) .putAllLabels(new HashMap()) - .setCapacityGb(-1923585408) - .setStorageBytes(2035244455) - .setSourceInstance(InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString()) - .setSourceFileShare("sourceFileShare-646832664") - .setDownloadBytes(971924980) - .setSatisfiesPzs(BoolValue.newBuilder().build()) + .setFilesystemUsedBytes(387235709) .build(); mockCloudFilestoreManager.addResponse(expectedResponse); - BackupName name = BackupName.of("[PROJECT]", "[LOCATION]", "[BACKUP]"); + SnapshotName name = SnapshotName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]", "[SNAPSHOT]"); - Backup actualResponse = client.getBackup(name); + Snapshot actualResponse = client.getSnapshot(name); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockCloudFilestoreManager.getRequests(); Assert.assertEquals(1, actualRequests.size()); - GetBackupRequest actualRequest = ((GetBackupRequest) actualRequests.get(0)); + GetSnapshotRequest actualRequest = ((GetSnapshotRequest) actualRequests.get(0)); Assert.assertEquals(name.toString(), actualRequest.getName()); Assert.assertTrue( @@ -718,13 +828,13 @@ public void getBackupTest() throws Exception { } @Test - public void getBackupExceptionTest() throws Exception { + public void getSnapshotExceptionTest() throws Exception { StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); mockCloudFilestoreManager.addException(exception); try { - BackupName name = BackupName.of("[PROJECT]", "[LOCATION]", "[BACKUP]"); - client.getBackup(name); + SnapshotName name = SnapshotName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]", "[SNAPSHOT]"); + client.getSnapshot(name); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception. @@ -732,30 +842,26 @@ public void getBackupExceptionTest() throws Exception { } @Test - public void getBackupTest2() throws Exception { - Backup expectedResponse = - Backup.newBuilder() - .setName(BackupName.of("[PROJECT]", "[LOCATION]", "[BACKUP]").toString()) + public void getSnapshotTest2() throws Exception { + Snapshot expectedResponse = + Snapshot.newBuilder() + .setName( + SnapshotName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]", "[SNAPSHOT]").toString()) .setDescription("description-1724546052") .setCreateTime(Timestamp.newBuilder().build()) .putAllLabels(new HashMap()) - .setCapacityGb(-1923585408) - .setStorageBytes(2035244455) - .setSourceInstance(InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString()) - .setSourceFileShare("sourceFileShare-646832664") - .setDownloadBytes(971924980) - .setSatisfiesPzs(BoolValue.newBuilder().build()) + .setFilesystemUsedBytes(387235709) .build(); mockCloudFilestoreManager.addResponse(expectedResponse); String name = "name3373707"; - Backup actualResponse = client.getBackup(name); + Snapshot actualResponse = client.getSnapshot(name); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockCloudFilestoreManager.getRequests(); Assert.assertEquals(1, actualRequests.size()); - GetBackupRequest actualRequest = ((GetBackupRequest) actualRequests.get(0)); + GetSnapshotRequest actualRequest = ((GetSnapshotRequest) actualRequests.get(0)); Assert.assertEquals(name, actualRequest.getName()); Assert.assertTrue( @@ -765,13 +871,13 @@ public void getBackupTest2() throws Exception { } @Test - public void getBackupExceptionTest2() throws Exception { + public void getSnapshotExceptionTest2() throws Exception { StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); mockCloudFilestoreManager.addException(exception); try { String name = "name3373707"; - client.getBackup(name); + client.getSnapshot(name); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception. @@ -779,42 +885,38 @@ public void getBackupExceptionTest2() throws Exception { } @Test - public void createBackupTest() throws Exception { - Backup expectedResponse = - Backup.newBuilder() - .setName(BackupName.of("[PROJECT]", "[LOCATION]", "[BACKUP]").toString()) + public void createSnapshotTest() throws Exception { + Snapshot expectedResponse = + Snapshot.newBuilder() + .setName( + SnapshotName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]", "[SNAPSHOT]").toString()) .setDescription("description-1724546052") .setCreateTime(Timestamp.newBuilder().build()) .putAllLabels(new HashMap()) - .setCapacityGb(-1923585408) - .setStorageBytes(2035244455) - .setSourceInstance(InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString()) - .setSourceFileShare("sourceFileShare-646832664") - .setDownloadBytes(971924980) - .setSatisfiesPzs(BoolValue.newBuilder().build()) + .setFilesystemUsedBytes(387235709) .build(); Operation resultOperation = Operation.newBuilder() - .setName("createBackupTest") + .setName("createSnapshotTest") .setDone(true) .setResponse(Any.pack(expectedResponse)) .build(); mockCloudFilestoreManager.addResponse(resultOperation); - LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); - Backup backup = Backup.newBuilder().build(); - String backupId = "backupId2121930365"; + InstanceName parent = InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]"); + Snapshot snapshot = Snapshot.newBuilder().build(); + String snapshotId = "snapshotId-1113817601"; - Backup actualResponse = client.createBackupAsync(parent, backup, backupId).get(); + Snapshot actualResponse = client.createSnapshotAsync(parent, snapshot, snapshotId).get(); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockCloudFilestoreManager.getRequests(); Assert.assertEquals(1, actualRequests.size()); - CreateBackupRequest actualRequest = ((CreateBackupRequest) actualRequests.get(0)); + CreateSnapshotRequest actualRequest = ((CreateSnapshotRequest) actualRequests.get(0)); Assert.assertEquals(parent.toString(), actualRequest.getParent()); - Assert.assertEquals(backup, actualRequest.getBackup()); - Assert.assertEquals(backupId, actualRequest.getBackupId()); + Assert.assertEquals(snapshot, actualRequest.getSnapshot()); + Assert.assertEquals(snapshotId, actualRequest.getSnapshotId()); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -822,15 +924,15 @@ public void createBackupTest() throws Exception { } @Test - public void createBackupExceptionTest() throws Exception { + public void createSnapshotExceptionTest() throws Exception { StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); mockCloudFilestoreManager.addException(exception); try { - LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); - Backup backup = Backup.newBuilder().build(); - String backupId = "backupId2121930365"; - client.createBackupAsync(parent, backup, backupId).get(); + InstanceName parent = InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]"); + Snapshot snapshot = Snapshot.newBuilder().build(); + String snapshotId = "snapshotId-1113817601"; + client.createSnapshotAsync(parent, snapshot, snapshotId).get(); Assert.fail("No exception raised"); } catch (ExecutionException e) { Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); @@ -840,42 +942,38 @@ public void createBackupExceptionTest() throws Exception { } @Test - public void createBackupTest2() throws Exception { - Backup expectedResponse = - Backup.newBuilder() - .setName(BackupName.of("[PROJECT]", "[LOCATION]", "[BACKUP]").toString()) + public void createSnapshotTest2() throws Exception { + Snapshot expectedResponse = + Snapshot.newBuilder() + .setName( + SnapshotName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]", "[SNAPSHOT]").toString()) .setDescription("description-1724546052") .setCreateTime(Timestamp.newBuilder().build()) .putAllLabels(new HashMap()) - .setCapacityGb(-1923585408) - .setStorageBytes(2035244455) - .setSourceInstance(InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString()) - .setSourceFileShare("sourceFileShare-646832664") - .setDownloadBytes(971924980) - .setSatisfiesPzs(BoolValue.newBuilder().build()) + .setFilesystemUsedBytes(387235709) .build(); Operation resultOperation = Operation.newBuilder() - .setName("createBackupTest") + .setName("createSnapshotTest") .setDone(true) .setResponse(Any.pack(expectedResponse)) .build(); mockCloudFilestoreManager.addResponse(resultOperation); String parent = "parent-995424086"; - Backup backup = Backup.newBuilder().build(); - String backupId = "backupId2121930365"; + Snapshot snapshot = Snapshot.newBuilder().build(); + String snapshotId = "snapshotId-1113817601"; - Backup actualResponse = client.createBackupAsync(parent, backup, backupId).get(); + Snapshot actualResponse = client.createSnapshotAsync(parent, snapshot, snapshotId).get(); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockCloudFilestoreManager.getRequests(); Assert.assertEquals(1, actualRequests.size()); - CreateBackupRequest actualRequest = ((CreateBackupRequest) actualRequests.get(0)); + CreateSnapshotRequest actualRequest = ((CreateSnapshotRequest) actualRequests.get(0)); Assert.assertEquals(parent, actualRequest.getParent()); - Assert.assertEquals(backup, actualRequest.getBackup()); - Assert.assertEquals(backupId, actualRequest.getBackupId()); + Assert.assertEquals(snapshot, actualRequest.getSnapshot()); + Assert.assertEquals(snapshotId, actualRequest.getSnapshotId()); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -883,15 +981,15 @@ public void createBackupTest2() throws Exception { } @Test - public void createBackupExceptionTest2() throws Exception { + public void createSnapshotExceptionTest2() throws Exception { StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); mockCloudFilestoreManager.addException(exception); try { String parent = "parent-995424086"; - Backup backup = Backup.newBuilder().build(); - String backupId = "backupId2121930365"; - client.createBackupAsync(parent, backup, backupId).get(); + Snapshot snapshot = Snapshot.newBuilder().build(); + String snapshotId = "snapshotId-1113817601"; + client.createSnapshotAsync(parent, snapshot, snapshotId).get(); Assert.fail("No exception raised"); } catch (ExecutionException e) { Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); @@ -901,23 +999,23 @@ public void createBackupExceptionTest2() throws Exception { } @Test - public void deleteBackupTest() throws Exception { + public void deleteSnapshotTest() throws Exception { Empty expectedResponse = Empty.newBuilder().build(); Operation resultOperation = Operation.newBuilder() - .setName("deleteBackupTest") + .setName("deleteSnapshotTest") .setDone(true) .setResponse(Any.pack(expectedResponse)) .build(); mockCloudFilestoreManager.addResponse(resultOperation); - BackupName name = BackupName.of("[PROJECT]", "[LOCATION]", "[BACKUP]"); + SnapshotName name = SnapshotName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]", "[SNAPSHOT]"); - client.deleteBackupAsync(name).get(); + client.deleteSnapshotAsync(name).get(); List actualRequests = mockCloudFilestoreManager.getRequests(); Assert.assertEquals(1, actualRequests.size()); - DeleteBackupRequest actualRequest = ((DeleteBackupRequest) actualRequests.get(0)); + DeleteSnapshotRequest actualRequest = ((DeleteSnapshotRequest) actualRequests.get(0)); Assert.assertEquals(name.toString(), actualRequest.getName()); Assert.assertTrue( @@ -927,13 +1025,13 @@ public void deleteBackupTest() throws Exception { } @Test - public void deleteBackupExceptionTest() throws Exception { + public void deleteSnapshotExceptionTest() throws Exception { StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); mockCloudFilestoreManager.addException(exception); try { - BackupName name = BackupName.of("[PROJECT]", "[LOCATION]", "[BACKUP]"); - client.deleteBackupAsync(name).get(); + SnapshotName name = SnapshotName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]", "[SNAPSHOT]"); + client.deleteSnapshotAsync(name).get(); Assert.fail("No exception raised"); } catch (ExecutionException e) { Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); @@ -943,11 +1041,11 @@ public void deleteBackupExceptionTest() throws Exception { } @Test - public void deleteBackupTest2() throws Exception { + public void deleteSnapshotTest2() throws Exception { Empty expectedResponse = Empty.newBuilder().build(); Operation resultOperation = Operation.newBuilder() - .setName("deleteBackupTest") + .setName("deleteSnapshotTest") .setDone(true) .setResponse(Any.pack(expectedResponse)) .build(); @@ -955,11 +1053,11 @@ public void deleteBackupTest2() throws Exception { String name = "name3373707"; - client.deleteBackupAsync(name).get(); + client.deleteSnapshotAsync(name).get(); List actualRequests = mockCloudFilestoreManager.getRequests(); Assert.assertEquals(1, actualRequests.size()); - DeleteBackupRequest actualRequest = ((DeleteBackupRequest) actualRequests.get(0)); + DeleteSnapshotRequest actualRequest = ((DeleteSnapshotRequest) actualRequests.get(0)); Assert.assertEquals(name, actualRequest.getName()); Assert.assertTrue( @@ -969,13 +1067,13 @@ public void deleteBackupTest2() throws Exception { } @Test - public void deleteBackupExceptionTest2() throws Exception { + public void deleteSnapshotExceptionTest2() throws Exception { StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); mockCloudFilestoreManager.addException(exception); try { String name = "name3373707"; - client.deleteBackupAsync(name).get(); + client.deleteSnapshotAsync(name).get(); Assert.fail("No exception raised"); } catch (ExecutionException e) { Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); @@ -985,39 +1083,35 @@ public void deleteBackupExceptionTest2() throws Exception { } @Test - public void updateBackupTest() throws Exception { - Backup expectedResponse = - Backup.newBuilder() - .setName(BackupName.of("[PROJECT]", "[LOCATION]", "[BACKUP]").toString()) + public void updateSnapshotTest() throws Exception { + Snapshot expectedResponse = + Snapshot.newBuilder() + .setName( + SnapshotName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]", "[SNAPSHOT]").toString()) .setDescription("description-1724546052") .setCreateTime(Timestamp.newBuilder().build()) .putAllLabels(new HashMap()) - .setCapacityGb(-1923585408) - .setStorageBytes(2035244455) - .setSourceInstance(InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString()) - .setSourceFileShare("sourceFileShare-646832664") - .setDownloadBytes(971924980) - .setSatisfiesPzs(BoolValue.newBuilder().build()) + .setFilesystemUsedBytes(387235709) .build(); Operation resultOperation = Operation.newBuilder() - .setName("updateBackupTest") + .setName("updateSnapshotTest") .setDone(true) .setResponse(Any.pack(expectedResponse)) .build(); mockCloudFilestoreManager.addResponse(resultOperation); - Backup backup = Backup.newBuilder().build(); + Snapshot snapshot = Snapshot.newBuilder().build(); FieldMask updateMask = FieldMask.newBuilder().build(); - Backup actualResponse = client.updateBackupAsync(backup, updateMask).get(); + Snapshot actualResponse = client.updateSnapshotAsync(snapshot, updateMask).get(); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockCloudFilestoreManager.getRequests(); Assert.assertEquals(1, actualRequests.size()); - UpdateBackupRequest actualRequest = ((UpdateBackupRequest) actualRequests.get(0)); + UpdateSnapshotRequest actualRequest = ((UpdateSnapshotRequest) actualRequests.get(0)); - Assert.assertEquals(backup, actualRequest.getBackup()); + Assert.assertEquals(snapshot, actualRequest.getSnapshot()); Assert.assertEquals(updateMask, actualRequest.getUpdateMask()); Assert.assertTrue( channelProvider.isHeaderSent( @@ -1026,14 +1120,896 @@ public void updateBackupTest() throws Exception { } @Test - public void updateBackupExceptionTest() throws Exception { + public void updateSnapshotExceptionTest() throws Exception { StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); mockCloudFilestoreManager.addException(exception); try { - Backup backup = Backup.newBuilder().build(); + Snapshot snapshot = Snapshot.newBuilder().build(); FieldMask updateMask = FieldMask.newBuilder().build(); - client.updateBackupAsync(backup, updateMask).get(); + client.updateSnapshotAsync(snapshot, updateMask).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void listBackupsTest() throws Exception { + Backup responsesElement = Backup.newBuilder().build(); + ListBackupsResponse expectedResponse = + ListBackupsResponse.newBuilder() + .setNextPageToken("") + .addAllBackups(Arrays.asList(responsesElement)) + .build(); + mockCloudFilestoreManager.addResponse(expectedResponse); + + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + + ListBackupsPagedResponse pagedListResponse = client.listBackups(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getBackupsList().get(0), resources.get(0)); + + List actualRequests = mockCloudFilestoreManager.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListBackupsRequest actualRequest = ((ListBackupsRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listBackupsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockCloudFilestoreManager.addException(exception); + + try { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + client.listBackups(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listBackupsTest2() throws Exception { + Backup responsesElement = Backup.newBuilder().build(); + ListBackupsResponse expectedResponse = + ListBackupsResponse.newBuilder() + .setNextPageToken("") + .addAllBackups(Arrays.asList(responsesElement)) + .build(); + mockCloudFilestoreManager.addResponse(expectedResponse); + + String parent = "parent-995424086"; + + ListBackupsPagedResponse pagedListResponse = client.listBackups(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getBackupsList().get(0), resources.get(0)); + + List actualRequests = mockCloudFilestoreManager.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListBackupsRequest actualRequest = ((ListBackupsRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listBackupsExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockCloudFilestoreManager.addException(exception); + + try { + String parent = "parent-995424086"; + client.listBackups(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getBackupTest() throws Exception { + Backup expectedResponse = + Backup.newBuilder() + .setName(BackupName.of("[PROJECT]", "[LOCATION]", "[BACKUP]").toString()) + .setDescription("description-1724546052") + .setCreateTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setCapacityGb(-1923585408) + .setStorageBytes(2035244455) + .setSourceInstance(InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString()) + .setSourceFileShare("sourceFileShare-646832664") + .setDownloadBytes(971924980) + .setSatisfiesPzs(BoolValue.newBuilder().build()) + .setKmsKeyName("kmsKeyName412586233") + .build(); + mockCloudFilestoreManager.addResponse(expectedResponse); + + BackupName name = BackupName.of("[PROJECT]", "[LOCATION]", "[BACKUP]"); + + Backup actualResponse = client.getBackup(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockCloudFilestoreManager.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetBackupRequest actualRequest = ((GetBackupRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getBackupExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockCloudFilestoreManager.addException(exception); + + try { + BackupName name = BackupName.of("[PROJECT]", "[LOCATION]", "[BACKUP]"); + client.getBackup(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getBackupTest2() throws Exception { + Backup expectedResponse = + Backup.newBuilder() + .setName(BackupName.of("[PROJECT]", "[LOCATION]", "[BACKUP]").toString()) + .setDescription("description-1724546052") + .setCreateTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setCapacityGb(-1923585408) + .setStorageBytes(2035244455) + .setSourceInstance(InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString()) + .setSourceFileShare("sourceFileShare-646832664") + .setDownloadBytes(971924980) + .setSatisfiesPzs(BoolValue.newBuilder().build()) + .setKmsKeyName("kmsKeyName412586233") + .build(); + mockCloudFilestoreManager.addResponse(expectedResponse); + + String name = "name3373707"; + + Backup actualResponse = client.getBackup(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockCloudFilestoreManager.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetBackupRequest actualRequest = ((GetBackupRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getBackupExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockCloudFilestoreManager.addException(exception); + + try { + String name = "name3373707"; + client.getBackup(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createBackupTest() throws Exception { + Backup expectedResponse = + Backup.newBuilder() + .setName(BackupName.of("[PROJECT]", "[LOCATION]", "[BACKUP]").toString()) + .setDescription("description-1724546052") + .setCreateTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setCapacityGb(-1923585408) + .setStorageBytes(2035244455) + .setSourceInstance(InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString()) + .setSourceFileShare("sourceFileShare-646832664") + .setDownloadBytes(971924980) + .setSatisfiesPzs(BoolValue.newBuilder().build()) + .setKmsKeyName("kmsKeyName412586233") + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("createBackupTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockCloudFilestoreManager.addResponse(resultOperation); + + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + Backup backup = Backup.newBuilder().build(); + String backupId = "backupId2121930365"; + + Backup actualResponse = client.createBackupAsync(parent, backup, backupId).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockCloudFilestoreManager.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateBackupRequest actualRequest = ((CreateBackupRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertEquals(backup, actualRequest.getBackup()); + Assert.assertEquals(backupId, actualRequest.getBackupId()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createBackupExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockCloudFilestoreManager.addException(exception); + + try { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + Backup backup = Backup.newBuilder().build(); + String backupId = "backupId2121930365"; + client.createBackupAsync(parent, backup, backupId).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void createBackupTest2() throws Exception { + Backup expectedResponse = + Backup.newBuilder() + .setName(BackupName.of("[PROJECT]", "[LOCATION]", "[BACKUP]").toString()) + .setDescription("description-1724546052") + .setCreateTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setCapacityGb(-1923585408) + .setStorageBytes(2035244455) + .setSourceInstance(InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString()) + .setSourceFileShare("sourceFileShare-646832664") + .setDownloadBytes(971924980) + .setSatisfiesPzs(BoolValue.newBuilder().build()) + .setKmsKeyName("kmsKeyName412586233") + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("createBackupTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockCloudFilestoreManager.addResponse(resultOperation); + + String parent = "parent-995424086"; + Backup backup = Backup.newBuilder().build(); + String backupId = "backupId2121930365"; + + Backup actualResponse = client.createBackupAsync(parent, backup, backupId).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockCloudFilestoreManager.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateBackupRequest actualRequest = ((CreateBackupRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertEquals(backup, actualRequest.getBackup()); + Assert.assertEquals(backupId, actualRequest.getBackupId()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createBackupExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockCloudFilestoreManager.addException(exception); + + try { + String parent = "parent-995424086"; + Backup backup = Backup.newBuilder().build(); + String backupId = "backupId2121930365"; + client.createBackupAsync(parent, backup, backupId).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void deleteBackupTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + Operation resultOperation = + Operation.newBuilder() + .setName("deleteBackupTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockCloudFilestoreManager.addResponse(resultOperation); + + BackupName name = BackupName.of("[PROJECT]", "[LOCATION]", "[BACKUP]"); + + client.deleteBackupAsync(name).get(); + + List actualRequests = mockCloudFilestoreManager.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteBackupRequest actualRequest = ((DeleteBackupRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteBackupExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockCloudFilestoreManager.addException(exception); + + try { + BackupName name = BackupName.of("[PROJECT]", "[LOCATION]", "[BACKUP]"); + client.deleteBackupAsync(name).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void deleteBackupTest2() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + Operation resultOperation = + Operation.newBuilder() + .setName("deleteBackupTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockCloudFilestoreManager.addResponse(resultOperation); + + String name = "name3373707"; + + client.deleteBackupAsync(name).get(); + + List actualRequests = mockCloudFilestoreManager.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteBackupRequest actualRequest = ((DeleteBackupRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteBackupExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockCloudFilestoreManager.addException(exception); + + try { + String name = "name3373707"; + client.deleteBackupAsync(name).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void updateBackupTest() throws Exception { + Backup expectedResponse = + Backup.newBuilder() + .setName(BackupName.of("[PROJECT]", "[LOCATION]", "[BACKUP]").toString()) + .setDescription("description-1724546052") + .setCreateTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setCapacityGb(-1923585408) + .setStorageBytes(2035244455) + .setSourceInstance(InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString()) + .setSourceFileShare("sourceFileShare-646832664") + .setDownloadBytes(971924980) + .setSatisfiesPzs(BoolValue.newBuilder().build()) + .setKmsKeyName("kmsKeyName412586233") + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("updateBackupTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockCloudFilestoreManager.addResponse(resultOperation); + + Backup backup = Backup.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + + Backup actualResponse = client.updateBackupAsync(backup, updateMask).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockCloudFilestoreManager.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + UpdateBackupRequest actualRequest = ((UpdateBackupRequest) actualRequests.get(0)); + + Assert.assertEquals(backup, actualRequest.getBackup()); + Assert.assertEquals(updateMask, actualRequest.getUpdateMask()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void updateBackupExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockCloudFilestoreManager.addException(exception); + + try { + Backup backup = Backup.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + client.updateBackupAsync(backup, updateMask).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void listSharesTest() throws Exception { + Share responsesElement = Share.newBuilder().build(); + ListSharesResponse expectedResponse = + ListSharesResponse.newBuilder() + .setNextPageToken("") + .addAllShares(Arrays.asList(responsesElement)) + .build(); + mockCloudFilestoreManager.addResponse(expectedResponse); + + InstanceName parent = InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]"); + + ListSharesPagedResponse pagedListResponse = client.listShares(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getSharesList().get(0), resources.get(0)); + + List actualRequests = mockCloudFilestoreManager.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListSharesRequest actualRequest = ((ListSharesRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listSharesExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockCloudFilestoreManager.addException(exception); + + try { + InstanceName parent = InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]"); + client.listShares(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listSharesTest2() throws Exception { + Share responsesElement = Share.newBuilder().build(); + ListSharesResponse expectedResponse = + ListSharesResponse.newBuilder() + .setNextPageToken("") + .addAllShares(Arrays.asList(responsesElement)) + .build(); + mockCloudFilestoreManager.addResponse(expectedResponse); + + String parent = "parent-995424086"; + + ListSharesPagedResponse pagedListResponse = client.listShares(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getSharesList().get(0), resources.get(0)); + + List actualRequests = mockCloudFilestoreManager.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListSharesRequest actualRequest = ((ListSharesRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listSharesExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockCloudFilestoreManager.addException(exception); + + try { + String parent = "parent-995424086"; + client.listShares(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getShareTest() throws Exception { + Share expectedResponse = + Share.newBuilder() + .setName(ShareName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]", "[SHARE]").toString()) + .setMountName("mountName456881732") + .setDescription("description-1724546052") + .setCapacityGb(-1923585408) + .addAllNfsExportOptions(new ArrayList()) + .setCreateTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .build(); + mockCloudFilestoreManager.addResponse(expectedResponse); + + ShareName name = ShareName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]", "[SHARE]"); + + Share actualResponse = client.getShare(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockCloudFilestoreManager.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetShareRequest actualRequest = ((GetShareRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getShareExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockCloudFilestoreManager.addException(exception); + + try { + ShareName name = ShareName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]", "[SHARE]"); + client.getShare(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getShareTest2() throws Exception { + Share expectedResponse = + Share.newBuilder() + .setName(ShareName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]", "[SHARE]").toString()) + .setMountName("mountName456881732") + .setDescription("description-1724546052") + .setCapacityGb(-1923585408) + .addAllNfsExportOptions(new ArrayList()) + .setCreateTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .build(); + mockCloudFilestoreManager.addResponse(expectedResponse); + + String name = "name3373707"; + + Share actualResponse = client.getShare(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockCloudFilestoreManager.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetShareRequest actualRequest = ((GetShareRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getShareExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockCloudFilestoreManager.addException(exception); + + try { + String name = "name3373707"; + client.getShare(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createShareTest() throws Exception { + Share expectedResponse = + Share.newBuilder() + .setName(ShareName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]", "[SHARE]").toString()) + .setMountName("mountName456881732") + .setDescription("description-1724546052") + .setCapacityGb(-1923585408) + .addAllNfsExportOptions(new ArrayList()) + .setCreateTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("createShareTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockCloudFilestoreManager.addResponse(resultOperation); + + InstanceName parent = InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]"); + Share share = Share.newBuilder().build(); + String shareId = "shareId2054217050"; + + Share actualResponse = client.createShareAsync(parent, share, shareId).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockCloudFilestoreManager.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateShareRequest actualRequest = ((CreateShareRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertEquals(share, actualRequest.getShare()); + Assert.assertEquals(shareId, actualRequest.getShareId()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createShareExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockCloudFilestoreManager.addException(exception); + + try { + InstanceName parent = InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]"); + Share share = Share.newBuilder().build(); + String shareId = "shareId2054217050"; + client.createShareAsync(parent, share, shareId).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void createShareTest2() throws Exception { + Share expectedResponse = + Share.newBuilder() + .setName(ShareName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]", "[SHARE]").toString()) + .setMountName("mountName456881732") + .setDescription("description-1724546052") + .setCapacityGb(-1923585408) + .addAllNfsExportOptions(new ArrayList()) + .setCreateTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("createShareTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockCloudFilestoreManager.addResponse(resultOperation); + + String parent = "parent-995424086"; + Share share = Share.newBuilder().build(); + String shareId = "shareId2054217050"; + + Share actualResponse = client.createShareAsync(parent, share, shareId).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockCloudFilestoreManager.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateShareRequest actualRequest = ((CreateShareRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertEquals(share, actualRequest.getShare()); + Assert.assertEquals(shareId, actualRequest.getShareId()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createShareExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockCloudFilestoreManager.addException(exception); + + try { + String parent = "parent-995424086"; + Share share = Share.newBuilder().build(); + String shareId = "shareId2054217050"; + client.createShareAsync(parent, share, shareId).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void deleteShareTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + Operation resultOperation = + Operation.newBuilder() + .setName("deleteShareTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockCloudFilestoreManager.addResponse(resultOperation); + + ShareName name = ShareName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]", "[SHARE]"); + + client.deleteShareAsync(name).get(); + + List actualRequests = mockCloudFilestoreManager.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteShareRequest actualRequest = ((DeleteShareRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteShareExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockCloudFilestoreManager.addException(exception); + + try { + ShareName name = ShareName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]", "[SHARE]"); + client.deleteShareAsync(name).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void deleteShareTest2() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + Operation resultOperation = + Operation.newBuilder() + .setName("deleteShareTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockCloudFilestoreManager.addResponse(resultOperation); + + String name = "name3373707"; + + client.deleteShareAsync(name).get(); + + List actualRequests = mockCloudFilestoreManager.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteShareRequest actualRequest = ((DeleteShareRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteShareExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockCloudFilestoreManager.addException(exception); + + try { + String name = "name3373707"; + client.deleteShareAsync(name).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void updateShareTest() throws Exception { + Share expectedResponse = + Share.newBuilder() + .setName(ShareName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]", "[SHARE]").toString()) + .setMountName("mountName456881732") + .setDescription("description-1724546052") + .setCapacityGb(-1923585408) + .addAllNfsExportOptions(new ArrayList()) + .setCreateTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("updateShareTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockCloudFilestoreManager.addResponse(resultOperation); + + Share share = Share.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + + Share actualResponse = client.updateShareAsync(share, updateMask).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockCloudFilestoreManager.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + UpdateShareRequest actualRequest = ((UpdateShareRequest) actualRequests.get(0)); + + Assert.assertEquals(share, actualRequest.getShare()); + Assert.assertEquals(updateMask, actualRequest.getUpdateMask()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void updateShareExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockCloudFilestoreManager.addException(exception); + + try { + Share share = Share.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + client.updateShareAsync(share, updateMask).get(); Assert.fail("No exception raised"); } catch (ExecutionException e) { Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); diff --git a/java-filestore/google-cloud-filestore/src/test/java/com/google/cloud/filestore/v1beta1/MockCloudFilestoreManagerImpl.java b/java-filestore/google-cloud-filestore/src/test/java/com/google/cloud/filestore/v1beta1/MockCloudFilestoreManagerImpl.java index e8d3f63369b6..b26a22762267 100644 --- a/java-filestore/google-cloud-filestore/src/test/java/com/google/cloud/filestore/v1beta1/MockCloudFilestoreManagerImpl.java +++ b/java-filestore/google-cloud-filestore/src/test/java/com/google/cloud/filestore/v1beta1/MockCloudFilestoreManagerImpl.java @@ -163,6 +163,27 @@ public void restoreInstance( } } + @Override + public void revertInstance( + RevertInstanceRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext(((Operation) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method RevertInstance, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + @Override public void deleteInstance( DeleteInstanceRequest request, StreamObserver responseObserver) { @@ -184,6 +205,110 @@ public void deleteInstance( } } + @Override + public void listSnapshots( + ListSnapshotsRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof ListSnapshotsResponse) { + requests.add(request); + responseObserver.onNext(((ListSnapshotsResponse) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method ListSnapshots, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + ListSnapshotsResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void getSnapshot(GetSnapshotRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Snapshot) { + requests.add(request); + responseObserver.onNext(((Snapshot) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method GetSnapshot, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Snapshot.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void createSnapshot( + CreateSnapshotRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext(((Operation) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method CreateSnapshot, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void deleteSnapshot( + DeleteSnapshotRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext(((Operation) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method DeleteSnapshot, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void updateSnapshot( + UpdateSnapshotRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext(((Operation) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method UpdateSnapshot, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + @Override public void listBackups( ListBackupsRequest request, StreamObserver responseObserver) { @@ -287,4 +412,105 @@ public void updateBackup( Exception.class.getName()))); } } + + @Override + public void listShares( + ListSharesRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof ListSharesResponse) { + requests.add(request); + responseObserver.onNext(((ListSharesResponse) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method ListShares, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + ListSharesResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void getShare(GetShareRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Share) { + requests.add(request); + responseObserver.onNext(((Share) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method GetShare, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Share.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void createShare(CreateShareRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext(((Operation) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method CreateShare, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void deleteShare(DeleteShareRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext(((Operation) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method DeleteShare, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void updateShare(UpdateShareRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext(((Operation) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method UpdateShare, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } } diff --git a/java-filestore/grpc-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/CloudFilestoreManagerGrpc.java b/java-filestore/grpc-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/CloudFilestoreManagerGrpc.java index f5b25919fae1..45f7ce382d65 100644 --- a/java-filestore/grpc-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/CloudFilestoreManagerGrpc.java +++ b/java-filestore/grpc-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/CloudFilestoreManagerGrpc.java @@ -21,15 +21,15 @@ * * *
- * Configures and manages Cloud Filestore resources.
- * Cloud Filestore Manager v1beta1.
- * The `file.googleapis.com` service implements the Cloud Filestore API and
+ * Configures and manages Filestore resources.
+ * Filestore Manager v1beta1.
+ * The `file.googleapis.com` service implements the Filestore API and
  * defines the following model for managing resources:
  * * The service works with a collection of cloud projects, named: `/projects/*`
  * * Each project has a collection of available locations, named: `/locations/*`
  * * Each location has a collection of instances and backups, named:
  * `/instances/*` and `/backups/*` respectively.
- * * As such, Cloud Filestore instances are resources of the form:
+ * * As such, Filestore instances are resources of the form:
  *   `/projects/{project_id}/locations/{location_id}/instances/{instance_id}`
  *   backups are resources of the form:
  *   `/projects/{project_id}/locations/{location_id}/backup/{backup_id}`
@@ -285,6 +285,52 @@ private CloudFilestoreManagerGrpc() {}
     return getRestoreInstanceMethod;
   }
 
+  private static volatile io.grpc.MethodDescriptor<
+          com.google.cloud.filestore.v1beta1.RevertInstanceRequest,
+          com.google.longrunning.Operation>
+      getRevertInstanceMethod;
+
+  @io.grpc.stub.annotations.RpcMethod(
+      fullMethodName = SERVICE_NAME + '/' + "RevertInstance",
+      requestType = com.google.cloud.filestore.v1beta1.RevertInstanceRequest.class,
+      responseType = com.google.longrunning.Operation.class,
+      methodType = io.grpc.MethodDescriptor.MethodType.UNARY)
+  public static io.grpc.MethodDescriptor<
+          com.google.cloud.filestore.v1beta1.RevertInstanceRequest,
+          com.google.longrunning.Operation>
+      getRevertInstanceMethod() {
+    io.grpc.MethodDescriptor<
+            com.google.cloud.filestore.v1beta1.RevertInstanceRequest,
+            com.google.longrunning.Operation>
+        getRevertInstanceMethod;
+    if ((getRevertInstanceMethod = CloudFilestoreManagerGrpc.getRevertInstanceMethod) == null) {
+      synchronized (CloudFilestoreManagerGrpc.class) {
+        if ((getRevertInstanceMethod = CloudFilestoreManagerGrpc.getRevertInstanceMethod) == null) {
+          CloudFilestoreManagerGrpc.getRevertInstanceMethod =
+              getRevertInstanceMethod =
+                  io.grpc.MethodDescriptor
+                      .
+                          newBuilder()
+                      .setType(io.grpc.MethodDescriptor.MethodType.UNARY)
+                      .setFullMethodName(generateFullMethodName(SERVICE_NAME, "RevertInstance"))
+                      .setSampledToLocalTracing(true)
+                      .setRequestMarshaller(
+                          io.grpc.protobuf.ProtoUtils.marshaller(
+                              com.google.cloud.filestore.v1beta1.RevertInstanceRequest
+                                  .getDefaultInstance()))
+                      .setResponseMarshaller(
+                          io.grpc.protobuf.ProtoUtils.marshaller(
+                              com.google.longrunning.Operation.getDefaultInstance()))
+                      .setSchemaDescriptor(
+                          new CloudFilestoreManagerMethodDescriptorSupplier("RevertInstance"))
+                      .build();
+        }
+      }
+    }
+    return getRevertInstanceMethod;
+  }
+
   private static volatile io.grpc.MethodDescriptor<
           com.google.cloud.filestore.v1beta1.DeleteInstanceRequest,
           com.google.longrunning.Operation>
@@ -331,6 +377,237 @@ private CloudFilestoreManagerGrpc() {}
     return getDeleteInstanceMethod;
   }
 
+  private static volatile io.grpc.MethodDescriptor<
+          com.google.cloud.filestore.v1beta1.ListSnapshotsRequest,
+          com.google.cloud.filestore.v1beta1.ListSnapshotsResponse>
+      getListSnapshotsMethod;
+
+  @io.grpc.stub.annotations.RpcMethod(
+      fullMethodName = SERVICE_NAME + '/' + "ListSnapshots",
+      requestType = com.google.cloud.filestore.v1beta1.ListSnapshotsRequest.class,
+      responseType = com.google.cloud.filestore.v1beta1.ListSnapshotsResponse.class,
+      methodType = io.grpc.MethodDescriptor.MethodType.UNARY)
+  public static io.grpc.MethodDescriptor<
+          com.google.cloud.filestore.v1beta1.ListSnapshotsRequest,
+          com.google.cloud.filestore.v1beta1.ListSnapshotsResponse>
+      getListSnapshotsMethod() {
+    io.grpc.MethodDescriptor<
+            com.google.cloud.filestore.v1beta1.ListSnapshotsRequest,
+            com.google.cloud.filestore.v1beta1.ListSnapshotsResponse>
+        getListSnapshotsMethod;
+    if ((getListSnapshotsMethod = CloudFilestoreManagerGrpc.getListSnapshotsMethod) == null) {
+      synchronized (CloudFilestoreManagerGrpc.class) {
+        if ((getListSnapshotsMethod = CloudFilestoreManagerGrpc.getListSnapshotsMethod) == null) {
+          CloudFilestoreManagerGrpc.getListSnapshotsMethod =
+              getListSnapshotsMethod =
+                  io.grpc.MethodDescriptor
+                      .
+                          newBuilder()
+                      .setType(io.grpc.MethodDescriptor.MethodType.UNARY)
+                      .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ListSnapshots"))
+                      .setSampledToLocalTracing(true)
+                      .setRequestMarshaller(
+                          io.grpc.protobuf.ProtoUtils.marshaller(
+                              com.google.cloud.filestore.v1beta1.ListSnapshotsRequest
+                                  .getDefaultInstance()))
+                      .setResponseMarshaller(
+                          io.grpc.protobuf.ProtoUtils.marshaller(
+                              com.google.cloud.filestore.v1beta1.ListSnapshotsResponse
+                                  .getDefaultInstance()))
+                      .setSchemaDescriptor(
+                          new CloudFilestoreManagerMethodDescriptorSupplier("ListSnapshots"))
+                      .build();
+        }
+      }
+    }
+    return getListSnapshotsMethod;
+  }
+
+  private static volatile io.grpc.MethodDescriptor<
+          com.google.cloud.filestore.v1beta1.GetSnapshotRequest,
+          com.google.cloud.filestore.v1beta1.Snapshot>
+      getGetSnapshotMethod;
+
+  @io.grpc.stub.annotations.RpcMethod(
+      fullMethodName = SERVICE_NAME + '/' + "GetSnapshot",
+      requestType = com.google.cloud.filestore.v1beta1.GetSnapshotRequest.class,
+      responseType = com.google.cloud.filestore.v1beta1.Snapshot.class,
+      methodType = io.grpc.MethodDescriptor.MethodType.UNARY)
+  public static io.grpc.MethodDescriptor<
+          com.google.cloud.filestore.v1beta1.GetSnapshotRequest,
+          com.google.cloud.filestore.v1beta1.Snapshot>
+      getGetSnapshotMethod() {
+    io.grpc.MethodDescriptor<
+            com.google.cloud.filestore.v1beta1.GetSnapshotRequest,
+            com.google.cloud.filestore.v1beta1.Snapshot>
+        getGetSnapshotMethod;
+    if ((getGetSnapshotMethod = CloudFilestoreManagerGrpc.getGetSnapshotMethod) == null) {
+      synchronized (CloudFilestoreManagerGrpc.class) {
+        if ((getGetSnapshotMethod = CloudFilestoreManagerGrpc.getGetSnapshotMethod) == null) {
+          CloudFilestoreManagerGrpc.getGetSnapshotMethod =
+              getGetSnapshotMethod =
+                  io.grpc.MethodDescriptor
+                      .
+                          newBuilder()
+                      .setType(io.grpc.MethodDescriptor.MethodType.UNARY)
+                      .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetSnapshot"))
+                      .setSampledToLocalTracing(true)
+                      .setRequestMarshaller(
+                          io.grpc.protobuf.ProtoUtils.marshaller(
+                              com.google.cloud.filestore.v1beta1.GetSnapshotRequest
+                                  .getDefaultInstance()))
+                      .setResponseMarshaller(
+                          io.grpc.protobuf.ProtoUtils.marshaller(
+                              com.google.cloud.filestore.v1beta1.Snapshot.getDefaultInstance()))
+                      .setSchemaDescriptor(
+                          new CloudFilestoreManagerMethodDescriptorSupplier("GetSnapshot"))
+                      .build();
+        }
+      }
+    }
+    return getGetSnapshotMethod;
+  }
+
+  private static volatile io.grpc.MethodDescriptor<
+          com.google.cloud.filestore.v1beta1.CreateSnapshotRequest,
+          com.google.longrunning.Operation>
+      getCreateSnapshotMethod;
+
+  @io.grpc.stub.annotations.RpcMethod(
+      fullMethodName = SERVICE_NAME + '/' + "CreateSnapshot",
+      requestType = com.google.cloud.filestore.v1beta1.CreateSnapshotRequest.class,
+      responseType = com.google.longrunning.Operation.class,
+      methodType = io.grpc.MethodDescriptor.MethodType.UNARY)
+  public static io.grpc.MethodDescriptor<
+          com.google.cloud.filestore.v1beta1.CreateSnapshotRequest,
+          com.google.longrunning.Operation>
+      getCreateSnapshotMethod() {
+    io.grpc.MethodDescriptor<
+            com.google.cloud.filestore.v1beta1.CreateSnapshotRequest,
+            com.google.longrunning.Operation>
+        getCreateSnapshotMethod;
+    if ((getCreateSnapshotMethod = CloudFilestoreManagerGrpc.getCreateSnapshotMethod) == null) {
+      synchronized (CloudFilestoreManagerGrpc.class) {
+        if ((getCreateSnapshotMethod = CloudFilestoreManagerGrpc.getCreateSnapshotMethod) == null) {
+          CloudFilestoreManagerGrpc.getCreateSnapshotMethod =
+              getCreateSnapshotMethod =
+                  io.grpc.MethodDescriptor
+                      .
+                          newBuilder()
+                      .setType(io.grpc.MethodDescriptor.MethodType.UNARY)
+                      .setFullMethodName(generateFullMethodName(SERVICE_NAME, "CreateSnapshot"))
+                      .setSampledToLocalTracing(true)
+                      .setRequestMarshaller(
+                          io.grpc.protobuf.ProtoUtils.marshaller(
+                              com.google.cloud.filestore.v1beta1.CreateSnapshotRequest
+                                  .getDefaultInstance()))
+                      .setResponseMarshaller(
+                          io.grpc.protobuf.ProtoUtils.marshaller(
+                              com.google.longrunning.Operation.getDefaultInstance()))
+                      .setSchemaDescriptor(
+                          new CloudFilestoreManagerMethodDescriptorSupplier("CreateSnapshot"))
+                      .build();
+        }
+      }
+    }
+    return getCreateSnapshotMethod;
+  }
+
+  private static volatile io.grpc.MethodDescriptor<
+          com.google.cloud.filestore.v1beta1.DeleteSnapshotRequest,
+          com.google.longrunning.Operation>
+      getDeleteSnapshotMethod;
+
+  @io.grpc.stub.annotations.RpcMethod(
+      fullMethodName = SERVICE_NAME + '/' + "DeleteSnapshot",
+      requestType = com.google.cloud.filestore.v1beta1.DeleteSnapshotRequest.class,
+      responseType = com.google.longrunning.Operation.class,
+      methodType = io.grpc.MethodDescriptor.MethodType.UNARY)
+  public static io.grpc.MethodDescriptor<
+          com.google.cloud.filestore.v1beta1.DeleteSnapshotRequest,
+          com.google.longrunning.Operation>
+      getDeleteSnapshotMethod() {
+    io.grpc.MethodDescriptor<
+            com.google.cloud.filestore.v1beta1.DeleteSnapshotRequest,
+            com.google.longrunning.Operation>
+        getDeleteSnapshotMethod;
+    if ((getDeleteSnapshotMethod = CloudFilestoreManagerGrpc.getDeleteSnapshotMethod) == null) {
+      synchronized (CloudFilestoreManagerGrpc.class) {
+        if ((getDeleteSnapshotMethod = CloudFilestoreManagerGrpc.getDeleteSnapshotMethod) == null) {
+          CloudFilestoreManagerGrpc.getDeleteSnapshotMethod =
+              getDeleteSnapshotMethod =
+                  io.grpc.MethodDescriptor
+                      .
+                          newBuilder()
+                      .setType(io.grpc.MethodDescriptor.MethodType.UNARY)
+                      .setFullMethodName(generateFullMethodName(SERVICE_NAME, "DeleteSnapshot"))
+                      .setSampledToLocalTracing(true)
+                      .setRequestMarshaller(
+                          io.grpc.protobuf.ProtoUtils.marshaller(
+                              com.google.cloud.filestore.v1beta1.DeleteSnapshotRequest
+                                  .getDefaultInstance()))
+                      .setResponseMarshaller(
+                          io.grpc.protobuf.ProtoUtils.marshaller(
+                              com.google.longrunning.Operation.getDefaultInstance()))
+                      .setSchemaDescriptor(
+                          new CloudFilestoreManagerMethodDescriptorSupplier("DeleteSnapshot"))
+                      .build();
+        }
+      }
+    }
+    return getDeleteSnapshotMethod;
+  }
+
+  private static volatile io.grpc.MethodDescriptor<
+          com.google.cloud.filestore.v1beta1.UpdateSnapshotRequest,
+          com.google.longrunning.Operation>
+      getUpdateSnapshotMethod;
+
+  @io.grpc.stub.annotations.RpcMethod(
+      fullMethodName = SERVICE_NAME + '/' + "UpdateSnapshot",
+      requestType = com.google.cloud.filestore.v1beta1.UpdateSnapshotRequest.class,
+      responseType = com.google.longrunning.Operation.class,
+      methodType = io.grpc.MethodDescriptor.MethodType.UNARY)
+  public static io.grpc.MethodDescriptor<
+          com.google.cloud.filestore.v1beta1.UpdateSnapshotRequest,
+          com.google.longrunning.Operation>
+      getUpdateSnapshotMethod() {
+    io.grpc.MethodDescriptor<
+            com.google.cloud.filestore.v1beta1.UpdateSnapshotRequest,
+            com.google.longrunning.Operation>
+        getUpdateSnapshotMethod;
+    if ((getUpdateSnapshotMethod = CloudFilestoreManagerGrpc.getUpdateSnapshotMethod) == null) {
+      synchronized (CloudFilestoreManagerGrpc.class) {
+        if ((getUpdateSnapshotMethod = CloudFilestoreManagerGrpc.getUpdateSnapshotMethod) == null) {
+          CloudFilestoreManagerGrpc.getUpdateSnapshotMethod =
+              getUpdateSnapshotMethod =
+                  io.grpc.MethodDescriptor
+                      .
+                          newBuilder()
+                      .setType(io.grpc.MethodDescriptor.MethodType.UNARY)
+                      .setFullMethodName(generateFullMethodName(SERVICE_NAME, "UpdateSnapshot"))
+                      .setSampledToLocalTracing(true)
+                      .setRequestMarshaller(
+                          io.grpc.protobuf.ProtoUtils.marshaller(
+                              com.google.cloud.filestore.v1beta1.UpdateSnapshotRequest
+                                  .getDefaultInstance()))
+                      .setResponseMarshaller(
+                          io.grpc.protobuf.ProtoUtils.marshaller(
+                              com.google.longrunning.Operation.getDefaultInstance()))
+                      .setSchemaDescriptor(
+                          new CloudFilestoreManagerMethodDescriptorSupplier("UpdateSnapshot"))
+                      .build();
+        }
+      }
+    }
+    return getUpdateSnapshotMethod;
+  }
+
   private static volatile io.grpc.MethodDescriptor<
           com.google.cloud.filestore.v1beta1.ListBackupsRequest,
           com.google.cloud.filestore.v1beta1.ListBackupsResponse>
@@ -556,6 +833,228 @@ private CloudFilestoreManagerGrpc() {}
     return getUpdateBackupMethod;
   }
 
+  private static volatile io.grpc.MethodDescriptor<
+          com.google.cloud.filestore.v1beta1.ListSharesRequest,
+          com.google.cloud.filestore.v1beta1.ListSharesResponse>
+      getListSharesMethod;
+
+  @io.grpc.stub.annotations.RpcMethod(
+      fullMethodName = SERVICE_NAME + '/' + "ListShares",
+      requestType = com.google.cloud.filestore.v1beta1.ListSharesRequest.class,
+      responseType = com.google.cloud.filestore.v1beta1.ListSharesResponse.class,
+      methodType = io.grpc.MethodDescriptor.MethodType.UNARY)
+  public static io.grpc.MethodDescriptor<
+          com.google.cloud.filestore.v1beta1.ListSharesRequest,
+          com.google.cloud.filestore.v1beta1.ListSharesResponse>
+      getListSharesMethod() {
+    io.grpc.MethodDescriptor<
+            com.google.cloud.filestore.v1beta1.ListSharesRequest,
+            com.google.cloud.filestore.v1beta1.ListSharesResponse>
+        getListSharesMethod;
+    if ((getListSharesMethod = CloudFilestoreManagerGrpc.getListSharesMethod) == null) {
+      synchronized (CloudFilestoreManagerGrpc.class) {
+        if ((getListSharesMethod = CloudFilestoreManagerGrpc.getListSharesMethod) == null) {
+          CloudFilestoreManagerGrpc.getListSharesMethod =
+              getListSharesMethod =
+                  io.grpc.MethodDescriptor
+                      .
+                          newBuilder()
+                      .setType(io.grpc.MethodDescriptor.MethodType.UNARY)
+                      .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ListShares"))
+                      .setSampledToLocalTracing(true)
+                      .setRequestMarshaller(
+                          io.grpc.protobuf.ProtoUtils.marshaller(
+                              com.google.cloud.filestore.v1beta1.ListSharesRequest
+                                  .getDefaultInstance()))
+                      .setResponseMarshaller(
+                          io.grpc.protobuf.ProtoUtils.marshaller(
+                              com.google.cloud.filestore.v1beta1.ListSharesResponse
+                                  .getDefaultInstance()))
+                      .setSchemaDescriptor(
+                          new CloudFilestoreManagerMethodDescriptorSupplier("ListShares"))
+                      .build();
+        }
+      }
+    }
+    return getListSharesMethod;
+  }
+
+  private static volatile io.grpc.MethodDescriptor<
+          com.google.cloud.filestore.v1beta1.GetShareRequest,
+          com.google.cloud.filestore.v1beta1.Share>
+      getGetShareMethod;
+
+  @io.grpc.stub.annotations.RpcMethod(
+      fullMethodName = SERVICE_NAME + '/' + "GetShare",
+      requestType = com.google.cloud.filestore.v1beta1.GetShareRequest.class,
+      responseType = com.google.cloud.filestore.v1beta1.Share.class,
+      methodType = io.grpc.MethodDescriptor.MethodType.UNARY)
+  public static io.grpc.MethodDescriptor<
+          com.google.cloud.filestore.v1beta1.GetShareRequest,
+          com.google.cloud.filestore.v1beta1.Share>
+      getGetShareMethod() {
+    io.grpc.MethodDescriptor<
+            com.google.cloud.filestore.v1beta1.GetShareRequest,
+            com.google.cloud.filestore.v1beta1.Share>
+        getGetShareMethod;
+    if ((getGetShareMethod = CloudFilestoreManagerGrpc.getGetShareMethod) == null) {
+      synchronized (CloudFilestoreManagerGrpc.class) {
+        if ((getGetShareMethod = CloudFilestoreManagerGrpc.getGetShareMethod) == null) {
+          CloudFilestoreManagerGrpc.getGetShareMethod =
+              getGetShareMethod =
+                  io.grpc.MethodDescriptor
+                      .
+                          newBuilder()
+                      .setType(io.grpc.MethodDescriptor.MethodType.UNARY)
+                      .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetShare"))
+                      .setSampledToLocalTracing(true)
+                      .setRequestMarshaller(
+                          io.grpc.protobuf.ProtoUtils.marshaller(
+                              com.google.cloud.filestore.v1beta1.GetShareRequest
+                                  .getDefaultInstance()))
+                      .setResponseMarshaller(
+                          io.grpc.protobuf.ProtoUtils.marshaller(
+                              com.google.cloud.filestore.v1beta1.Share.getDefaultInstance()))
+                      .setSchemaDescriptor(
+                          new CloudFilestoreManagerMethodDescriptorSupplier("GetShare"))
+                      .build();
+        }
+      }
+    }
+    return getGetShareMethod;
+  }
+
+  private static volatile io.grpc.MethodDescriptor<
+          com.google.cloud.filestore.v1beta1.CreateShareRequest, com.google.longrunning.Operation>
+      getCreateShareMethod;
+
+  @io.grpc.stub.annotations.RpcMethod(
+      fullMethodName = SERVICE_NAME + '/' + "CreateShare",
+      requestType = com.google.cloud.filestore.v1beta1.CreateShareRequest.class,
+      responseType = com.google.longrunning.Operation.class,
+      methodType = io.grpc.MethodDescriptor.MethodType.UNARY)
+  public static io.grpc.MethodDescriptor<
+          com.google.cloud.filestore.v1beta1.CreateShareRequest, com.google.longrunning.Operation>
+      getCreateShareMethod() {
+    io.grpc.MethodDescriptor<
+            com.google.cloud.filestore.v1beta1.CreateShareRequest, com.google.longrunning.Operation>
+        getCreateShareMethod;
+    if ((getCreateShareMethod = CloudFilestoreManagerGrpc.getCreateShareMethod) == null) {
+      synchronized (CloudFilestoreManagerGrpc.class) {
+        if ((getCreateShareMethod = CloudFilestoreManagerGrpc.getCreateShareMethod) == null) {
+          CloudFilestoreManagerGrpc.getCreateShareMethod =
+              getCreateShareMethod =
+                  io.grpc.MethodDescriptor
+                      .
+                          newBuilder()
+                      .setType(io.grpc.MethodDescriptor.MethodType.UNARY)
+                      .setFullMethodName(generateFullMethodName(SERVICE_NAME, "CreateShare"))
+                      .setSampledToLocalTracing(true)
+                      .setRequestMarshaller(
+                          io.grpc.protobuf.ProtoUtils.marshaller(
+                              com.google.cloud.filestore.v1beta1.CreateShareRequest
+                                  .getDefaultInstance()))
+                      .setResponseMarshaller(
+                          io.grpc.protobuf.ProtoUtils.marshaller(
+                              com.google.longrunning.Operation.getDefaultInstance()))
+                      .setSchemaDescriptor(
+                          new CloudFilestoreManagerMethodDescriptorSupplier("CreateShare"))
+                      .build();
+        }
+      }
+    }
+    return getCreateShareMethod;
+  }
+
+  private static volatile io.grpc.MethodDescriptor<
+          com.google.cloud.filestore.v1beta1.DeleteShareRequest, com.google.longrunning.Operation>
+      getDeleteShareMethod;
+
+  @io.grpc.stub.annotations.RpcMethod(
+      fullMethodName = SERVICE_NAME + '/' + "DeleteShare",
+      requestType = com.google.cloud.filestore.v1beta1.DeleteShareRequest.class,
+      responseType = com.google.longrunning.Operation.class,
+      methodType = io.grpc.MethodDescriptor.MethodType.UNARY)
+  public static io.grpc.MethodDescriptor<
+          com.google.cloud.filestore.v1beta1.DeleteShareRequest, com.google.longrunning.Operation>
+      getDeleteShareMethod() {
+    io.grpc.MethodDescriptor<
+            com.google.cloud.filestore.v1beta1.DeleteShareRequest, com.google.longrunning.Operation>
+        getDeleteShareMethod;
+    if ((getDeleteShareMethod = CloudFilestoreManagerGrpc.getDeleteShareMethod) == null) {
+      synchronized (CloudFilestoreManagerGrpc.class) {
+        if ((getDeleteShareMethod = CloudFilestoreManagerGrpc.getDeleteShareMethod) == null) {
+          CloudFilestoreManagerGrpc.getDeleteShareMethod =
+              getDeleteShareMethod =
+                  io.grpc.MethodDescriptor
+                      .
+                          newBuilder()
+                      .setType(io.grpc.MethodDescriptor.MethodType.UNARY)
+                      .setFullMethodName(generateFullMethodName(SERVICE_NAME, "DeleteShare"))
+                      .setSampledToLocalTracing(true)
+                      .setRequestMarshaller(
+                          io.grpc.protobuf.ProtoUtils.marshaller(
+                              com.google.cloud.filestore.v1beta1.DeleteShareRequest
+                                  .getDefaultInstance()))
+                      .setResponseMarshaller(
+                          io.grpc.protobuf.ProtoUtils.marshaller(
+                              com.google.longrunning.Operation.getDefaultInstance()))
+                      .setSchemaDescriptor(
+                          new CloudFilestoreManagerMethodDescriptorSupplier("DeleteShare"))
+                      .build();
+        }
+      }
+    }
+    return getDeleteShareMethod;
+  }
+
+  private static volatile io.grpc.MethodDescriptor<
+          com.google.cloud.filestore.v1beta1.UpdateShareRequest, com.google.longrunning.Operation>
+      getUpdateShareMethod;
+
+  @io.grpc.stub.annotations.RpcMethod(
+      fullMethodName = SERVICE_NAME + '/' + "UpdateShare",
+      requestType = com.google.cloud.filestore.v1beta1.UpdateShareRequest.class,
+      responseType = com.google.longrunning.Operation.class,
+      methodType = io.grpc.MethodDescriptor.MethodType.UNARY)
+  public static io.grpc.MethodDescriptor<
+          com.google.cloud.filestore.v1beta1.UpdateShareRequest, com.google.longrunning.Operation>
+      getUpdateShareMethod() {
+    io.grpc.MethodDescriptor<
+            com.google.cloud.filestore.v1beta1.UpdateShareRequest, com.google.longrunning.Operation>
+        getUpdateShareMethod;
+    if ((getUpdateShareMethod = CloudFilestoreManagerGrpc.getUpdateShareMethod) == null) {
+      synchronized (CloudFilestoreManagerGrpc.class) {
+        if ((getUpdateShareMethod = CloudFilestoreManagerGrpc.getUpdateShareMethod) == null) {
+          CloudFilestoreManagerGrpc.getUpdateShareMethod =
+              getUpdateShareMethod =
+                  io.grpc.MethodDescriptor
+                      .
+                          newBuilder()
+                      .setType(io.grpc.MethodDescriptor.MethodType.UNARY)
+                      .setFullMethodName(generateFullMethodName(SERVICE_NAME, "UpdateShare"))
+                      .setSampledToLocalTracing(true)
+                      .setRequestMarshaller(
+                          io.grpc.protobuf.ProtoUtils.marshaller(
+                              com.google.cloud.filestore.v1beta1.UpdateShareRequest
+                                  .getDefaultInstance()))
+                      .setResponseMarshaller(
+                          io.grpc.protobuf.ProtoUtils.marshaller(
+                              com.google.longrunning.Operation.getDefaultInstance()))
+                      .setSchemaDescriptor(
+                          new CloudFilestoreManagerMethodDescriptorSupplier("UpdateShare"))
+                      .build();
+        }
+      }
+    }
+    return getUpdateShareMethod;
+  }
+
   /** Creates a new async stub that supports all call types for the service */
   public static CloudFilestoreManagerStub newStub(io.grpc.Channel channel) {
     io.grpc.stub.AbstractStub.StubFactory factory =
@@ -601,15 +1100,15 @@ public CloudFilestoreManagerFutureStub newStub(
    *
    *
    * 
-   * Configures and manages Cloud Filestore resources.
-   * Cloud Filestore Manager v1beta1.
-   * The `file.googleapis.com` service implements the Cloud Filestore API and
+   * Configures and manages Filestore resources.
+   * Filestore Manager v1beta1.
+   * The `file.googleapis.com` service implements the Filestore API and
    * defines the following model for managing resources:
    * * The service works with a collection of cloud projects, named: `/projects/*`
    * * Each project has a collection of available locations, named: `/locations/*`
    * * Each location has a collection of instances and backups, named:
    * `/instances/*` and `/backups/*` respectively.
-   * * As such, Cloud Filestore instances are resources of the form:
+   * * As such, Filestore instances are resources of the form:
    *   `/projects/{project_id}/locations/{location_id}/instances/{instance_id}`
    *   backups are resources of the form:
    *   `/projects/{project_id}/locations/{location_id}/backup/{backup_id}`
@@ -644,76 +1143,162 @@ public void listInstances(
      *
      *
      * 
-     * Gets the details of a specific instance.
+     * Gets the details of a specific instance.
+     * 
+ */ + public void getInstance( + com.google.cloud.filestore.v1beta1.GetInstanceRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getGetInstanceMethod(), responseObserver); + } + + /** + * + * + *
+     * Creates an instance.
+     * When creating from a backup, the capacity of the new instance needs to be
+     * equal to or larger than the capacity of the backup (and also equal to or
+     * larger than the minimum capacity of the tier).
+     * 
+ */ + public void createInstance( + com.google.cloud.filestore.v1beta1.CreateInstanceRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getCreateInstanceMethod(), responseObserver); + } + + /** + * + * + *
+     * Updates the settings of a specific instance.
+     * 
+ */ + public void updateInstance( + com.google.cloud.filestore.v1beta1.UpdateInstanceRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getUpdateInstanceMethod(), responseObserver); + } + + /** + * + * + *
+     * Restores an existing instance's file share from a backup.
+     * The capacity of the instance needs to be equal to or larger than the
+     * capacity of the backup (and also equal to or larger than the minimum
+     * capacity of the tier).
+     * 
+ */ + public void restoreInstance( + com.google.cloud.filestore.v1beta1.RestoreInstanceRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getRestoreInstanceMethod(), responseObserver); + } + + /** + * + * + *
+     * Revert an existing instance's file system to a specified snapshot.
+     * 
+ */ + public void revertInstance( + com.google.cloud.filestore.v1beta1.RevertInstanceRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getRevertInstanceMethod(), responseObserver); + } + + /** + * + * + *
+     * Deletes an instance.
+     * 
+ */ + public void deleteInstance( + com.google.cloud.filestore.v1beta1.DeleteInstanceRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getDeleteInstanceMethod(), responseObserver); + } + + /** + * + * + *
+     * Lists all snapshots in a project for either a specified location
+     * or for all locations.
      * 
*/ - public void getInstance( - com.google.cloud.filestore.v1beta1.GetInstanceRequest request, - io.grpc.stub.StreamObserver responseObserver) { + public void listSnapshots( + com.google.cloud.filestore.v1beta1.ListSnapshotsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( - getGetInstanceMethod(), responseObserver); + getListSnapshotsMethod(), responseObserver); } /** * * *
-     * Creates an instance.
-     * When creating from a backup, the capacity of the new instance needs to be
-     * equal to or larger than the capacity of the backup (and also equal to or
-     * larger than the minimum capacity of the tier).
+     * Gets the details of a specific snapshot.
      * 
*/ - public void createInstance( - com.google.cloud.filestore.v1beta1.CreateInstanceRequest request, - io.grpc.stub.StreamObserver responseObserver) { + public void getSnapshot( + com.google.cloud.filestore.v1beta1.GetSnapshotRequest request, + io.grpc.stub.StreamObserver responseObserver) { io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( - getCreateInstanceMethod(), responseObserver); + getGetSnapshotMethod(), responseObserver); } /** * * *
-     * Updates the settings of a specific instance.
+     * Creates a snapshot.
      * 
*/ - public void updateInstance( - com.google.cloud.filestore.v1beta1.UpdateInstanceRequest request, + public void createSnapshot( + com.google.cloud.filestore.v1beta1.CreateSnapshotRequest request, io.grpc.stub.StreamObserver responseObserver) { io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( - getUpdateInstanceMethod(), responseObserver); + getCreateSnapshotMethod(), responseObserver); } /** * * *
-     * Restores an existing instance's file share from a backup.
-     * The capacity of the instance needs to be equal to or larger than the
-     * capacity of the backup (and also equal to or larger than the minimum
-     * capacity of the tier).
+     * Deletes a snapshot.
      * 
*/ - public void restoreInstance( - com.google.cloud.filestore.v1beta1.RestoreInstanceRequest request, + public void deleteSnapshot( + com.google.cloud.filestore.v1beta1.DeleteSnapshotRequest request, io.grpc.stub.StreamObserver responseObserver) { io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( - getRestoreInstanceMethod(), responseObserver); + getDeleteSnapshotMethod(), responseObserver); } /** * * *
-     * Deletes an instance.
+     * Updates the settings of a specific snapshot.
      * 
*/ - public void deleteInstance( - com.google.cloud.filestore.v1beta1.DeleteInstanceRequest request, + public void updateSnapshot( + com.google.cloud.filestore.v1beta1.UpdateSnapshotRequest request, io.grpc.stub.StreamObserver responseObserver) { io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( - getDeleteInstanceMethod(), responseObserver); + getUpdateSnapshotMethod(), responseObserver); } /** @@ -787,6 +1372,75 @@ public void updateBackup( getUpdateBackupMethod(), responseObserver); } + /** + * + * + *
+     * Lists all shares for a specified instance.
+     * 
+ */ + public void listShares( + com.google.cloud.filestore.v1beta1.ListSharesRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getListSharesMethod(), responseObserver); + } + + /** + * + * + *
+     * Gets the details of a specific share.
+     * 
+ */ + public void getShare( + com.google.cloud.filestore.v1beta1.GetShareRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getGetShareMethod(), responseObserver); + } + + /** + * + * + *
+     * Creates a share.
+     * 
+ */ + public void createShare( + com.google.cloud.filestore.v1beta1.CreateShareRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getCreateShareMethod(), responseObserver); + } + + /** + * + * + *
+     * Deletes a share.
+     * 
+ */ + public void deleteShare( + com.google.cloud.filestore.v1beta1.DeleteShareRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getDeleteShareMethod(), responseObserver); + } + + /** + * + * + *
+     * Updates the settings of a specific share.
+     * 
+ */ + public void updateShare( + com.google.cloud.filestore.v1beta1.UpdateShareRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getUpdateShareMethod(), responseObserver); + } + @java.lang.Override public final io.grpc.ServerServiceDefinition bindService() { return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) @@ -821,12 +1475,49 @@ public final io.grpc.ServerServiceDefinition bindService() { new MethodHandlers< com.google.cloud.filestore.v1beta1.RestoreInstanceRequest, com.google.longrunning.Operation>(this, METHODID_RESTORE_INSTANCE))) + .addMethod( + getRevertInstanceMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.filestore.v1beta1.RevertInstanceRequest, + com.google.longrunning.Operation>(this, METHODID_REVERT_INSTANCE))) .addMethod( getDeleteInstanceMethod(), io.grpc.stub.ServerCalls.asyncUnaryCall( new MethodHandlers< com.google.cloud.filestore.v1beta1.DeleteInstanceRequest, com.google.longrunning.Operation>(this, METHODID_DELETE_INSTANCE))) + .addMethod( + getListSnapshotsMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.filestore.v1beta1.ListSnapshotsRequest, + com.google.cloud.filestore.v1beta1.ListSnapshotsResponse>( + this, METHODID_LIST_SNAPSHOTS))) + .addMethod( + getGetSnapshotMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.filestore.v1beta1.GetSnapshotRequest, + com.google.cloud.filestore.v1beta1.Snapshot>(this, METHODID_GET_SNAPSHOT))) + .addMethod( + getCreateSnapshotMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.filestore.v1beta1.CreateSnapshotRequest, + com.google.longrunning.Operation>(this, METHODID_CREATE_SNAPSHOT))) + .addMethod( + getDeleteSnapshotMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.filestore.v1beta1.DeleteSnapshotRequest, + com.google.longrunning.Operation>(this, METHODID_DELETE_SNAPSHOT))) + .addMethod( + getUpdateSnapshotMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.filestore.v1beta1.UpdateSnapshotRequest, + com.google.longrunning.Operation>(this, METHODID_UPDATE_SNAPSHOT))) .addMethod( getListBackupsMethod(), io.grpc.stub.ServerCalls.asyncUnaryCall( @@ -858,6 +1549,37 @@ public final io.grpc.ServerServiceDefinition bindService() { new MethodHandlers< com.google.cloud.filestore.v1beta1.UpdateBackupRequest, com.google.longrunning.Operation>(this, METHODID_UPDATE_BACKUP))) + .addMethod( + getListSharesMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.filestore.v1beta1.ListSharesRequest, + com.google.cloud.filestore.v1beta1.ListSharesResponse>( + this, METHODID_LIST_SHARES))) + .addMethod( + getGetShareMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.filestore.v1beta1.GetShareRequest, + com.google.cloud.filestore.v1beta1.Share>(this, METHODID_GET_SHARE))) + .addMethod( + getCreateShareMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.filestore.v1beta1.CreateShareRequest, + com.google.longrunning.Operation>(this, METHODID_CREATE_SHARE))) + .addMethod( + getDeleteShareMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.filestore.v1beta1.DeleteShareRequest, + com.google.longrunning.Operation>(this, METHODID_DELETE_SHARE))) + .addMethod( + getUpdateShareMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.filestore.v1beta1.UpdateShareRequest, + com.google.longrunning.Operation>(this, METHODID_UPDATE_SHARE))) .build(); } } @@ -866,15 +1588,15 @@ public final io.grpc.ServerServiceDefinition bindService() { * * *
-   * Configures and manages Cloud Filestore resources.
-   * Cloud Filestore Manager v1beta1.
-   * The `file.googleapis.com` service implements the Cloud Filestore API and
+   * Configures and manages Filestore resources.
+   * Filestore Manager v1beta1.
+   * The `file.googleapis.com` service implements the Filestore API and
    * defines the following model for managing resources:
    * * The service works with a collection of cloud projects, named: `/projects/*`
    * * Each project has a collection of available locations, named: `/locations/*`
    * * Each location has a collection of instances and backups, named:
    * `/instances/*` and `/backups/*` respectively.
-   * * As such, Cloud Filestore instances are resources of the form:
+   * * As such, Filestore instances are resources of the form:
    *   `/projects/{project_id}/locations/{location_id}/instances/{instance_id}`
    *   backups are resources of the form:
    *   `/projects/{project_id}/locations/{location_id}/backup/{backup_id}`
@@ -987,6 +1709,22 @@ public void restoreInstance(
           responseObserver);
     }
 
+    /**
+     *
+     *
+     * 
+     * Revert an existing instance's file system to a specified snapshot.
+     * 
+ */ + public void revertInstance( + com.google.cloud.filestore.v1beta1.RevertInstanceRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getRevertInstanceMethod(), getCallOptions()), + request, + responseObserver); + } + /** * * @@ -1003,6 +1741,88 @@ public void deleteInstance( responseObserver); } + /** + * + * + *
+     * Lists all snapshots in a project for either a specified location
+     * or for all locations.
+     * 
+ */ + public void listSnapshots( + com.google.cloud.filestore.v1beta1.ListSnapshotsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getListSnapshotsMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Gets the details of a specific snapshot.
+     * 
+ */ + public void getSnapshot( + com.google.cloud.filestore.v1beta1.GetSnapshotRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetSnapshotMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Creates a snapshot.
+     * 
+ */ + public void createSnapshot( + com.google.cloud.filestore.v1beta1.CreateSnapshotRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getCreateSnapshotMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Deletes a snapshot.
+     * 
+ */ + public void deleteSnapshot( + com.google.cloud.filestore.v1beta1.DeleteSnapshotRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getDeleteSnapshotMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Updates the settings of a specific snapshot.
+     * 
+ */ + public void updateSnapshot( + com.google.cloud.filestore.v1beta1.UpdateSnapshotRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getUpdateSnapshotMethod(), getCallOptions()), + request, + responseObserver); + } + /** * * @@ -1016,37 +1836,114 @@ public void listBackups( io.grpc.stub.StreamObserver responseObserver) { io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getListBackupsMethod(), getCallOptions()), - request, - responseObserver); + getChannel().newCall(getListBackupsMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Gets the details of a specific backup.
+     * 
+ */ + public void getBackup( + com.google.cloud.filestore.v1beta1.GetBackupRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetBackupMethod(), getCallOptions()), request, responseObserver); + } + + /** + * + * + *
+     * Creates a backup.
+     * 
+ */ + public void createBackup( + com.google.cloud.filestore.v1beta1.CreateBackupRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getCreateBackupMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Deletes a backup.
+     * 
+ */ + public void deleteBackup( + com.google.cloud.filestore.v1beta1.DeleteBackupRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getDeleteBackupMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Updates the settings of a specific backup.
+     * 
+ */ + public void updateBackup( + com.google.cloud.filestore.v1beta1.UpdateBackupRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getUpdateBackupMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Lists all shares for a specified instance.
+     * 
+ */ + public void listShares( + com.google.cloud.filestore.v1beta1.ListSharesRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getListSharesMethod(), getCallOptions()), request, responseObserver); } /** * * *
-     * Gets the details of a specific backup.
+     * Gets the details of a specific share.
      * 
*/ - public void getBackup( - com.google.cloud.filestore.v1beta1.GetBackupRequest request, - io.grpc.stub.StreamObserver responseObserver) { + public void getShare( + com.google.cloud.filestore.v1beta1.GetShareRequest request, + io.grpc.stub.StreamObserver responseObserver) { io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getGetBackupMethod(), getCallOptions()), request, responseObserver); + getChannel().newCall(getGetShareMethod(), getCallOptions()), request, responseObserver); } /** * * *
-     * Creates a backup.
+     * Creates a share.
      * 
*/ - public void createBackup( - com.google.cloud.filestore.v1beta1.CreateBackupRequest request, + public void createShare( + com.google.cloud.filestore.v1beta1.CreateShareRequest request, io.grpc.stub.StreamObserver responseObserver) { io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getCreateBackupMethod(), getCallOptions()), + getChannel().newCall(getCreateShareMethod(), getCallOptions()), request, responseObserver); } @@ -1055,14 +1952,14 @@ public void createBackup( * * *
-     * Deletes a backup.
+     * Deletes a share.
      * 
*/ - public void deleteBackup( - com.google.cloud.filestore.v1beta1.DeleteBackupRequest request, + public void deleteShare( + com.google.cloud.filestore.v1beta1.DeleteShareRequest request, io.grpc.stub.StreamObserver responseObserver) { io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getDeleteBackupMethod(), getCallOptions()), + getChannel().newCall(getDeleteShareMethod(), getCallOptions()), request, responseObserver); } @@ -1071,14 +1968,14 @@ public void deleteBackup( * * *
-     * Updates the settings of a specific backup.
+     * Updates the settings of a specific share.
      * 
*/ - public void updateBackup( - com.google.cloud.filestore.v1beta1.UpdateBackupRequest request, + public void updateShare( + com.google.cloud.filestore.v1beta1.UpdateShareRequest request, io.grpc.stub.StreamObserver responseObserver) { io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getUpdateBackupMethod(), getCallOptions()), + getChannel().newCall(getUpdateShareMethod(), getCallOptions()), request, responseObserver); } @@ -1088,15 +1985,15 @@ public void updateBackup( * * *
-   * Configures and manages Cloud Filestore resources.
-   * Cloud Filestore Manager v1beta1.
-   * The `file.googleapis.com` service implements the Cloud Filestore API and
+   * Configures and manages Filestore resources.
+   * Filestore Manager v1beta1.
+   * The `file.googleapis.com` service implements the Filestore API and
    * defines the following model for managing resources:
    * * The service works with a collection of cloud projects, named: `/projects/*`
    * * Each project has a collection of available locations, named: `/locations/*`
    * * Each location has a collection of instances and backups, named:
    * `/instances/*` and `/backups/*` respectively.
-   * * As such, Cloud Filestore instances are resources of the form:
+   * * As such, Filestore instances are resources of the form:
    *   `/projects/{project_id}/locations/{location_id}/instances/{instance_id}`
    *   backups are resources of the form:
    *   `/projects/{project_id}/locations/{location_id}/backup/{backup_id}`
@@ -1194,6 +2091,19 @@ public com.google.longrunning.Operation restoreInstance(
           getChannel(), getRestoreInstanceMethod(), getCallOptions(), request);
     }
 
+    /**
+     *
+     *
+     * 
+     * Revert an existing instance's file system to a specified snapshot.
+     * 
+ */ + public com.google.longrunning.Operation revertInstance( + com.google.cloud.filestore.v1beta1.RevertInstanceRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getRevertInstanceMethod(), getCallOptions(), request); + } + /** * * @@ -1207,6 +2117,72 @@ public com.google.longrunning.Operation deleteInstance( getChannel(), getDeleteInstanceMethod(), getCallOptions(), request); } + /** + * + * + *
+     * Lists all snapshots in a project for either a specified location
+     * or for all locations.
+     * 
+ */ + public com.google.cloud.filestore.v1beta1.ListSnapshotsResponse listSnapshots( + com.google.cloud.filestore.v1beta1.ListSnapshotsRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getListSnapshotsMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Gets the details of a specific snapshot.
+     * 
+ */ + public com.google.cloud.filestore.v1beta1.Snapshot getSnapshot( + com.google.cloud.filestore.v1beta1.GetSnapshotRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetSnapshotMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Creates a snapshot.
+     * 
+ */ + public com.google.longrunning.Operation createSnapshot( + com.google.cloud.filestore.v1beta1.CreateSnapshotRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getCreateSnapshotMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Deletes a snapshot.
+     * 
+ */ + public com.google.longrunning.Operation deleteSnapshot( + com.google.cloud.filestore.v1beta1.DeleteSnapshotRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getDeleteSnapshotMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Updates the settings of a specific snapshot.
+     * 
+ */ + public com.google.longrunning.Operation updateSnapshot( + com.google.cloud.filestore.v1beta1.UpdateSnapshotRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getUpdateSnapshotMethod(), getCallOptions(), request); + } + /** * * @@ -1272,21 +2248,86 @@ public com.google.longrunning.Operation updateBackup( return io.grpc.stub.ClientCalls.blockingUnaryCall( getChannel(), getUpdateBackupMethod(), getCallOptions(), request); } + + /** + * + * + *
+     * Lists all shares for a specified instance.
+     * 
+ */ + public com.google.cloud.filestore.v1beta1.ListSharesResponse listShares( + com.google.cloud.filestore.v1beta1.ListSharesRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getListSharesMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Gets the details of a specific share.
+     * 
+ */ + public com.google.cloud.filestore.v1beta1.Share getShare( + com.google.cloud.filestore.v1beta1.GetShareRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetShareMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Creates a share.
+     * 
+ */ + public com.google.longrunning.Operation createShare( + com.google.cloud.filestore.v1beta1.CreateShareRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getCreateShareMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Deletes a share.
+     * 
+ */ + public com.google.longrunning.Operation deleteShare( + com.google.cloud.filestore.v1beta1.DeleteShareRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getDeleteShareMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Updates the settings of a specific share.
+     * 
+ */ + public com.google.longrunning.Operation updateShare( + com.google.cloud.filestore.v1beta1.UpdateShareRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getUpdateShareMethod(), getCallOptions(), request); + } } /** * * *
-   * Configures and manages Cloud Filestore resources.
-   * Cloud Filestore Manager v1beta1.
-   * The `file.googleapis.com` service implements the Cloud Filestore API and
+   * Configures and manages Filestore resources.
+   * Filestore Manager v1beta1.
+   * The `file.googleapis.com` service implements the Filestore API and
    * defines the following model for managing resources:
    * * The service works with a collection of cloud projects, named: `/projects/*`
    * * Each project has a collection of available locations, named: `/locations/*`
    * * Each location has a collection of instances and backups, named:
    * `/instances/*` and `/backups/*` respectively.
-   * * As such, Cloud Filestore instances are resources of the form:
+   * * As such, Filestore instances are resources of the form:
    *   `/projects/{project_id}/locations/{location_id}/instances/{instance_id}`
    *   backups are resources of the form:
    *   `/projects/{project_id}/locations/{location_id}/backup/{backup_id}`
@@ -1386,6 +2427,19 @@ protected CloudFilestoreManagerFutureStub build(
           getChannel().newCall(getRestoreInstanceMethod(), getCallOptions()), request);
     }
 
+    /**
+     *
+     *
+     * 
+     * Revert an existing instance's file system to a specified snapshot.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + revertInstance(com.google.cloud.filestore.v1beta1.RevertInstanceRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getRevertInstanceMethod(), getCallOptions()), request); + } + /** * * @@ -1399,6 +2453,74 @@ protected CloudFilestoreManagerFutureStub build( getChannel().newCall(getDeleteInstanceMethod(), getCallOptions()), request); } + /** + * + * + *
+     * Lists all snapshots in a project for either a specified location
+     * or for all locations.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.filestore.v1beta1.ListSnapshotsResponse> + listSnapshots(com.google.cloud.filestore.v1beta1.ListSnapshotsRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getListSnapshotsMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Gets the details of a specific snapshot.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.filestore.v1beta1.Snapshot> + getSnapshot(com.google.cloud.filestore.v1beta1.GetSnapshotRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetSnapshotMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Creates a snapshot.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + createSnapshot(com.google.cloud.filestore.v1beta1.CreateSnapshotRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getCreateSnapshotMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Deletes a snapshot.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + deleteSnapshot(com.google.cloud.filestore.v1beta1.DeleteSnapshotRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getDeleteSnapshotMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Updates the settings of a specific snapshot.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + updateSnapshot(com.google.cloud.filestore.v1beta1.UpdateSnapshotRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getUpdateSnapshotMethod(), getCallOptions()), request); + } + /** * * @@ -1466,6 +2588,73 @@ protected CloudFilestoreManagerFutureStub build( return io.grpc.stub.ClientCalls.futureUnaryCall( getChannel().newCall(getUpdateBackupMethod(), getCallOptions()), request); } + + /** + * + * + *
+     * Lists all shares for a specified instance.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.filestore.v1beta1.ListSharesResponse> + listShares(com.google.cloud.filestore.v1beta1.ListSharesRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getListSharesMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Gets the details of a specific share.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.filestore.v1beta1.Share> + getShare(com.google.cloud.filestore.v1beta1.GetShareRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetShareMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Creates a share.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + createShare(com.google.cloud.filestore.v1beta1.CreateShareRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getCreateShareMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Deletes a share.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + deleteShare(com.google.cloud.filestore.v1beta1.DeleteShareRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getDeleteShareMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Updates the settings of a specific share.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + updateShare(com.google.cloud.filestore.v1beta1.UpdateShareRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getUpdateShareMethod(), getCallOptions()), request); + } } private static final int METHODID_LIST_INSTANCES = 0; @@ -1473,12 +2662,23 @@ protected CloudFilestoreManagerFutureStub build( private static final int METHODID_CREATE_INSTANCE = 2; private static final int METHODID_UPDATE_INSTANCE = 3; private static final int METHODID_RESTORE_INSTANCE = 4; - private static final int METHODID_DELETE_INSTANCE = 5; - private static final int METHODID_LIST_BACKUPS = 6; - private static final int METHODID_GET_BACKUP = 7; - private static final int METHODID_CREATE_BACKUP = 8; - private static final int METHODID_DELETE_BACKUP = 9; - private static final int METHODID_UPDATE_BACKUP = 10; + private static final int METHODID_REVERT_INSTANCE = 5; + private static final int METHODID_DELETE_INSTANCE = 6; + private static final int METHODID_LIST_SNAPSHOTS = 7; + private static final int METHODID_GET_SNAPSHOT = 8; + private static final int METHODID_CREATE_SNAPSHOT = 9; + private static final int METHODID_DELETE_SNAPSHOT = 10; + private static final int METHODID_UPDATE_SNAPSHOT = 11; + private static final int METHODID_LIST_BACKUPS = 12; + private static final int METHODID_GET_BACKUP = 13; + private static final int METHODID_CREATE_BACKUP = 14; + private static final int METHODID_DELETE_BACKUP = 15; + private static final int METHODID_UPDATE_BACKUP = 16; + private static final int METHODID_LIST_SHARES = 17; + private static final int METHODID_GET_SHARE = 18; + private static final int METHODID_CREATE_SHARE = 19; + private static final int METHODID_DELETE_SHARE = 20; + private static final int METHODID_UPDATE_SHARE = 21; private static final class MethodHandlers implements io.grpc.stub.ServerCalls.UnaryMethod, @@ -1525,11 +2725,44 @@ public void invoke(Req request, io.grpc.stub.StreamObserver responseObserv (com.google.cloud.filestore.v1beta1.RestoreInstanceRequest) request, (io.grpc.stub.StreamObserver) responseObserver); break; + case METHODID_REVERT_INSTANCE: + serviceImpl.revertInstance( + (com.google.cloud.filestore.v1beta1.RevertInstanceRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; case METHODID_DELETE_INSTANCE: serviceImpl.deleteInstance( (com.google.cloud.filestore.v1beta1.DeleteInstanceRequest) request, (io.grpc.stub.StreamObserver) responseObserver); break; + case METHODID_LIST_SNAPSHOTS: + serviceImpl.listSnapshots( + (com.google.cloud.filestore.v1beta1.ListSnapshotsRequest) request, + (io.grpc.stub.StreamObserver< + com.google.cloud.filestore.v1beta1.ListSnapshotsResponse>) + responseObserver); + break; + case METHODID_GET_SNAPSHOT: + serviceImpl.getSnapshot( + (com.google.cloud.filestore.v1beta1.GetSnapshotRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_CREATE_SNAPSHOT: + serviceImpl.createSnapshot( + (com.google.cloud.filestore.v1beta1.CreateSnapshotRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_DELETE_SNAPSHOT: + serviceImpl.deleteSnapshot( + (com.google.cloud.filestore.v1beta1.DeleteSnapshotRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_UPDATE_SNAPSHOT: + serviceImpl.updateSnapshot( + (com.google.cloud.filestore.v1beta1.UpdateSnapshotRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; case METHODID_LIST_BACKUPS: serviceImpl.listBackups( (com.google.cloud.filestore.v1beta1.ListBackupsRequest) request, @@ -1557,6 +2790,33 @@ public void invoke(Req request, io.grpc.stub.StreamObserver responseObserv (com.google.cloud.filestore.v1beta1.UpdateBackupRequest) request, (io.grpc.stub.StreamObserver) responseObserver); break; + case METHODID_LIST_SHARES: + serviceImpl.listShares( + (com.google.cloud.filestore.v1beta1.ListSharesRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_GET_SHARE: + serviceImpl.getShare( + (com.google.cloud.filestore.v1beta1.GetShareRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_CREATE_SHARE: + serviceImpl.createShare( + (com.google.cloud.filestore.v1beta1.CreateShareRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_DELETE_SHARE: + serviceImpl.deleteShare( + (com.google.cloud.filestore.v1beta1.DeleteShareRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_UPDATE_SHARE: + serviceImpl.updateShare( + (com.google.cloud.filestore.v1beta1.UpdateShareRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; default: throw new AssertionError(); } @@ -1626,12 +2886,23 @@ public static io.grpc.ServiceDescriptor getServiceDescriptor() { .addMethod(getCreateInstanceMethod()) .addMethod(getUpdateInstanceMethod()) .addMethod(getRestoreInstanceMethod()) + .addMethod(getRevertInstanceMethod()) .addMethod(getDeleteInstanceMethod()) + .addMethod(getListSnapshotsMethod()) + .addMethod(getGetSnapshotMethod()) + .addMethod(getCreateSnapshotMethod()) + .addMethod(getDeleteSnapshotMethod()) + .addMethod(getUpdateSnapshotMethod()) .addMethod(getListBackupsMethod()) .addMethod(getGetBackupMethod()) .addMethod(getCreateBackupMethod()) .addMethod(getDeleteBackupMethod()) .addMethod(getUpdateBackupMethod()) + .addMethod(getListSharesMethod()) + .addMethod(getGetShareMethod()) + .addMethod(getCreateShareMethod()) + .addMethod(getDeleteShareMethod()) + .addMethod(getUpdateShareMethod()) .build(); } } diff --git a/java-filestore/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/Backup.java b/java-filestore/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/Backup.java index 747ff66772df..3e8ea79012d8 100644 --- a/java-filestore/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/Backup.java +++ b/java-filestore/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/Backup.java @@ -22,7 +22,7 @@ * * *
- * A Cloud Filestore backup.
+ * A Filestore backup.
  * 
* * Protobuf type {@code google.cloud.filestore.v1beta1.Backup} @@ -44,6 +44,7 @@ private Backup() { sourceInstance_ = ""; sourceFileShare_ = ""; sourceInstanceTier_ = 0; + kmsKeyName_ = ""; } @java.lang.Override @@ -618,7 +619,7 @@ public long getStorageBytes() { * * *
-   * The resource name of the source Cloud Filestore instance, in the format
+   * The resource name of the source Filestore instance, in the format
    * `projects/{project_id}/locations/{location_id}/instances/{instance_id}`,
    * used to create this backup.
    * 
@@ -643,7 +644,7 @@ public java.lang.String getSourceInstance() { * * *
-   * The resource name of the source Cloud Filestore instance, in the format
+   * The resource name of the source Filestore instance, in the format
    * `projects/{project_id}/locations/{location_id}/instances/{instance_id}`,
    * used to create this backup.
    * 
@@ -671,7 +672,7 @@ public com.google.protobuf.ByteString getSourceInstanceBytes() { * * *
-   * Name of the file share in the source Cloud Filestore instance that the
+   * Name of the file share in the source Filestore instance that the
    * backup is created from.
    * 
* @@ -695,7 +696,7 @@ public java.lang.String getSourceFileShare() { * * *
-   * Name of the file share in the source Cloud Filestore instance that the
+   * Name of the file share in the source Filestore instance that the
    * backup is created from.
    * 
* @@ -722,7 +723,7 @@ public com.google.protobuf.ByteString getSourceFileShareBytes() { * * *
-   * Output only. The service tier of the source Cloud Filestore instance that this backup
+   * Output only. The service tier of the source Filestore instance that this backup
    * is created from.
    * 
* @@ -740,7 +741,7 @@ public int getSourceInstanceTierValue() { * * *
-   * Output only. The service tier of the source Cloud Filestore instance that this backup
+   * Output only. The service tier of the source Filestore instance that this backup
    * is created from.
    * 
* @@ -830,6 +831,55 @@ public com.google.protobuf.BoolValueOrBuilder getSatisfiesPzsOrBuilder() { return getSatisfiesPzs(); } + public static final int KMS_KEY_NAME_FIELD_NUMBER = 13; + private volatile java.lang.Object kmsKeyName_; + /** + * + * + *
+   * Immutable. KMS key name used for data encryption.
+   * 
+ * + * string kms_key_name = 13 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return The kmsKeyName. + */ + @java.lang.Override + public java.lang.String getKmsKeyName() { + java.lang.Object ref = kmsKeyName_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kmsKeyName_ = s; + return s; + } + } + /** + * + * + *
+   * Immutable. KMS key name used for data encryption.
+   * 
+ * + * string kms_key_name = 13 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return The bytes for kmsKeyName. + */ + @java.lang.Override + public com.google.protobuf.ByteString getKmsKeyNameBytes() { + java.lang.Object ref = kmsKeyName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kmsKeyName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + private byte memoizedIsInitialized = -1; @java.lang.Override @@ -880,6 +930,9 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (satisfiesPzs_ != null) { output.writeMessage(12, getSatisfiesPzs()); } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(kmsKeyName_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 13, kmsKeyName_); + } getUnknownFields().writeTo(output); } @@ -933,6 +986,9 @@ public int getSerializedSize() { if (satisfiesPzs_ != null) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(12, getSatisfiesPzs()); } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(kmsKeyName_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(13, kmsKeyName_); + } size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; @@ -967,6 +1023,7 @@ public boolean equals(final java.lang.Object obj) { if (hasSatisfiesPzs()) { if (!getSatisfiesPzs().equals(other.getSatisfiesPzs())) return false; } + if (!getKmsKeyName().equals(other.getKmsKeyName())) return false; if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -1008,6 +1065,8 @@ public int hashCode() { hash = (37 * hash) + SATISFIES_PZS_FIELD_NUMBER; hash = (53 * hash) + getSatisfiesPzs().hashCode(); } + hash = (37 * hash) + KMS_KEY_NAME_FIELD_NUMBER; + hash = (53 * hash) + getKmsKeyName().hashCode(); hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; @@ -1112,7 +1171,7 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build * * *
-   * A Cloud Filestore backup.
+   * A Filestore backup.
    * 
* * Protobuf type {@code google.cloud.filestore.v1beta1.Backup} @@ -1197,6 +1256,8 @@ public Builder clear() { satisfiesPzs_ = null; satisfiesPzsBuilder_ = null; } + kmsKeyName_ = ""; + return this; } @@ -1246,6 +1307,7 @@ public com.google.cloud.filestore.v1beta1.Backup buildPartial() { } else { result.satisfiesPzs_ = satisfiesPzsBuilder_.build(); } + result.kmsKeyName_ = kmsKeyName_; onBuilt(); return result; } @@ -1333,6 +1395,10 @@ public Builder mergeFrom(com.google.cloud.filestore.v1beta1.Backup other) { if (other.hasSatisfiesPzs()) { mergeSatisfiesPzs(other.getSatisfiesPzs()); } + if (!other.getKmsKeyName().isEmpty()) { + kmsKeyName_ = other.kmsKeyName_; + onChanged(); + } this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; @@ -1436,6 +1502,12 @@ public Builder mergeFrom( break; } // case 98 + case 106: + { + kmsKeyName_ = input.readStringRequireUtf8(); + + break; + } // case 106 default: { if (!super.parseUnknownField(input, extensionRegistry, tag)) { @@ -2249,7 +2321,7 @@ public Builder clearStorageBytes() { * * *
-     * The resource name of the source Cloud Filestore instance, in the format
+     * The resource name of the source Filestore instance, in the format
      * `projects/{project_id}/locations/{location_id}/instances/{instance_id}`,
      * used to create this backup.
      * 
@@ -2273,7 +2345,7 @@ public java.lang.String getSourceInstance() { * * *
-     * The resource name of the source Cloud Filestore instance, in the format
+     * The resource name of the source Filestore instance, in the format
      * `projects/{project_id}/locations/{location_id}/instances/{instance_id}`,
      * used to create this backup.
      * 
@@ -2297,7 +2369,7 @@ public com.google.protobuf.ByteString getSourceInstanceBytes() { * * *
-     * The resource name of the source Cloud Filestore instance, in the format
+     * The resource name of the source Filestore instance, in the format
      * `projects/{project_id}/locations/{location_id}/instances/{instance_id}`,
      * used to create this backup.
      * 
@@ -2320,7 +2392,7 @@ public Builder setSourceInstance(java.lang.String value) { * * *
-     * The resource name of the source Cloud Filestore instance, in the format
+     * The resource name of the source Filestore instance, in the format
      * `projects/{project_id}/locations/{location_id}/instances/{instance_id}`,
      * used to create this backup.
      * 
@@ -2339,7 +2411,7 @@ public Builder clearSourceInstance() { * * *
-     * The resource name of the source Cloud Filestore instance, in the format
+     * The resource name of the source Filestore instance, in the format
      * `projects/{project_id}/locations/{location_id}/instances/{instance_id}`,
      * used to create this backup.
      * 
@@ -2365,7 +2437,7 @@ public Builder setSourceInstanceBytes(com.google.protobuf.ByteString value) { * * *
-     * Name of the file share in the source Cloud Filestore instance that the
+     * Name of the file share in the source Filestore instance that the
      * backup is created from.
      * 
* @@ -2388,7 +2460,7 @@ public java.lang.String getSourceFileShare() { * * *
-     * Name of the file share in the source Cloud Filestore instance that the
+     * Name of the file share in the source Filestore instance that the
      * backup is created from.
      * 
* @@ -2411,7 +2483,7 @@ public com.google.protobuf.ByteString getSourceFileShareBytes() { * * *
-     * Name of the file share in the source Cloud Filestore instance that the
+     * Name of the file share in the source Filestore instance that the
      * backup is created from.
      * 
* @@ -2433,7 +2505,7 @@ public Builder setSourceFileShare(java.lang.String value) { * * *
-     * Name of the file share in the source Cloud Filestore instance that the
+     * Name of the file share in the source Filestore instance that the
      * backup is created from.
      * 
* @@ -2451,7 +2523,7 @@ public Builder clearSourceFileShare() { * * *
-     * Name of the file share in the source Cloud Filestore instance that the
+     * Name of the file share in the source Filestore instance that the
      * backup is created from.
      * 
* @@ -2476,7 +2548,7 @@ public Builder setSourceFileShareBytes(com.google.protobuf.ByteString value) { * * *
-     * Output only. The service tier of the source Cloud Filestore instance that this backup
+     * Output only. The service tier of the source Filestore instance that this backup
      * is created from.
      * 
* @@ -2494,7 +2566,7 @@ public int getSourceInstanceTierValue() { * * *
-     * Output only. The service tier of the source Cloud Filestore instance that this backup
+     * Output only. The service tier of the source Filestore instance that this backup
      * is created from.
      * 
* @@ -2515,7 +2587,7 @@ public Builder setSourceInstanceTierValue(int value) { * * *
-     * Output only. The service tier of the source Cloud Filestore instance that this backup
+     * Output only. The service tier of the source Filestore instance that this backup
      * is created from.
      * 
* @@ -2538,7 +2610,7 @@ public com.google.cloud.filestore.v1beta1.Instance.Tier getSourceInstanceTier() * * *
-     * Output only. The service tier of the source Cloud Filestore instance that this backup
+     * Output only. The service tier of the source Filestore instance that this backup
      * is created from.
      * 
* @@ -2562,7 +2634,7 @@ public Builder setSourceInstanceTier(com.google.cloud.filestore.v1beta1.Instance * * *
-     * Output only. The service tier of the source Cloud Filestore instance that this backup
+     * Output only. The service tier of the source Filestore instance that this backup
      * is created from.
      * 
* @@ -2834,6 +2906,112 @@ public com.google.protobuf.BoolValueOrBuilder getSatisfiesPzsOrBuilder() { return satisfiesPzsBuilder_; } + private java.lang.Object kmsKeyName_ = ""; + /** + * + * + *
+     * Immutable. KMS key name used for data encryption.
+     * 
+ * + * string kms_key_name = 13 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return The kmsKeyName. + */ + public java.lang.String getKmsKeyName() { + java.lang.Object ref = kmsKeyName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kmsKeyName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Immutable. KMS key name used for data encryption.
+     * 
+ * + * string kms_key_name = 13 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return The bytes for kmsKeyName. + */ + public com.google.protobuf.ByteString getKmsKeyNameBytes() { + java.lang.Object ref = kmsKeyName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kmsKeyName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Immutable. KMS key name used for data encryption.
+     * 
+ * + * string kms_key_name = 13 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @param value The kmsKeyName to set. + * @return This builder for chaining. + */ + public Builder setKmsKeyName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + kmsKeyName_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Immutable. KMS key name used for data encryption.
+     * 
+ * + * string kms_key_name = 13 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return This builder for chaining. + */ + public Builder clearKmsKeyName() { + + kmsKeyName_ = getDefaultInstance().getKmsKeyName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Immutable. KMS key name used for data encryption.
+     * 
+ * + * string kms_key_name = 13 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @param value The bytes for kmsKeyName to set. + * @return This builder for chaining. + */ + public Builder setKmsKeyNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + kmsKeyName_ = value; + onChanged(); + return this; + } + @java.lang.Override public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { return super.setUnknownFields(unknownFields); diff --git a/java-filestore/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/BackupOrBuilder.java b/java-filestore/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/BackupOrBuilder.java index 3a2865c6762f..d9e1d4e6603e 100644 --- a/java-filestore/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/BackupOrBuilder.java +++ b/java-filestore/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/BackupOrBuilder.java @@ -234,7 +234,7 @@ java.lang.String getLabelsOrDefault( * * *
-   * The resource name of the source Cloud Filestore instance, in the format
+   * The resource name of the source Filestore instance, in the format
    * `projects/{project_id}/locations/{location_id}/instances/{instance_id}`,
    * used to create this backup.
    * 
@@ -248,7 +248,7 @@ java.lang.String getLabelsOrDefault( * * *
-   * The resource name of the source Cloud Filestore instance, in the format
+   * The resource name of the source Filestore instance, in the format
    * `projects/{project_id}/locations/{location_id}/instances/{instance_id}`,
    * used to create this backup.
    * 
@@ -263,7 +263,7 @@ java.lang.String getLabelsOrDefault( * * *
-   * Name of the file share in the source Cloud Filestore instance that the
+   * Name of the file share in the source Filestore instance that the
    * backup is created from.
    * 
* @@ -276,7 +276,7 @@ java.lang.String getLabelsOrDefault( * * *
-   * Name of the file share in the source Cloud Filestore instance that the
+   * Name of the file share in the source Filestore instance that the
    * backup is created from.
    * 
* @@ -290,7 +290,7 @@ java.lang.String getLabelsOrDefault( * * *
-   * Output only. The service tier of the source Cloud Filestore instance that this backup
+   * Output only. The service tier of the source Filestore instance that this backup
    * is created from.
    * 
* @@ -305,7 +305,7 @@ java.lang.String getLabelsOrDefault( * * *
-   * Output only. The service tier of the source Cloud Filestore instance that this backup
+   * Output only. The service tier of the source Filestore instance that this backup
    * is created from.
    * 
* @@ -370,4 +370,29 @@ java.lang.String getLabelsOrDefault( * */ com.google.protobuf.BoolValueOrBuilder getSatisfiesPzsOrBuilder(); + + /** + * + * + *
+   * Immutable. KMS key name used for data encryption.
+   * 
+ * + * string kms_key_name = 13 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return The kmsKeyName. + */ + java.lang.String getKmsKeyName(); + /** + * + * + *
+   * Immutable. KMS key name used for data encryption.
+   * 
+ * + * string kms_key_name = 13 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return The bytes for kmsKeyName. + */ + com.google.protobuf.ByteString getKmsKeyNameBytes(); } diff --git a/java-filestore/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/CloudFilestoreServiceProto.java b/java-filestore/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/CloudFilestoreServiceProto.java index 016b03950556..b1e955c7dee7 100644 --- a/java-filestore/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/CloudFilestoreServiceProto.java +++ b/java-filestore/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/CloudFilestoreServiceProto.java @@ -63,6 +63,10 @@ public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry r internal_static_google_cloud_filestore_v1beta1_RestoreInstanceRequest_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_google_cloud_filestore_v1beta1_RestoreInstanceRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_filestore_v1beta1_RevertInstanceRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_filestore_v1beta1_RevertInstanceRequest_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_cloud_filestore_v1beta1_DeleteInstanceRequest_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable @@ -83,6 +87,30 @@ public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry r internal_static_google_cloud_filestore_v1beta1_Snapshot_LabelsEntry_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_google_cloud_filestore_v1beta1_Snapshot_LabelsEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_filestore_v1beta1_CreateSnapshotRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_filestore_v1beta1_CreateSnapshotRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_filestore_v1beta1_GetSnapshotRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_filestore_v1beta1_GetSnapshotRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_filestore_v1beta1_DeleteSnapshotRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_filestore_v1beta1_DeleteSnapshotRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_filestore_v1beta1_UpdateSnapshotRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_filestore_v1beta1_UpdateSnapshotRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_filestore_v1beta1_ListSnapshotsRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_filestore_v1beta1_ListSnapshotsRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_filestore_v1beta1_ListSnapshotsResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_filestore_v1beta1_ListSnapshotsResponse_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_cloud_filestore_v1beta1_Backup_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable @@ -115,6 +143,38 @@ public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry r internal_static_google_cloud_filestore_v1beta1_ListBackupsResponse_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_google_cloud_filestore_v1beta1_ListBackupsResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_filestore_v1beta1_Share_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_filestore_v1beta1_Share_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_filestore_v1beta1_Share_LabelsEntry_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_filestore_v1beta1_Share_LabelsEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_filestore_v1beta1_CreateShareRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_filestore_v1beta1_CreateShareRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_filestore_v1beta1_GetShareRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_filestore_v1beta1_GetShareRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_filestore_v1beta1_DeleteShareRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_filestore_v1beta1_DeleteShareRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_filestore_v1beta1_ListSharesRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_filestore_v1beta1_ListSharesRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_filestore_v1beta1_ListSharesResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_filestore_v1beta1_ListSharesResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_filestore_v1beta1_UpdateShareRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_filestore_v1beta1_UpdateShareRequest_fieldAccessorTable; public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { return descriptor; @@ -129,197 +189,331 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "estore.v1beta1\032\034google/api/annotations.p" + "roto\032\027google/api/client.proto\032\037google/ap" + "i/field_behavior.proto\032\031google/api/resou" - + "rce.proto\032#google/longrunning/operations" - + ".proto\032 google/protobuf/field_mask.proto" - + "\032\037google/protobuf/timestamp.proto\032\036googl" - + "e/protobuf/wrappers.proto\"\334\001\n\rNetworkCon" - + "fig\022\017\n\007network\030\001 \001(\t\022H\n\005modes\030\003 \003(\01629.go" - + "ogle.cloud.filestore.v1beta1.NetworkConf" - + "ig.AddressMode\022\031\n\021reserved_ip_range\030\004 \001(" - + "\t\022\031\n\014ip_addresses\030\005 \003(\tB\003\340A\003\":\n\013AddressM" - + "ode\022\034\n\030ADDRESS_MODE_UNSPECIFIED\020\000\022\r\n\tMOD" - + "E_IPV4\020\001\"\306\001\n\017FileShareConfig\022\014\n\004name\030\001 \001" - + "(\t\022\023\n\013capacity_gb\030\002 \001(\003\0228\n\rsource_backup" - + "\030\t \001(\tB\037\372A\034\n\032file.googleapis.com/BackupH" - + "\000\022L\n\022nfs_export_options\030\010 \003(\01320.google.c" - + "loud.filestore.v1beta1.NfsExportOptionsB" - + "\010\n\006source\"\207\003\n\020NfsExportOptions\022\021\n\tip_ran" - + "ges\030\001 \003(\t\022P\n\013access_mode\030\002 \001(\0162;.google." - + "cloud.filestore.v1beta1.NfsExportOptions" - + ".AccessMode\022P\n\013squash_mode\030\003 \001(\0162;.googl" - + "e.cloud.filestore.v1beta1.NfsExportOptio" - + "ns.SquashMode\022\020\n\010anon_uid\030\004 \001(\003\022\020\n\010anon_" - + "gid\030\005 \001(\003\"H\n\nAccessMode\022\033\n\027ACCESS_MODE_U" - + "NSPECIFIED\020\000\022\r\n\tREAD_ONLY\020\001\022\016\n\nREAD_WRIT" - + "E\020\002\"N\n\nSquashMode\022\033\n\027SQUASH_MODE_UNSPECI" - + "FIED\020\000\022\022\n\016NO_ROOT_SQUASH\020\001\022\017\n\013ROOT_SQUAS" - + "H\020\002\"\204\007\n\010Instance\022\021\n\004name\030\001 \001(\tB\003\340A\003\022\023\n\013d" - + "escription\030\002 \001(\t\022B\n\005state\030\005 \001(\0162..google" - + ".cloud.filestore.v1beta1.Instance.StateB" - + "\003\340A\003\022\033\n\016status_message\030\006 \001(\tB\003\340A\003\0224\n\013cre" - + "ate_time\030\007 \001(\0132\032.google.protobuf.Timesta" - + "mpB\003\340A\003\022;\n\004tier\030\010 \001(\0162-.google.cloud.fil" - + "estore.v1beta1.Instance.Tier\022D\n\006labels\030\t" - + " \003(\01324.google.cloud.filestore.v1beta1.In" - + "stance.LabelsEntry\022D\n\013file_shares\030\n \003(\0132" - + "/.google.cloud.filestore.v1beta1.FileSha" - + "reConfig\022?\n\010networks\030\013 \003(\0132-.google.clou" - + "d.filestore.v1beta1.NetworkConfig\022\014\n\004eta" - + "g\030\014 \001(\t\0226\n\rsatisfies_pzs\030\r \001(\0132\032.google." - + "protobuf.BoolValueB\003\340A\003\032-\n\013LabelsEntry\022\013" - + "\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001\"n\n\005State\022" - + "\025\n\021STATE_UNSPECIFIED\020\000\022\014\n\010CREATING\020\001\022\t\n\005" - + "READY\020\002\022\r\n\tREPAIRING\020\003\022\014\n\010DELETING\020\004\022\t\n\005" - + "ERROR\020\006\022\r\n\tRESTORING\020\007\"i\n\004Tier\022\024\n\020TIER_U" - + "NSPECIFIED\020\000\022\014\n\010STANDARD\020\001\022\013\n\007PREMIUM\020\002\022" - + "\r\n\tBASIC_HDD\020\003\022\r\n\tBASIC_SSD\020\004\022\022\n\016HIGH_SC" - + "ALE_SSD\020\006:_\352A\\\n\034file.googleapis.com/Inst" - + "ance\022\"2/v1" - + "beta1/{parent=projects/*/locations/*}/in" - + "stances:\010instance\332A\033parent,instance,inst" - + "ance_id\312A1\n\010Instance\022%google.cloud.commo" - + "n.OperationMetadata\022\201\002\n\016UpdateInstance\0225" - + ".google.cloud.filestore.v1beta1.UpdateIn" - + "stanceRequest\032\035.google.longrunning.Opera" - + "tion\"\230\001\202\323\344\223\002G2;/v1beta1/{instance.name=p" - + "rojects/*/locations/*/instances/*}:\010inst" - + "ance\332A\024instance,update_mask\312A1\n\010Instance" - + "\022%google.cloud.common.OperationMetadata\022" - + "\343\001\n\017RestoreInstance\0226.google.cloud.files" - + "tore.v1beta1.RestoreInstanceRequest\032\035.go" - + "ogle.longrunning.Operation\"y\202\323\344\223\002?\":/v1b" - + "eta1/{name=projects/*/locations/*/instan" - + "ces/*}:restore:\001*\312A1\n\010Instance\022%google.c" - + "loud.common.OperationMetadata\022\353\001\n\016Delete" - + "Instance\0225.google.cloud.filestore.v1beta" - + "1.DeleteInstanceRequest\032\035.google.longrun" - + "ning.Operation\"\202\001\202\323\344\223\0024*2/v1beta1/{name=" + + "rce.proto\032,google/cloud/common/operation" + + "_metadata.proto\032#google/longrunning/oper" + + "ations.proto\032 google/protobuf/field_mask" + + ".proto\032\037google/protobuf/timestamp.proto\032" + + "\036google/protobuf/wrappers.proto\"\212\003\n\rNetw" + + "orkConfig\022\017\n\007network\030\001 \001(\t\022H\n\005modes\030\003 \003(" + + "\01629.google.cloud.filestore.v1beta1.Netwo" + + "rkConfig.AddressMode\022\031\n\021reserved_ip_rang" + + "e\030\004 \001(\t\022\031\n\014ip_addresses\030\005 \003(\tB\003\340A\003\022O\n\014co" + + "nnect_mode\030\006 \001(\01629.google.cloud.filestor" + + "e.v1beta1.NetworkConfig.ConnectMode\":\n\013A" + + "ddressMode\022\034\n\030ADDRESS_MODE_UNSPECIFIED\020\000" + + "\022\r\n\tMODE_IPV4\020\001\"[\n\013ConnectMode\022\034\n\030CONNEC" + + "T_MODE_UNSPECIFIED\020\000\022\022\n\016DIRECT_PEERING\020\001" + + "\022\032\n\026PRIVATE_SERVICE_ACCESS\020\002\"\306\001\n\017FileSha" + + "reConfig\022\014\n\004name\030\001 \001(\t\022\023\n\013capacity_gb\030\002 " + + "\001(\003\0228\n\rsource_backup\030\t \001(\tB\037\372A\034\n\032file.go" + + "ogleapis.com/BackupH\000\022L\n\022nfs_export_opti" + + "ons\030\010 \003(\01320.google.cloud.filestore.v1bet" + + "a1.NfsExportOptionsB\010\n\006source\"\207\003\n\020NfsExp" + + "ortOptions\022\021\n\tip_ranges\030\001 \003(\t\022P\n\013access_" + + "mode\030\002 \001(\0162;.google.cloud.filestore.v1be" + + "ta1.NfsExportOptions.AccessMode\022P\n\013squas" + + "h_mode\030\003 \001(\0162;.google.cloud.filestore.v1" + + "beta1.NfsExportOptions.SquashMode\022\020\n\010ano" + + "n_uid\030\004 \001(\003\022\020\n\010anon_gid\030\005 \001(\003\"H\n\nAccessM" + + "ode\022\033\n\027ACCESS_MODE_UNSPECIFIED\020\000\022\r\n\tREAD" + + "_ONLY\020\001\022\016\n\nREAD_WRITE\020\002\"N\n\nSquashMode\022\033\n" + + "\027SQUASH_MODE_UNSPECIFIED\020\000\022\022\n\016NO_ROOT_SQ" + + "UASH\020\001\022\017\n\013ROOT_SQUASH\020\002\"\237\n\n\010Instance\022\021\n\004" + + "name\030\001 \001(\tB\003\340A\003\022\023\n\013description\030\002 \001(\t\022B\n\005" + + "state\030\005 \001(\0162..google.cloud.filestore.v1b" + + "eta1.Instance.StateB\003\340A\003\022\033\n\016status_messa" + + "ge\030\006 \001(\tB\003\340A\003\0224\n\013create_time\030\007 \001(\0132\032.goo" + + "gle.protobuf.TimestampB\003\340A\003\022;\n\004tier\030\010 \001(" + + "\0162-.google.cloud.filestore.v1beta1.Insta" + + "nce.Tier\022D\n\006labels\030\t \003(\01324.google.cloud." + + "filestore.v1beta1.Instance.LabelsEntry\022D" + + "\n\013file_shares\030\n \003(\0132/.google.cloud.files" + + "tore.v1beta1.FileShareConfig\022?\n\010networks" + + "\030\013 \003(\0132-.google.cloud.filestore.v1beta1." + + "NetworkConfig\022\014\n\004etag\030\014 \001(\t\0226\n\rsatisfies" + + "_pzs\030\r \001(\0132\032.google.protobuf.BoolValueB\003" + + "\340A\003\022\024\n\014kms_key_name\030\016 \001(\t\022Z\n\022suspension_" + + "reasons\030\017 \003(\01629.google.cloud.filestore.v" + + "1beta1.Instance.SuspensionReasonB\003\340A\003\022\034\n" + + "\017max_capacity_gb\030\020 \001(\003B\003\340A\003\022\"\n\025capacity_" + + "step_size_gb\030\021 \001(\003B\003\340A\003\022\034\n\017max_share_cou" + + "nt\030\022 \001(\003B\003\340A\003\022\023\n\013capacity_gb\030\023 \001(\003\022\033\n\023mu" + + "lti_share_enabled\030\024 \001(\010\032-\n\013LabelsEntry\022\013" + + "\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001\"\252\001\n\005State" + + "\022\025\n\021STATE_UNSPECIFIED\020\000\022\014\n\010CREATING\020\001\022\t\n" + + "\005READY\020\002\022\r\n\tREPAIRING\020\003\022\014\n\010DELETING\020\004\022\t\n" + + "\005ERROR\020\006\022\r\n\tRESTORING\020\007\022\r\n\tSUSPENDED\020\010\022\r" + + "\n\tREVERTING\020\t\022\016\n\nSUSPENDING\020\n\022\014\n\010RESUMIN" + + "G\020\013\"y\n\004Tier\022\024\n\020TIER_UNSPECIFIED\020\000\022\014\n\010STA" + + "NDARD\020\001\022\013\n\007PREMIUM\020\002\022\r\n\tBASIC_HDD\020\003\022\r\n\tB" + + "ASIC_SSD\020\004\022\022\n\016HIGH_SCALE_SSD\020\006\022\016\n\nENTERP" + + "RISE\020\007\"H\n\020SuspensionReason\022!\n\035SUSPENSION" + + "_REASON_UNSPECIFIED\020\000\022\021\n\rKMS_KEY_ISSUE\020\001" + + ":_\352A\\\n\034file.googleapis.com/Instance\022\n\025google.protobuf.Empty\022%google.clo" - + "ud.common.OperationMetadata\022\271\001\n\013ListBack" - + "ups\0222.google.cloud.filestore.v1beta1.Lis" - + "tBackupsRequest\0323.google.cloud.filestore" - + ".v1beta1.ListBackupsResponse\"A\202\323\344\223\0022\0220/v" - + "1beta1/{parent=projects/*/locations/*}/b" - + "ackups\332A\006parent\022\246\001\n\tGetBackup\0220.google.c" - + "loud.filestore.v1beta1.GetBackupRequest\032" - + "&.google.cloud.filestore.v1beta1.Backup\"" - + "?\202\323\344\223\0022\0220/v1beta1/{name=projects/*/locat" - + "ions/*/backups/*}\332A\004name\022\361\001\n\014CreateBacku" - + "p\0223.google.cloud.filestore.v1beta1.Creat" - + "eBackupRequest\032\035.google.longrunning.Oper" - + "ation\"\214\001\202\323\344\223\002:\"0/v1beta1/{parent=project" - + "s/*/locations/*}/backups:\006backup\332A\027paren" - + "t,backup,backup_id\312A/\n\006Backup\022%google.cl" - + "oud.common.OperationMetadata\022\345\001\n\014DeleteB" - + "ackup\0223.google.cloud.filestore.v1beta1.D" - + "eleteBackupRequest\032\035.google.longrunning." - + "Operation\"\200\001\202\323\344\223\0022*0/v1beta1/{name=proje" - + "cts/*/locations/*/backups/*}\332A\004name\312A>\n\025" - + "google.protobuf.Empty\022%google.cloud.comm" - + "on.OperationMetadata\022\363\001\n\014UpdateBackup\0223." - + "google.cloud.filestore.v1beta1.UpdateBac" - + "kupRequest\032\035.google.longrunning.Operatio" - + "n\"\216\001\202\323\344\223\002A27/v1beta1/{backup.name=projec" - + "ts/*/locations/*/backups/*}:\006backup\332A\022ba" - + "ckup,update_mask\312A/\n\006Backup\022%google.clou" - + "d.common.OperationMetadata\032G\312A\023file.goog" - + "leapis.com\322A.https://www.googleapis.com/" - + "auth/cloud-platformB\315\001\n\"com.google.cloud" - + ".filestore.v1beta1B\032CloudFilestoreServic" - + "eProtoP\001ZGgoogle.golang.org/genproto/goo" - + "gleapis/cloud/filestore/v1beta1;filestor" - + "e\252\002\036Google.Cloud.Filestore.V1Beta1\312\002\036Goo" - + "gle\\Cloud\\Filestore\\V1beta1b\006proto3" + + "me\022\377\001\n\016CreateInstance\0225.google.cloud.fil" + + "estore.v1beta1.CreateInstanceRequest\032\035.g" + + "oogle.longrunning.Operation\"\226\001\202\323\344\223\002>\"2/v" + + "1beta1/{parent=projects/*/locations/*}/i" + + "nstances:\010instance\332A\033parent,instance,ins" + + "tance_id\312A1\n\010Instance\022%google.cloud.comm" + + "on.OperationMetadata\022\201\002\n\016UpdateInstance\022" + + "5.google.cloud.filestore.v1beta1.UpdateI" + + "nstanceRequest\032\035.google.longrunning.Oper" + + "ation\"\230\001\202\323\344\223\002G2;/v1beta1/{instance.name=" + + "projects/*/locations/*/instances/*}:\010ins" + + "tance\332A\024instance,update_mask\312A1\n\010Instanc" + + "e\022%google.cloud.common.OperationMetadata" + + "\022\343\001\n\017RestoreInstance\0226.google.cloud.file" + + "store.v1beta1.RestoreInstanceRequest\032\035.g" + + "oogle.longrunning.Operation\"y\202\323\344\223\002?\":/v1" + + "beta1/{name=projects/*/locations/*/insta" + + "nces/*}:restore:\001*\312A1\n\010Instance\022%google." + + "cloud.common.OperationMetadata\022\340\001\n\016Rever" + + "tInstance\0225.google.cloud.filestore.v1bet" + + "a1.RevertInstanceRequest\032\035.google.longru" + + "nning.Operation\"x\202\323\344\223\002>\"9/v1beta1/{name=" + + "projects/*/locations/*/instances/*}:reve" + + "rt:\001*\312A1\n\010Instance\022%google.cloud.common." + + "OperationMetadata\022\353\001\n\016DeleteInstance\0225.g" + + "oogle.cloud.filestore.v1beta1.DeleteInst" + + "anceRequest\032\035.google.longrunning.Operati" + + "on\"\202\001\202\323\344\223\0024*2/v1beta1/{name=projects/*/l" + + "ocations/*/instances/*}\332A\004name\312A>\n\025googl" + + "e.protobuf.Empty\022%google.cloud.common.Op" + + "erationMetadata\022\315\001\n\rListSnapshots\0224.goog" + + "le.cloud.filestore.v1beta1.ListSnapshots" + + "Request\0325.google.cloud.filestore.v1beta1" + + ".ListSnapshotsResponse\"O\202\323\344\223\002@\022>/v1beta1" + + "/{parent=projects/*/locations/*/instance" + + "s/*}/snapshots\332A\006parent\022\272\001\n\013GetSnapshot\022" + + "2.google.cloud.filestore.v1beta1.GetSnap" + + "shotRequest\032(.google.cloud.filestore.v1b" + + "eta1.Snapshot\"M\202\323\344\223\002@\022>/v1beta1/{name=pr" + + "ojects/*/locations/*/instances/*/snapsho" + + "ts/*}\332A\004name\022\213\002\n\016CreateSnapshot\0225.google" + + ".cloud.filestore.v1beta1.CreateSnapshotR" + + "equest\032\035.google.longrunning.Operation\"\242\001" + + "\202\323\344\223\002J\">/v1beta1/{parent=projects/*/loca" + + "tions/*/instances/*}/snapshots:\010snapshot" + + "\332A\033parent,snapshot,snapshot_id\312A1\n\010Snaps" + + "hot\022%google.cloud.common.OperationMetada" + + "ta\022\367\001\n\016DeleteSnapshot\0225.google.cloud.fil" + + "estore.v1beta1.DeleteSnapshotRequest\032\035.g" + + "oogle.longrunning.Operation\"\216\001\202\323\344\223\002@*>/v" + + "1beta1/{name=projects/*/locations/*/inst" + + "ances/*/snapshots/*}\332A\004name\312A>\n\025google.p" + + "rotobuf.Empty\022%google.cloud.common.Opera" + + "tionMetadata\022\215\002\n\016UpdateSnapshot\0225.google" + + ".cloud.filestore.v1beta1.UpdateSnapshotR" + + "equest\032\035.google.longrunning.Operation\"\244\001" + + "\202\323\344\223\002S2G/v1beta1/{snapshot.name=projects" + + "/*/locations/*/instances/*/snapshots/*}:" + + "\010snapshot\332A\024snapshot,update_mask\312A1\n\010Sna" + + "pshot\022%google.cloud.common.OperationMeta" + + "data\022\271\001\n\013ListBackups\0222.google.cloud.file" + + "store.v1beta1.ListBackupsRequest\0323.googl" + + "e.cloud.filestore.v1beta1.ListBackupsRes" + + "ponse\"A\202\323\344\223\0022\0220/v1beta1/{parent=projects" + + "/*/locations/*}/backups\332A\006parent\022\246\001\n\tGet" + + "Backup\0220.google.cloud.filestore.v1beta1." + + "GetBackupRequest\032&.google.cloud.filestor" + + "e.v1beta1.Backup\"?\202\323\344\223\0022\0220/v1beta1/{name" + + "=projects/*/locations/*/backups/*}\332A\004nam" + + "e\022\361\001\n\014CreateBackup\0223.google.cloud.filest" + + "ore.v1beta1.CreateBackupRequest\032\035.google" + + ".longrunning.Operation\"\214\001\202\323\344\223\002:\"0/v1beta" + + "1/{parent=projects/*/locations/*}/backup" + + "s:\006backup\332A\027parent,backup,backup_id\312A/\n\006" + + "Backup\022%google.cloud.common.OperationMet" + + "adata\022\345\001\n\014DeleteBackup\0223.google.cloud.fi" + + "lestore.v1beta1.DeleteBackupRequest\032\035.go" + + "ogle.longrunning.Operation\"\200\001\202\323\344\223\0022*0/v1" + + "beta1/{name=projects/*/locations/*/backu" + + "ps/*}\332A\004name\312A>\n\025google.protobuf.Empty\022%" + + "google.cloud.common.OperationMetadata\022\363\001" + + "\n\014UpdateBackup\0223.google.cloud.filestore." + + "v1beta1.UpdateBackupRequest\032\035.google.lon" + + "grunning.Operation\"\216\001\202\323\344\223\002A27/v1beta1/{b" + + "ackup.name=projects/*/locations/*/backup" + + "s/*}:\006backup\332A\022backup,update_mask\312A/\n\006Ba" + + "ckup\022%google.cloud.common.OperationMetad" + + "ata\022\301\001\n\nListShares\0221.google.cloud.filest" + + "ore.v1beta1.ListSharesRequest\0322.google.c" + + "loud.filestore.v1beta1.ListSharesRespons" + + "e\"L\202\323\344\223\002=\022;/v1beta1/{parent=projects/*/l" + + "ocations/*/instances/*}/shares\332A\006parent\022" + + "\256\001\n\010GetShare\022/.google.cloud.filestore.v1" + + "beta1.GetShareRequest\032%.google.cloud.fil" + + "estore.v1beta1.Share\"J\202\323\344\223\002=\022;/v1beta1/{" + + "name=projects/*/locations/*/instances/*/" + + "shares/*}\332A\004name\022\366\001\n\013CreateShare\0222.googl" + + "e.cloud.filestore.v1beta1.CreateShareReq" + + "uest\032\035.google.longrunning.Operation\"\223\001\202\323" + + "\344\223\002D\";/v1beta1/{parent=projects/*/locati" + + "ons/*/instances/*}/shares:\005share\332A\025paren" + + "t,share,share_id\312A.\n\005Share\022%google.cloud" + + ".common.OperationMetadata\022\356\001\n\013DeleteShar" + + "e\0222.google.cloud.filestore.v1beta1.Delet" + + "eShareRequest\032\035.google.longrunning.Opera" + + "tion\"\213\001\202\323\344\223\002=*;/v1beta1/{name=projects/*" + + "/locations/*/instances/*/shares/*}\332A\004nam" + + "e\312A>\n\025google.protobuf.Empty\022%google.clou" + + "d.common.OperationMetadata\022\370\001\n\013UpdateSha" + + "re\0222.google.cloud.filestore.v1beta1.Upda" + + "teShareRequest\032\035.google.longrunning.Oper" + + "ation\"\225\001\202\323\344\223\002J2A/v1beta1/{share.name=pro" + + "jects/*/locations/*/instances/*/shares/*" + + "}:\005share\332A\021share,update_mask\312A.\n\005Share\022%" + + "google.cloud.common.OperationMetadata\032G\312" + + "A\023file.googleapis.com\322A.https://www.goog" + + "leapis.com/auth/cloud-platformB\315\001\n\"com.g" + + "oogle.cloud.filestore.v1beta1B\032CloudFile" + + "storeServiceProtoP\001ZGgoogle.golang.org/g" + + "enproto/googleapis/cloud/filestore/v1bet" + + "a1;filestore\252\002\036Google.Cloud.Filestore.V1" + + "Beta1\312\002\036Google\\Cloud\\Filestore\\V1beta1b\006" + + "proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( @@ -329,6 +523,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { com.google.api.ClientProto.getDescriptor(), com.google.api.FieldBehaviorProto.getDescriptor(), com.google.api.ResourceProto.getDescriptor(), + com.google.cloud.common.OperationMetadataOuterClass.getDescriptor(), com.google.longrunning.OperationsProto.getDescriptor(), com.google.protobuf.FieldMaskProto.getDescriptor(), com.google.protobuf.TimestampProto.getDescriptor(), @@ -340,7 +535,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_filestore_v1beta1_NetworkConfig_descriptor, new java.lang.String[] { - "Network", "Modes", "ReservedIpRange", "IpAddresses", + "Network", "Modes", "ReservedIpRange", "IpAddresses", "ConnectMode", }); internal_static_google_cloud_filestore_v1beta1_FileShareConfig_descriptor = getDescriptor().getMessageTypes().get(1); @@ -375,6 +570,13 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Networks", "Etag", "SatisfiesPzs", + "KmsKeyName", + "SuspensionReasons", + "MaxCapacityGb", + "CapacityStepSizeGb", + "MaxShareCount", + "CapacityGb", + "MultiShareEnabled", }); internal_static_google_cloud_filestore_v1beta1_Instance_LabelsEntry_descriptor = internal_static_google_cloud_filestore_v1beta1_Instance_descriptor.getNestedTypes().get(0); @@ -416,16 +618,24 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { new java.lang.String[] { "Name", "FileShare", "SourceSnapshot", "SourceBackup", "Source", }); - internal_static_google_cloud_filestore_v1beta1_DeleteInstanceRequest_descriptor = + internal_static_google_cloud_filestore_v1beta1_RevertInstanceRequest_descriptor = getDescriptor().getMessageTypes().get(8); + internal_static_google_cloud_filestore_v1beta1_RevertInstanceRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_filestore_v1beta1_RevertInstanceRequest_descriptor, + new java.lang.String[] { + "Name", "TargetSnapshotId", + }); + internal_static_google_cloud_filestore_v1beta1_DeleteInstanceRequest_descriptor = + getDescriptor().getMessageTypes().get(9); internal_static_google_cloud_filestore_v1beta1_DeleteInstanceRequest_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_filestore_v1beta1_DeleteInstanceRequest_descriptor, new java.lang.String[] { - "Name", + "Name", "Force", }); internal_static_google_cloud_filestore_v1beta1_ListInstancesRequest_descriptor = - getDescriptor().getMessageTypes().get(9); + getDescriptor().getMessageTypes().get(10); internal_static_google_cloud_filestore_v1beta1_ListInstancesRequest_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_filestore_v1beta1_ListInstancesRequest_descriptor, @@ -433,7 +643,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Parent", "PageSize", "PageToken", "OrderBy", "Filter", }); internal_static_google_cloud_filestore_v1beta1_ListInstancesResponse_descriptor = - getDescriptor().getMessageTypes().get(10); + getDescriptor().getMessageTypes().get(11); internal_static_google_cloud_filestore_v1beta1_ListInstancesResponse_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_filestore_v1beta1_ListInstancesResponse_descriptor, @@ -441,7 +651,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Instances", "NextPageToken", "Unreachable", }); internal_static_google_cloud_filestore_v1beta1_Snapshot_descriptor = - getDescriptor().getMessageTypes().get(11); + getDescriptor().getMessageTypes().get(12); internal_static_google_cloud_filestore_v1beta1_Snapshot_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_filestore_v1beta1_Snapshot_descriptor, @@ -456,8 +666,56 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { new java.lang.String[] { "Key", "Value", }); + internal_static_google_cloud_filestore_v1beta1_CreateSnapshotRequest_descriptor = + getDescriptor().getMessageTypes().get(13); + internal_static_google_cloud_filestore_v1beta1_CreateSnapshotRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_filestore_v1beta1_CreateSnapshotRequest_descriptor, + new java.lang.String[] { + "Parent", "SnapshotId", "Snapshot", + }); + internal_static_google_cloud_filestore_v1beta1_GetSnapshotRequest_descriptor = + getDescriptor().getMessageTypes().get(14); + internal_static_google_cloud_filestore_v1beta1_GetSnapshotRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_filestore_v1beta1_GetSnapshotRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_cloud_filestore_v1beta1_DeleteSnapshotRequest_descriptor = + getDescriptor().getMessageTypes().get(15); + internal_static_google_cloud_filestore_v1beta1_DeleteSnapshotRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_filestore_v1beta1_DeleteSnapshotRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_cloud_filestore_v1beta1_UpdateSnapshotRequest_descriptor = + getDescriptor().getMessageTypes().get(16); + internal_static_google_cloud_filestore_v1beta1_UpdateSnapshotRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_filestore_v1beta1_UpdateSnapshotRequest_descriptor, + new java.lang.String[] { + "UpdateMask", "Snapshot", + }); + internal_static_google_cloud_filestore_v1beta1_ListSnapshotsRequest_descriptor = + getDescriptor().getMessageTypes().get(17); + internal_static_google_cloud_filestore_v1beta1_ListSnapshotsRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_filestore_v1beta1_ListSnapshotsRequest_descriptor, + new java.lang.String[] { + "Parent", "PageSize", "PageToken", "OrderBy", "Filter", + }); + internal_static_google_cloud_filestore_v1beta1_ListSnapshotsResponse_descriptor = + getDescriptor().getMessageTypes().get(18); + internal_static_google_cloud_filestore_v1beta1_ListSnapshotsResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_filestore_v1beta1_ListSnapshotsResponse_descriptor, + new java.lang.String[] { + "Snapshots", "NextPageToken", + }); internal_static_google_cloud_filestore_v1beta1_Backup_descriptor = - getDescriptor().getMessageTypes().get(12); + getDescriptor().getMessageTypes().get(19); internal_static_google_cloud_filestore_v1beta1_Backup_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_filestore_v1beta1_Backup_descriptor, @@ -474,6 +732,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "SourceInstanceTier", "DownloadBytes", "SatisfiesPzs", + "KmsKeyName", }); internal_static_google_cloud_filestore_v1beta1_Backup_LabelsEntry_descriptor = internal_static_google_cloud_filestore_v1beta1_Backup_descriptor.getNestedTypes().get(0); @@ -484,7 +743,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Key", "Value", }); internal_static_google_cloud_filestore_v1beta1_CreateBackupRequest_descriptor = - getDescriptor().getMessageTypes().get(13); + getDescriptor().getMessageTypes().get(20); internal_static_google_cloud_filestore_v1beta1_CreateBackupRequest_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_filestore_v1beta1_CreateBackupRequest_descriptor, @@ -492,7 +751,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Parent", "Backup", "BackupId", }); internal_static_google_cloud_filestore_v1beta1_DeleteBackupRequest_descriptor = - getDescriptor().getMessageTypes().get(14); + getDescriptor().getMessageTypes().get(21); internal_static_google_cloud_filestore_v1beta1_DeleteBackupRequest_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_filestore_v1beta1_DeleteBackupRequest_descriptor, @@ -500,7 +759,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Name", }); internal_static_google_cloud_filestore_v1beta1_UpdateBackupRequest_descriptor = - getDescriptor().getMessageTypes().get(15); + getDescriptor().getMessageTypes().get(22); internal_static_google_cloud_filestore_v1beta1_UpdateBackupRequest_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_filestore_v1beta1_UpdateBackupRequest_descriptor, @@ -508,7 +767,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Backup", "UpdateMask", }); internal_static_google_cloud_filestore_v1beta1_GetBackupRequest_descriptor = - getDescriptor().getMessageTypes().get(16); + getDescriptor().getMessageTypes().get(23); internal_static_google_cloud_filestore_v1beta1_GetBackupRequest_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_filestore_v1beta1_GetBackupRequest_descriptor, @@ -516,7 +775,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Name", }); internal_static_google_cloud_filestore_v1beta1_ListBackupsRequest_descriptor = - getDescriptor().getMessageTypes().get(17); + getDescriptor().getMessageTypes().get(24); internal_static_google_cloud_filestore_v1beta1_ListBackupsRequest_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_filestore_v1beta1_ListBackupsRequest_descriptor, @@ -524,13 +783,84 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Parent", "PageSize", "PageToken", "OrderBy", "Filter", }); internal_static_google_cloud_filestore_v1beta1_ListBackupsResponse_descriptor = - getDescriptor().getMessageTypes().get(18); + getDescriptor().getMessageTypes().get(25); internal_static_google_cloud_filestore_v1beta1_ListBackupsResponse_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_filestore_v1beta1_ListBackupsResponse_descriptor, new java.lang.String[] { "Backups", "NextPageToken", "Unreachable", }); + internal_static_google_cloud_filestore_v1beta1_Share_descriptor = + getDescriptor().getMessageTypes().get(26); + internal_static_google_cloud_filestore_v1beta1_Share_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_filestore_v1beta1_Share_descriptor, + new java.lang.String[] { + "Name", + "MountName", + "Description", + "CapacityGb", + "NfsExportOptions", + "State", + "CreateTime", + "Labels", + }); + internal_static_google_cloud_filestore_v1beta1_Share_LabelsEntry_descriptor = + internal_static_google_cloud_filestore_v1beta1_Share_descriptor.getNestedTypes().get(0); + internal_static_google_cloud_filestore_v1beta1_Share_LabelsEntry_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_filestore_v1beta1_Share_LabelsEntry_descriptor, + new java.lang.String[] { + "Key", "Value", + }); + internal_static_google_cloud_filestore_v1beta1_CreateShareRequest_descriptor = + getDescriptor().getMessageTypes().get(27); + internal_static_google_cloud_filestore_v1beta1_CreateShareRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_filestore_v1beta1_CreateShareRequest_descriptor, + new java.lang.String[] { + "Parent", "ShareId", "Share", + }); + internal_static_google_cloud_filestore_v1beta1_GetShareRequest_descriptor = + getDescriptor().getMessageTypes().get(28); + internal_static_google_cloud_filestore_v1beta1_GetShareRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_filestore_v1beta1_GetShareRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_cloud_filestore_v1beta1_DeleteShareRequest_descriptor = + getDescriptor().getMessageTypes().get(29); + internal_static_google_cloud_filestore_v1beta1_DeleteShareRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_filestore_v1beta1_DeleteShareRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_cloud_filestore_v1beta1_ListSharesRequest_descriptor = + getDescriptor().getMessageTypes().get(30); + internal_static_google_cloud_filestore_v1beta1_ListSharesRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_filestore_v1beta1_ListSharesRequest_descriptor, + new java.lang.String[] { + "Parent", "PageSize", "PageToken", "OrderBy", "Filter", + }); + internal_static_google_cloud_filestore_v1beta1_ListSharesResponse_descriptor = + getDescriptor().getMessageTypes().get(31); + internal_static_google_cloud_filestore_v1beta1_ListSharesResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_filestore_v1beta1_ListSharesResponse_descriptor, + new java.lang.String[] { + "Shares", "NextPageToken", "Unreachable", + }); + internal_static_google_cloud_filestore_v1beta1_UpdateShareRequest_descriptor = + getDescriptor().getMessageTypes().get(32); + internal_static_google_cloud_filestore_v1beta1_UpdateShareRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_filestore_v1beta1_UpdateShareRequest_descriptor, + new java.lang.String[] { + "Share", "UpdateMask", + }); com.google.protobuf.ExtensionRegistry registry = com.google.protobuf.ExtensionRegistry.newInstance(); registry.add(com.google.api.ClientProto.defaultHost); @@ -547,6 +877,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { com.google.api.ClientProto.getDescriptor(); com.google.api.FieldBehaviorProto.getDescriptor(); com.google.api.ResourceProto.getDescriptor(); + com.google.cloud.common.OperationMetadataOuterClass.getDescriptor(); com.google.longrunning.OperationsProto.getDescriptor(); com.google.protobuf.FieldMaskProto.getDescriptor(); com.google.protobuf.TimestampProto.getDescriptor(); diff --git a/java-filestore/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/CreateBackupRequest.java b/java-filestore/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/CreateBackupRequest.java index 87740c030692..c0612a3e8447 100644 --- a/java-filestore/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/CreateBackupRequest.java +++ b/java-filestore/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/CreateBackupRequest.java @@ -75,7 +75,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { * *
    * Required. The backup's project and location, in the format
-   * `projects/{project_id}/locations/{location}`. In Cloud Filestore,
+   * `projects/{project_id}/locations/{location}`. In Filestore,
    * backup locations map to GCP regions, for example **us-west1**.
    * 
* @@ -102,7 +102,7 @@ public java.lang.String getParent() { * *
    * Required. The backup's project and location, in the format
-   * `projects/{project_id}/locations/{location}`. In Cloud Filestore,
+   * `projects/{project_id}/locations/{location}`. In Filestore,
    * backup locations map to GCP regions, for example **us-west1**.
    * 
* @@ -627,7 +627,7 @@ public Builder mergeFrom( * *
      * Required. The backup's project and location, in the format
-     * `projects/{project_id}/locations/{location}`. In Cloud Filestore,
+     * `projects/{project_id}/locations/{location}`. In Filestore,
      * backup locations map to GCP regions, for example **us-west1**.
      * 
* @@ -653,7 +653,7 @@ public java.lang.String getParent() { * *
      * Required. The backup's project and location, in the format
-     * `projects/{project_id}/locations/{location}`. In Cloud Filestore,
+     * `projects/{project_id}/locations/{location}`. In Filestore,
      * backup locations map to GCP regions, for example **us-west1**.
      * 
* @@ -679,7 +679,7 @@ public com.google.protobuf.ByteString getParentBytes() { * *
      * Required. The backup's project and location, in the format
-     * `projects/{project_id}/locations/{location}`. In Cloud Filestore,
+     * `projects/{project_id}/locations/{location}`. In Filestore,
      * backup locations map to GCP regions, for example **us-west1**.
      * 
* @@ -704,7 +704,7 @@ public Builder setParent(java.lang.String value) { * *
      * Required. The backup's project and location, in the format
-     * `projects/{project_id}/locations/{location}`. In Cloud Filestore,
+     * `projects/{project_id}/locations/{location}`. In Filestore,
      * backup locations map to GCP regions, for example **us-west1**.
      * 
* @@ -725,7 +725,7 @@ public Builder clearParent() { * *
      * Required. The backup's project and location, in the format
-     * `projects/{project_id}/locations/{location}`. In Cloud Filestore,
+     * `projects/{project_id}/locations/{location}`. In Filestore,
      * backup locations map to GCP regions, for example **us-west1**.
      * 
* diff --git a/java-filestore/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/CreateBackupRequestOrBuilder.java b/java-filestore/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/CreateBackupRequestOrBuilder.java index fcb6f4a8aeec..8c671834baec 100644 --- a/java-filestore/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/CreateBackupRequestOrBuilder.java +++ b/java-filestore/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/CreateBackupRequestOrBuilder.java @@ -28,7 +28,7 @@ public interface CreateBackupRequestOrBuilder * *
    * Required. The backup's project and location, in the format
-   * `projects/{project_id}/locations/{location}`. In Cloud Filestore,
+   * `projects/{project_id}/locations/{location}`. In Filestore,
    * backup locations map to GCP regions, for example **us-west1**.
    * 
* @@ -44,7 +44,7 @@ public interface CreateBackupRequestOrBuilder * *
    * Required. The backup's project and location, in the format
-   * `projects/{project_id}/locations/{location}`. In Cloud Filestore,
+   * `projects/{project_id}/locations/{location}`. In Filestore,
    * backup locations map to GCP regions, for example **us-west1**.
    * 
* diff --git a/java-filestore/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/CreateInstanceRequest.java b/java-filestore/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/CreateInstanceRequest.java index ff1ae26da768..98840df7c52b 100644 --- a/java-filestore/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/CreateInstanceRequest.java +++ b/java-filestore/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/CreateInstanceRequest.java @@ -75,7 +75,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { * *
    * Required. The instance's project and location, in the format
-   * `projects/{project_id}/locations/{location}`. In Cloud Filestore,
+   * `projects/{project_id}/locations/{location}`. In Filestore,
    * locations map to GCP zones, for example **us-west1-b**.
    * 
* @@ -102,7 +102,7 @@ public java.lang.String getParent() { * *
    * Required. The instance's project and location, in the format
-   * `projects/{project_id}/locations/{location}`. In Cloud Filestore,
+   * `projects/{project_id}/locations/{location}`. In Filestore,
    * locations map to GCP zones, for example **us-west1-b**.
    * 
* @@ -627,7 +627,7 @@ public Builder mergeFrom( * *
      * Required. The instance's project and location, in the format
-     * `projects/{project_id}/locations/{location}`. In Cloud Filestore,
+     * `projects/{project_id}/locations/{location}`. In Filestore,
      * locations map to GCP zones, for example **us-west1-b**.
      * 
* @@ -653,7 +653,7 @@ public java.lang.String getParent() { * *
      * Required. The instance's project and location, in the format
-     * `projects/{project_id}/locations/{location}`. In Cloud Filestore,
+     * `projects/{project_id}/locations/{location}`. In Filestore,
      * locations map to GCP zones, for example **us-west1-b**.
      * 
* @@ -679,7 +679,7 @@ public com.google.protobuf.ByteString getParentBytes() { * *
      * Required. The instance's project and location, in the format
-     * `projects/{project_id}/locations/{location}`. In Cloud Filestore,
+     * `projects/{project_id}/locations/{location}`. In Filestore,
      * locations map to GCP zones, for example **us-west1-b**.
      * 
* @@ -704,7 +704,7 @@ public Builder setParent(java.lang.String value) { * *
      * Required. The instance's project and location, in the format
-     * `projects/{project_id}/locations/{location}`. In Cloud Filestore,
+     * `projects/{project_id}/locations/{location}`. In Filestore,
      * locations map to GCP zones, for example **us-west1-b**.
      * 
* @@ -725,7 +725,7 @@ public Builder clearParent() { * *
      * Required. The instance's project and location, in the format
-     * `projects/{project_id}/locations/{location}`. In Cloud Filestore,
+     * `projects/{project_id}/locations/{location}`. In Filestore,
      * locations map to GCP zones, for example **us-west1-b**.
      * 
* diff --git a/java-filestore/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/CreateInstanceRequestOrBuilder.java b/java-filestore/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/CreateInstanceRequestOrBuilder.java index 4460055d6fbf..3feed1ab7be4 100644 --- a/java-filestore/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/CreateInstanceRequestOrBuilder.java +++ b/java-filestore/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/CreateInstanceRequestOrBuilder.java @@ -28,7 +28,7 @@ public interface CreateInstanceRequestOrBuilder * *
    * Required. The instance's project and location, in the format
-   * `projects/{project_id}/locations/{location}`. In Cloud Filestore,
+   * `projects/{project_id}/locations/{location}`. In Filestore,
    * locations map to GCP zones, for example **us-west1-b**.
    * 
* @@ -44,7 +44,7 @@ public interface CreateInstanceRequestOrBuilder * *
    * Required. The instance's project and location, in the format
-   * `projects/{project_id}/locations/{location}`. In Cloud Filestore,
+   * `projects/{project_id}/locations/{location}`. In Filestore,
    * locations map to GCP zones, for example **us-west1-b**.
    * 
* diff --git a/java-filestore/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/CreateShareRequest.java b/java-filestore/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/CreateShareRequest.java new file mode 100644 index 000000000000..2a0395f8b606 --- /dev/null +++ b/java-filestore/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/CreateShareRequest.java @@ -0,0 +1,1125 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/filestore/v1beta1/cloud_filestore_service.proto + +package com.google.cloud.filestore.v1beta1; + +/** + * + * + *
+ * CreateShareRequest creates a share.
+ * 
+ * + * Protobuf type {@code google.cloud.filestore.v1beta1.CreateShareRequest} + */ +public final class CreateShareRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.filestore.v1beta1.CreateShareRequest) + CreateShareRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use CreateShareRequest.newBuilder() to construct. + private CreateShareRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CreateShareRequest() { + parent_ = ""; + shareId_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new CreateShareRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.filestore.v1beta1.CloudFilestoreServiceProto + .internal_static_google_cloud_filestore_v1beta1_CreateShareRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.filestore.v1beta1.CloudFilestoreServiceProto + .internal_static_google_cloud_filestore_v1beta1_CreateShareRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.filestore.v1beta1.CreateShareRequest.class, + com.google.cloud.filestore.v1beta1.CreateShareRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + * + * + *
+   * Required. The Filestore Instance to create the share for, in the format
+   * `projects/{project_id}/locations/{location}/instances/{instance_id}`
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + @java.lang.Override + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The Filestore Instance to create the share for, in the format
+   * `projects/{project_id}/locations/{location}/instances/{instance_id}`
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + @java.lang.Override + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SHARE_ID_FIELD_NUMBER = 2; + private volatile java.lang.Object shareId_; + /** + * + * + *
+   * Required. The ID to use for the share.
+   * The ID must be unique within the specified instance.
+   * This value must start with a lowercase letter followed by up to 62
+   * lowercase letters, numbers, or hyphens, and cannot end with a hyphen.
+   * 
+ * + * string share_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The shareId. + */ + @java.lang.Override + public java.lang.String getShareId() { + java.lang.Object ref = shareId_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + shareId_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The ID to use for the share.
+   * The ID must be unique within the specified instance.
+   * This value must start with a lowercase letter followed by up to 62
+   * lowercase letters, numbers, or hyphens, and cannot end with a hyphen.
+   * 
+ * + * string share_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for shareId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getShareIdBytes() { + java.lang.Object ref = shareId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + shareId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SHARE_FIELD_NUMBER = 3; + private com.google.cloud.filestore.v1beta1.Share share_; + /** + * + * + *
+   * Required. A share resource
+   * 
+ * + * + * .google.cloud.filestore.v1beta1.Share share = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the share field is set. + */ + @java.lang.Override + public boolean hasShare() { + return share_ != null; + } + /** + * + * + *
+   * Required. A share resource
+   * 
+ * + * + * .google.cloud.filestore.v1beta1.Share share = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The share. + */ + @java.lang.Override + public com.google.cloud.filestore.v1beta1.Share getShare() { + return share_ == null ? com.google.cloud.filestore.v1beta1.Share.getDefaultInstance() : share_; + } + /** + * + * + *
+   * Required. A share resource
+   * 
+ * + * + * .google.cloud.filestore.v1beta1.Share share = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.filestore.v1beta1.ShareOrBuilder getShareOrBuilder() { + return getShare(); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(shareId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, shareId_); + } + if (share_ != null) { + output.writeMessage(3, getShare()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(shareId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, shareId_); + } + if (share_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getShare()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.filestore.v1beta1.CreateShareRequest)) { + return super.equals(obj); + } + com.google.cloud.filestore.v1beta1.CreateShareRequest other = + (com.google.cloud.filestore.v1beta1.CreateShareRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (!getShareId().equals(other.getShareId())) return false; + if (hasShare() != other.hasShare()) return false; + if (hasShare()) { + if (!getShare().equals(other.getShare())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + hash = (37 * hash) + SHARE_ID_FIELD_NUMBER; + hash = (53 * hash) + getShareId().hashCode(); + if (hasShare()) { + hash = (37 * hash) + SHARE_FIELD_NUMBER; + hash = (53 * hash) + getShare().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.filestore.v1beta1.CreateShareRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.filestore.v1beta1.CreateShareRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.filestore.v1beta1.CreateShareRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.filestore.v1beta1.CreateShareRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.filestore.v1beta1.CreateShareRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.filestore.v1beta1.CreateShareRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.filestore.v1beta1.CreateShareRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.filestore.v1beta1.CreateShareRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.filestore.v1beta1.CreateShareRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.filestore.v1beta1.CreateShareRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.filestore.v1beta1.CreateShareRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.filestore.v1beta1.CreateShareRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.filestore.v1beta1.CreateShareRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * CreateShareRequest creates a share.
+   * 
+ * + * Protobuf type {@code google.cloud.filestore.v1beta1.CreateShareRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.filestore.v1beta1.CreateShareRequest) + com.google.cloud.filestore.v1beta1.CreateShareRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.filestore.v1beta1.CloudFilestoreServiceProto + .internal_static_google_cloud_filestore_v1beta1_CreateShareRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.filestore.v1beta1.CloudFilestoreServiceProto + .internal_static_google_cloud_filestore_v1beta1_CreateShareRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.filestore.v1beta1.CreateShareRequest.class, + com.google.cloud.filestore.v1beta1.CreateShareRequest.Builder.class); + } + + // Construct using com.google.cloud.filestore.v1beta1.CreateShareRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + parent_ = ""; + + shareId_ = ""; + + if (shareBuilder_ == null) { + share_ = null; + } else { + share_ = null; + shareBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.filestore.v1beta1.CloudFilestoreServiceProto + .internal_static_google_cloud_filestore_v1beta1_CreateShareRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.filestore.v1beta1.CreateShareRequest getDefaultInstanceForType() { + return com.google.cloud.filestore.v1beta1.CreateShareRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.filestore.v1beta1.CreateShareRequest build() { + com.google.cloud.filestore.v1beta1.CreateShareRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.filestore.v1beta1.CreateShareRequest buildPartial() { + com.google.cloud.filestore.v1beta1.CreateShareRequest result = + new com.google.cloud.filestore.v1beta1.CreateShareRequest(this); + result.parent_ = parent_; + result.shareId_ = shareId_; + if (shareBuilder_ == null) { + result.share_ = share_; + } else { + result.share_ = shareBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.filestore.v1beta1.CreateShareRequest) { + return mergeFrom((com.google.cloud.filestore.v1beta1.CreateShareRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.filestore.v1beta1.CreateShareRequest other) { + if (other == com.google.cloud.filestore.v1beta1.CreateShareRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + onChanged(); + } + if (!other.getShareId().isEmpty()) { + shareId_ = other.shareId_; + onChanged(); + } + if (other.hasShare()) { + mergeShare(other.getShare()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + parent_ = input.readStringRequireUtf8(); + + break; + } // case 10 + case 18: + { + shareId_ = input.readStringRequireUtf8(); + + break; + } // case 18 + case 26: + { + input.readMessage(getShareFieldBuilder().getBuilder(), extensionRegistry); + + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. The Filestore Instance to create the share for, in the format
+     * `projects/{project_id}/locations/{location}/instances/{instance_id}`
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The Filestore Instance to create the share for, in the format
+     * `projects/{project_id}/locations/{location}/instances/{instance_id}`
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The Filestore Instance to create the share for, in the format
+     * `projects/{project_id}/locations/{location}/instances/{instance_id}`
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The parent to set. + * @return This builder for chaining. + */ + public Builder setParent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + parent_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The Filestore Instance to create the share for, in the format
+     * `projects/{project_id}/locations/{location}/instances/{instance_id}`
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + + parent_ = getDefaultInstance().getParent(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The Filestore Instance to create the share for, in the format
+     * `projects/{project_id}/locations/{location}/instances/{instance_id}`
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for parent to set. + * @return This builder for chaining. + */ + public Builder setParentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + parent_ = value; + onChanged(); + return this; + } + + private java.lang.Object shareId_ = ""; + /** + * + * + *
+     * Required. The ID to use for the share.
+     * The ID must be unique within the specified instance.
+     * This value must start with a lowercase letter followed by up to 62
+     * lowercase letters, numbers, or hyphens, and cannot end with a hyphen.
+     * 
+ * + * string share_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The shareId. + */ + public java.lang.String getShareId() { + java.lang.Object ref = shareId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + shareId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The ID to use for the share.
+     * The ID must be unique within the specified instance.
+     * This value must start with a lowercase letter followed by up to 62
+     * lowercase letters, numbers, or hyphens, and cannot end with a hyphen.
+     * 
+ * + * string share_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for shareId. + */ + public com.google.protobuf.ByteString getShareIdBytes() { + java.lang.Object ref = shareId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + shareId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The ID to use for the share.
+     * The ID must be unique within the specified instance.
+     * This value must start with a lowercase letter followed by up to 62
+     * lowercase letters, numbers, or hyphens, and cannot end with a hyphen.
+     * 
+ * + * string share_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The shareId to set. + * @return This builder for chaining. + */ + public Builder setShareId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + shareId_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The ID to use for the share.
+     * The ID must be unique within the specified instance.
+     * This value must start with a lowercase letter followed by up to 62
+     * lowercase letters, numbers, or hyphens, and cannot end with a hyphen.
+     * 
+ * + * string share_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearShareId() { + + shareId_ = getDefaultInstance().getShareId(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The ID to use for the share.
+     * The ID must be unique within the specified instance.
+     * This value must start with a lowercase letter followed by up to 62
+     * lowercase letters, numbers, or hyphens, and cannot end with a hyphen.
+     * 
+ * + * string share_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for shareId to set. + * @return This builder for chaining. + */ + public Builder setShareIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + shareId_ = value; + onChanged(); + return this; + } + + private com.google.cloud.filestore.v1beta1.Share share_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.filestore.v1beta1.Share, + com.google.cloud.filestore.v1beta1.Share.Builder, + com.google.cloud.filestore.v1beta1.ShareOrBuilder> + shareBuilder_; + /** + * + * + *
+     * Required. A share resource
+     * 
+ * + * + * .google.cloud.filestore.v1beta1.Share share = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the share field is set. + */ + public boolean hasShare() { + return shareBuilder_ != null || share_ != null; + } + /** + * + * + *
+     * Required. A share resource
+     * 
+ * + * + * .google.cloud.filestore.v1beta1.Share share = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The share. + */ + public com.google.cloud.filestore.v1beta1.Share getShare() { + if (shareBuilder_ == null) { + return share_ == null + ? com.google.cloud.filestore.v1beta1.Share.getDefaultInstance() + : share_; + } else { + return shareBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. A share resource
+     * 
+ * + * + * .google.cloud.filestore.v1beta1.Share share = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setShare(com.google.cloud.filestore.v1beta1.Share value) { + if (shareBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + share_ = value; + onChanged(); + } else { + shareBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Required. A share resource
+     * 
+ * + * + * .google.cloud.filestore.v1beta1.Share share = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setShare(com.google.cloud.filestore.v1beta1.Share.Builder builderForValue) { + if (shareBuilder_ == null) { + share_ = builderForValue.build(); + onChanged(); + } else { + shareBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Required. A share resource
+     * 
+ * + * + * .google.cloud.filestore.v1beta1.Share share = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeShare(com.google.cloud.filestore.v1beta1.Share value) { + if (shareBuilder_ == null) { + if (share_ != null) { + share_ = + com.google.cloud.filestore.v1beta1.Share.newBuilder(share_) + .mergeFrom(value) + .buildPartial(); + } else { + share_ = value; + } + onChanged(); + } else { + shareBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Required. A share resource
+     * 
+ * + * + * .google.cloud.filestore.v1beta1.Share share = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearShare() { + if (shareBuilder_ == null) { + share_ = null; + onChanged(); + } else { + share_ = null; + shareBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Required. A share resource
+     * 
+ * + * + * .google.cloud.filestore.v1beta1.Share share = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.filestore.v1beta1.Share.Builder getShareBuilder() { + + onChanged(); + return getShareFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. A share resource
+     * 
+ * + * + * .google.cloud.filestore.v1beta1.Share share = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.filestore.v1beta1.ShareOrBuilder getShareOrBuilder() { + if (shareBuilder_ != null) { + return shareBuilder_.getMessageOrBuilder(); + } else { + return share_ == null + ? com.google.cloud.filestore.v1beta1.Share.getDefaultInstance() + : share_; + } + } + /** + * + * + *
+     * Required. A share resource
+     * 
+ * + * + * .google.cloud.filestore.v1beta1.Share share = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.filestore.v1beta1.Share, + com.google.cloud.filestore.v1beta1.Share.Builder, + com.google.cloud.filestore.v1beta1.ShareOrBuilder> + getShareFieldBuilder() { + if (shareBuilder_ == null) { + shareBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.filestore.v1beta1.Share, + com.google.cloud.filestore.v1beta1.Share.Builder, + com.google.cloud.filestore.v1beta1.ShareOrBuilder>( + getShare(), getParentForChildren(), isClean()); + share_ = null; + } + return shareBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.filestore.v1beta1.CreateShareRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.filestore.v1beta1.CreateShareRequest) + private static final com.google.cloud.filestore.v1beta1.CreateShareRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.filestore.v1beta1.CreateShareRequest(); + } + + public static com.google.cloud.filestore.v1beta1.CreateShareRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CreateShareRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.filestore.v1beta1.CreateShareRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-filestore/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/CreateShareRequestOrBuilder.java b/java-filestore/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/CreateShareRequestOrBuilder.java new file mode 100644 index 000000000000..29fab7024ec6 --- /dev/null +++ b/java-filestore/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/CreateShareRequestOrBuilder.java @@ -0,0 +1,128 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/filestore/v1beta1/cloud_filestore_service.proto + +package com.google.cloud.filestore.v1beta1; + +public interface CreateShareRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.filestore.v1beta1.CreateShareRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The Filestore Instance to create the share for, in the format
+   * `projects/{project_id}/locations/{location}/instances/{instance_id}`
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. The Filestore Instance to create the share for, in the format
+   * `projects/{project_id}/locations/{location}/instances/{instance_id}`
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Required. The ID to use for the share.
+   * The ID must be unique within the specified instance.
+   * This value must start with a lowercase letter followed by up to 62
+   * lowercase letters, numbers, or hyphens, and cannot end with a hyphen.
+   * 
+ * + * string share_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The shareId. + */ + java.lang.String getShareId(); + /** + * + * + *
+   * Required. The ID to use for the share.
+   * The ID must be unique within the specified instance.
+   * This value must start with a lowercase letter followed by up to 62
+   * lowercase letters, numbers, or hyphens, and cannot end with a hyphen.
+   * 
+ * + * string share_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for shareId. + */ + com.google.protobuf.ByteString getShareIdBytes(); + + /** + * + * + *
+   * Required. A share resource
+   * 
+ * + * + * .google.cloud.filestore.v1beta1.Share share = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the share field is set. + */ + boolean hasShare(); + /** + * + * + *
+   * Required. A share resource
+   * 
+ * + * + * .google.cloud.filestore.v1beta1.Share share = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The share. + */ + com.google.cloud.filestore.v1beta1.Share getShare(); + /** + * + * + *
+   * Required. A share resource
+   * 
+ * + * + * .google.cloud.filestore.v1beta1.Share share = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.filestore.v1beta1.ShareOrBuilder getShareOrBuilder(); +} diff --git a/java-filestore/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/CreateSnapshotRequest.java b/java-filestore/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/CreateSnapshotRequest.java new file mode 100644 index 000000000000..8ded8547058b --- /dev/null +++ b/java-filestore/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/CreateSnapshotRequest.java @@ -0,0 +1,1128 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/filestore/v1beta1/cloud_filestore_service.proto + +package com.google.cloud.filestore.v1beta1; + +/** + * + * + *
+ * CreateSnapshotRequest creates a snapshot.
+ * 
+ * + * Protobuf type {@code google.cloud.filestore.v1beta1.CreateSnapshotRequest} + */ +public final class CreateSnapshotRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.filestore.v1beta1.CreateSnapshotRequest) + CreateSnapshotRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use CreateSnapshotRequest.newBuilder() to construct. + private CreateSnapshotRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CreateSnapshotRequest() { + parent_ = ""; + snapshotId_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new CreateSnapshotRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.filestore.v1beta1.CloudFilestoreServiceProto + .internal_static_google_cloud_filestore_v1beta1_CreateSnapshotRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.filestore.v1beta1.CloudFilestoreServiceProto + .internal_static_google_cloud_filestore_v1beta1_CreateSnapshotRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.filestore.v1beta1.CreateSnapshotRequest.class, + com.google.cloud.filestore.v1beta1.CreateSnapshotRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + * + * + *
+   * Required. The Filestore Instance to create the snapshots of, in the format
+   * `projects/{project_id}/locations/{location}/instances/{instance_id}`
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + @java.lang.Override + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The Filestore Instance to create the snapshots of, in the format
+   * `projects/{project_id}/locations/{location}/instances/{instance_id}`
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + @java.lang.Override + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SNAPSHOT_ID_FIELD_NUMBER = 2; + private volatile java.lang.Object snapshotId_; + /** + * + * + *
+   * Required. The ID to use for the snapshot.
+   * The ID must be unique within the specified instance.
+   * This value must start with a lowercase letter followed by up to 62
+   * lowercase letters, numbers, or hyphens, and cannot end with a hyphen.
+   * 
+ * + * string snapshot_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The snapshotId. + */ + @java.lang.Override + public java.lang.String getSnapshotId() { + java.lang.Object ref = snapshotId_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + snapshotId_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The ID to use for the snapshot.
+   * The ID must be unique within the specified instance.
+   * This value must start with a lowercase letter followed by up to 62
+   * lowercase letters, numbers, or hyphens, and cannot end with a hyphen.
+   * 
+ * + * string snapshot_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for snapshotId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getSnapshotIdBytes() { + java.lang.Object ref = snapshotId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + snapshotId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SNAPSHOT_FIELD_NUMBER = 3; + private com.google.cloud.filestore.v1beta1.Snapshot snapshot_; + /** + * + * + *
+   * Required. A snapshot resource
+   * 
+ * + * + * .google.cloud.filestore.v1beta1.Snapshot snapshot = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the snapshot field is set. + */ + @java.lang.Override + public boolean hasSnapshot() { + return snapshot_ != null; + } + /** + * + * + *
+   * Required. A snapshot resource
+   * 
+ * + * + * .google.cloud.filestore.v1beta1.Snapshot snapshot = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The snapshot. + */ + @java.lang.Override + public com.google.cloud.filestore.v1beta1.Snapshot getSnapshot() { + return snapshot_ == null + ? com.google.cloud.filestore.v1beta1.Snapshot.getDefaultInstance() + : snapshot_; + } + /** + * + * + *
+   * Required. A snapshot resource
+   * 
+ * + * + * .google.cloud.filestore.v1beta1.Snapshot snapshot = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.filestore.v1beta1.SnapshotOrBuilder getSnapshotOrBuilder() { + return getSnapshot(); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(snapshotId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, snapshotId_); + } + if (snapshot_ != null) { + output.writeMessage(3, getSnapshot()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(snapshotId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, snapshotId_); + } + if (snapshot_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getSnapshot()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.filestore.v1beta1.CreateSnapshotRequest)) { + return super.equals(obj); + } + com.google.cloud.filestore.v1beta1.CreateSnapshotRequest other = + (com.google.cloud.filestore.v1beta1.CreateSnapshotRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (!getSnapshotId().equals(other.getSnapshotId())) return false; + if (hasSnapshot() != other.hasSnapshot()) return false; + if (hasSnapshot()) { + if (!getSnapshot().equals(other.getSnapshot())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + hash = (37 * hash) + SNAPSHOT_ID_FIELD_NUMBER; + hash = (53 * hash) + getSnapshotId().hashCode(); + if (hasSnapshot()) { + hash = (37 * hash) + SNAPSHOT_FIELD_NUMBER; + hash = (53 * hash) + getSnapshot().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.filestore.v1beta1.CreateSnapshotRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.filestore.v1beta1.CreateSnapshotRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.filestore.v1beta1.CreateSnapshotRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.filestore.v1beta1.CreateSnapshotRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.filestore.v1beta1.CreateSnapshotRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.filestore.v1beta1.CreateSnapshotRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.filestore.v1beta1.CreateSnapshotRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.filestore.v1beta1.CreateSnapshotRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.filestore.v1beta1.CreateSnapshotRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.filestore.v1beta1.CreateSnapshotRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.filestore.v1beta1.CreateSnapshotRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.filestore.v1beta1.CreateSnapshotRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.filestore.v1beta1.CreateSnapshotRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * CreateSnapshotRequest creates a snapshot.
+   * 
+ * + * Protobuf type {@code google.cloud.filestore.v1beta1.CreateSnapshotRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.filestore.v1beta1.CreateSnapshotRequest) + com.google.cloud.filestore.v1beta1.CreateSnapshotRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.filestore.v1beta1.CloudFilestoreServiceProto + .internal_static_google_cloud_filestore_v1beta1_CreateSnapshotRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.filestore.v1beta1.CloudFilestoreServiceProto + .internal_static_google_cloud_filestore_v1beta1_CreateSnapshotRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.filestore.v1beta1.CreateSnapshotRequest.class, + com.google.cloud.filestore.v1beta1.CreateSnapshotRequest.Builder.class); + } + + // Construct using com.google.cloud.filestore.v1beta1.CreateSnapshotRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + parent_ = ""; + + snapshotId_ = ""; + + if (snapshotBuilder_ == null) { + snapshot_ = null; + } else { + snapshot_ = null; + snapshotBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.filestore.v1beta1.CloudFilestoreServiceProto + .internal_static_google_cloud_filestore_v1beta1_CreateSnapshotRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.filestore.v1beta1.CreateSnapshotRequest getDefaultInstanceForType() { + return com.google.cloud.filestore.v1beta1.CreateSnapshotRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.filestore.v1beta1.CreateSnapshotRequest build() { + com.google.cloud.filestore.v1beta1.CreateSnapshotRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.filestore.v1beta1.CreateSnapshotRequest buildPartial() { + com.google.cloud.filestore.v1beta1.CreateSnapshotRequest result = + new com.google.cloud.filestore.v1beta1.CreateSnapshotRequest(this); + result.parent_ = parent_; + result.snapshotId_ = snapshotId_; + if (snapshotBuilder_ == null) { + result.snapshot_ = snapshot_; + } else { + result.snapshot_ = snapshotBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.filestore.v1beta1.CreateSnapshotRequest) { + return mergeFrom((com.google.cloud.filestore.v1beta1.CreateSnapshotRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.filestore.v1beta1.CreateSnapshotRequest other) { + if (other == com.google.cloud.filestore.v1beta1.CreateSnapshotRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + onChanged(); + } + if (!other.getSnapshotId().isEmpty()) { + snapshotId_ = other.snapshotId_; + onChanged(); + } + if (other.hasSnapshot()) { + mergeSnapshot(other.getSnapshot()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + parent_ = input.readStringRequireUtf8(); + + break; + } // case 10 + case 18: + { + snapshotId_ = input.readStringRequireUtf8(); + + break; + } // case 18 + case 26: + { + input.readMessage(getSnapshotFieldBuilder().getBuilder(), extensionRegistry); + + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. The Filestore Instance to create the snapshots of, in the format
+     * `projects/{project_id}/locations/{location}/instances/{instance_id}`
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The Filestore Instance to create the snapshots of, in the format
+     * `projects/{project_id}/locations/{location}/instances/{instance_id}`
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The Filestore Instance to create the snapshots of, in the format
+     * `projects/{project_id}/locations/{location}/instances/{instance_id}`
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The parent to set. + * @return This builder for chaining. + */ + public Builder setParent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + parent_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The Filestore Instance to create the snapshots of, in the format
+     * `projects/{project_id}/locations/{location}/instances/{instance_id}`
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + + parent_ = getDefaultInstance().getParent(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The Filestore Instance to create the snapshots of, in the format
+     * `projects/{project_id}/locations/{location}/instances/{instance_id}`
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for parent to set. + * @return This builder for chaining. + */ + public Builder setParentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + parent_ = value; + onChanged(); + return this; + } + + private java.lang.Object snapshotId_ = ""; + /** + * + * + *
+     * Required. The ID to use for the snapshot.
+     * The ID must be unique within the specified instance.
+     * This value must start with a lowercase letter followed by up to 62
+     * lowercase letters, numbers, or hyphens, and cannot end with a hyphen.
+     * 
+ * + * string snapshot_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The snapshotId. + */ + public java.lang.String getSnapshotId() { + java.lang.Object ref = snapshotId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + snapshotId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The ID to use for the snapshot.
+     * The ID must be unique within the specified instance.
+     * This value must start with a lowercase letter followed by up to 62
+     * lowercase letters, numbers, or hyphens, and cannot end with a hyphen.
+     * 
+ * + * string snapshot_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for snapshotId. + */ + public com.google.protobuf.ByteString getSnapshotIdBytes() { + java.lang.Object ref = snapshotId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + snapshotId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The ID to use for the snapshot.
+     * The ID must be unique within the specified instance.
+     * This value must start with a lowercase letter followed by up to 62
+     * lowercase letters, numbers, or hyphens, and cannot end with a hyphen.
+     * 
+ * + * string snapshot_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The snapshotId to set. + * @return This builder for chaining. + */ + public Builder setSnapshotId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + snapshotId_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The ID to use for the snapshot.
+     * The ID must be unique within the specified instance.
+     * This value must start with a lowercase letter followed by up to 62
+     * lowercase letters, numbers, or hyphens, and cannot end with a hyphen.
+     * 
+ * + * string snapshot_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearSnapshotId() { + + snapshotId_ = getDefaultInstance().getSnapshotId(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The ID to use for the snapshot.
+     * The ID must be unique within the specified instance.
+     * This value must start with a lowercase letter followed by up to 62
+     * lowercase letters, numbers, or hyphens, and cannot end with a hyphen.
+     * 
+ * + * string snapshot_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for snapshotId to set. + * @return This builder for chaining. + */ + public Builder setSnapshotIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + snapshotId_ = value; + onChanged(); + return this; + } + + private com.google.cloud.filestore.v1beta1.Snapshot snapshot_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.filestore.v1beta1.Snapshot, + com.google.cloud.filestore.v1beta1.Snapshot.Builder, + com.google.cloud.filestore.v1beta1.SnapshotOrBuilder> + snapshotBuilder_; + /** + * + * + *
+     * Required. A snapshot resource
+     * 
+ * + * + * .google.cloud.filestore.v1beta1.Snapshot snapshot = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the snapshot field is set. + */ + public boolean hasSnapshot() { + return snapshotBuilder_ != null || snapshot_ != null; + } + /** + * + * + *
+     * Required. A snapshot resource
+     * 
+ * + * + * .google.cloud.filestore.v1beta1.Snapshot snapshot = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The snapshot. + */ + public com.google.cloud.filestore.v1beta1.Snapshot getSnapshot() { + if (snapshotBuilder_ == null) { + return snapshot_ == null + ? com.google.cloud.filestore.v1beta1.Snapshot.getDefaultInstance() + : snapshot_; + } else { + return snapshotBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. A snapshot resource
+     * 
+ * + * + * .google.cloud.filestore.v1beta1.Snapshot snapshot = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setSnapshot(com.google.cloud.filestore.v1beta1.Snapshot value) { + if (snapshotBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + snapshot_ = value; + onChanged(); + } else { + snapshotBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Required. A snapshot resource
+     * 
+ * + * + * .google.cloud.filestore.v1beta1.Snapshot snapshot = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setSnapshot( + com.google.cloud.filestore.v1beta1.Snapshot.Builder builderForValue) { + if (snapshotBuilder_ == null) { + snapshot_ = builderForValue.build(); + onChanged(); + } else { + snapshotBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Required. A snapshot resource
+     * 
+ * + * + * .google.cloud.filestore.v1beta1.Snapshot snapshot = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeSnapshot(com.google.cloud.filestore.v1beta1.Snapshot value) { + if (snapshotBuilder_ == null) { + if (snapshot_ != null) { + snapshot_ = + com.google.cloud.filestore.v1beta1.Snapshot.newBuilder(snapshot_) + .mergeFrom(value) + .buildPartial(); + } else { + snapshot_ = value; + } + onChanged(); + } else { + snapshotBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Required. A snapshot resource
+     * 
+ * + * + * .google.cloud.filestore.v1beta1.Snapshot snapshot = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearSnapshot() { + if (snapshotBuilder_ == null) { + snapshot_ = null; + onChanged(); + } else { + snapshot_ = null; + snapshotBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Required. A snapshot resource
+     * 
+ * + * + * .google.cloud.filestore.v1beta1.Snapshot snapshot = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.filestore.v1beta1.Snapshot.Builder getSnapshotBuilder() { + + onChanged(); + return getSnapshotFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. A snapshot resource
+     * 
+ * + * + * .google.cloud.filestore.v1beta1.Snapshot snapshot = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.filestore.v1beta1.SnapshotOrBuilder getSnapshotOrBuilder() { + if (snapshotBuilder_ != null) { + return snapshotBuilder_.getMessageOrBuilder(); + } else { + return snapshot_ == null + ? com.google.cloud.filestore.v1beta1.Snapshot.getDefaultInstance() + : snapshot_; + } + } + /** + * + * + *
+     * Required. A snapshot resource
+     * 
+ * + * + * .google.cloud.filestore.v1beta1.Snapshot snapshot = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.filestore.v1beta1.Snapshot, + com.google.cloud.filestore.v1beta1.Snapshot.Builder, + com.google.cloud.filestore.v1beta1.SnapshotOrBuilder> + getSnapshotFieldBuilder() { + if (snapshotBuilder_ == null) { + snapshotBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.filestore.v1beta1.Snapshot, + com.google.cloud.filestore.v1beta1.Snapshot.Builder, + com.google.cloud.filestore.v1beta1.SnapshotOrBuilder>( + getSnapshot(), getParentForChildren(), isClean()); + snapshot_ = null; + } + return snapshotBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.filestore.v1beta1.CreateSnapshotRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.filestore.v1beta1.CreateSnapshotRequest) + private static final com.google.cloud.filestore.v1beta1.CreateSnapshotRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.filestore.v1beta1.CreateSnapshotRequest(); + } + + public static com.google.cloud.filestore.v1beta1.CreateSnapshotRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CreateSnapshotRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.filestore.v1beta1.CreateSnapshotRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-filestore/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/CreateSnapshotRequestOrBuilder.java b/java-filestore/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/CreateSnapshotRequestOrBuilder.java new file mode 100644 index 000000000000..566db50b3aa1 --- /dev/null +++ b/java-filestore/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/CreateSnapshotRequestOrBuilder.java @@ -0,0 +1,128 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/filestore/v1beta1/cloud_filestore_service.proto + +package com.google.cloud.filestore.v1beta1; + +public interface CreateSnapshotRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.filestore.v1beta1.CreateSnapshotRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The Filestore Instance to create the snapshots of, in the format
+   * `projects/{project_id}/locations/{location}/instances/{instance_id}`
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. The Filestore Instance to create the snapshots of, in the format
+   * `projects/{project_id}/locations/{location}/instances/{instance_id}`
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Required. The ID to use for the snapshot.
+   * The ID must be unique within the specified instance.
+   * This value must start with a lowercase letter followed by up to 62
+   * lowercase letters, numbers, or hyphens, and cannot end with a hyphen.
+   * 
+ * + * string snapshot_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The snapshotId. + */ + java.lang.String getSnapshotId(); + /** + * + * + *
+   * Required. The ID to use for the snapshot.
+   * The ID must be unique within the specified instance.
+   * This value must start with a lowercase letter followed by up to 62
+   * lowercase letters, numbers, or hyphens, and cannot end with a hyphen.
+   * 
+ * + * string snapshot_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for snapshotId. + */ + com.google.protobuf.ByteString getSnapshotIdBytes(); + + /** + * + * + *
+   * Required. A snapshot resource
+   * 
+ * + * + * .google.cloud.filestore.v1beta1.Snapshot snapshot = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the snapshot field is set. + */ + boolean hasSnapshot(); + /** + * + * + *
+   * Required. A snapshot resource
+   * 
+ * + * + * .google.cloud.filestore.v1beta1.Snapshot snapshot = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The snapshot. + */ + com.google.cloud.filestore.v1beta1.Snapshot getSnapshot(); + /** + * + * + *
+   * Required. A snapshot resource
+   * 
+ * + * + * .google.cloud.filestore.v1beta1.Snapshot snapshot = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.filestore.v1beta1.SnapshotOrBuilder getSnapshotOrBuilder(); +} diff --git a/java-filestore/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/DeleteInstanceRequest.java b/java-filestore/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/DeleteInstanceRequest.java index c45db5d13e27..063230cacb7a 100644 --- a/java-filestore/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/DeleteInstanceRequest.java +++ b/java-filestore/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/DeleteInstanceRequest.java @@ -122,6 +122,25 @@ public com.google.protobuf.ByteString getNameBytes() { } } + public static final int FORCE_FIELD_NUMBER = 2; + private boolean force_; + /** + * + * + *
+   * If set to true, any snapshots of the instance will also be deleted.
+   * (Otherwise, the request will only work if the instance has no snapshots.)
+   * 
+ * + * bool force = 2; + * + * @return The force. + */ + @java.lang.Override + public boolean getForce() { + return force_; + } + private byte memoizedIsInitialized = -1; @java.lang.Override @@ -139,6 +158,9 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); } + if (force_ != false) { + output.writeBool(2, force_); + } getUnknownFields().writeTo(output); } @@ -151,6 +173,9 @@ public int getSerializedSize() { if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); } + if (force_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(2, force_); + } size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; @@ -168,6 +193,7 @@ public boolean equals(final java.lang.Object obj) { (com.google.cloud.filestore.v1beta1.DeleteInstanceRequest) obj; if (!getName().equals(other.getName())) return false; + if (getForce() != other.getForce()) return false; if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -181,6 +207,8 @@ public int hashCode() { hash = (19 * hash) + getDescriptor().hashCode(); hash = (37 * hash) + NAME_FIELD_NUMBER; hash = (53 * hash) + getName().hashCode(); + hash = (37 * hash) + FORCE_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getForce()); hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; @@ -322,6 +350,8 @@ public Builder clear() { super.clear(); name_ = ""; + force_ = false; + return this; } @@ -350,6 +380,7 @@ public com.google.cloud.filestore.v1beta1.DeleteInstanceRequest buildPartial() { com.google.cloud.filestore.v1beta1.DeleteInstanceRequest result = new com.google.cloud.filestore.v1beta1.DeleteInstanceRequest(this); result.name_ = name_; + result.force_ = force_; onBuilt(); return result; } @@ -404,6 +435,9 @@ public Builder mergeFrom(com.google.cloud.filestore.v1beta1.DeleteInstanceReques name_ = other.name_; onChanged(); } + if (other.getForce() != false) { + setForce(other.getForce()); + } this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; @@ -436,6 +470,12 @@ public Builder mergeFrom( break; } // case 10 + case 16: + { + force_ = input.readBool(); + + break; + } // case 16 default: { if (!super.parseUnknownField(input, extensionRegistry, tag)) { @@ -574,6 +614,61 @@ public Builder setNameBytes(com.google.protobuf.ByteString value) { return this; } + private boolean force_; + /** + * + * + *
+     * If set to true, any snapshots of the instance will also be deleted.
+     * (Otherwise, the request will only work if the instance has no snapshots.)
+     * 
+ * + * bool force = 2; + * + * @return The force. + */ + @java.lang.Override + public boolean getForce() { + return force_; + } + /** + * + * + *
+     * If set to true, any snapshots of the instance will also be deleted.
+     * (Otherwise, the request will only work if the instance has no snapshots.)
+     * 
+ * + * bool force = 2; + * + * @param value The force to set. + * @return This builder for chaining. + */ + public Builder setForce(boolean value) { + + force_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * If set to true, any snapshots of the instance will also be deleted.
+     * (Otherwise, the request will only work if the instance has no snapshots.)
+     * 
+ * + * bool force = 2; + * + * @return This builder for chaining. + */ + public Builder clearForce() { + + force_ = false; + onChanged(); + return this; + } + @java.lang.Override public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { return super.setUnknownFields(unknownFields); diff --git a/java-filestore/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/DeleteInstanceRequestOrBuilder.java b/java-filestore/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/DeleteInstanceRequestOrBuilder.java index be30f190fbe1..2a6b8ee13512 100644 --- a/java-filestore/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/DeleteInstanceRequestOrBuilder.java +++ b/java-filestore/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/DeleteInstanceRequestOrBuilder.java @@ -53,4 +53,18 @@ public interface DeleteInstanceRequestOrBuilder * @return The bytes for name. */ com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * If set to true, any snapshots of the instance will also be deleted.
+   * (Otherwise, the request will only work if the instance has no snapshots.)
+   * 
+ * + * bool force = 2; + * + * @return The force. + */ + boolean getForce(); } diff --git a/java-filestore/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/DeleteShareRequest.java b/java-filestore/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/DeleteShareRequest.java new file mode 100644 index 000000000000..d08b5b49e5fe --- /dev/null +++ b/java-filestore/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/DeleteShareRequest.java @@ -0,0 +1,637 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/filestore/v1beta1/cloud_filestore_service.proto + +package com.google.cloud.filestore.v1beta1; + +/** + * + * + *
+ * DeleteShareRequest deletes a share.
+ * 
+ * + * Protobuf type {@code google.cloud.filestore.v1beta1.DeleteShareRequest} + */ +public final class DeleteShareRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.filestore.v1beta1.DeleteShareRequest) + DeleteShareRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use DeleteShareRequest.newBuilder() to construct. + private DeleteShareRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private DeleteShareRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new DeleteShareRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.filestore.v1beta1.CloudFilestoreServiceProto + .internal_static_google_cloud_filestore_v1beta1_DeleteShareRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.filestore.v1beta1.CloudFilestoreServiceProto + .internal_static_google_cloud_filestore_v1beta1_DeleteShareRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.filestore.v1beta1.DeleteShareRequest.class, + com.google.cloud.filestore.v1beta1.DeleteShareRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Required. The share resource name, in the format
+   * `projects/{project_id}/locations/{location}/instances/{instance_id}/share/{share_id}`
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The share resource name, in the format
+   * `projects/{project_id}/locations/{location}/instances/{instance_id}/share/{share_id}`
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.filestore.v1beta1.DeleteShareRequest)) { + return super.equals(obj); + } + com.google.cloud.filestore.v1beta1.DeleteShareRequest other = + (com.google.cloud.filestore.v1beta1.DeleteShareRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.filestore.v1beta1.DeleteShareRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.filestore.v1beta1.DeleteShareRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.filestore.v1beta1.DeleteShareRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.filestore.v1beta1.DeleteShareRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.filestore.v1beta1.DeleteShareRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.filestore.v1beta1.DeleteShareRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.filestore.v1beta1.DeleteShareRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.filestore.v1beta1.DeleteShareRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.filestore.v1beta1.DeleteShareRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.filestore.v1beta1.DeleteShareRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.filestore.v1beta1.DeleteShareRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.filestore.v1beta1.DeleteShareRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.filestore.v1beta1.DeleteShareRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * DeleteShareRequest deletes a share.
+   * 
+ * + * Protobuf type {@code google.cloud.filestore.v1beta1.DeleteShareRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.filestore.v1beta1.DeleteShareRequest) + com.google.cloud.filestore.v1beta1.DeleteShareRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.filestore.v1beta1.CloudFilestoreServiceProto + .internal_static_google_cloud_filestore_v1beta1_DeleteShareRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.filestore.v1beta1.CloudFilestoreServiceProto + .internal_static_google_cloud_filestore_v1beta1_DeleteShareRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.filestore.v1beta1.DeleteShareRequest.class, + com.google.cloud.filestore.v1beta1.DeleteShareRequest.Builder.class); + } + + // Construct using com.google.cloud.filestore.v1beta1.DeleteShareRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.filestore.v1beta1.CloudFilestoreServiceProto + .internal_static_google_cloud_filestore_v1beta1_DeleteShareRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.filestore.v1beta1.DeleteShareRequest getDefaultInstanceForType() { + return com.google.cloud.filestore.v1beta1.DeleteShareRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.filestore.v1beta1.DeleteShareRequest build() { + com.google.cloud.filestore.v1beta1.DeleteShareRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.filestore.v1beta1.DeleteShareRequest buildPartial() { + com.google.cloud.filestore.v1beta1.DeleteShareRequest result = + new com.google.cloud.filestore.v1beta1.DeleteShareRequest(this); + result.name_ = name_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.filestore.v1beta1.DeleteShareRequest) { + return mergeFrom((com.google.cloud.filestore.v1beta1.DeleteShareRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.filestore.v1beta1.DeleteShareRequest other) { + if (other == com.google.cloud.filestore.v1beta1.DeleteShareRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. The share resource name, in the format
+     * `projects/{project_id}/locations/{location}/instances/{instance_id}/share/{share_id}`
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The share resource name, in the format
+     * `projects/{project_id}/locations/{location}/instances/{instance_id}/share/{share_id}`
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The share resource name, in the format
+     * `projects/{project_id}/locations/{location}/instances/{instance_id}/share/{share_id}`
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The share resource name, in the format
+     * `projects/{project_id}/locations/{location}/instances/{instance_id}/share/{share_id}`
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The share resource name, in the format
+     * `projects/{project_id}/locations/{location}/instances/{instance_id}/share/{share_id}`
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.filestore.v1beta1.DeleteShareRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.filestore.v1beta1.DeleteShareRequest) + private static final com.google.cloud.filestore.v1beta1.DeleteShareRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.filestore.v1beta1.DeleteShareRequest(); + } + + public static com.google.cloud.filestore.v1beta1.DeleteShareRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DeleteShareRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.filestore.v1beta1.DeleteShareRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-filestore/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/DeleteShareRequestOrBuilder.java b/java-filestore/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/DeleteShareRequestOrBuilder.java new file mode 100644 index 000000000000..17734c29beda --- /dev/null +++ b/java-filestore/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/DeleteShareRequestOrBuilder.java @@ -0,0 +1,56 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/filestore/v1beta1/cloud_filestore_service.proto + +package com.google.cloud.filestore.v1beta1; + +public interface DeleteShareRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.filestore.v1beta1.DeleteShareRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The share resource name, in the format
+   * `projects/{project_id}/locations/{location}/instances/{instance_id}/share/{share_id}`
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. The share resource name, in the format
+   * `projects/{project_id}/locations/{location}/instances/{instance_id}/share/{share_id}`
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); +} diff --git a/java-filestore/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/DeleteSnapshotRequest.java b/java-filestore/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/DeleteSnapshotRequest.java new file mode 100644 index 000000000000..3d893921cd50 --- /dev/null +++ b/java-filestore/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/DeleteSnapshotRequest.java @@ -0,0 +1,637 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/filestore/v1beta1/cloud_filestore_service.proto + +package com.google.cloud.filestore.v1beta1; + +/** + * + * + *
+ * DeleteSnapshotRequest deletes a snapshot.
+ * 
+ * + * Protobuf type {@code google.cloud.filestore.v1beta1.DeleteSnapshotRequest} + */ +public final class DeleteSnapshotRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.filestore.v1beta1.DeleteSnapshotRequest) + DeleteSnapshotRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use DeleteSnapshotRequest.newBuilder() to construct. + private DeleteSnapshotRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private DeleteSnapshotRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new DeleteSnapshotRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.filestore.v1beta1.CloudFilestoreServiceProto + .internal_static_google_cloud_filestore_v1beta1_DeleteSnapshotRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.filestore.v1beta1.CloudFilestoreServiceProto + .internal_static_google_cloud_filestore_v1beta1_DeleteSnapshotRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.filestore.v1beta1.DeleteSnapshotRequest.class, + com.google.cloud.filestore.v1beta1.DeleteSnapshotRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Required. The snapshot resource name, in the format
+   * `projects/{project_id}/locations/{location}/instances/{instance_id}/snapshots/{snapshot_id}`
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The snapshot resource name, in the format
+   * `projects/{project_id}/locations/{location}/instances/{instance_id}/snapshots/{snapshot_id}`
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.filestore.v1beta1.DeleteSnapshotRequest)) { + return super.equals(obj); + } + com.google.cloud.filestore.v1beta1.DeleteSnapshotRequest other = + (com.google.cloud.filestore.v1beta1.DeleteSnapshotRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.filestore.v1beta1.DeleteSnapshotRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.filestore.v1beta1.DeleteSnapshotRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.filestore.v1beta1.DeleteSnapshotRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.filestore.v1beta1.DeleteSnapshotRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.filestore.v1beta1.DeleteSnapshotRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.filestore.v1beta1.DeleteSnapshotRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.filestore.v1beta1.DeleteSnapshotRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.filestore.v1beta1.DeleteSnapshotRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.filestore.v1beta1.DeleteSnapshotRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.filestore.v1beta1.DeleteSnapshotRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.filestore.v1beta1.DeleteSnapshotRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.filestore.v1beta1.DeleteSnapshotRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.filestore.v1beta1.DeleteSnapshotRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * DeleteSnapshotRequest deletes a snapshot.
+   * 
+ * + * Protobuf type {@code google.cloud.filestore.v1beta1.DeleteSnapshotRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.filestore.v1beta1.DeleteSnapshotRequest) + com.google.cloud.filestore.v1beta1.DeleteSnapshotRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.filestore.v1beta1.CloudFilestoreServiceProto + .internal_static_google_cloud_filestore_v1beta1_DeleteSnapshotRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.filestore.v1beta1.CloudFilestoreServiceProto + .internal_static_google_cloud_filestore_v1beta1_DeleteSnapshotRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.filestore.v1beta1.DeleteSnapshotRequest.class, + com.google.cloud.filestore.v1beta1.DeleteSnapshotRequest.Builder.class); + } + + // Construct using com.google.cloud.filestore.v1beta1.DeleteSnapshotRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.filestore.v1beta1.CloudFilestoreServiceProto + .internal_static_google_cloud_filestore_v1beta1_DeleteSnapshotRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.filestore.v1beta1.DeleteSnapshotRequest getDefaultInstanceForType() { + return com.google.cloud.filestore.v1beta1.DeleteSnapshotRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.filestore.v1beta1.DeleteSnapshotRequest build() { + com.google.cloud.filestore.v1beta1.DeleteSnapshotRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.filestore.v1beta1.DeleteSnapshotRequest buildPartial() { + com.google.cloud.filestore.v1beta1.DeleteSnapshotRequest result = + new com.google.cloud.filestore.v1beta1.DeleteSnapshotRequest(this); + result.name_ = name_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.filestore.v1beta1.DeleteSnapshotRequest) { + return mergeFrom((com.google.cloud.filestore.v1beta1.DeleteSnapshotRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.filestore.v1beta1.DeleteSnapshotRequest other) { + if (other == com.google.cloud.filestore.v1beta1.DeleteSnapshotRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. The snapshot resource name, in the format
+     * `projects/{project_id}/locations/{location}/instances/{instance_id}/snapshots/{snapshot_id}`
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The snapshot resource name, in the format
+     * `projects/{project_id}/locations/{location}/instances/{instance_id}/snapshots/{snapshot_id}`
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The snapshot resource name, in the format
+     * `projects/{project_id}/locations/{location}/instances/{instance_id}/snapshots/{snapshot_id}`
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The snapshot resource name, in the format
+     * `projects/{project_id}/locations/{location}/instances/{instance_id}/snapshots/{snapshot_id}`
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The snapshot resource name, in the format
+     * `projects/{project_id}/locations/{location}/instances/{instance_id}/snapshots/{snapshot_id}`
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.filestore.v1beta1.DeleteSnapshotRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.filestore.v1beta1.DeleteSnapshotRequest) + private static final com.google.cloud.filestore.v1beta1.DeleteSnapshotRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.filestore.v1beta1.DeleteSnapshotRequest(); + } + + public static com.google.cloud.filestore.v1beta1.DeleteSnapshotRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DeleteSnapshotRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.filestore.v1beta1.DeleteSnapshotRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-filestore/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/DeleteSnapshotRequestOrBuilder.java b/java-filestore/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/DeleteSnapshotRequestOrBuilder.java new file mode 100644 index 000000000000..d43d14ab5296 --- /dev/null +++ b/java-filestore/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/DeleteSnapshotRequestOrBuilder.java @@ -0,0 +1,56 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/filestore/v1beta1/cloud_filestore_service.proto + +package com.google.cloud.filestore.v1beta1; + +public interface DeleteSnapshotRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.filestore.v1beta1.DeleteSnapshotRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The snapshot resource name, in the format
+   * `projects/{project_id}/locations/{location}/instances/{instance_id}/snapshots/{snapshot_id}`
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. The snapshot resource name, in the format
+   * `projects/{project_id}/locations/{location}/instances/{instance_id}/snapshots/{snapshot_id}`
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); +} diff --git a/java-filestore/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/FileShareConfig.java b/java-filestore/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/FileShareConfig.java index 11d07e9e105f..1d4be21945d2 100644 --- a/java-filestore/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/FileShareConfig.java +++ b/java-filestore/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/FileShareConfig.java @@ -118,7 +118,9 @@ public SourceCase getSourceCase() { * * *
-   * The name of the file share (must be 16 characters or less).
+   * The name of the file share (must be 32 characters or less for
+   * Enterprise and High Scale SSD tiers and 16 characters or less for all other
+   * tiers).
    * 
* * string name = 1; @@ -141,7 +143,9 @@ public java.lang.String getName() { * * *
-   * The name of the file share (must be 16 characters or less).
+   * The name of the file share (must be 32 characters or less for
+   * Enterprise and High Scale SSD tiers and 16 characters or less for all other
+   * tiers).
    * 
* * string name = 1; @@ -168,7 +172,7 @@ public com.google.protobuf.ByteString getNameBytes() { * *
    * File share capacity in gigabytes (GB).
-   * Cloud Filestore defines 1 GB as 1024^3 bytes.
+   * Filestore defines 1 GB as 1024^3 bytes.
    * 
* * int64 capacity_gb = 2; @@ -821,7 +825,9 @@ public Builder clearSource() { * * *
-     * The name of the file share (must be 16 characters or less).
+     * The name of the file share (must be 32 characters or less for
+     * Enterprise and High Scale SSD tiers and 16 characters or less for all other
+     * tiers).
      * 
* * string name = 1; @@ -843,7 +849,9 @@ public java.lang.String getName() { * * *
-     * The name of the file share (must be 16 characters or less).
+     * The name of the file share (must be 32 characters or less for
+     * Enterprise and High Scale SSD tiers and 16 characters or less for all other
+     * tiers).
      * 
* * string name = 1; @@ -865,7 +873,9 @@ public com.google.protobuf.ByteString getNameBytes() { * * *
-     * The name of the file share (must be 16 characters or less).
+     * The name of the file share (must be 32 characters or less for
+     * Enterprise and High Scale SSD tiers and 16 characters or less for all other
+     * tiers).
      * 
* * string name = 1; @@ -886,7 +896,9 @@ public Builder setName(java.lang.String value) { * * *
-     * The name of the file share (must be 16 characters or less).
+     * The name of the file share (must be 32 characters or less for
+     * Enterprise and High Scale SSD tiers and 16 characters or less for all other
+     * tiers).
      * 
* * string name = 1; @@ -903,7 +915,9 @@ public Builder clearName() { * * *
-     * The name of the file share (must be 16 characters or less).
+     * The name of the file share (must be 32 characters or less for
+     * Enterprise and High Scale SSD tiers and 16 characters or less for all other
+     * tiers).
      * 
* * string name = 1; @@ -928,7 +942,7 @@ public Builder setNameBytes(com.google.protobuf.ByteString value) { * *
      * File share capacity in gigabytes (GB).
-     * Cloud Filestore defines 1 GB as 1024^3 bytes.
+     * Filestore defines 1 GB as 1024^3 bytes.
      * 
* * int64 capacity_gb = 2; @@ -944,7 +958,7 @@ public long getCapacityGb() { * *
      * File share capacity in gigabytes (GB).
-     * Cloud Filestore defines 1 GB as 1024^3 bytes.
+     * Filestore defines 1 GB as 1024^3 bytes.
      * 
* * int64 capacity_gb = 2; @@ -963,7 +977,7 @@ public Builder setCapacityGb(long value) { * *
      * File share capacity in gigabytes (GB).
-     * Cloud Filestore defines 1 GB as 1024^3 bytes.
+     * Filestore defines 1 GB as 1024^3 bytes.
      * 
* * int64 capacity_gb = 2; diff --git a/java-filestore/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/FileShareConfigOrBuilder.java b/java-filestore/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/FileShareConfigOrBuilder.java index f5fe4625118e..a2968dd626bf 100644 --- a/java-filestore/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/FileShareConfigOrBuilder.java +++ b/java-filestore/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/FileShareConfigOrBuilder.java @@ -27,7 +27,9 @@ public interface FileShareConfigOrBuilder * * *
-   * The name of the file share (must be 16 characters or less).
+   * The name of the file share (must be 32 characters or less for
+   * Enterprise and High Scale SSD tiers and 16 characters or less for all other
+   * tiers).
    * 
* * string name = 1; @@ -39,7 +41,9 @@ public interface FileShareConfigOrBuilder * * *
-   * The name of the file share (must be 16 characters or less).
+   * The name of the file share (must be 32 characters or less for
+   * Enterprise and High Scale SSD tiers and 16 characters or less for all other
+   * tiers).
    * 
* * string name = 1; @@ -53,7 +57,7 @@ public interface FileShareConfigOrBuilder * *
    * File share capacity in gigabytes (GB).
-   * Cloud Filestore defines 1 GB as 1024^3 bytes.
+   * Filestore defines 1 GB as 1024^3 bytes.
    * 
* * int64 capacity_gb = 2; diff --git a/java-filestore/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/GetShareRequest.java b/java-filestore/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/GetShareRequest.java new file mode 100644 index 000000000000..2dc7237ecde9 --- /dev/null +++ b/java-filestore/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/GetShareRequest.java @@ -0,0 +1,636 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/filestore/v1beta1/cloud_filestore_service.proto + +package com.google.cloud.filestore.v1beta1; + +/** + * + * + *
+ * GetShareRequest gets the state of a share.
+ * 
+ * + * Protobuf type {@code google.cloud.filestore.v1beta1.GetShareRequest} + */ +public final class GetShareRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.filestore.v1beta1.GetShareRequest) + GetShareRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use GetShareRequest.newBuilder() to construct. + private GetShareRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GetShareRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GetShareRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.filestore.v1beta1.CloudFilestoreServiceProto + .internal_static_google_cloud_filestore_v1beta1_GetShareRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.filestore.v1beta1.CloudFilestoreServiceProto + .internal_static_google_cloud_filestore_v1beta1_GetShareRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.filestore.v1beta1.GetShareRequest.class, + com.google.cloud.filestore.v1beta1.GetShareRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Required. The share resource name, in the format
+   * `projects/{project_id}/locations/{location}/instances/{instance_id}/shares/{share_id}`
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The share resource name, in the format
+   * `projects/{project_id}/locations/{location}/instances/{instance_id}/shares/{share_id}`
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.filestore.v1beta1.GetShareRequest)) { + return super.equals(obj); + } + com.google.cloud.filestore.v1beta1.GetShareRequest other = + (com.google.cloud.filestore.v1beta1.GetShareRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.filestore.v1beta1.GetShareRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.filestore.v1beta1.GetShareRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.filestore.v1beta1.GetShareRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.filestore.v1beta1.GetShareRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.filestore.v1beta1.GetShareRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.filestore.v1beta1.GetShareRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.filestore.v1beta1.GetShareRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.filestore.v1beta1.GetShareRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.filestore.v1beta1.GetShareRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.filestore.v1beta1.GetShareRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.filestore.v1beta1.GetShareRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.filestore.v1beta1.GetShareRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.filestore.v1beta1.GetShareRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * GetShareRequest gets the state of a share.
+   * 
+ * + * Protobuf type {@code google.cloud.filestore.v1beta1.GetShareRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.filestore.v1beta1.GetShareRequest) + com.google.cloud.filestore.v1beta1.GetShareRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.filestore.v1beta1.CloudFilestoreServiceProto + .internal_static_google_cloud_filestore_v1beta1_GetShareRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.filestore.v1beta1.CloudFilestoreServiceProto + .internal_static_google_cloud_filestore_v1beta1_GetShareRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.filestore.v1beta1.GetShareRequest.class, + com.google.cloud.filestore.v1beta1.GetShareRequest.Builder.class); + } + + // Construct using com.google.cloud.filestore.v1beta1.GetShareRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.filestore.v1beta1.CloudFilestoreServiceProto + .internal_static_google_cloud_filestore_v1beta1_GetShareRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.filestore.v1beta1.GetShareRequest getDefaultInstanceForType() { + return com.google.cloud.filestore.v1beta1.GetShareRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.filestore.v1beta1.GetShareRequest build() { + com.google.cloud.filestore.v1beta1.GetShareRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.filestore.v1beta1.GetShareRequest buildPartial() { + com.google.cloud.filestore.v1beta1.GetShareRequest result = + new com.google.cloud.filestore.v1beta1.GetShareRequest(this); + result.name_ = name_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.filestore.v1beta1.GetShareRequest) { + return mergeFrom((com.google.cloud.filestore.v1beta1.GetShareRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.filestore.v1beta1.GetShareRequest other) { + if (other == com.google.cloud.filestore.v1beta1.GetShareRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. The share resource name, in the format
+     * `projects/{project_id}/locations/{location}/instances/{instance_id}/shares/{share_id}`
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The share resource name, in the format
+     * `projects/{project_id}/locations/{location}/instances/{instance_id}/shares/{share_id}`
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The share resource name, in the format
+     * `projects/{project_id}/locations/{location}/instances/{instance_id}/shares/{share_id}`
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The share resource name, in the format
+     * `projects/{project_id}/locations/{location}/instances/{instance_id}/shares/{share_id}`
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The share resource name, in the format
+     * `projects/{project_id}/locations/{location}/instances/{instance_id}/shares/{share_id}`
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.filestore.v1beta1.GetShareRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.filestore.v1beta1.GetShareRequest) + private static final com.google.cloud.filestore.v1beta1.GetShareRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.filestore.v1beta1.GetShareRequest(); + } + + public static com.google.cloud.filestore.v1beta1.GetShareRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetShareRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.filestore.v1beta1.GetShareRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-filestore/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/GetShareRequestOrBuilder.java b/java-filestore/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/GetShareRequestOrBuilder.java new file mode 100644 index 000000000000..7bb0a84a149c --- /dev/null +++ b/java-filestore/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/GetShareRequestOrBuilder.java @@ -0,0 +1,56 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/filestore/v1beta1/cloud_filestore_service.proto + +package com.google.cloud.filestore.v1beta1; + +public interface GetShareRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.filestore.v1beta1.GetShareRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The share resource name, in the format
+   * `projects/{project_id}/locations/{location}/instances/{instance_id}/shares/{share_id}`
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. The share resource name, in the format
+   * `projects/{project_id}/locations/{location}/instances/{instance_id}/shares/{share_id}`
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); +} diff --git a/java-filestore/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/GetSnapshotRequest.java b/java-filestore/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/GetSnapshotRequest.java new file mode 100644 index 000000000000..b000c73b5390 --- /dev/null +++ b/java-filestore/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/GetSnapshotRequest.java @@ -0,0 +1,637 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/filestore/v1beta1/cloud_filestore_service.proto + +package com.google.cloud.filestore.v1beta1; + +/** + * + * + *
+ * GetSnapshotRequest gets the state of a snapshot.
+ * 
+ * + * Protobuf type {@code google.cloud.filestore.v1beta1.GetSnapshotRequest} + */ +public final class GetSnapshotRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.filestore.v1beta1.GetSnapshotRequest) + GetSnapshotRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use GetSnapshotRequest.newBuilder() to construct. + private GetSnapshotRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GetSnapshotRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GetSnapshotRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.filestore.v1beta1.CloudFilestoreServiceProto + .internal_static_google_cloud_filestore_v1beta1_GetSnapshotRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.filestore.v1beta1.CloudFilestoreServiceProto + .internal_static_google_cloud_filestore_v1beta1_GetSnapshotRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.filestore.v1beta1.GetSnapshotRequest.class, + com.google.cloud.filestore.v1beta1.GetSnapshotRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Required. The snapshot resource name, in the format
+   * `projects/{project_id}/locations/{location}/instances/{instance_id}/snapshots/{snapshot_id}`
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The snapshot resource name, in the format
+   * `projects/{project_id}/locations/{location}/instances/{instance_id}/snapshots/{snapshot_id}`
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.filestore.v1beta1.GetSnapshotRequest)) { + return super.equals(obj); + } + com.google.cloud.filestore.v1beta1.GetSnapshotRequest other = + (com.google.cloud.filestore.v1beta1.GetSnapshotRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.filestore.v1beta1.GetSnapshotRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.filestore.v1beta1.GetSnapshotRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.filestore.v1beta1.GetSnapshotRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.filestore.v1beta1.GetSnapshotRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.filestore.v1beta1.GetSnapshotRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.filestore.v1beta1.GetSnapshotRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.filestore.v1beta1.GetSnapshotRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.filestore.v1beta1.GetSnapshotRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.filestore.v1beta1.GetSnapshotRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.filestore.v1beta1.GetSnapshotRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.filestore.v1beta1.GetSnapshotRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.filestore.v1beta1.GetSnapshotRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.filestore.v1beta1.GetSnapshotRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * GetSnapshotRequest gets the state of a snapshot.
+   * 
+ * + * Protobuf type {@code google.cloud.filestore.v1beta1.GetSnapshotRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.filestore.v1beta1.GetSnapshotRequest) + com.google.cloud.filestore.v1beta1.GetSnapshotRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.filestore.v1beta1.CloudFilestoreServiceProto + .internal_static_google_cloud_filestore_v1beta1_GetSnapshotRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.filestore.v1beta1.CloudFilestoreServiceProto + .internal_static_google_cloud_filestore_v1beta1_GetSnapshotRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.filestore.v1beta1.GetSnapshotRequest.class, + com.google.cloud.filestore.v1beta1.GetSnapshotRequest.Builder.class); + } + + // Construct using com.google.cloud.filestore.v1beta1.GetSnapshotRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.filestore.v1beta1.CloudFilestoreServiceProto + .internal_static_google_cloud_filestore_v1beta1_GetSnapshotRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.filestore.v1beta1.GetSnapshotRequest getDefaultInstanceForType() { + return com.google.cloud.filestore.v1beta1.GetSnapshotRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.filestore.v1beta1.GetSnapshotRequest build() { + com.google.cloud.filestore.v1beta1.GetSnapshotRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.filestore.v1beta1.GetSnapshotRequest buildPartial() { + com.google.cloud.filestore.v1beta1.GetSnapshotRequest result = + new com.google.cloud.filestore.v1beta1.GetSnapshotRequest(this); + result.name_ = name_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.filestore.v1beta1.GetSnapshotRequest) { + return mergeFrom((com.google.cloud.filestore.v1beta1.GetSnapshotRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.filestore.v1beta1.GetSnapshotRequest other) { + if (other == com.google.cloud.filestore.v1beta1.GetSnapshotRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. The snapshot resource name, in the format
+     * `projects/{project_id}/locations/{location}/instances/{instance_id}/snapshots/{snapshot_id}`
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The snapshot resource name, in the format
+     * `projects/{project_id}/locations/{location}/instances/{instance_id}/snapshots/{snapshot_id}`
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The snapshot resource name, in the format
+     * `projects/{project_id}/locations/{location}/instances/{instance_id}/snapshots/{snapshot_id}`
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The snapshot resource name, in the format
+     * `projects/{project_id}/locations/{location}/instances/{instance_id}/snapshots/{snapshot_id}`
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The snapshot resource name, in the format
+     * `projects/{project_id}/locations/{location}/instances/{instance_id}/snapshots/{snapshot_id}`
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.filestore.v1beta1.GetSnapshotRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.filestore.v1beta1.GetSnapshotRequest) + private static final com.google.cloud.filestore.v1beta1.GetSnapshotRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.filestore.v1beta1.GetSnapshotRequest(); + } + + public static com.google.cloud.filestore.v1beta1.GetSnapshotRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetSnapshotRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.filestore.v1beta1.GetSnapshotRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-filestore/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/GetSnapshotRequestOrBuilder.java b/java-filestore/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/GetSnapshotRequestOrBuilder.java new file mode 100644 index 000000000000..1ce175fa576b --- /dev/null +++ b/java-filestore/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/GetSnapshotRequestOrBuilder.java @@ -0,0 +1,56 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/filestore/v1beta1/cloud_filestore_service.proto + +package com.google.cloud.filestore.v1beta1; + +public interface GetSnapshotRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.filestore.v1beta1.GetSnapshotRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The snapshot resource name, in the format
+   * `projects/{project_id}/locations/{location}/instances/{instance_id}/snapshots/{snapshot_id}`
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. The snapshot resource name, in the format
+   * `projects/{project_id}/locations/{location}/instances/{instance_id}/snapshots/{snapshot_id}`
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); +} diff --git a/java-filestore/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/Instance.java b/java-filestore/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/Instance.java index 3450f7ec2266..fb2106bcbe8c 100644 --- a/java-filestore/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/Instance.java +++ b/java-filestore/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/Instance.java @@ -22,7 +22,7 @@ * * *
- * A Cloud Filestore instance.
+ * A Filestore instance.
  * 
* * Protobuf type {@code google.cloud.filestore.v1beta1.Instance} @@ -46,6 +46,8 @@ private Instance() { fileShares_ = java.util.Collections.emptyList(); networks_ = java.util.Collections.emptyList(); etag_ = ""; + kmsKeyName_ = ""; + suspensionReasons_ = java.util.Collections.emptyList(); } @java.lang.Override @@ -169,6 +171,47 @@ public enum State implements com.google.protobuf.ProtocolMessageEnum { * RESTORING = 7; */ RESTORING(7), + /** + * + * + *
+     * The instance is suspended. You can get further details from
+     * the `suspension_reasons` field of the `Instance` resource.
+     * 
+ * + * SUSPENDED = 8; + */ + SUSPENDED(8), + /** + * + * + *
+     * The instance is reverting to a snapshot.
+     * 
+ * + * REVERTING = 9; + */ + REVERTING(9), + /** + * + * + *
+     * The instance is in the process of becoming suspended.
+     * 
+ * + * SUSPENDING = 10; + */ + SUSPENDING(10), + /** + * + * + *
+     * The instance is in the process of becoming active.
+     * 
+ * + * RESUMING = 11; + */ + RESUMING(11), UNRECOGNIZED(-1), ; @@ -246,6 +289,47 @@ public enum State implements com.google.protobuf.ProtocolMessageEnum { * RESTORING = 7; */ public static final int RESTORING_VALUE = 7; + /** + * + * + *
+     * The instance is suspended. You can get further details from
+     * the `suspension_reasons` field of the `Instance` resource.
+     * 
+ * + * SUSPENDED = 8; + */ + public static final int SUSPENDED_VALUE = 8; + /** + * + * + *
+     * The instance is reverting to a snapshot.
+     * 
+ * + * REVERTING = 9; + */ + public static final int REVERTING_VALUE = 9; + /** + * + * + *
+     * The instance is in the process of becoming suspended.
+     * 
+ * + * SUSPENDING = 10; + */ + public static final int SUSPENDING_VALUE = 10; + /** + * + * + *
+     * The instance is in the process of becoming active.
+     * 
+ * + * RESUMING = 11; + */ + public static final int RESUMING_VALUE = 11; public final int getNumber() { if (this == UNRECOGNIZED) { @@ -285,6 +369,14 @@ public static State forNumber(int value) { return ERROR; case 7: return RESTORING; + case 8: + return SUSPENDED; + case 9: + return REVERTING; + case 10: + return SUSPENDING; + case 11: + return RESUMING; default: return null; } @@ -413,6 +505,17 @@ public enum Tier implements com.google.protobuf.ProtocolMessageEnum { * HIGH_SCALE_SSD = 6; */ HIGH_SCALE_SSD(6), + /** + * + * + *
+     * ENTERPRISE instances offer the features and availability needed for
+     * mission-critical workloads.
+     * 
+ * + * ENTERPRISE = 7; + */ + ENTERPRISE(7), UNRECOGNIZED(-1), ; @@ -481,6 +584,17 @@ public enum Tier implements com.google.protobuf.ProtocolMessageEnum { * HIGH_SCALE_SSD = 6; */ public static final int HIGH_SCALE_SSD_VALUE = 6; + /** + * + * + *
+     * ENTERPRISE instances offer the features and availability needed for
+     * mission-critical workloads.
+     * 
+ * + * ENTERPRISE = 7; + */ + public static final int ENTERPRISE_VALUE = 7; public final int getNumber() { if (this == UNRECOGNIZED) { @@ -518,6 +632,8 @@ public static Tier forNumber(int value) { return BASIC_SSD; case 6: return HIGH_SCALE_SSD; + case 7: + return ENTERPRISE; default: return null; } @@ -571,6 +687,143 @@ private Tier(int value) { // @@protoc_insertion_point(enum_scope:google.cloud.filestore.v1beta1.Instance.Tier) } + /** + * + * + *
+   * SuspensionReason contains the possible reasons for a suspension.
+   * 
+ * + * Protobuf enum {@code google.cloud.filestore.v1beta1.Instance.SuspensionReason} + */ + public enum SuspensionReason implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Not set.
+     * 
+ * + * SUSPENSION_REASON_UNSPECIFIED = 0; + */ + SUSPENSION_REASON_UNSPECIFIED(0), + /** + * + * + *
+     * The KMS key used by the instance is either revoked or denied access to.
+     * 
+ * + * KMS_KEY_ISSUE = 1; + */ + KMS_KEY_ISSUE(1), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * Not set.
+     * 
+ * + * SUSPENSION_REASON_UNSPECIFIED = 0; + */ + public static final int SUSPENSION_REASON_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * The KMS key used by the instance is either revoked or denied access to.
+     * 
+ * + * KMS_KEY_ISSUE = 1; + */ + public static final int KMS_KEY_ISSUE_VALUE = 1; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static SuspensionReason valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static SuspensionReason forNumber(int value) { + switch (value) { + case 0: + return SUSPENSION_REASON_UNSPECIFIED; + case 1: + return KMS_KEY_ISSUE; + default: + return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() { + return internalValueMap; + } + + private static final com.google.protobuf.Internal.EnumLiteMap + internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public SuspensionReason findValueByNumber(int number) { + return SuspensionReason.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.filestore.v1beta1.Instance.getDescriptor().getEnumTypes().get(2); + } + + private static final SuspensionReason[] VALUES = values(); + + public static SuspensionReason valueOf( + com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private SuspensionReason(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.filestore.v1beta1.Instance.SuspensionReason) + } + public static final int NAME_FIELD_NUMBER = 1; private volatile java.lang.Object name_; /** @@ -1197,61 +1450,341 @@ public com.google.protobuf.BoolValueOrBuilder getSatisfiesPzsOrBuilder() { return getSatisfiesPzs(); } - private byte memoizedIsInitialized = -1; - + public static final int KMS_KEY_NAME_FIELD_NUMBER = 14; + private volatile java.lang.Object kmsKeyName_; + /** + * + * + *
+   * KMS key name used for data encryption.
+   * 
+ * + * string kms_key_name = 14; + * + * @return The kmsKeyName. + */ @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; + public java.lang.String getKmsKeyName() { + java.lang.Object ref = kmsKeyName_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kmsKeyName_ = s; + return s; + } } - + /** + * + * + *
+   * KMS key name used for data encryption.
+   * 
+ * + * string kms_key_name = 14; + * + * @return The bytes for kmsKeyName. + */ @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(description_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, description_); - } - if (state_ != com.google.cloud.filestore.v1beta1.Instance.State.STATE_UNSPECIFIED.getNumber()) { - output.writeEnum(5, state_); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(statusMessage_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 6, statusMessage_); - } - if (createTime_ != null) { - output.writeMessage(7, getCreateTime()); - } - if (tier_ != com.google.cloud.filestore.v1beta1.Instance.Tier.TIER_UNSPECIFIED.getNumber()) { - output.writeEnum(8, tier_); - } - com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( - output, internalGetLabels(), LabelsDefaultEntryHolder.defaultEntry, 9); - for (int i = 0; i < fileShares_.size(); i++) { - output.writeMessage(10, fileShares_.get(i)); - } - for (int i = 0; i < networks_.size(); i++) { - output.writeMessage(11, networks_.get(i)); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(etag_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 12, etag_); - } - if (satisfiesPzs_ != null) { - output.writeMessage(13, getSatisfiesPzs()); + public com.google.protobuf.ByteString getKmsKeyNameBytes() { + java.lang.Object ref = kmsKeyName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kmsKeyName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; } - getUnknownFields().writeTo(output); } - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; + public static final int SUSPENSION_REASONS_FIELD_NUMBER = 15; + private java.util.List suspensionReasons_; + private static final com.google.protobuf.Internal.ListAdapter.Converter< + java.lang.Integer, com.google.cloud.filestore.v1beta1.Instance.SuspensionReason> + suspensionReasons_converter_ = + new com.google.protobuf.Internal.ListAdapter.Converter< + java.lang.Integer, com.google.cloud.filestore.v1beta1.Instance.SuspensionReason>() { + public com.google.cloud.filestore.v1beta1.Instance.SuspensionReason convert( + java.lang.Integer from) { + @SuppressWarnings("deprecation") + com.google.cloud.filestore.v1beta1.Instance.SuspensionReason result = + com.google.cloud.filestore.v1beta1.Instance.SuspensionReason.valueOf(from); + return result == null + ? com.google.cloud.filestore.v1beta1.Instance.SuspensionReason.UNRECOGNIZED + : result; + } + }; + /** + * + * + *
+   * Output only. Field indicates all the reasons the instance is in "SUSPENDED" state.
+   * 
+ * + * + * repeated .google.cloud.filestore.v1beta1.Instance.SuspensionReason suspension_reasons = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return A list containing the suspensionReasons. + */ + @java.lang.Override + public java.util.List + getSuspensionReasonsList() { + return new com.google.protobuf.Internal.ListAdapter< + java.lang.Integer, com.google.cloud.filestore.v1beta1.Instance.SuspensionReason>( + suspensionReasons_, suspensionReasons_converter_); + } + /** + * + * + *
+   * Output only. Field indicates all the reasons the instance is in "SUSPENDED" state.
+   * 
+ * + * + * repeated .google.cloud.filestore.v1beta1.Instance.SuspensionReason suspension_reasons = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The count of suspensionReasons. + */ + @java.lang.Override + public int getSuspensionReasonsCount() { + return suspensionReasons_.size(); + } + /** + * + * + *
+   * Output only. Field indicates all the reasons the instance is in "SUSPENDED" state.
+   * 
+ * + * + * repeated .google.cloud.filestore.v1beta1.Instance.SuspensionReason suspension_reasons = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param index The index of the element to return. + * @return The suspensionReasons at the given index. + */ + @java.lang.Override + public com.google.cloud.filestore.v1beta1.Instance.SuspensionReason getSuspensionReasons( + int index) { + return suspensionReasons_converter_.convert(suspensionReasons_.get(index)); + } + /** + * + * + *
+   * Output only. Field indicates all the reasons the instance is in "SUSPENDED" state.
+   * 
+ * + * + * repeated .google.cloud.filestore.v1beta1.Instance.SuspensionReason suspension_reasons = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return A list containing the enum numeric values on the wire for suspensionReasons. + */ + @java.lang.Override + public java.util.List getSuspensionReasonsValueList() { + return suspensionReasons_; + } + /** + * + * + *
+   * Output only. Field indicates all the reasons the instance is in "SUSPENDED" state.
+   * 
+ * + * + * repeated .google.cloud.filestore.v1beta1.Instance.SuspensionReason suspension_reasons = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param index The index of the value to return. + * @return The enum numeric value on the wire of suspensionReasons at the given index. + */ + @java.lang.Override + public int getSuspensionReasonsValue(int index) { + return suspensionReasons_.get(index); + } + + private int suspensionReasonsMemoizedSerializedSize; + + public static final int MAX_CAPACITY_GB_FIELD_NUMBER = 16; + private long maxCapacityGb_; + /** + * + * + *
+   * Output only. The max capacity of the instance.
+   * 
+ * + * int64 max_capacity_gb = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The maxCapacityGb. + */ + @java.lang.Override + public long getMaxCapacityGb() { + return maxCapacityGb_; + } + + public static final int CAPACITY_STEP_SIZE_GB_FIELD_NUMBER = 17; + private long capacityStepSizeGb_; + /** + * + * + *
+   * Output only. The increase/decrease capacity step size.
+   * 
+ * + * int64 capacity_step_size_gb = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The capacityStepSizeGb. + */ + @java.lang.Override + public long getCapacityStepSizeGb() { + return capacityStepSizeGb_; + } + + public static final int MAX_SHARE_COUNT_FIELD_NUMBER = 18; + private long maxShareCount_; + /** + * + * + *
+   * Output only. The max number of shares allowed.
+   * 
+ * + * int64 max_share_count = 18 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The maxShareCount. + */ + @java.lang.Override + public long getMaxShareCount() { + return maxShareCount_; + } + + public static final int CAPACITY_GB_FIELD_NUMBER = 19; + private long capacityGb_; + /** + * + * + *
+   * The storage capacity of the instance in gigabytes (GB = 1024^3 bytes).
+   * This capacity can be increased up to `max_capacity_gb` GB in multipliers
+   * of `capacity_step_size_gb` GB.
+   * 
+ * + * int64 capacity_gb = 19; + * + * @return The capacityGb. + */ + @java.lang.Override + public long getCapacityGb() { + return capacityGb_; + } + + public static final int MULTI_SHARE_ENABLED_FIELD_NUMBER = 20; + private boolean multiShareEnabled_; + /** + * + * + *
+   * Indicates whether this instance uses a multi-share configuration with which
+   * it can have more than one file-share or none at all. File-shares are added,
+   * updated and removed through the separate file-share APIs.
+   * 
+ * + * bool multi_share_enabled = 20; + * + * @return The multiShareEnabled. + */ + @java.lang.Override + public boolean getMultiShareEnabled() { + return multiShareEnabled_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + getSerializedSize(); + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(description_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, description_); + } + if (state_ != com.google.cloud.filestore.v1beta1.Instance.State.STATE_UNSPECIFIED.getNumber()) { + output.writeEnum(5, state_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(statusMessage_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 6, statusMessage_); + } + if (createTime_ != null) { + output.writeMessage(7, getCreateTime()); + } + if (tier_ != com.google.cloud.filestore.v1beta1.Instance.Tier.TIER_UNSPECIFIED.getNumber()) { + output.writeEnum(8, tier_); + } + com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( + output, internalGetLabels(), LabelsDefaultEntryHolder.defaultEntry, 9); + for (int i = 0; i < fileShares_.size(); i++) { + output.writeMessage(10, fileShares_.get(i)); + } + for (int i = 0; i < networks_.size(); i++) { + output.writeMessage(11, networks_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(etag_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 12, etag_); + } + if (satisfiesPzs_ != null) { + output.writeMessage(13, getSatisfiesPzs()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(kmsKeyName_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 14, kmsKeyName_); + } + if (getSuspensionReasonsList().size() > 0) { + output.writeUInt32NoTag(122); + output.writeUInt32NoTag(suspensionReasonsMemoizedSerializedSize); + } + for (int i = 0; i < suspensionReasons_.size(); i++) { + output.writeEnumNoTag(suspensionReasons_.get(i)); + } + if (maxCapacityGb_ != 0L) { + output.writeInt64(16, maxCapacityGb_); + } + if (capacityStepSizeGb_ != 0L) { + output.writeInt64(17, capacityStepSizeGb_); + } + if (maxShareCount_ != 0L) { + output.writeInt64(18, maxShareCount_); + } + if (capacityGb_ != 0L) { + output.writeInt64(19, capacityGb_); + } + if (multiShareEnabled_ != false) { + output.writeBool(20, multiShareEnabled_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); } @@ -1292,6 +1825,37 @@ public int getSerializedSize() { if (satisfiesPzs_ != null) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(13, getSatisfiesPzs()); } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(kmsKeyName_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(14, kmsKeyName_); + } + { + int dataSize = 0; + for (int i = 0; i < suspensionReasons_.size(); i++) { + dataSize += + com.google.protobuf.CodedOutputStream.computeEnumSizeNoTag(suspensionReasons_.get(i)); + } + size += dataSize; + if (!getSuspensionReasonsList().isEmpty()) { + size += 1; + size += com.google.protobuf.CodedOutputStream.computeUInt32SizeNoTag(dataSize); + } + suspensionReasonsMemoizedSerializedSize = dataSize; + } + if (maxCapacityGb_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(16, maxCapacityGb_); + } + if (capacityStepSizeGb_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(17, capacityStepSizeGb_); + } + if (maxShareCount_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(18, maxShareCount_); + } + if (capacityGb_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(19, capacityGb_); + } + if (multiShareEnabled_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(20, multiShareEnabled_); + } size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; @@ -1325,6 +1889,13 @@ public boolean equals(final java.lang.Object obj) { if (hasSatisfiesPzs()) { if (!getSatisfiesPzs().equals(other.getSatisfiesPzs())) return false; } + if (!getKmsKeyName().equals(other.getKmsKeyName())) return false; + if (!suspensionReasons_.equals(other.suspensionReasons_)) return false; + if (getMaxCapacityGb() != other.getMaxCapacityGb()) return false; + if (getCapacityStepSizeGb() != other.getCapacityStepSizeGb()) return false; + if (getMaxShareCount() != other.getMaxShareCount()) return false; + if (getCapacityGb() != other.getCapacityGb()) return false; + if (getMultiShareEnabled() != other.getMultiShareEnabled()) return false; if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -1368,6 +1939,22 @@ public int hashCode() { hash = (37 * hash) + SATISFIES_PZS_FIELD_NUMBER; hash = (53 * hash) + getSatisfiesPzs().hashCode(); } + hash = (37 * hash) + KMS_KEY_NAME_FIELD_NUMBER; + hash = (53 * hash) + getKmsKeyName().hashCode(); + if (getSuspensionReasonsCount() > 0) { + hash = (37 * hash) + SUSPENSION_REASONS_FIELD_NUMBER; + hash = (53 * hash) + suspensionReasons_.hashCode(); + } + hash = (37 * hash) + MAX_CAPACITY_GB_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getMaxCapacityGb()); + hash = (37 * hash) + CAPACITY_STEP_SIZE_GB_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getCapacityStepSizeGb()); + hash = (37 * hash) + MAX_SHARE_COUNT_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getMaxShareCount()); + hash = (37 * hash) + CAPACITY_GB_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getCapacityGb()); + hash = (37 * hash) + MULTI_SHARE_ENABLED_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getMultiShareEnabled()); hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; @@ -1472,7 +2059,7 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build * * *
-   * A Cloud Filestore instance.
+   * A Filestore instance.
    * 
* * Protobuf type {@code google.cloud.filestore.v1beta1.Instance} @@ -1565,6 +2152,20 @@ public Builder clear() { satisfiesPzs_ = null; satisfiesPzsBuilder_ = null; } + kmsKeyName_ = ""; + + suspensionReasons_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000008); + maxCapacityGb_ = 0L; + + capacityStepSizeGb_ = 0L; + + maxShareCount_ = 0L; + + capacityGb_ = 0L; + + multiShareEnabled_ = false; + return this; } @@ -1629,6 +2230,17 @@ public com.google.cloud.filestore.v1beta1.Instance buildPartial() { } else { result.satisfiesPzs_ = satisfiesPzsBuilder_.build(); } + result.kmsKeyName_ = kmsKeyName_; + if (((bitField0_ & 0x00000008) != 0)) { + suspensionReasons_ = java.util.Collections.unmodifiableList(suspensionReasons_); + bitField0_ = (bitField0_ & ~0x00000008); + } + result.suspensionReasons_ = suspensionReasons_; + result.maxCapacityGb_ = maxCapacityGb_; + result.capacityStepSizeGb_ = capacityStepSizeGb_; + result.maxShareCount_ = maxShareCount_; + result.capacityGb_ = capacityGb_; + result.multiShareEnabled_ = multiShareEnabled_; onBuilt(); return result; } @@ -1761,6 +2373,35 @@ public Builder mergeFrom(com.google.cloud.filestore.v1beta1.Instance other) { if (other.hasSatisfiesPzs()) { mergeSatisfiesPzs(other.getSatisfiesPzs()); } + if (!other.getKmsKeyName().isEmpty()) { + kmsKeyName_ = other.kmsKeyName_; + onChanged(); + } + if (!other.suspensionReasons_.isEmpty()) { + if (suspensionReasons_.isEmpty()) { + suspensionReasons_ = other.suspensionReasons_; + bitField0_ = (bitField0_ & ~0x00000008); + } else { + ensureSuspensionReasonsIsMutable(); + suspensionReasons_.addAll(other.suspensionReasons_); + } + onChanged(); + } + if (other.getMaxCapacityGb() != 0L) { + setMaxCapacityGb(other.getMaxCapacityGb()); + } + if (other.getCapacityStepSizeGb() != 0L) { + setCapacityStepSizeGb(other.getCapacityStepSizeGb()); + } + if (other.getMaxShareCount() != 0L) { + setMaxShareCount(other.getMaxShareCount()); + } + if (other.getCapacityGb() != 0L) { + setCapacityGb(other.getCapacityGb()); + } + if (other.getMultiShareEnabled() != false) { + setMultiShareEnabled(other.getMultiShareEnabled()); + } this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; @@ -1874,6 +2515,61 @@ public Builder mergeFrom( break; } // case 106 + case 114: + { + kmsKeyName_ = input.readStringRequireUtf8(); + + break; + } // case 114 + case 120: + { + int tmpRaw = input.readEnum(); + ensureSuspensionReasonsIsMutable(); + suspensionReasons_.add(tmpRaw); + break; + } // case 120 + case 122: + { + int length = input.readRawVarint32(); + int oldLimit = input.pushLimit(length); + while (input.getBytesUntilLimit() > 0) { + int tmpRaw = input.readEnum(); + ensureSuspensionReasonsIsMutable(); + suspensionReasons_.add(tmpRaw); + } + input.popLimit(oldLimit); + break; + } // case 122 + case 128: + { + maxCapacityGb_ = input.readInt64(); + + break; + } // case 128 + case 136: + { + capacityStepSizeGb_ = input.readInt64(); + + break; + } // case 136 + case 144: + { + maxShareCount_ = input.readInt64(); + + break; + } // case 144 + case 152: + { + capacityGb_ = input.readInt64(); + + break; + } // case 152 + case 160: + { + multiShareEnabled_ = input.readBool(); + + break; + } // case 160 default: { if (!super.parseUnknownField(input, extensionRegistry, tag)) { @@ -3831,6 +4527,635 @@ public com.google.protobuf.BoolValueOrBuilder getSatisfiesPzsOrBuilder() { return satisfiesPzsBuilder_; } + private java.lang.Object kmsKeyName_ = ""; + /** + * + * + *
+     * KMS key name used for data encryption.
+     * 
+ * + * string kms_key_name = 14; + * + * @return The kmsKeyName. + */ + public java.lang.String getKmsKeyName() { + java.lang.Object ref = kmsKeyName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kmsKeyName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * KMS key name used for data encryption.
+     * 
+ * + * string kms_key_name = 14; + * + * @return The bytes for kmsKeyName. + */ + public com.google.protobuf.ByteString getKmsKeyNameBytes() { + java.lang.Object ref = kmsKeyName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kmsKeyName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * KMS key name used for data encryption.
+     * 
+ * + * string kms_key_name = 14; + * + * @param value The kmsKeyName to set. + * @return This builder for chaining. + */ + public Builder setKmsKeyName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + kmsKeyName_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * KMS key name used for data encryption.
+     * 
+ * + * string kms_key_name = 14; + * + * @return This builder for chaining. + */ + public Builder clearKmsKeyName() { + + kmsKeyName_ = getDefaultInstance().getKmsKeyName(); + onChanged(); + return this; + } + /** + * + * + *
+     * KMS key name used for data encryption.
+     * 
+ * + * string kms_key_name = 14; + * + * @param value The bytes for kmsKeyName to set. + * @return This builder for chaining. + */ + public Builder setKmsKeyNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + kmsKeyName_ = value; + onChanged(); + return this; + } + + private java.util.List suspensionReasons_ = + java.util.Collections.emptyList(); + + private void ensureSuspensionReasonsIsMutable() { + if (!((bitField0_ & 0x00000008) != 0)) { + suspensionReasons_ = new java.util.ArrayList(suspensionReasons_); + bitField0_ |= 0x00000008; + } + } + /** + * + * + *
+     * Output only. Field indicates all the reasons the instance is in "SUSPENDED" state.
+     * 
+ * + * + * repeated .google.cloud.filestore.v1beta1.Instance.SuspensionReason suspension_reasons = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return A list containing the suspensionReasons. + */ + public java.util.List + getSuspensionReasonsList() { + return new com.google.protobuf.Internal.ListAdapter< + java.lang.Integer, com.google.cloud.filestore.v1beta1.Instance.SuspensionReason>( + suspensionReasons_, suspensionReasons_converter_); + } + /** + * + * + *
+     * Output only. Field indicates all the reasons the instance is in "SUSPENDED" state.
+     * 
+ * + * + * repeated .google.cloud.filestore.v1beta1.Instance.SuspensionReason suspension_reasons = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The count of suspensionReasons. + */ + public int getSuspensionReasonsCount() { + return suspensionReasons_.size(); + } + /** + * + * + *
+     * Output only. Field indicates all the reasons the instance is in "SUSPENDED" state.
+     * 
+ * + * + * repeated .google.cloud.filestore.v1beta1.Instance.SuspensionReason suspension_reasons = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param index The index of the element to return. + * @return The suspensionReasons at the given index. + */ + public com.google.cloud.filestore.v1beta1.Instance.SuspensionReason getSuspensionReasons( + int index) { + return suspensionReasons_converter_.convert(suspensionReasons_.get(index)); + } + /** + * + * + *
+     * Output only. Field indicates all the reasons the instance is in "SUSPENDED" state.
+     * 
+ * + * + * repeated .google.cloud.filestore.v1beta1.Instance.SuspensionReason suspension_reasons = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param index The index to set the value at. + * @param value The suspensionReasons to set. + * @return This builder for chaining. + */ + public Builder setSuspensionReasons( + int index, com.google.cloud.filestore.v1beta1.Instance.SuspensionReason value) { + if (value == null) { + throw new NullPointerException(); + } + ensureSuspensionReasonsIsMutable(); + suspensionReasons_.set(index, value.getNumber()); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Field indicates all the reasons the instance is in "SUSPENDED" state.
+     * 
+ * + * + * repeated .google.cloud.filestore.v1beta1.Instance.SuspensionReason suspension_reasons = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The suspensionReasons to add. + * @return This builder for chaining. + */ + public Builder addSuspensionReasons( + com.google.cloud.filestore.v1beta1.Instance.SuspensionReason value) { + if (value == null) { + throw new NullPointerException(); + } + ensureSuspensionReasonsIsMutable(); + suspensionReasons_.add(value.getNumber()); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Field indicates all the reasons the instance is in "SUSPENDED" state.
+     * 
+ * + * + * repeated .google.cloud.filestore.v1beta1.Instance.SuspensionReason suspension_reasons = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param values The suspensionReasons to add. + * @return This builder for chaining. + */ + public Builder addAllSuspensionReasons( + java.lang.Iterable + values) { + ensureSuspensionReasonsIsMutable(); + for (com.google.cloud.filestore.v1beta1.Instance.SuspensionReason value : values) { + suspensionReasons_.add(value.getNumber()); + } + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Field indicates all the reasons the instance is in "SUSPENDED" state.
+     * 
+ * + * + * repeated .google.cloud.filestore.v1beta1.Instance.SuspensionReason suspension_reasons = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return This builder for chaining. + */ + public Builder clearSuspensionReasons() { + suspensionReasons_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Field indicates all the reasons the instance is in "SUSPENDED" state.
+     * 
+ * + * + * repeated .google.cloud.filestore.v1beta1.Instance.SuspensionReason suspension_reasons = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return A list containing the enum numeric values on the wire for suspensionReasons. + */ + public java.util.List getSuspensionReasonsValueList() { + return java.util.Collections.unmodifiableList(suspensionReasons_); + } + /** + * + * + *
+     * Output only. Field indicates all the reasons the instance is in "SUSPENDED" state.
+     * 
+ * + * + * repeated .google.cloud.filestore.v1beta1.Instance.SuspensionReason suspension_reasons = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param index The index of the value to return. + * @return The enum numeric value on the wire of suspensionReasons at the given index. + */ + public int getSuspensionReasonsValue(int index) { + return suspensionReasons_.get(index); + } + /** + * + * + *
+     * Output only. Field indicates all the reasons the instance is in "SUSPENDED" state.
+     * 
+ * + * + * repeated .google.cloud.filestore.v1beta1.Instance.SuspensionReason suspension_reasons = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param index The index to set the value at. + * @param value The enum numeric value on the wire for suspensionReasons to set. + * @return This builder for chaining. + */ + public Builder setSuspensionReasonsValue(int index, int value) { + ensureSuspensionReasonsIsMutable(); + suspensionReasons_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Field indicates all the reasons the instance is in "SUSPENDED" state.
+     * 
+ * + * + * repeated .google.cloud.filestore.v1beta1.Instance.SuspensionReason suspension_reasons = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The enum numeric value on the wire for suspensionReasons to add. + * @return This builder for chaining. + */ + public Builder addSuspensionReasonsValue(int value) { + ensureSuspensionReasonsIsMutable(); + suspensionReasons_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Field indicates all the reasons the instance is in "SUSPENDED" state.
+     * 
+ * + * + * repeated .google.cloud.filestore.v1beta1.Instance.SuspensionReason suspension_reasons = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param values The enum numeric values on the wire for suspensionReasons to add. + * @return This builder for chaining. + */ + public Builder addAllSuspensionReasonsValue(java.lang.Iterable values) { + ensureSuspensionReasonsIsMutable(); + for (int value : values) { + suspensionReasons_.add(value); + } + onChanged(); + return this; + } + + private long maxCapacityGb_; + /** + * + * + *
+     * Output only. The max capacity of the instance.
+     * 
+ * + * int64 max_capacity_gb = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The maxCapacityGb. + */ + @java.lang.Override + public long getMaxCapacityGb() { + return maxCapacityGb_; + } + /** + * + * + *
+     * Output only. The max capacity of the instance.
+     * 
+ * + * int64 max_capacity_gb = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The maxCapacityGb to set. + * @return This builder for chaining. + */ + public Builder setMaxCapacityGb(long value) { + + maxCapacityGb_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The max capacity of the instance.
+     * 
+ * + * int64 max_capacity_gb = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearMaxCapacityGb() { + + maxCapacityGb_ = 0L; + onChanged(); + return this; + } + + private long capacityStepSizeGb_; + /** + * + * + *
+     * Output only. The increase/decrease capacity step size.
+     * 
+ * + * int64 capacity_step_size_gb = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The capacityStepSizeGb. + */ + @java.lang.Override + public long getCapacityStepSizeGb() { + return capacityStepSizeGb_; + } + /** + * + * + *
+     * Output only. The increase/decrease capacity step size.
+     * 
+ * + * int64 capacity_step_size_gb = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The capacityStepSizeGb to set. + * @return This builder for chaining. + */ + public Builder setCapacityStepSizeGb(long value) { + + capacityStepSizeGb_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The increase/decrease capacity step size.
+     * 
+ * + * int64 capacity_step_size_gb = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearCapacityStepSizeGb() { + + capacityStepSizeGb_ = 0L; + onChanged(); + return this; + } + + private long maxShareCount_; + /** + * + * + *
+     * Output only. The max number of shares allowed.
+     * 
+ * + * int64 max_share_count = 18 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The maxShareCount. + */ + @java.lang.Override + public long getMaxShareCount() { + return maxShareCount_; + } + /** + * + * + *
+     * Output only. The max number of shares allowed.
+     * 
+ * + * int64 max_share_count = 18 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The maxShareCount to set. + * @return This builder for chaining. + */ + public Builder setMaxShareCount(long value) { + + maxShareCount_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The max number of shares allowed.
+     * 
+ * + * int64 max_share_count = 18 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearMaxShareCount() { + + maxShareCount_ = 0L; + onChanged(); + return this; + } + + private long capacityGb_; + /** + * + * + *
+     * The storage capacity of the instance in gigabytes (GB = 1024^3 bytes).
+     * This capacity can be increased up to `max_capacity_gb` GB in multipliers
+     * of `capacity_step_size_gb` GB.
+     * 
+ * + * int64 capacity_gb = 19; + * + * @return The capacityGb. + */ + @java.lang.Override + public long getCapacityGb() { + return capacityGb_; + } + /** + * + * + *
+     * The storage capacity of the instance in gigabytes (GB = 1024^3 bytes).
+     * This capacity can be increased up to `max_capacity_gb` GB in multipliers
+     * of `capacity_step_size_gb` GB.
+     * 
+ * + * int64 capacity_gb = 19; + * + * @param value The capacityGb to set. + * @return This builder for chaining. + */ + public Builder setCapacityGb(long value) { + + capacityGb_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The storage capacity of the instance in gigabytes (GB = 1024^3 bytes).
+     * This capacity can be increased up to `max_capacity_gb` GB in multipliers
+     * of `capacity_step_size_gb` GB.
+     * 
+ * + * int64 capacity_gb = 19; + * + * @return This builder for chaining. + */ + public Builder clearCapacityGb() { + + capacityGb_ = 0L; + onChanged(); + return this; + } + + private boolean multiShareEnabled_; + /** + * + * + *
+     * Indicates whether this instance uses a multi-share configuration with which
+     * it can have more than one file-share or none at all. File-shares are added,
+     * updated and removed through the separate file-share APIs.
+     * 
+ * + * bool multi_share_enabled = 20; + * + * @return The multiShareEnabled. + */ + @java.lang.Override + public boolean getMultiShareEnabled() { + return multiShareEnabled_; + } + /** + * + * + *
+     * Indicates whether this instance uses a multi-share configuration with which
+     * it can have more than one file-share or none at all. File-shares are added,
+     * updated and removed through the separate file-share APIs.
+     * 
+ * + * bool multi_share_enabled = 20; + * + * @param value The multiShareEnabled to set. + * @return This builder for chaining. + */ + public Builder setMultiShareEnabled(boolean value) { + + multiShareEnabled_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Indicates whether this instance uses a multi-share configuration with which
+     * it can have more than one file-share or none at all. File-shares are added,
+     * updated and removed through the separate file-share APIs.
+     * 
+ * + * bool multi_share_enabled = 20; + * + * @return This builder for chaining. + */ + public Builder clearMultiShareEnabled() { + + multiShareEnabled_ = false; + onChanged(); + return this; + } + @java.lang.Override public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { return super.setUnknownFields(unknownFields); diff --git a/java-filestore/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/InstanceOrBuilder.java b/java-filestore/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/InstanceOrBuilder.java index a26766cbf9da..21f10c8d2f83 100644 --- a/java-filestore/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/InstanceOrBuilder.java +++ b/java-filestore/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/InstanceOrBuilder.java @@ -432,4 +432,172 @@ java.lang.String getLabelsOrDefault( * */ com.google.protobuf.BoolValueOrBuilder getSatisfiesPzsOrBuilder(); + + /** + * + * + *
+   * KMS key name used for data encryption.
+   * 
+ * + * string kms_key_name = 14; + * + * @return The kmsKeyName. + */ + java.lang.String getKmsKeyName(); + /** + * + * + *
+   * KMS key name used for data encryption.
+   * 
+ * + * string kms_key_name = 14; + * + * @return The bytes for kmsKeyName. + */ + com.google.protobuf.ByteString getKmsKeyNameBytes(); + + /** + * + * + *
+   * Output only. Field indicates all the reasons the instance is in "SUSPENDED" state.
+   * 
+ * + * + * repeated .google.cloud.filestore.v1beta1.Instance.SuspensionReason suspension_reasons = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return A list containing the suspensionReasons. + */ + java.util.List + getSuspensionReasonsList(); + /** + * + * + *
+   * Output only. Field indicates all the reasons the instance is in "SUSPENDED" state.
+   * 
+ * + * + * repeated .google.cloud.filestore.v1beta1.Instance.SuspensionReason suspension_reasons = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The count of suspensionReasons. + */ + int getSuspensionReasonsCount(); + /** + * + * + *
+   * Output only. Field indicates all the reasons the instance is in "SUSPENDED" state.
+   * 
+ * + * + * repeated .google.cloud.filestore.v1beta1.Instance.SuspensionReason suspension_reasons = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param index The index of the element to return. + * @return The suspensionReasons at the given index. + */ + com.google.cloud.filestore.v1beta1.Instance.SuspensionReason getSuspensionReasons(int index); + /** + * + * + *
+   * Output only. Field indicates all the reasons the instance is in "SUSPENDED" state.
+   * 
+ * + * + * repeated .google.cloud.filestore.v1beta1.Instance.SuspensionReason suspension_reasons = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return A list containing the enum numeric values on the wire for suspensionReasons. + */ + java.util.List getSuspensionReasonsValueList(); + /** + * + * + *
+   * Output only. Field indicates all the reasons the instance is in "SUSPENDED" state.
+   * 
+ * + * + * repeated .google.cloud.filestore.v1beta1.Instance.SuspensionReason suspension_reasons = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param index The index of the value to return. + * @return The enum numeric value on the wire of suspensionReasons at the given index. + */ + int getSuspensionReasonsValue(int index); + + /** + * + * + *
+   * Output only. The max capacity of the instance.
+   * 
+ * + * int64 max_capacity_gb = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The maxCapacityGb. + */ + long getMaxCapacityGb(); + + /** + * + * + *
+   * Output only. The increase/decrease capacity step size.
+   * 
+ * + * int64 capacity_step_size_gb = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The capacityStepSizeGb. + */ + long getCapacityStepSizeGb(); + + /** + * + * + *
+   * Output only. The max number of shares allowed.
+   * 
+ * + * int64 max_share_count = 18 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The maxShareCount. + */ + long getMaxShareCount(); + + /** + * + * + *
+   * The storage capacity of the instance in gigabytes (GB = 1024^3 bytes).
+   * This capacity can be increased up to `max_capacity_gb` GB in multipliers
+   * of `capacity_step_size_gb` GB.
+   * 
+ * + * int64 capacity_gb = 19; + * + * @return The capacityGb. + */ + long getCapacityGb(); + + /** + * + * + *
+   * Indicates whether this instance uses a multi-share configuration with which
+   * it can have more than one file-share or none at all. File-shares are added,
+   * updated and removed through the separate file-share APIs.
+   * 
+ * + * bool multi_share_enabled = 20; + * + * @return The multiShareEnabled. + */ + boolean getMultiShareEnabled(); } diff --git a/java-filestore/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/ListBackupsRequest.java b/java-filestore/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/ListBackupsRequest.java index cb9298df1137..ba515e238595 100644 --- a/java-filestore/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/ListBackupsRequest.java +++ b/java-filestore/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/ListBackupsRequest.java @@ -78,7 +78,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { *
    * Required. The project and location for which to retrieve backup information,
    * in the format `projects/{project_id}/locations/{location}`.
-   * In Cloud Filestore, backup locations map to GCP regions,
+   * In Filestore, backup locations map to GCP regions,
    * for example **us-west1**.
    * To retrieve backup information for all locations, use "-" for the
    * `{location}` value.
@@ -108,7 +108,7 @@ public java.lang.String getParent() {
    * 
    * Required. The project and location for which to retrieve backup information,
    * in the format `projects/{project_id}/locations/{location}`.
-   * In Cloud Filestore, backup locations map to GCP regions,
+   * In Filestore, backup locations map to GCP regions,
    * for example **us-west1**.
    * To retrieve backup information for all locations, use "-" for the
    * `{location}` value.
@@ -725,7 +725,7 @@ public Builder mergeFrom(
      * 
      * Required. The project and location for which to retrieve backup information,
      * in the format `projects/{project_id}/locations/{location}`.
-     * In Cloud Filestore, backup locations map to GCP regions,
+     * In Filestore, backup locations map to GCP regions,
      * for example **us-west1**.
      * To retrieve backup information for all locations, use "-" for the
      * `{location}` value.
@@ -754,7 +754,7 @@ public java.lang.String getParent() {
      * 
      * Required. The project and location for which to retrieve backup information,
      * in the format `projects/{project_id}/locations/{location}`.
-     * In Cloud Filestore, backup locations map to GCP regions,
+     * In Filestore, backup locations map to GCP regions,
      * for example **us-west1**.
      * To retrieve backup information for all locations, use "-" for the
      * `{location}` value.
@@ -783,7 +783,7 @@ public com.google.protobuf.ByteString getParentBytes() {
      * 
      * Required. The project and location for which to retrieve backup information,
      * in the format `projects/{project_id}/locations/{location}`.
-     * In Cloud Filestore, backup locations map to GCP regions,
+     * In Filestore, backup locations map to GCP regions,
      * for example **us-west1**.
      * To retrieve backup information for all locations, use "-" for the
      * `{location}` value.
@@ -811,7 +811,7 @@ public Builder setParent(java.lang.String value) {
      * 
      * Required. The project and location for which to retrieve backup information,
      * in the format `projects/{project_id}/locations/{location}`.
-     * In Cloud Filestore, backup locations map to GCP regions,
+     * In Filestore, backup locations map to GCP regions,
      * for example **us-west1**.
      * To retrieve backup information for all locations, use "-" for the
      * `{location}` value.
@@ -835,7 +835,7 @@ public Builder clearParent() {
      * 
      * Required. The project and location for which to retrieve backup information,
      * in the format `projects/{project_id}/locations/{location}`.
-     * In Cloud Filestore, backup locations map to GCP regions,
+     * In Filestore, backup locations map to GCP regions,
      * for example **us-west1**.
      * To retrieve backup information for all locations, use "-" for the
      * `{location}` value.
diff --git a/java-filestore/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/ListBackupsRequestOrBuilder.java b/java-filestore/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/ListBackupsRequestOrBuilder.java
index bcce4ab3ff54..95d9fa16c81f 100644
--- a/java-filestore/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/ListBackupsRequestOrBuilder.java
+++ b/java-filestore/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/ListBackupsRequestOrBuilder.java
@@ -29,7 +29,7 @@ public interface ListBackupsRequestOrBuilder
    * 
    * Required. The project and location for which to retrieve backup information,
    * in the format `projects/{project_id}/locations/{location}`.
-   * In Cloud Filestore, backup locations map to GCP regions,
+   * In Filestore, backup locations map to GCP regions,
    * for example **us-west1**.
    * To retrieve backup information for all locations, use "-" for the
    * `{location}` value.
@@ -48,7 +48,7 @@ public interface ListBackupsRequestOrBuilder
    * 
    * Required. The project and location for which to retrieve backup information,
    * in the format `projects/{project_id}/locations/{location}`.
-   * In Cloud Filestore, backup locations map to GCP regions,
+   * In Filestore, backup locations map to GCP regions,
    * for example **us-west1**.
    * To retrieve backup information for all locations, use "-" for the
    * `{location}` value.
diff --git a/java-filestore/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/ListSharesRequest.java b/java-filestore/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/ListSharesRequest.java
new file mode 100644
index 000000000000..0d521aa473bf
--- /dev/null
+++ b/java-filestore/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/ListSharesRequest.java
@@ -0,0 +1,1275 @@
+/*
+ * Copyright 2020 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+// Generated by the protocol buffer compiler.  DO NOT EDIT!
+// source: google/cloud/filestore/v1beta1/cloud_filestore_service.proto
+
+package com.google.cloud.filestore.v1beta1;
+
+/**
+ *
+ *
+ * 
+ * ListSharesRequest lists shares.
+ * 
+ * + * Protobuf type {@code google.cloud.filestore.v1beta1.ListSharesRequest} + */ +public final class ListSharesRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.filestore.v1beta1.ListSharesRequest) + ListSharesRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListSharesRequest.newBuilder() to construct. + private ListSharesRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListSharesRequest() { + parent_ = ""; + pageToken_ = ""; + orderBy_ = ""; + filter_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListSharesRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.filestore.v1beta1.CloudFilestoreServiceProto + .internal_static_google_cloud_filestore_v1beta1_ListSharesRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.filestore.v1beta1.CloudFilestoreServiceProto + .internal_static_google_cloud_filestore_v1beta1_ListSharesRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.filestore.v1beta1.ListSharesRequest.class, + com.google.cloud.filestore.v1beta1.ListSharesRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + * + * + *
+   * Required. The instance for which to retrieve share information,
+   * in the format
+   * `projects/{project_id}/locations/{location}/instances/{instance_id}`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + @java.lang.Override + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The instance for which to retrieve share information,
+   * in the format
+   * `projects/{project_id}/locations/{location}/instances/{instance_id}`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + @java.lang.Override + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PAGE_SIZE_FIELD_NUMBER = 2; + private int pageSize_; + /** + * + * + *
+   * The maximum number of items to return.
+   * 
+ * + * int32 page_size = 2; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + + public static final int PAGE_TOKEN_FIELD_NUMBER = 3; + private volatile java.lang.Object pageToken_; + /** + * + * + *
+   * The next_page_token value to use if there are additional
+   * results to retrieve for this list request.
+   * 
+ * + * string page_token = 3; + * + * @return The pageToken. + */ + @java.lang.Override + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } + } + /** + * + * + *
+   * The next_page_token value to use if there are additional
+   * results to retrieve for this list request.
+   * 
+ * + * string page_token = 3; + * + * @return The bytes for pageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ORDER_BY_FIELD_NUMBER = 4; + private volatile java.lang.Object orderBy_; + /** + * + * + *
+   * Sort results. Supported values are "name", "name desc" or "" (unsorted).
+   * 
+ * + * string order_by = 4; + * + * @return The orderBy. + */ + @java.lang.Override + public java.lang.String getOrderBy() { + java.lang.Object ref = orderBy_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + orderBy_ = s; + return s; + } + } + /** + * + * + *
+   * Sort results. Supported values are "name", "name desc" or "" (unsorted).
+   * 
+ * + * string order_by = 4; + * + * @return The bytes for orderBy. + */ + @java.lang.Override + public com.google.protobuf.ByteString getOrderByBytes() { + java.lang.Object ref = orderBy_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + orderBy_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int FILTER_FIELD_NUMBER = 5; + private volatile java.lang.Object filter_; + /** + * + * + *
+   * List filter.
+   * 
+ * + * string filter = 5; + * + * @return The filter. + */ + @java.lang.Override + public java.lang.String getFilter() { + java.lang.Object ref = filter_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + filter_ = s; + return s; + } + } + /** + * + * + *
+   * List filter.
+   * 
+ * + * string filter = 5; + * + * @return The bytes for filter. + */ + @java.lang.Override + public com.google.protobuf.ByteString getFilterBytes() { + java.lang.Object ref = filter_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + filter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (pageSize_ != 0) { + output.writeInt32(2, pageSize_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, pageToken_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(orderBy_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, orderBy_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(filter_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, filter_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (pageSize_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(2, pageSize_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, pageToken_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(orderBy_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, orderBy_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(filter_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, filter_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.filestore.v1beta1.ListSharesRequest)) { + return super.equals(obj); + } + com.google.cloud.filestore.v1beta1.ListSharesRequest other = + (com.google.cloud.filestore.v1beta1.ListSharesRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (getPageSize() != other.getPageSize()) return false; + if (!getPageToken().equals(other.getPageToken())) return false; + if (!getOrderBy().equals(other.getOrderBy())) return false; + if (!getFilter().equals(other.getFilter())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + hash = (37 * hash) + PAGE_SIZE_FIELD_NUMBER; + hash = (53 * hash) + getPageSize(); + hash = (37 * hash) + PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getPageToken().hashCode(); + hash = (37 * hash) + ORDER_BY_FIELD_NUMBER; + hash = (53 * hash) + getOrderBy().hashCode(); + hash = (37 * hash) + FILTER_FIELD_NUMBER; + hash = (53 * hash) + getFilter().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.filestore.v1beta1.ListSharesRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.filestore.v1beta1.ListSharesRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.filestore.v1beta1.ListSharesRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.filestore.v1beta1.ListSharesRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.filestore.v1beta1.ListSharesRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.filestore.v1beta1.ListSharesRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.filestore.v1beta1.ListSharesRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.filestore.v1beta1.ListSharesRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.filestore.v1beta1.ListSharesRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.filestore.v1beta1.ListSharesRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.filestore.v1beta1.ListSharesRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.filestore.v1beta1.ListSharesRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.filestore.v1beta1.ListSharesRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * ListSharesRequest lists shares.
+   * 
+ * + * Protobuf type {@code google.cloud.filestore.v1beta1.ListSharesRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.filestore.v1beta1.ListSharesRequest) + com.google.cloud.filestore.v1beta1.ListSharesRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.filestore.v1beta1.CloudFilestoreServiceProto + .internal_static_google_cloud_filestore_v1beta1_ListSharesRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.filestore.v1beta1.CloudFilestoreServiceProto + .internal_static_google_cloud_filestore_v1beta1_ListSharesRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.filestore.v1beta1.ListSharesRequest.class, + com.google.cloud.filestore.v1beta1.ListSharesRequest.Builder.class); + } + + // Construct using com.google.cloud.filestore.v1beta1.ListSharesRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + parent_ = ""; + + pageSize_ = 0; + + pageToken_ = ""; + + orderBy_ = ""; + + filter_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.filestore.v1beta1.CloudFilestoreServiceProto + .internal_static_google_cloud_filestore_v1beta1_ListSharesRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.filestore.v1beta1.ListSharesRequest getDefaultInstanceForType() { + return com.google.cloud.filestore.v1beta1.ListSharesRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.filestore.v1beta1.ListSharesRequest build() { + com.google.cloud.filestore.v1beta1.ListSharesRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.filestore.v1beta1.ListSharesRequest buildPartial() { + com.google.cloud.filestore.v1beta1.ListSharesRequest result = + new com.google.cloud.filestore.v1beta1.ListSharesRequest(this); + result.parent_ = parent_; + result.pageSize_ = pageSize_; + result.pageToken_ = pageToken_; + result.orderBy_ = orderBy_; + result.filter_ = filter_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.filestore.v1beta1.ListSharesRequest) { + return mergeFrom((com.google.cloud.filestore.v1beta1.ListSharesRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.filestore.v1beta1.ListSharesRequest other) { + if (other == com.google.cloud.filestore.v1beta1.ListSharesRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + onChanged(); + } + if (other.getPageSize() != 0) { + setPageSize(other.getPageSize()); + } + if (!other.getPageToken().isEmpty()) { + pageToken_ = other.pageToken_; + onChanged(); + } + if (!other.getOrderBy().isEmpty()) { + orderBy_ = other.orderBy_; + onChanged(); + } + if (!other.getFilter().isEmpty()) { + filter_ = other.filter_; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + parent_ = input.readStringRequireUtf8(); + + break; + } // case 10 + case 16: + { + pageSize_ = input.readInt32(); + + break; + } // case 16 + case 26: + { + pageToken_ = input.readStringRequireUtf8(); + + break; + } // case 26 + case 34: + { + orderBy_ = input.readStringRequireUtf8(); + + break; + } // case 34 + case 42: + { + filter_ = input.readStringRequireUtf8(); + + break; + } // case 42 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. The instance for which to retrieve share information,
+     * in the format
+     * `projects/{project_id}/locations/{location}/instances/{instance_id}`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The instance for which to retrieve share information,
+     * in the format
+     * `projects/{project_id}/locations/{location}/instances/{instance_id}`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The instance for which to retrieve share information,
+     * in the format
+     * `projects/{project_id}/locations/{location}/instances/{instance_id}`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The parent to set. + * @return This builder for chaining. + */ + public Builder setParent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + parent_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The instance for which to retrieve share information,
+     * in the format
+     * `projects/{project_id}/locations/{location}/instances/{instance_id}`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + + parent_ = getDefaultInstance().getParent(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The instance for which to retrieve share information,
+     * in the format
+     * `projects/{project_id}/locations/{location}/instances/{instance_id}`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for parent to set. + * @return This builder for chaining. + */ + public Builder setParentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + parent_ = value; + onChanged(); + return this; + } + + private int pageSize_; + /** + * + * + *
+     * The maximum number of items to return.
+     * 
+ * + * int32 page_size = 2; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + /** + * + * + *
+     * The maximum number of items to return.
+     * 
+ * + * int32 page_size = 2; + * + * @param value The pageSize to set. + * @return This builder for chaining. + */ + public Builder setPageSize(int value) { + + pageSize_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The maximum number of items to return.
+     * 
+ * + * int32 page_size = 2; + * + * @return This builder for chaining. + */ + public Builder clearPageSize() { + + pageSize_ = 0; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + /** + * + * + *
+     * The next_page_token value to use if there are additional
+     * results to retrieve for this list request.
+     * 
+ * + * string page_token = 3; + * + * @return The pageToken. + */ + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The next_page_token value to use if there are additional
+     * results to retrieve for this list request.
+     * 
+ * + * string page_token = 3; + * + * @return The bytes for pageToken. + */ + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The next_page_token value to use if there are additional
+     * results to retrieve for this list request.
+     * 
+ * + * string page_token = 3; + * + * @param value The pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + pageToken_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The next_page_token value to use if there are additional
+     * results to retrieve for this list request.
+     * 
+ * + * string page_token = 3; + * + * @return This builder for chaining. + */ + public Builder clearPageToken() { + + pageToken_ = getDefaultInstance().getPageToken(); + onChanged(); + return this; + } + /** + * + * + *
+     * The next_page_token value to use if there are additional
+     * results to retrieve for this list request.
+     * 
+ * + * string page_token = 3; + * + * @param value The bytes for pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + pageToken_ = value; + onChanged(); + return this; + } + + private java.lang.Object orderBy_ = ""; + /** + * + * + *
+     * Sort results. Supported values are "name", "name desc" or "" (unsorted).
+     * 
+ * + * string order_by = 4; + * + * @return The orderBy. + */ + public java.lang.String getOrderBy() { + java.lang.Object ref = orderBy_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + orderBy_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Sort results. Supported values are "name", "name desc" or "" (unsorted).
+     * 
+ * + * string order_by = 4; + * + * @return The bytes for orderBy. + */ + public com.google.protobuf.ByteString getOrderByBytes() { + java.lang.Object ref = orderBy_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + orderBy_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Sort results. Supported values are "name", "name desc" or "" (unsorted).
+     * 
+ * + * string order_by = 4; + * + * @param value The orderBy to set. + * @return This builder for chaining. + */ + public Builder setOrderBy(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + orderBy_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Sort results. Supported values are "name", "name desc" or "" (unsorted).
+     * 
+ * + * string order_by = 4; + * + * @return This builder for chaining. + */ + public Builder clearOrderBy() { + + orderBy_ = getDefaultInstance().getOrderBy(); + onChanged(); + return this; + } + /** + * + * + *
+     * Sort results. Supported values are "name", "name desc" or "" (unsorted).
+     * 
+ * + * string order_by = 4; + * + * @param value The bytes for orderBy to set. + * @return This builder for chaining. + */ + public Builder setOrderByBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + orderBy_ = value; + onChanged(); + return this; + } + + private java.lang.Object filter_ = ""; + /** + * + * + *
+     * List filter.
+     * 
+ * + * string filter = 5; + * + * @return The filter. + */ + public java.lang.String getFilter() { + java.lang.Object ref = filter_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + filter_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * List filter.
+     * 
+ * + * string filter = 5; + * + * @return The bytes for filter. + */ + public com.google.protobuf.ByteString getFilterBytes() { + java.lang.Object ref = filter_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + filter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * List filter.
+     * 
+ * + * string filter = 5; + * + * @param value The filter to set. + * @return This builder for chaining. + */ + public Builder setFilter(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + filter_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * List filter.
+     * 
+ * + * string filter = 5; + * + * @return This builder for chaining. + */ + public Builder clearFilter() { + + filter_ = getDefaultInstance().getFilter(); + onChanged(); + return this; + } + /** + * + * + *
+     * List filter.
+     * 
+ * + * string filter = 5; + * + * @param value The bytes for filter to set. + * @return This builder for chaining. + */ + public Builder setFilterBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + filter_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.filestore.v1beta1.ListSharesRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.filestore.v1beta1.ListSharesRequest) + private static final com.google.cloud.filestore.v1beta1.ListSharesRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.filestore.v1beta1.ListSharesRequest(); + } + + public static com.google.cloud.filestore.v1beta1.ListSharesRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListSharesRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.filestore.v1beta1.ListSharesRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-filestore/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/ListSharesRequestOrBuilder.java b/java-filestore/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/ListSharesRequestOrBuilder.java new file mode 100644 index 000000000000..4e596590c46b --- /dev/null +++ b/java-filestore/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/ListSharesRequestOrBuilder.java @@ -0,0 +1,148 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/filestore/v1beta1/cloud_filestore_service.proto + +package com.google.cloud.filestore.v1beta1; + +public interface ListSharesRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.filestore.v1beta1.ListSharesRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The instance for which to retrieve share information,
+   * in the format
+   * `projects/{project_id}/locations/{location}/instances/{instance_id}`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. The instance for which to retrieve share information,
+   * in the format
+   * `projects/{project_id}/locations/{location}/instances/{instance_id}`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * The maximum number of items to return.
+   * 
+ * + * int32 page_size = 2; + * + * @return The pageSize. + */ + int getPageSize(); + + /** + * + * + *
+   * The next_page_token value to use if there are additional
+   * results to retrieve for this list request.
+   * 
+ * + * string page_token = 3; + * + * @return The pageToken. + */ + java.lang.String getPageToken(); + /** + * + * + *
+   * The next_page_token value to use if there are additional
+   * results to retrieve for this list request.
+   * 
+ * + * string page_token = 3; + * + * @return The bytes for pageToken. + */ + com.google.protobuf.ByteString getPageTokenBytes(); + + /** + * + * + *
+   * Sort results. Supported values are "name", "name desc" or "" (unsorted).
+   * 
+ * + * string order_by = 4; + * + * @return The orderBy. + */ + java.lang.String getOrderBy(); + /** + * + * + *
+   * Sort results. Supported values are "name", "name desc" or "" (unsorted).
+   * 
+ * + * string order_by = 4; + * + * @return The bytes for orderBy. + */ + com.google.protobuf.ByteString getOrderByBytes(); + + /** + * + * + *
+   * List filter.
+   * 
+ * + * string filter = 5; + * + * @return The filter. + */ + java.lang.String getFilter(); + /** + * + * + *
+   * List filter.
+   * 
+ * + * string filter = 5; + * + * @return The bytes for filter. + */ + com.google.protobuf.ByteString getFilterBytes(); +} diff --git a/java-filestore/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/ListSharesResponse.java b/java-filestore/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/ListSharesResponse.java new file mode 100644 index 000000000000..bfea69284a61 --- /dev/null +++ b/java-filestore/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/ListSharesResponse.java @@ -0,0 +1,1381 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/filestore/v1beta1/cloud_filestore_service.proto + +package com.google.cloud.filestore.v1beta1; + +/** + * + * + *
+ * ListSharesResponse is the result of ListSharesRequest.
+ * 
+ * + * Protobuf type {@code google.cloud.filestore.v1beta1.ListSharesResponse} + */ +public final class ListSharesResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.filestore.v1beta1.ListSharesResponse) + ListSharesResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListSharesResponse.newBuilder() to construct. + private ListSharesResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListSharesResponse() { + shares_ = java.util.Collections.emptyList(); + nextPageToken_ = ""; + unreachable_ = com.google.protobuf.LazyStringArrayList.EMPTY; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListSharesResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.filestore.v1beta1.CloudFilestoreServiceProto + .internal_static_google_cloud_filestore_v1beta1_ListSharesResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.filestore.v1beta1.CloudFilestoreServiceProto + .internal_static_google_cloud_filestore_v1beta1_ListSharesResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.filestore.v1beta1.ListSharesResponse.class, + com.google.cloud.filestore.v1beta1.ListSharesResponse.Builder.class); + } + + public static final int SHARES_FIELD_NUMBER = 1; + private java.util.List shares_; + /** + * + * + *
+   * A list of shares in the project for the specified instance.
+   * 
+ * + * repeated .google.cloud.filestore.v1beta1.Share shares = 1; + */ + @java.lang.Override + public java.util.List getSharesList() { + return shares_; + } + /** + * + * + *
+   * A list of shares in the project for the specified instance.
+   * 
+ * + * repeated .google.cloud.filestore.v1beta1.Share shares = 1; + */ + @java.lang.Override + public java.util.List + getSharesOrBuilderList() { + return shares_; + } + /** + * + * + *
+   * A list of shares in the project for the specified instance.
+   * 
+ * + * repeated .google.cloud.filestore.v1beta1.Share shares = 1; + */ + @java.lang.Override + public int getSharesCount() { + return shares_.size(); + } + /** + * + * + *
+   * A list of shares in the project for the specified instance.
+   * 
+ * + * repeated .google.cloud.filestore.v1beta1.Share shares = 1; + */ + @java.lang.Override + public com.google.cloud.filestore.v1beta1.Share getShares(int index) { + return shares_.get(index); + } + /** + * + * + *
+   * A list of shares in the project for the specified instance.
+   * 
+ * + * repeated .google.cloud.filestore.v1beta1.Share shares = 1; + */ + @java.lang.Override + public com.google.cloud.filestore.v1beta1.ShareOrBuilder getSharesOrBuilder(int index) { + return shares_.get(index); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; + private volatile java.lang.Object nextPageToken_; + /** + * + * + *
+   * The token you can use to retrieve the next page of results. Not returned
+   * if there are no more results in the list.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + @java.lang.Override + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } + } + /** + * + * + *
+   * The token you can use to retrieve the next page of results. Not returned
+   * if there are no more results in the list.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int UNREACHABLE_FIELD_NUMBER = 3; + private com.google.protobuf.LazyStringList unreachable_; + /** + * + * + *
+   * Locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 3; + * + * @return A list containing the unreachable. + */ + public com.google.protobuf.ProtocolStringList getUnreachableList() { + return unreachable_; + } + /** + * + * + *
+   * Locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 3; + * + * @return The count of unreachable. + */ + public int getUnreachableCount() { + return unreachable_.size(); + } + /** + * + * + *
+   * Locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 3; + * + * @param index The index of the element to return. + * @return The unreachable at the given index. + */ + public java.lang.String getUnreachable(int index) { + return unreachable_.get(index); + } + /** + * + * + *
+   * Locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 3; + * + * @param index The index of the value to return. + * @return The bytes of the unreachable at the given index. + */ + public com.google.protobuf.ByteString getUnreachableBytes(int index) { + return unreachable_.getByteString(index); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + for (int i = 0; i < shares_.size(); i++) { + output.writeMessage(1, shares_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, nextPageToken_); + } + for (int i = 0; i < unreachable_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, unreachable_.getRaw(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < shares_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, shares_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, nextPageToken_); + } + { + int dataSize = 0; + for (int i = 0; i < unreachable_.size(); i++) { + dataSize += computeStringSizeNoTag(unreachable_.getRaw(i)); + } + size += dataSize; + size += 1 * getUnreachableList().size(); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.filestore.v1beta1.ListSharesResponse)) { + return super.equals(obj); + } + com.google.cloud.filestore.v1beta1.ListSharesResponse other = + (com.google.cloud.filestore.v1beta1.ListSharesResponse) obj; + + if (!getSharesList().equals(other.getSharesList())) return false; + if (!getNextPageToken().equals(other.getNextPageToken())) return false; + if (!getUnreachableList().equals(other.getUnreachableList())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getSharesCount() > 0) { + hash = (37 * hash) + SHARES_FIELD_NUMBER; + hash = (53 * hash) + getSharesList().hashCode(); + } + hash = (37 * hash) + NEXT_PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getNextPageToken().hashCode(); + if (getUnreachableCount() > 0) { + hash = (37 * hash) + UNREACHABLE_FIELD_NUMBER; + hash = (53 * hash) + getUnreachableList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.filestore.v1beta1.ListSharesResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.filestore.v1beta1.ListSharesResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.filestore.v1beta1.ListSharesResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.filestore.v1beta1.ListSharesResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.filestore.v1beta1.ListSharesResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.filestore.v1beta1.ListSharesResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.filestore.v1beta1.ListSharesResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.filestore.v1beta1.ListSharesResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.filestore.v1beta1.ListSharesResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.filestore.v1beta1.ListSharesResponse parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.filestore.v1beta1.ListSharesResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.filestore.v1beta1.ListSharesResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.filestore.v1beta1.ListSharesResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * ListSharesResponse is the result of ListSharesRequest.
+   * 
+ * + * Protobuf type {@code google.cloud.filestore.v1beta1.ListSharesResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.filestore.v1beta1.ListSharesResponse) + com.google.cloud.filestore.v1beta1.ListSharesResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.filestore.v1beta1.CloudFilestoreServiceProto + .internal_static_google_cloud_filestore_v1beta1_ListSharesResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.filestore.v1beta1.CloudFilestoreServiceProto + .internal_static_google_cloud_filestore_v1beta1_ListSharesResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.filestore.v1beta1.ListSharesResponse.class, + com.google.cloud.filestore.v1beta1.ListSharesResponse.Builder.class); + } + + // Construct using com.google.cloud.filestore.v1beta1.ListSharesResponse.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (sharesBuilder_ == null) { + shares_ = java.util.Collections.emptyList(); + } else { + shares_ = null; + sharesBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + nextPageToken_ = ""; + + unreachable_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000002); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.filestore.v1beta1.CloudFilestoreServiceProto + .internal_static_google_cloud_filestore_v1beta1_ListSharesResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.filestore.v1beta1.ListSharesResponse getDefaultInstanceForType() { + return com.google.cloud.filestore.v1beta1.ListSharesResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.filestore.v1beta1.ListSharesResponse build() { + com.google.cloud.filestore.v1beta1.ListSharesResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.filestore.v1beta1.ListSharesResponse buildPartial() { + com.google.cloud.filestore.v1beta1.ListSharesResponse result = + new com.google.cloud.filestore.v1beta1.ListSharesResponse(this); + int from_bitField0_ = bitField0_; + if (sharesBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + shares_ = java.util.Collections.unmodifiableList(shares_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.shares_ = shares_; + } else { + result.shares_ = sharesBuilder_.build(); + } + result.nextPageToken_ = nextPageToken_; + if (((bitField0_ & 0x00000002) != 0)) { + unreachable_ = unreachable_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.unreachable_ = unreachable_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.filestore.v1beta1.ListSharesResponse) { + return mergeFrom((com.google.cloud.filestore.v1beta1.ListSharesResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.filestore.v1beta1.ListSharesResponse other) { + if (other == com.google.cloud.filestore.v1beta1.ListSharesResponse.getDefaultInstance()) + return this; + if (sharesBuilder_ == null) { + if (!other.shares_.isEmpty()) { + if (shares_.isEmpty()) { + shares_ = other.shares_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureSharesIsMutable(); + shares_.addAll(other.shares_); + } + onChanged(); + } + } else { + if (!other.shares_.isEmpty()) { + if (sharesBuilder_.isEmpty()) { + sharesBuilder_.dispose(); + sharesBuilder_ = null; + shares_ = other.shares_; + bitField0_ = (bitField0_ & ~0x00000001); + sharesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getSharesFieldBuilder() + : null; + } else { + sharesBuilder_.addAllMessages(other.shares_); + } + } + } + if (!other.getNextPageToken().isEmpty()) { + nextPageToken_ = other.nextPageToken_; + onChanged(); + } + if (!other.unreachable_.isEmpty()) { + if (unreachable_.isEmpty()) { + unreachable_ = other.unreachable_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureUnreachableIsMutable(); + unreachable_.addAll(other.unreachable_); + } + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.cloud.filestore.v1beta1.Share m = + input.readMessage( + com.google.cloud.filestore.v1beta1.Share.parser(), extensionRegistry); + if (sharesBuilder_ == null) { + ensureSharesIsMutable(); + shares_.add(m); + } else { + sharesBuilder_.addMessage(m); + } + break; + } // case 10 + case 18: + { + nextPageToken_ = input.readStringRequireUtf8(); + + break; + } // case 18 + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + ensureUnreachableIsMutable(); + unreachable_.add(s); + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.util.List shares_ = + java.util.Collections.emptyList(); + + private void ensureSharesIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + shares_ = new java.util.ArrayList(shares_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.filestore.v1beta1.Share, + com.google.cloud.filestore.v1beta1.Share.Builder, + com.google.cloud.filestore.v1beta1.ShareOrBuilder> + sharesBuilder_; + + /** + * + * + *
+     * A list of shares in the project for the specified instance.
+     * 
+ * + * repeated .google.cloud.filestore.v1beta1.Share shares = 1; + */ + public java.util.List getSharesList() { + if (sharesBuilder_ == null) { + return java.util.Collections.unmodifiableList(shares_); + } else { + return sharesBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * A list of shares in the project for the specified instance.
+     * 
+ * + * repeated .google.cloud.filestore.v1beta1.Share shares = 1; + */ + public int getSharesCount() { + if (sharesBuilder_ == null) { + return shares_.size(); + } else { + return sharesBuilder_.getCount(); + } + } + /** + * + * + *
+     * A list of shares in the project for the specified instance.
+     * 
+ * + * repeated .google.cloud.filestore.v1beta1.Share shares = 1; + */ + public com.google.cloud.filestore.v1beta1.Share getShares(int index) { + if (sharesBuilder_ == null) { + return shares_.get(index); + } else { + return sharesBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * A list of shares in the project for the specified instance.
+     * 
+ * + * repeated .google.cloud.filestore.v1beta1.Share shares = 1; + */ + public Builder setShares(int index, com.google.cloud.filestore.v1beta1.Share value) { + if (sharesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSharesIsMutable(); + shares_.set(index, value); + onChanged(); + } else { + sharesBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * A list of shares in the project for the specified instance.
+     * 
+ * + * repeated .google.cloud.filestore.v1beta1.Share shares = 1; + */ + public Builder setShares( + int index, com.google.cloud.filestore.v1beta1.Share.Builder builderForValue) { + if (sharesBuilder_ == null) { + ensureSharesIsMutable(); + shares_.set(index, builderForValue.build()); + onChanged(); + } else { + sharesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * A list of shares in the project for the specified instance.
+     * 
+ * + * repeated .google.cloud.filestore.v1beta1.Share shares = 1; + */ + public Builder addShares(com.google.cloud.filestore.v1beta1.Share value) { + if (sharesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSharesIsMutable(); + shares_.add(value); + onChanged(); + } else { + sharesBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * A list of shares in the project for the specified instance.
+     * 
+ * + * repeated .google.cloud.filestore.v1beta1.Share shares = 1; + */ + public Builder addShares(int index, com.google.cloud.filestore.v1beta1.Share value) { + if (sharesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSharesIsMutable(); + shares_.add(index, value); + onChanged(); + } else { + sharesBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * A list of shares in the project for the specified instance.
+     * 
+ * + * repeated .google.cloud.filestore.v1beta1.Share shares = 1; + */ + public Builder addShares(com.google.cloud.filestore.v1beta1.Share.Builder builderForValue) { + if (sharesBuilder_ == null) { + ensureSharesIsMutable(); + shares_.add(builderForValue.build()); + onChanged(); + } else { + sharesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * A list of shares in the project for the specified instance.
+     * 
+ * + * repeated .google.cloud.filestore.v1beta1.Share shares = 1; + */ + public Builder addShares( + int index, com.google.cloud.filestore.v1beta1.Share.Builder builderForValue) { + if (sharesBuilder_ == null) { + ensureSharesIsMutable(); + shares_.add(index, builderForValue.build()); + onChanged(); + } else { + sharesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * A list of shares in the project for the specified instance.
+     * 
+ * + * repeated .google.cloud.filestore.v1beta1.Share shares = 1; + */ + public Builder addAllShares( + java.lang.Iterable values) { + if (sharesBuilder_ == null) { + ensureSharesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, shares_); + onChanged(); + } else { + sharesBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * A list of shares in the project for the specified instance.
+     * 
+ * + * repeated .google.cloud.filestore.v1beta1.Share shares = 1; + */ + public Builder clearShares() { + if (sharesBuilder_ == null) { + shares_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + sharesBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * A list of shares in the project for the specified instance.
+     * 
+ * + * repeated .google.cloud.filestore.v1beta1.Share shares = 1; + */ + public Builder removeShares(int index) { + if (sharesBuilder_ == null) { + ensureSharesIsMutable(); + shares_.remove(index); + onChanged(); + } else { + sharesBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * A list of shares in the project for the specified instance.
+     * 
+ * + * repeated .google.cloud.filestore.v1beta1.Share shares = 1; + */ + public com.google.cloud.filestore.v1beta1.Share.Builder getSharesBuilder(int index) { + return getSharesFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * A list of shares in the project for the specified instance.
+     * 
+ * + * repeated .google.cloud.filestore.v1beta1.Share shares = 1; + */ + public com.google.cloud.filestore.v1beta1.ShareOrBuilder getSharesOrBuilder(int index) { + if (sharesBuilder_ == null) { + return shares_.get(index); + } else { + return sharesBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * A list of shares in the project for the specified instance.
+     * 
+ * + * repeated .google.cloud.filestore.v1beta1.Share shares = 1; + */ + public java.util.List + getSharesOrBuilderList() { + if (sharesBuilder_ != null) { + return sharesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(shares_); + } + } + /** + * + * + *
+     * A list of shares in the project for the specified instance.
+     * 
+ * + * repeated .google.cloud.filestore.v1beta1.Share shares = 1; + */ + public com.google.cloud.filestore.v1beta1.Share.Builder addSharesBuilder() { + return getSharesFieldBuilder() + .addBuilder(com.google.cloud.filestore.v1beta1.Share.getDefaultInstance()); + } + /** + * + * + *
+     * A list of shares in the project for the specified instance.
+     * 
+ * + * repeated .google.cloud.filestore.v1beta1.Share shares = 1; + */ + public com.google.cloud.filestore.v1beta1.Share.Builder addSharesBuilder(int index) { + return getSharesFieldBuilder() + .addBuilder(index, com.google.cloud.filestore.v1beta1.Share.getDefaultInstance()); + } + /** + * + * + *
+     * A list of shares in the project for the specified instance.
+     * 
+ * + * repeated .google.cloud.filestore.v1beta1.Share shares = 1; + */ + public java.util.List getSharesBuilderList() { + return getSharesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.filestore.v1beta1.Share, + com.google.cloud.filestore.v1beta1.Share.Builder, + com.google.cloud.filestore.v1beta1.ShareOrBuilder> + getSharesFieldBuilder() { + if (sharesBuilder_ == null) { + sharesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.filestore.v1beta1.Share, + com.google.cloud.filestore.v1beta1.Share.Builder, + com.google.cloud.filestore.v1beta1.ShareOrBuilder>( + shares_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + shares_ = null; + } + return sharesBuilder_; + } + + private java.lang.Object nextPageToken_ = ""; + /** + * + * + *
+     * The token you can use to retrieve the next page of results. Not returned
+     * if there are no more results in the list.
+     * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The token you can use to retrieve the next page of results. Not returned
+     * if there are no more results in the list.
+     * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The token you can use to retrieve the next page of results. Not returned
+     * if there are no more results in the list.
+     * 
+ * + * string next_page_token = 2; + * + * @param value The nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + nextPageToken_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The token you can use to retrieve the next page of results. Not returned
+     * if there are no more results in the list.
+     * 
+ * + * string next_page_token = 2; + * + * @return This builder for chaining. + */ + public Builder clearNextPageToken() { + + nextPageToken_ = getDefaultInstance().getNextPageToken(); + onChanged(); + return this; + } + /** + * + * + *
+     * The token you can use to retrieve the next page of results. Not returned
+     * if there are no more results in the list.
+     * 
+ * + * string next_page_token = 2; + * + * @param value The bytes for nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + nextPageToken_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringList unreachable_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureUnreachableIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + unreachable_ = new com.google.protobuf.LazyStringArrayList(unreachable_); + bitField0_ |= 0x00000002; + } + } + /** + * + * + *
+     * Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3; + * + * @return A list containing the unreachable. + */ + public com.google.protobuf.ProtocolStringList getUnreachableList() { + return unreachable_.getUnmodifiableView(); + } + /** + * + * + *
+     * Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3; + * + * @return The count of unreachable. + */ + public int getUnreachableCount() { + return unreachable_.size(); + } + /** + * + * + *
+     * Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3; + * + * @param index The index of the element to return. + * @return The unreachable at the given index. + */ + public java.lang.String getUnreachable(int index) { + return unreachable_.get(index); + } + /** + * + * + *
+     * Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3; + * + * @param index The index of the value to return. + * @return The bytes of the unreachable at the given index. + */ + public com.google.protobuf.ByteString getUnreachableBytes(int index) { + return unreachable_.getByteString(index); + } + /** + * + * + *
+     * Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3; + * + * @param index The index to set the value at. + * @param value The unreachable to set. + * @return This builder for chaining. + */ + public Builder setUnreachable(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureUnreachableIsMutable(); + unreachable_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3; + * + * @param value The unreachable to add. + * @return This builder for chaining. + */ + public Builder addUnreachable(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureUnreachableIsMutable(); + unreachable_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+     * Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3; + * + * @param values The unreachable to add. + * @return This builder for chaining. + */ + public Builder addAllUnreachable(java.lang.Iterable values) { + ensureUnreachableIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, unreachable_); + onChanged(); + return this; + } + /** + * + * + *
+     * Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3; + * + * @return This builder for chaining. + */ + public Builder clearUnreachable() { + unreachable_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3; + * + * @param value The bytes of the unreachable to add. + * @return This builder for chaining. + */ + public Builder addUnreachableBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureUnreachableIsMutable(); + unreachable_.add(value); + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.filestore.v1beta1.ListSharesResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.filestore.v1beta1.ListSharesResponse) + private static final com.google.cloud.filestore.v1beta1.ListSharesResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.filestore.v1beta1.ListSharesResponse(); + } + + public static com.google.cloud.filestore.v1beta1.ListSharesResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListSharesResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.filestore.v1beta1.ListSharesResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-filestore/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/ListSharesResponseOrBuilder.java b/java-filestore/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/ListSharesResponseOrBuilder.java new file mode 100644 index 000000000000..fe07abad95f3 --- /dev/null +++ b/java-filestore/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/ListSharesResponseOrBuilder.java @@ -0,0 +1,155 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/filestore/v1beta1/cloud_filestore_service.proto + +package com.google.cloud.filestore.v1beta1; + +public interface ListSharesResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.filestore.v1beta1.ListSharesResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * A list of shares in the project for the specified instance.
+   * 
+ * + * repeated .google.cloud.filestore.v1beta1.Share shares = 1; + */ + java.util.List getSharesList(); + /** + * + * + *
+   * A list of shares in the project for the specified instance.
+   * 
+ * + * repeated .google.cloud.filestore.v1beta1.Share shares = 1; + */ + com.google.cloud.filestore.v1beta1.Share getShares(int index); + /** + * + * + *
+   * A list of shares in the project for the specified instance.
+   * 
+ * + * repeated .google.cloud.filestore.v1beta1.Share shares = 1; + */ + int getSharesCount(); + /** + * + * + *
+   * A list of shares in the project for the specified instance.
+   * 
+ * + * repeated .google.cloud.filestore.v1beta1.Share shares = 1; + */ + java.util.List + getSharesOrBuilderList(); + /** + * + * + *
+   * A list of shares in the project for the specified instance.
+   * 
+ * + * repeated .google.cloud.filestore.v1beta1.Share shares = 1; + */ + com.google.cloud.filestore.v1beta1.ShareOrBuilder getSharesOrBuilder(int index); + + /** + * + * + *
+   * The token you can use to retrieve the next page of results. Not returned
+   * if there are no more results in the list.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + java.lang.String getNextPageToken(); + /** + * + * + *
+   * The token you can use to retrieve the next page of results. Not returned
+   * if there are no more results in the list.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + com.google.protobuf.ByteString getNextPageTokenBytes(); + + /** + * + * + *
+   * Locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 3; + * + * @return A list containing the unreachable. + */ + java.util.List getUnreachableList(); + /** + * + * + *
+   * Locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 3; + * + * @return The count of unreachable. + */ + int getUnreachableCount(); + /** + * + * + *
+   * Locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 3; + * + * @param index The index of the element to return. + * @return The unreachable at the given index. + */ + java.lang.String getUnreachable(int index); + /** + * + * + *
+   * Locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 3; + * + * @param index The index of the value to return. + * @return The bytes of the unreachable at the given index. + */ + com.google.protobuf.ByteString getUnreachableBytes(int index); +} diff --git a/java-filestore/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/ListSnapshotsRequest.java b/java-filestore/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/ListSnapshotsRequest.java new file mode 100644 index 000000000000..24db3c1a663a --- /dev/null +++ b/java-filestore/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/ListSnapshotsRequest.java @@ -0,0 +1,1276 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/filestore/v1beta1/cloud_filestore_service.proto + +package com.google.cloud.filestore.v1beta1; + +/** + * + * + *
+ * ListSnapshotsRequest lists snapshots.
+ * 
+ * + * Protobuf type {@code google.cloud.filestore.v1beta1.ListSnapshotsRequest} + */ +public final class ListSnapshotsRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.filestore.v1beta1.ListSnapshotsRequest) + ListSnapshotsRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListSnapshotsRequest.newBuilder() to construct. + private ListSnapshotsRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListSnapshotsRequest() { + parent_ = ""; + pageToken_ = ""; + orderBy_ = ""; + filter_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListSnapshotsRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.filestore.v1beta1.CloudFilestoreServiceProto + .internal_static_google_cloud_filestore_v1beta1_ListSnapshotsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.filestore.v1beta1.CloudFilestoreServiceProto + .internal_static_google_cloud_filestore_v1beta1_ListSnapshotsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.filestore.v1beta1.ListSnapshotsRequest.class, + com.google.cloud.filestore.v1beta1.ListSnapshotsRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + * + * + *
+   * Required. The instance for which to retrieve snapshot information,
+   * in the format
+   * `projects/{project_id}/locations/{location}/instances/{instance_id}`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + @java.lang.Override + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The instance for which to retrieve snapshot information,
+   * in the format
+   * `projects/{project_id}/locations/{location}/instances/{instance_id}`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + @java.lang.Override + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PAGE_SIZE_FIELD_NUMBER = 2; + private int pageSize_; + /** + * + * + *
+   * The maximum number of items to return.
+   * 
+ * + * int32 page_size = 2; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + + public static final int PAGE_TOKEN_FIELD_NUMBER = 3; + private volatile java.lang.Object pageToken_; + /** + * + * + *
+   * The next_page_token value to use if there are additional
+   * results to retrieve for this list request.
+   * 
+ * + * string page_token = 3; + * + * @return The pageToken. + */ + @java.lang.Override + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } + } + /** + * + * + *
+   * The next_page_token value to use if there are additional
+   * results to retrieve for this list request.
+   * 
+ * + * string page_token = 3; + * + * @return The bytes for pageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ORDER_BY_FIELD_NUMBER = 4; + private volatile java.lang.Object orderBy_; + /** + * + * + *
+   * Sort results. Supported values are "name", "name desc" or "" (unsorted).
+   * 
+ * + * string order_by = 4; + * + * @return The orderBy. + */ + @java.lang.Override + public java.lang.String getOrderBy() { + java.lang.Object ref = orderBy_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + orderBy_ = s; + return s; + } + } + /** + * + * + *
+   * Sort results. Supported values are "name", "name desc" or "" (unsorted).
+   * 
+ * + * string order_by = 4; + * + * @return The bytes for orderBy. + */ + @java.lang.Override + public com.google.protobuf.ByteString getOrderByBytes() { + java.lang.Object ref = orderBy_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + orderBy_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int FILTER_FIELD_NUMBER = 5; + private volatile java.lang.Object filter_; + /** + * + * + *
+   * List filter.
+   * 
+ * + * string filter = 5; + * + * @return The filter. + */ + @java.lang.Override + public java.lang.String getFilter() { + java.lang.Object ref = filter_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + filter_ = s; + return s; + } + } + /** + * + * + *
+   * List filter.
+   * 
+ * + * string filter = 5; + * + * @return The bytes for filter. + */ + @java.lang.Override + public com.google.protobuf.ByteString getFilterBytes() { + java.lang.Object ref = filter_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + filter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (pageSize_ != 0) { + output.writeInt32(2, pageSize_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, pageToken_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(orderBy_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, orderBy_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(filter_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, filter_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (pageSize_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(2, pageSize_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, pageToken_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(orderBy_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, orderBy_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(filter_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, filter_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.filestore.v1beta1.ListSnapshotsRequest)) { + return super.equals(obj); + } + com.google.cloud.filestore.v1beta1.ListSnapshotsRequest other = + (com.google.cloud.filestore.v1beta1.ListSnapshotsRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (getPageSize() != other.getPageSize()) return false; + if (!getPageToken().equals(other.getPageToken())) return false; + if (!getOrderBy().equals(other.getOrderBy())) return false; + if (!getFilter().equals(other.getFilter())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + hash = (37 * hash) + PAGE_SIZE_FIELD_NUMBER; + hash = (53 * hash) + getPageSize(); + hash = (37 * hash) + PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getPageToken().hashCode(); + hash = (37 * hash) + ORDER_BY_FIELD_NUMBER; + hash = (53 * hash) + getOrderBy().hashCode(); + hash = (37 * hash) + FILTER_FIELD_NUMBER; + hash = (53 * hash) + getFilter().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.filestore.v1beta1.ListSnapshotsRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.filestore.v1beta1.ListSnapshotsRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.filestore.v1beta1.ListSnapshotsRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.filestore.v1beta1.ListSnapshotsRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.filestore.v1beta1.ListSnapshotsRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.filestore.v1beta1.ListSnapshotsRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.filestore.v1beta1.ListSnapshotsRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.filestore.v1beta1.ListSnapshotsRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.filestore.v1beta1.ListSnapshotsRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.filestore.v1beta1.ListSnapshotsRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.filestore.v1beta1.ListSnapshotsRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.filestore.v1beta1.ListSnapshotsRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.filestore.v1beta1.ListSnapshotsRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * ListSnapshotsRequest lists snapshots.
+   * 
+ * + * Protobuf type {@code google.cloud.filestore.v1beta1.ListSnapshotsRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.filestore.v1beta1.ListSnapshotsRequest) + com.google.cloud.filestore.v1beta1.ListSnapshotsRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.filestore.v1beta1.CloudFilestoreServiceProto + .internal_static_google_cloud_filestore_v1beta1_ListSnapshotsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.filestore.v1beta1.CloudFilestoreServiceProto + .internal_static_google_cloud_filestore_v1beta1_ListSnapshotsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.filestore.v1beta1.ListSnapshotsRequest.class, + com.google.cloud.filestore.v1beta1.ListSnapshotsRequest.Builder.class); + } + + // Construct using com.google.cloud.filestore.v1beta1.ListSnapshotsRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + parent_ = ""; + + pageSize_ = 0; + + pageToken_ = ""; + + orderBy_ = ""; + + filter_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.filestore.v1beta1.CloudFilestoreServiceProto + .internal_static_google_cloud_filestore_v1beta1_ListSnapshotsRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.filestore.v1beta1.ListSnapshotsRequest getDefaultInstanceForType() { + return com.google.cloud.filestore.v1beta1.ListSnapshotsRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.filestore.v1beta1.ListSnapshotsRequest build() { + com.google.cloud.filestore.v1beta1.ListSnapshotsRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.filestore.v1beta1.ListSnapshotsRequest buildPartial() { + com.google.cloud.filestore.v1beta1.ListSnapshotsRequest result = + new com.google.cloud.filestore.v1beta1.ListSnapshotsRequest(this); + result.parent_ = parent_; + result.pageSize_ = pageSize_; + result.pageToken_ = pageToken_; + result.orderBy_ = orderBy_; + result.filter_ = filter_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.filestore.v1beta1.ListSnapshotsRequest) { + return mergeFrom((com.google.cloud.filestore.v1beta1.ListSnapshotsRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.filestore.v1beta1.ListSnapshotsRequest other) { + if (other == com.google.cloud.filestore.v1beta1.ListSnapshotsRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + onChanged(); + } + if (other.getPageSize() != 0) { + setPageSize(other.getPageSize()); + } + if (!other.getPageToken().isEmpty()) { + pageToken_ = other.pageToken_; + onChanged(); + } + if (!other.getOrderBy().isEmpty()) { + orderBy_ = other.orderBy_; + onChanged(); + } + if (!other.getFilter().isEmpty()) { + filter_ = other.filter_; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + parent_ = input.readStringRequireUtf8(); + + break; + } // case 10 + case 16: + { + pageSize_ = input.readInt32(); + + break; + } // case 16 + case 26: + { + pageToken_ = input.readStringRequireUtf8(); + + break; + } // case 26 + case 34: + { + orderBy_ = input.readStringRequireUtf8(); + + break; + } // case 34 + case 42: + { + filter_ = input.readStringRequireUtf8(); + + break; + } // case 42 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. The instance for which to retrieve snapshot information,
+     * in the format
+     * `projects/{project_id}/locations/{location}/instances/{instance_id}`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The instance for which to retrieve snapshot information,
+     * in the format
+     * `projects/{project_id}/locations/{location}/instances/{instance_id}`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The instance for which to retrieve snapshot information,
+     * in the format
+     * `projects/{project_id}/locations/{location}/instances/{instance_id}`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The parent to set. + * @return This builder for chaining. + */ + public Builder setParent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + parent_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The instance for which to retrieve snapshot information,
+     * in the format
+     * `projects/{project_id}/locations/{location}/instances/{instance_id}`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + + parent_ = getDefaultInstance().getParent(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The instance for which to retrieve snapshot information,
+     * in the format
+     * `projects/{project_id}/locations/{location}/instances/{instance_id}`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for parent to set. + * @return This builder for chaining. + */ + public Builder setParentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + parent_ = value; + onChanged(); + return this; + } + + private int pageSize_; + /** + * + * + *
+     * The maximum number of items to return.
+     * 
+ * + * int32 page_size = 2; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + /** + * + * + *
+     * The maximum number of items to return.
+     * 
+ * + * int32 page_size = 2; + * + * @param value The pageSize to set. + * @return This builder for chaining. + */ + public Builder setPageSize(int value) { + + pageSize_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The maximum number of items to return.
+     * 
+ * + * int32 page_size = 2; + * + * @return This builder for chaining. + */ + public Builder clearPageSize() { + + pageSize_ = 0; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + /** + * + * + *
+     * The next_page_token value to use if there are additional
+     * results to retrieve for this list request.
+     * 
+ * + * string page_token = 3; + * + * @return The pageToken. + */ + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The next_page_token value to use if there are additional
+     * results to retrieve for this list request.
+     * 
+ * + * string page_token = 3; + * + * @return The bytes for pageToken. + */ + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The next_page_token value to use if there are additional
+     * results to retrieve for this list request.
+     * 
+ * + * string page_token = 3; + * + * @param value The pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + pageToken_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The next_page_token value to use if there are additional
+     * results to retrieve for this list request.
+     * 
+ * + * string page_token = 3; + * + * @return This builder for chaining. + */ + public Builder clearPageToken() { + + pageToken_ = getDefaultInstance().getPageToken(); + onChanged(); + return this; + } + /** + * + * + *
+     * The next_page_token value to use if there are additional
+     * results to retrieve for this list request.
+     * 
+ * + * string page_token = 3; + * + * @param value The bytes for pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + pageToken_ = value; + onChanged(); + return this; + } + + private java.lang.Object orderBy_ = ""; + /** + * + * + *
+     * Sort results. Supported values are "name", "name desc" or "" (unsorted).
+     * 
+ * + * string order_by = 4; + * + * @return The orderBy. + */ + public java.lang.String getOrderBy() { + java.lang.Object ref = orderBy_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + orderBy_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Sort results. Supported values are "name", "name desc" or "" (unsorted).
+     * 
+ * + * string order_by = 4; + * + * @return The bytes for orderBy. + */ + public com.google.protobuf.ByteString getOrderByBytes() { + java.lang.Object ref = orderBy_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + orderBy_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Sort results. Supported values are "name", "name desc" or "" (unsorted).
+     * 
+ * + * string order_by = 4; + * + * @param value The orderBy to set. + * @return This builder for chaining. + */ + public Builder setOrderBy(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + orderBy_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Sort results. Supported values are "name", "name desc" or "" (unsorted).
+     * 
+ * + * string order_by = 4; + * + * @return This builder for chaining. + */ + public Builder clearOrderBy() { + + orderBy_ = getDefaultInstance().getOrderBy(); + onChanged(); + return this; + } + /** + * + * + *
+     * Sort results. Supported values are "name", "name desc" or "" (unsorted).
+     * 
+ * + * string order_by = 4; + * + * @param value The bytes for orderBy to set. + * @return This builder for chaining. + */ + public Builder setOrderByBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + orderBy_ = value; + onChanged(); + return this; + } + + private java.lang.Object filter_ = ""; + /** + * + * + *
+     * List filter.
+     * 
+ * + * string filter = 5; + * + * @return The filter. + */ + public java.lang.String getFilter() { + java.lang.Object ref = filter_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + filter_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * List filter.
+     * 
+ * + * string filter = 5; + * + * @return The bytes for filter. + */ + public com.google.protobuf.ByteString getFilterBytes() { + java.lang.Object ref = filter_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + filter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * List filter.
+     * 
+ * + * string filter = 5; + * + * @param value The filter to set. + * @return This builder for chaining. + */ + public Builder setFilter(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + filter_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * List filter.
+     * 
+ * + * string filter = 5; + * + * @return This builder for chaining. + */ + public Builder clearFilter() { + + filter_ = getDefaultInstance().getFilter(); + onChanged(); + return this; + } + /** + * + * + *
+     * List filter.
+     * 
+ * + * string filter = 5; + * + * @param value The bytes for filter to set. + * @return This builder for chaining. + */ + public Builder setFilterBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + filter_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.filestore.v1beta1.ListSnapshotsRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.filestore.v1beta1.ListSnapshotsRequest) + private static final com.google.cloud.filestore.v1beta1.ListSnapshotsRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.filestore.v1beta1.ListSnapshotsRequest(); + } + + public static com.google.cloud.filestore.v1beta1.ListSnapshotsRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListSnapshotsRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.filestore.v1beta1.ListSnapshotsRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-filestore/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/ListSnapshotsRequestOrBuilder.java b/java-filestore/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/ListSnapshotsRequestOrBuilder.java new file mode 100644 index 000000000000..cbbec8ba3a1b --- /dev/null +++ b/java-filestore/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/ListSnapshotsRequestOrBuilder.java @@ -0,0 +1,148 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/filestore/v1beta1/cloud_filestore_service.proto + +package com.google.cloud.filestore.v1beta1; + +public interface ListSnapshotsRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.filestore.v1beta1.ListSnapshotsRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The instance for which to retrieve snapshot information,
+   * in the format
+   * `projects/{project_id}/locations/{location}/instances/{instance_id}`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. The instance for which to retrieve snapshot information,
+   * in the format
+   * `projects/{project_id}/locations/{location}/instances/{instance_id}`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * The maximum number of items to return.
+   * 
+ * + * int32 page_size = 2; + * + * @return The pageSize. + */ + int getPageSize(); + + /** + * + * + *
+   * The next_page_token value to use if there are additional
+   * results to retrieve for this list request.
+   * 
+ * + * string page_token = 3; + * + * @return The pageToken. + */ + java.lang.String getPageToken(); + /** + * + * + *
+   * The next_page_token value to use if there are additional
+   * results to retrieve for this list request.
+   * 
+ * + * string page_token = 3; + * + * @return The bytes for pageToken. + */ + com.google.protobuf.ByteString getPageTokenBytes(); + + /** + * + * + *
+   * Sort results. Supported values are "name", "name desc" or "" (unsorted).
+   * 
+ * + * string order_by = 4; + * + * @return The orderBy. + */ + java.lang.String getOrderBy(); + /** + * + * + *
+   * Sort results. Supported values are "name", "name desc" or "" (unsorted).
+   * 
+ * + * string order_by = 4; + * + * @return The bytes for orderBy. + */ + com.google.protobuf.ByteString getOrderByBytes(); + + /** + * + * + *
+   * List filter.
+   * 
+ * + * string filter = 5; + * + * @return The filter. + */ + java.lang.String getFilter(); + /** + * + * + *
+   * List filter.
+   * 
+ * + * string filter = 5; + * + * @return The bytes for filter. + */ + com.google.protobuf.ByteString getFilterBytes(); +} diff --git a/java-filestore/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/ListSnapshotsResponse.java b/java-filestore/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/ListSnapshotsResponse.java new file mode 100644 index 000000000000..983affd8dee3 --- /dev/null +++ b/java-filestore/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/ListSnapshotsResponse.java @@ -0,0 +1,1114 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/filestore/v1beta1/cloud_filestore_service.proto + +package com.google.cloud.filestore.v1beta1; + +/** + * + * + *
+ * ListSnapshotsResponse is the result of ListSnapshotsRequest.
+ * 
+ * + * Protobuf type {@code google.cloud.filestore.v1beta1.ListSnapshotsResponse} + */ +public final class ListSnapshotsResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.filestore.v1beta1.ListSnapshotsResponse) + ListSnapshotsResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListSnapshotsResponse.newBuilder() to construct. + private ListSnapshotsResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListSnapshotsResponse() { + snapshots_ = java.util.Collections.emptyList(); + nextPageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListSnapshotsResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.filestore.v1beta1.CloudFilestoreServiceProto + .internal_static_google_cloud_filestore_v1beta1_ListSnapshotsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.filestore.v1beta1.CloudFilestoreServiceProto + .internal_static_google_cloud_filestore_v1beta1_ListSnapshotsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.filestore.v1beta1.ListSnapshotsResponse.class, + com.google.cloud.filestore.v1beta1.ListSnapshotsResponse.Builder.class); + } + + public static final int SNAPSHOTS_FIELD_NUMBER = 1; + private java.util.List snapshots_; + /** + * + * + *
+   * A list of snapshots in the project for the specified instance.
+   * 
+ * + * repeated .google.cloud.filestore.v1beta1.Snapshot snapshots = 1; + */ + @java.lang.Override + public java.util.List getSnapshotsList() { + return snapshots_; + } + /** + * + * + *
+   * A list of snapshots in the project for the specified instance.
+   * 
+ * + * repeated .google.cloud.filestore.v1beta1.Snapshot snapshots = 1; + */ + @java.lang.Override + public java.util.List + getSnapshotsOrBuilderList() { + return snapshots_; + } + /** + * + * + *
+   * A list of snapshots in the project for the specified instance.
+   * 
+ * + * repeated .google.cloud.filestore.v1beta1.Snapshot snapshots = 1; + */ + @java.lang.Override + public int getSnapshotsCount() { + return snapshots_.size(); + } + /** + * + * + *
+   * A list of snapshots in the project for the specified instance.
+   * 
+ * + * repeated .google.cloud.filestore.v1beta1.Snapshot snapshots = 1; + */ + @java.lang.Override + public com.google.cloud.filestore.v1beta1.Snapshot getSnapshots(int index) { + return snapshots_.get(index); + } + /** + * + * + *
+   * A list of snapshots in the project for the specified instance.
+   * 
+ * + * repeated .google.cloud.filestore.v1beta1.Snapshot snapshots = 1; + */ + @java.lang.Override + public com.google.cloud.filestore.v1beta1.SnapshotOrBuilder getSnapshotsOrBuilder(int index) { + return snapshots_.get(index); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; + private volatile java.lang.Object nextPageToken_; + /** + * + * + *
+   * The token you can use to retrieve the next page of results. Not returned
+   * if there are no more results in the list.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + @java.lang.Override + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } + } + /** + * + * + *
+   * The token you can use to retrieve the next page of results. Not returned
+   * if there are no more results in the list.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + for (int i = 0; i < snapshots_.size(); i++) { + output.writeMessage(1, snapshots_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, nextPageToken_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < snapshots_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, snapshots_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, nextPageToken_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.filestore.v1beta1.ListSnapshotsResponse)) { + return super.equals(obj); + } + com.google.cloud.filestore.v1beta1.ListSnapshotsResponse other = + (com.google.cloud.filestore.v1beta1.ListSnapshotsResponse) obj; + + if (!getSnapshotsList().equals(other.getSnapshotsList())) return false; + if (!getNextPageToken().equals(other.getNextPageToken())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getSnapshotsCount() > 0) { + hash = (37 * hash) + SNAPSHOTS_FIELD_NUMBER; + hash = (53 * hash) + getSnapshotsList().hashCode(); + } + hash = (37 * hash) + NEXT_PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getNextPageToken().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.filestore.v1beta1.ListSnapshotsResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.filestore.v1beta1.ListSnapshotsResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.filestore.v1beta1.ListSnapshotsResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.filestore.v1beta1.ListSnapshotsResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.filestore.v1beta1.ListSnapshotsResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.filestore.v1beta1.ListSnapshotsResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.filestore.v1beta1.ListSnapshotsResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.filestore.v1beta1.ListSnapshotsResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.filestore.v1beta1.ListSnapshotsResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.filestore.v1beta1.ListSnapshotsResponse parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.filestore.v1beta1.ListSnapshotsResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.filestore.v1beta1.ListSnapshotsResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.filestore.v1beta1.ListSnapshotsResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * ListSnapshotsResponse is the result of ListSnapshotsRequest.
+   * 
+ * + * Protobuf type {@code google.cloud.filestore.v1beta1.ListSnapshotsResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.filestore.v1beta1.ListSnapshotsResponse) + com.google.cloud.filestore.v1beta1.ListSnapshotsResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.filestore.v1beta1.CloudFilestoreServiceProto + .internal_static_google_cloud_filestore_v1beta1_ListSnapshotsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.filestore.v1beta1.CloudFilestoreServiceProto + .internal_static_google_cloud_filestore_v1beta1_ListSnapshotsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.filestore.v1beta1.ListSnapshotsResponse.class, + com.google.cloud.filestore.v1beta1.ListSnapshotsResponse.Builder.class); + } + + // Construct using com.google.cloud.filestore.v1beta1.ListSnapshotsResponse.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (snapshotsBuilder_ == null) { + snapshots_ = java.util.Collections.emptyList(); + } else { + snapshots_ = null; + snapshotsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + nextPageToken_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.filestore.v1beta1.CloudFilestoreServiceProto + .internal_static_google_cloud_filestore_v1beta1_ListSnapshotsResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.filestore.v1beta1.ListSnapshotsResponse getDefaultInstanceForType() { + return com.google.cloud.filestore.v1beta1.ListSnapshotsResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.filestore.v1beta1.ListSnapshotsResponse build() { + com.google.cloud.filestore.v1beta1.ListSnapshotsResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.filestore.v1beta1.ListSnapshotsResponse buildPartial() { + com.google.cloud.filestore.v1beta1.ListSnapshotsResponse result = + new com.google.cloud.filestore.v1beta1.ListSnapshotsResponse(this); + int from_bitField0_ = bitField0_; + if (snapshotsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + snapshots_ = java.util.Collections.unmodifiableList(snapshots_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.snapshots_ = snapshots_; + } else { + result.snapshots_ = snapshotsBuilder_.build(); + } + result.nextPageToken_ = nextPageToken_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.filestore.v1beta1.ListSnapshotsResponse) { + return mergeFrom((com.google.cloud.filestore.v1beta1.ListSnapshotsResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.filestore.v1beta1.ListSnapshotsResponse other) { + if (other == com.google.cloud.filestore.v1beta1.ListSnapshotsResponse.getDefaultInstance()) + return this; + if (snapshotsBuilder_ == null) { + if (!other.snapshots_.isEmpty()) { + if (snapshots_.isEmpty()) { + snapshots_ = other.snapshots_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureSnapshotsIsMutable(); + snapshots_.addAll(other.snapshots_); + } + onChanged(); + } + } else { + if (!other.snapshots_.isEmpty()) { + if (snapshotsBuilder_.isEmpty()) { + snapshotsBuilder_.dispose(); + snapshotsBuilder_ = null; + snapshots_ = other.snapshots_; + bitField0_ = (bitField0_ & ~0x00000001); + snapshotsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getSnapshotsFieldBuilder() + : null; + } else { + snapshotsBuilder_.addAllMessages(other.snapshots_); + } + } + } + if (!other.getNextPageToken().isEmpty()) { + nextPageToken_ = other.nextPageToken_; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.cloud.filestore.v1beta1.Snapshot m = + input.readMessage( + com.google.cloud.filestore.v1beta1.Snapshot.parser(), extensionRegistry); + if (snapshotsBuilder_ == null) { + ensureSnapshotsIsMutable(); + snapshots_.add(m); + } else { + snapshotsBuilder_.addMessage(m); + } + break; + } // case 10 + case 18: + { + nextPageToken_ = input.readStringRequireUtf8(); + + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.util.List snapshots_ = + java.util.Collections.emptyList(); + + private void ensureSnapshotsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + snapshots_ = + new java.util.ArrayList(snapshots_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.filestore.v1beta1.Snapshot, + com.google.cloud.filestore.v1beta1.Snapshot.Builder, + com.google.cloud.filestore.v1beta1.SnapshotOrBuilder> + snapshotsBuilder_; + + /** + * + * + *
+     * A list of snapshots in the project for the specified instance.
+     * 
+ * + * repeated .google.cloud.filestore.v1beta1.Snapshot snapshots = 1; + */ + public java.util.List getSnapshotsList() { + if (snapshotsBuilder_ == null) { + return java.util.Collections.unmodifiableList(snapshots_); + } else { + return snapshotsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * A list of snapshots in the project for the specified instance.
+     * 
+ * + * repeated .google.cloud.filestore.v1beta1.Snapshot snapshots = 1; + */ + public int getSnapshotsCount() { + if (snapshotsBuilder_ == null) { + return snapshots_.size(); + } else { + return snapshotsBuilder_.getCount(); + } + } + /** + * + * + *
+     * A list of snapshots in the project for the specified instance.
+     * 
+ * + * repeated .google.cloud.filestore.v1beta1.Snapshot snapshots = 1; + */ + public com.google.cloud.filestore.v1beta1.Snapshot getSnapshots(int index) { + if (snapshotsBuilder_ == null) { + return snapshots_.get(index); + } else { + return snapshotsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * A list of snapshots in the project for the specified instance.
+     * 
+ * + * repeated .google.cloud.filestore.v1beta1.Snapshot snapshots = 1; + */ + public Builder setSnapshots(int index, com.google.cloud.filestore.v1beta1.Snapshot value) { + if (snapshotsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSnapshotsIsMutable(); + snapshots_.set(index, value); + onChanged(); + } else { + snapshotsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * A list of snapshots in the project for the specified instance.
+     * 
+ * + * repeated .google.cloud.filestore.v1beta1.Snapshot snapshots = 1; + */ + public Builder setSnapshots( + int index, com.google.cloud.filestore.v1beta1.Snapshot.Builder builderForValue) { + if (snapshotsBuilder_ == null) { + ensureSnapshotsIsMutable(); + snapshots_.set(index, builderForValue.build()); + onChanged(); + } else { + snapshotsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * A list of snapshots in the project for the specified instance.
+     * 
+ * + * repeated .google.cloud.filestore.v1beta1.Snapshot snapshots = 1; + */ + public Builder addSnapshots(com.google.cloud.filestore.v1beta1.Snapshot value) { + if (snapshotsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSnapshotsIsMutable(); + snapshots_.add(value); + onChanged(); + } else { + snapshotsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * A list of snapshots in the project for the specified instance.
+     * 
+ * + * repeated .google.cloud.filestore.v1beta1.Snapshot snapshots = 1; + */ + public Builder addSnapshots(int index, com.google.cloud.filestore.v1beta1.Snapshot value) { + if (snapshotsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSnapshotsIsMutable(); + snapshots_.add(index, value); + onChanged(); + } else { + snapshotsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * A list of snapshots in the project for the specified instance.
+     * 
+ * + * repeated .google.cloud.filestore.v1beta1.Snapshot snapshots = 1; + */ + public Builder addSnapshots( + com.google.cloud.filestore.v1beta1.Snapshot.Builder builderForValue) { + if (snapshotsBuilder_ == null) { + ensureSnapshotsIsMutable(); + snapshots_.add(builderForValue.build()); + onChanged(); + } else { + snapshotsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * A list of snapshots in the project for the specified instance.
+     * 
+ * + * repeated .google.cloud.filestore.v1beta1.Snapshot snapshots = 1; + */ + public Builder addSnapshots( + int index, com.google.cloud.filestore.v1beta1.Snapshot.Builder builderForValue) { + if (snapshotsBuilder_ == null) { + ensureSnapshotsIsMutable(); + snapshots_.add(index, builderForValue.build()); + onChanged(); + } else { + snapshotsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * A list of snapshots in the project for the specified instance.
+     * 
+ * + * repeated .google.cloud.filestore.v1beta1.Snapshot snapshots = 1; + */ + public Builder addAllSnapshots( + java.lang.Iterable values) { + if (snapshotsBuilder_ == null) { + ensureSnapshotsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, snapshots_); + onChanged(); + } else { + snapshotsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * A list of snapshots in the project for the specified instance.
+     * 
+ * + * repeated .google.cloud.filestore.v1beta1.Snapshot snapshots = 1; + */ + public Builder clearSnapshots() { + if (snapshotsBuilder_ == null) { + snapshots_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + snapshotsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * A list of snapshots in the project for the specified instance.
+     * 
+ * + * repeated .google.cloud.filestore.v1beta1.Snapshot snapshots = 1; + */ + public Builder removeSnapshots(int index) { + if (snapshotsBuilder_ == null) { + ensureSnapshotsIsMutable(); + snapshots_.remove(index); + onChanged(); + } else { + snapshotsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * A list of snapshots in the project for the specified instance.
+     * 
+ * + * repeated .google.cloud.filestore.v1beta1.Snapshot snapshots = 1; + */ + public com.google.cloud.filestore.v1beta1.Snapshot.Builder getSnapshotsBuilder(int index) { + return getSnapshotsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * A list of snapshots in the project for the specified instance.
+     * 
+ * + * repeated .google.cloud.filestore.v1beta1.Snapshot snapshots = 1; + */ + public com.google.cloud.filestore.v1beta1.SnapshotOrBuilder getSnapshotsOrBuilder(int index) { + if (snapshotsBuilder_ == null) { + return snapshots_.get(index); + } else { + return snapshotsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * A list of snapshots in the project for the specified instance.
+     * 
+ * + * repeated .google.cloud.filestore.v1beta1.Snapshot snapshots = 1; + */ + public java.util.List + getSnapshotsOrBuilderList() { + if (snapshotsBuilder_ != null) { + return snapshotsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(snapshots_); + } + } + /** + * + * + *
+     * A list of snapshots in the project for the specified instance.
+     * 
+ * + * repeated .google.cloud.filestore.v1beta1.Snapshot snapshots = 1; + */ + public com.google.cloud.filestore.v1beta1.Snapshot.Builder addSnapshotsBuilder() { + return getSnapshotsFieldBuilder() + .addBuilder(com.google.cloud.filestore.v1beta1.Snapshot.getDefaultInstance()); + } + /** + * + * + *
+     * A list of snapshots in the project for the specified instance.
+     * 
+ * + * repeated .google.cloud.filestore.v1beta1.Snapshot snapshots = 1; + */ + public com.google.cloud.filestore.v1beta1.Snapshot.Builder addSnapshotsBuilder(int index) { + return getSnapshotsFieldBuilder() + .addBuilder(index, com.google.cloud.filestore.v1beta1.Snapshot.getDefaultInstance()); + } + /** + * + * + *
+     * A list of snapshots in the project for the specified instance.
+     * 
+ * + * repeated .google.cloud.filestore.v1beta1.Snapshot snapshots = 1; + */ + public java.util.List + getSnapshotsBuilderList() { + return getSnapshotsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.filestore.v1beta1.Snapshot, + com.google.cloud.filestore.v1beta1.Snapshot.Builder, + com.google.cloud.filestore.v1beta1.SnapshotOrBuilder> + getSnapshotsFieldBuilder() { + if (snapshotsBuilder_ == null) { + snapshotsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.filestore.v1beta1.Snapshot, + com.google.cloud.filestore.v1beta1.Snapshot.Builder, + com.google.cloud.filestore.v1beta1.SnapshotOrBuilder>( + snapshots_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + snapshots_ = null; + } + return snapshotsBuilder_; + } + + private java.lang.Object nextPageToken_ = ""; + /** + * + * + *
+     * The token you can use to retrieve the next page of results. Not returned
+     * if there are no more results in the list.
+     * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The token you can use to retrieve the next page of results. Not returned
+     * if there are no more results in the list.
+     * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The token you can use to retrieve the next page of results. Not returned
+     * if there are no more results in the list.
+     * 
+ * + * string next_page_token = 2; + * + * @param value The nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + nextPageToken_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The token you can use to retrieve the next page of results. Not returned
+     * if there are no more results in the list.
+     * 
+ * + * string next_page_token = 2; + * + * @return This builder for chaining. + */ + public Builder clearNextPageToken() { + + nextPageToken_ = getDefaultInstance().getNextPageToken(); + onChanged(); + return this; + } + /** + * + * + *
+     * The token you can use to retrieve the next page of results. Not returned
+     * if there are no more results in the list.
+     * 
+ * + * string next_page_token = 2; + * + * @param value The bytes for nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + nextPageToken_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.filestore.v1beta1.ListSnapshotsResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.filestore.v1beta1.ListSnapshotsResponse) + private static final com.google.cloud.filestore.v1beta1.ListSnapshotsResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.filestore.v1beta1.ListSnapshotsResponse(); + } + + public static com.google.cloud.filestore.v1beta1.ListSnapshotsResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListSnapshotsResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.filestore.v1beta1.ListSnapshotsResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-filestore/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/ListSnapshotsResponseOrBuilder.java b/java-filestore/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/ListSnapshotsResponseOrBuilder.java new file mode 100644 index 000000000000..fd0791ac8e51 --- /dev/null +++ b/java-filestore/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/ListSnapshotsResponseOrBuilder.java @@ -0,0 +1,104 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/filestore/v1beta1/cloud_filestore_service.proto + +package com.google.cloud.filestore.v1beta1; + +public interface ListSnapshotsResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.filestore.v1beta1.ListSnapshotsResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * A list of snapshots in the project for the specified instance.
+   * 
+ * + * repeated .google.cloud.filestore.v1beta1.Snapshot snapshots = 1; + */ + java.util.List getSnapshotsList(); + /** + * + * + *
+   * A list of snapshots in the project for the specified instance.
+   * 
+ * + * repeated .google.cloud.filestore.v1beta1.Snapshot snapshots = 1; + */ + com.google.cloud.filestore.v1beta1.Snapshot getSnapshots(int index); + /** + * + * + *
+   * A list of snapshots in the project for the specified instance.
+   * 
+ * + * repeated .google.cloud.filestore.v1beta1.Snapshot snapshots = 1; + */ + int getSnapshotsCount(); + /** + * + * + *
+   * A list of snapshots in the project for the specified instance.
+   * 
+ * + * repeated .google.cloud.filestore.v1beta1.Snapshot snapshots = 1; + */ + java.util.List + getSnapshotsOrBuilderList(); + /** + * + * + *
+   * A list of snapshots in the project for the specified instance.
+   * 
+ * + * repeated .google.cloud.filestore.v1beta1.Snapshot snapshots = 1; + */ + com.google.cloud.filestore.v1beta1.SnapshotOrBuilder getSnapshotsOrBuilder(int index); + + /** + * + * + *
+   * The token you can use to retrieve the next page of results. Not returned
+   * if there are no more results in the list.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + java.lang.String getNextPageToken(); + /** + * + * + *
+   * The token you can use to retrieve the next page of results. Not returned
+   * if there are no more results in the list.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + com.google.protobuf.ByteString getNextPageTokenBytes(); +} diff --git a/java-filestore/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/NetworkConfig.java b/java-filestore/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/NetworkConfig.java index 58984418c89f..7b03697de6da 100644 --- a/java-filestore/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/NetworkConfig.java +++ b/java-filestore/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/NetworkConfig.java @@ -42,6 +42,7 @@ private NetworkConfig() { modes_ = java.util.Collections.emptyList(); reservedIpRange_ = ""; ipAddresses_ = com.google.protobuf.LazyStringArrayList.EMPTY; + connectMode_ = 0; } @java.lang.Override @@ -74,7 +75,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { * * *
-   * Internet protocol versions supported by Cloud Filestore.
+   * Internet protocol versions supported by Filestore.
    * 
* * Protobuf enum {@code google.cloud.filestore.v1beta1.NetworkConfig.AddressMode} @@ -205,6 +206,167 @@ private AddressMode(int value) { // @@protoc_insertion_point(enum_scope:google.cloud.filestore.v1beta1.NetworkConfig.AddressMode) } + /** + * + * + *
+   * Available connection modes.
+   * 
+ * + * Protobuf enum {@code google.cloud.filestore.v1beta1.NetworkConfig.ConnectMode} + */ + public enum ConnectMode implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * ConnectMode not set.
+     * 
+ * + * CONNECT_MODE_UNSPECIFIED = 0; + */ + CONNECT_MODE_UNSPECIFIED(0), + /** + * + * + *
+     * Connect via direct peering to the Filestore service.
+     * 
+ * + * DIRECT_PEERING = 1; + */ + DIRECT_PEERING(1), + /** + * + * + *
+     * Connect to your Filestore instance using Private Service
+     * Access. Private services access provides an IP address range for multiple
+     * Google Cloud services, including Filestore.
+     * 
+ * + * PRIVATE_SERVICE_ACCESS = 2; + */ + PRIVATE_SERVICE_ACCESS(2), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * ConnectMode not set.
+     * 
+ * + * CONNECT_MODE_UNSPECIFIED = 0; + */ + public static final int CONNECT_MODE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * Connect via direct peering to the Filestore service.
+     * 
+ * + * DIRECT_PEERING = 1; + */ + public static final int DIRECT_PEERING_VALUE = 1; + /** + * + * + *
+     * Connect to your Filestore instance using Private Service
+     * Access. Private services access provides an IP address range for multiple
+     * Google Cloud services, including Filestore.
+     * 
+ * + * PRIVATE_SERVICE_ACCESS = 2; + */ + public static final int PRIVATE_SERVICE_ACCESS_VALUE = 2; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static ConnectMode valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static ConnectMode forNumber(int value) { + switch (value) { + case 0: + return CONNECT_MODE_UNSPECIFIED; + case 1: + return DIRECT_PEERING; + case 2: + return PRIVATE_SERVICE_ACCESS; + default: + return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() { + return internalValueMap; + } + + private static final com.google.protobuf.Internal.EnumLiteMap internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public ConnectMode findValueByNumber(int number) { + return ConnectMode.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.filestore.v1beta1.NetworkConfig.getDescriptor().getEnumTypes().get(1); + } + + private static final ConnectMode[] VALUES = values(); + + public static ConnectMode valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private ConnectMode(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.filestore.v1beta1.NetworkConfig.ConnectMode) + } + public static final int NETWORK_FIELD_NUMBER = 1; private volatile java.lang.Object network_; /** @@ -369,13 +531,23 @@ public int getModesValue(int index) { * * *
-   * A /29 CIDR block for Basic or a /23 CIDR block for High Scale in one of the
-   * [internal IP address
+   * Optional, reserved_ip_range can have one of the following two types of
+   * values.
+   * * CIDR range value when using DIRECT_PEERING connect mode.
+   * * [Allocated IP address
+   * range](https://cloud.google.com/compute/docs/ip-addresses/reserve-static-internal-ip-address)
+   * when using PRIVATE_SERVICE_ACCESS connect mode.
+   * When the name of an allocated IP address range is specified, it must be one
+   * of the ranges associated with the private service access connection.
+   * When specified as a direct CIDR value, it must be a /29 CIDR block for
+   * Basic tier, a /24 CIDR block for High Scale tier, or a /26 CIDR block for
+   * Enterprise tier in one of the [internal IP address
    * ranges](https://www.arin.net/reference/research/statistics/address_filters/)
    * that identifies the range of IP addresses reserved for this instance. For
-   * example, 10.0.0.0/29 or 192.168.0.0/23. The range you specify can't overlap
-   * with either existing subnets or assigned IP address ranges for other Cloud
-   * Filestore instances in the selected VPC network.
+   * example, 10.0.0.0/29, 192.168.0.0/24, or 192.168.0.0/26, respectively. The
+   * range you specify can't overlap with either existing subnets or assigned IP
+   * address ranges for other Filestore instances in the selected VPC
+   * network.
    * 
* * string reserved_ip_range = 4; @@ -398,13 +570,23 @@ public java.lang.String getReservedIpRange() { * * *
-   * A /29 CIDR block for Basic or a /23 CIDR block for High Scale in one of the
-   * [internal IP address
+   * Optional, reserved_ip_range can have one of the following two types of
+   * values.
+   * * CIDR range value when using DIRECT_PEERING connect mode.
+   * * [Allocated IP address
+   * range](https://cloud.google.com/compute/docs/ip-addresses/reserve-static-internal-ip-address)
+   * when using PRIVATE_SERVICE_ACCESS connect mode.
+   * When the name of an allocated IP address range is specified, it must be one
+   * of the ranges associated with the private service access connection.
+   * When specified as a direct CIDR value, it must be a /29 CIDR block for
+   * Basic tier, a /24 CIDR block for High Scale tier, or a /26 CIDR block for
+   * Enterprise tier in one of the [internal IP address
    * ranges](https://www.arin.net/reference/research/statistics/address_filters/)
    * that identifies the range of IP addresses reserved for this instance. For
-   * example, 10.0.0.0/29 or 192.168.0.0/23. The range you specify can't overlap
-   * with either existing subnets or assigned IP address ranges for other Cloud
-   * Filestore instances in the selected VPC network.
+   * example, 10.0.0.0/29, 192.168.0.0/24, or 192.168.0.0/26, respectively. The
+   * range you specify can't overlap with either existing subnets or assigned IP
+   * address ranges for other Filestore instances in the selected VPC
+   * network.
    * 
* * string reserved_ip_range = 4; @@ -430,8 +612,8 @@ public com.google.protobuf.ByteString getReservedIpRangeBytes() { * * *
-   * Output only. IPv4 addresses in the format
-   * `{octet1}.{octet2}.{octet3}.{octet4}` or IPv6 addresses in the format
+   * Output only. IPv4 addresses in the format `{octet1}.{octet2}.{octet3}.{octet4}` or
+   * IPv6 addresses in the format
    * `{block1}:{block2}:{block3}:{block4}:{block5}:{block6}:{block7}:{block8}`.
    * 
* @@ -446,8 +628,8 @@ public com.google.protobuf.ProtocolStringList getIpAddressesList() { * * *
-   * Output only. IPv4 addresses in the format
-   * `{octet1}.{octet2}.{octet3}.{octet4}` or IPv6 addresses in the format
+   * Output only. IPv4 addresses in the format `{octet1}.{octet2}.{octet3}.{octet4}` or
+   * IPv6 addresses in the format
    * `{block1}:{block2}:{block3}:{block4}:{block5}:{block6}:{block7}:{block8}`.
    * 
* @@ -462,8 +644,8 @@ public int getIpAddressesCount() { * * *
-   * Output only. IPv4 addresses in the format
-   * `{octet1}.{octet2}.{octet3}.{octet4}` or IPv6 addresses in the format
+   * Output only. IPv4 addresses in the format `{octet1}.{octet2}.{octet3}.{octet4}` or
+   * IPv6 addresses in the format
    * `{block1}:{block2}:{block3}:{block4}:{block5}:{block6}:{block7}:{block8}`.
    * 
* @@ -479,8 +661,8 @@ public java.lang.String getIpAddresses(int index) { * * *
-   * Output only. IPv4 addresses in the format
-   * `{octet1}.{octet2}.{octet3}.{octet4}` or IPv6 addresses in the format
+   * Output only. IPv4 addresses in the format `{octet1}.{octet2}.{octet3}.{octet4}` or
+   * IPv6 addresses in the format
    * `{block1}:{block2}:{block3}:{block4}:{block5}:{block6}:{block7}:{block8}`.
    * 
* @@ -493,6 +675,46 @@ public com.google.protobuf.ByteString getIpAddressesBytes(int index) { return ipAddresses_.getByteString(index); } + public static final int CONNECT_MODE_FIELD_NUMBER = 6; + private int connectMode_; + /** + * + * + *
+   * The network connect mode of the Filestore instance.
+   * If not provided, the connect mode defaults to DIRECT_PEERING.
+   * 
+ * + * .google.cloud.filestore.v1beta1.NetworkConfig.ConnectMode connect_mode = 6; + * + * @return The enum numeric value on the wire for connectMode. + */ + @java.lang.Override + public int getConnectModeValue() { + return connectMode_; + } + /** + * + * + *
+   * The network connect mode of the Filestore instance.
+   * If not provided, the connect mode defaults to DIRECT_PEERING.
+   * 
+ * + * .google.cloud.filestore.v1beta1.NetworkConfig.ConnectMode connect_mode = 6; + * + * @return The connectMode. + */ + @java.lang.Override + public com.google.cloud.filestore.v1beta1.NetworkConfig.ConnectMode getConnectMode() { + @SuppressWarnings("deprecation") + com.google.cloud.filestore.v1beta1.NetworkConfig.ConnectMode result = + com.google.cloud.filestore.v1beta1.NetworkConfig.ConnectMode.valueOf(connectMode_); + return result == null + ? com.google.cloud.filestore.v1beta1.NetworkConfig.ConnectMode.UNRECOGNIZED + : result; + } + private byte memoizedIsInitialized = -1; @java.lang.Override @@ -524,6 +746,11 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io for (int i = 0; i < ipAddresses_.size(); i++) { com.google.protobuf.GeneratedMessageV3.writeString(output, 5, ipAddresses_.getRaw(i)); } + if (connectMode_ + != com.google.cloud.filestore.v1beta1.NetworkConfig.ConnectMode.CONNECT_MODE_UNSPECIFIED + .getNumber()) { + output.writeEnum(6, connectMode_); + } getUnknownFields().writeTo(output); } @@ -559,6 +786,11 @@ public int getSerializedSize() { size += dataSize; size += 1 * getIpAddressesList().size(); } + if (connectMode_ + != com.google.cloud.filestore.v1beta1.NetworkConfig.ConnectMode.CONNECT_MODE_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(6, connectMode_); + } size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; @@ -579,6 +811,7 @@ public boolean equals(final java.lang.Object obj) { if (!modes_.equals(other.modes_)) return false; if (!getReservedIpRange().equals(other.getReservedIpRange())) return false; if (!getIpAddressesList().equals(other.getIpAddressesList())) return false; + if (connectMode_ != other.connectMode_) return false; if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -602,6 +835,8 @@ public int hashCode() { hash = (37 * hash) + IP_ADDRESSES_FIELD_NUMBER; hash = (53 * hash) + getIpAddressesList().hashCode(); } + hash = (37 * hash) + CONNECT_MODE_FIELD_NUMBER; + hash = (53 * hash) + connectMode_; hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; @@ -748,6 +983,8 @@ public Builder clear() { ipAddresses_ = com.google.protobuf.LazyStringArrayList.EMPTY; bitField0_ = (bitField0_ & ~0x00000002); + connectMode_ = 0; + return this; } @@ -788,6 +1025,7 @@ public com.google.cloud.filestore.v1beta1.NetworkConfig buildPartial() { bitField0_ = (bitField0_ & ~0x00000002); } result.ipAddresses_ = ipAddresses_; + result.connectMode_ = connectMode_; onBuilt(); return result; } @@ -866,6 +1104,9 @@ public Builder mergeFrom(com.google.cloud.filestore.v1beta1.NetworkConfig other) } onChanged(); } + if (other.connectMode_ != 0) { + setConnectModeValue(other.getConnectModeValue()); + } this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; @@ -930,6 +1171,12 @@ public Builder mergeFrom( ipAddresses_.add(s); break; } // case 42 + case 48: + { + connectMode_ = input.readEnum(); + + break; + } // case 48 default: { if (!super.parseUnknownField(input, extensionRegistry, tag)) { @@ -1306,13 +1553,23 @@ public Builder addAllModesValue(java.lang.Iterable values) { * * *
-     * A /29 CIDR block for Basic or a /23 CIDR block for High Scale in one of the
-     * [internal IP address
+     * Optional, reserved_ip_range can have one of the following two types of
+     * values.
+     * * CIDR range value when using DIRECT_PEERING connect mode.
+     * * [Allocated IP address
+     * range](https://cloud.google.com/compute/docs/ip-addresses/reserve-static-internal-ip-address)
+     * when using PRIVATE_SERVICE_ACCESS connect mode.
+     * When the name of an allocated IP address range is specified, it must be one
+     * of the ranges associated with the private service access connection.
+     * When specified as a direct CIDR value, it must be a /29 CIDR block for
+     * Basic tier, a /24 CIDR block for High Scale tier, or a /26 CIDR block for
+     * Enterprise tier in one of the [internal IP address
      * ranges](https://www.arin.net/reference/research/statistics/address_filters/)
      * that identifies the range of IP addresses reserved for this instance. For
-     * example, 10.0.0.0/29 or 192.168.0.0/23. The range you specify can't overlap
-     * with either existing subnets or assigned IP address ranges for other Cloud
-     * Filestore instances in the selected VPC network.
+     * example, 10.0.0.0/29, 192.168.0.0/24, or 192.168.0.0/26, respectively. The
+     * range you specify can't overlap with either existing subnets or assigned IP
+     * address ranges for other Filestore instances in the selected VPC
+     * network.
      * 
* * string reserved_ip_range = 4; @@ -1334,13 +1591,23 @@ public java.lang.String getReservedIpRange() { * * *
-     * A /29 CIDR block for Basic or a /23 CIDR block for High Scale in one of the
-     * [internal IP address
+     * Optional, reserved_ip_range can have one of the following two types of
+     * values.
+     * * CIDR range value when using DIRECT_PEERING connect mode.
+     * * [Allocated IP address
+     * range](https://cloud.google.com/compute/docs/ip-addresses/reserve-static-internal-ip-address)
+     * when using PRIVATE_SERVICE_ACCESS connect mode.
+     * When the name of an allocated IP address range is specified, it must be one
+     * of the ranges associated with the private service access connection.
+     * When specified as a direct CIDR value, it must be a /29 CIDR block for
+     * Basic tier, a /24 CIDR block for High Scale tier, or a /26 CIDR block for
+     * Enterprise tier in one of the [internal IP address
      * ranges](https://www.arin.net/reference/research/statistics/address_filters/)
      * that identifies the range of IP addresses reserved for this instance. For
-     * example, 10.0.0.0/29 or 192.168.0.0/23. The range you specify can't overlap
-     * with either existing subnets or assigned IP address ranges for other Cloud
-     * Filestore instances in the selected VPC network.
+     * example, 10.0.0.0/29, 192.168.0.0/24, or 192.168.0.0/26, respectively. The
+     * range you specify can't overlap with either existing subnets or assigned IP
+     * address ranges for other Filestore instances in the selected VPC
+     * network.
      * 
* * string reserved_ip_range = 4; @@ -1362,13 +1629,23 @@ public com.google.protobuf.ByteString getReservedIpRangeBytes() { * * *
-     * A /29 CIDR block for Basic or a /23 CIDR block for High Scale in one of the
-     * [internal IP address
+     * Optional, reserved_ip_range can have one of the following two types of
+     * values.
+     * * CIDR range value when using DIRECT_PEERING connect mode.
+     * * [Allocated IP address
+     * range](https://cloud.google.com/compute/docs/ip-addresses/reserve-static-internal-ip-address)
+     * when using PRIVATE_SERVICE_ACCESS connect mode.
+     * When the name of an allocated IP address range is specified, it must be one
+     * of the ranges associated with the private service access connection.
+     * When specified as a direct CIDR value, it must be a /29 CIDR block for
+     * Basic tier, a /24 CIDR block for High Scale tier, or a /26 CIDR block for
+     * Enterprise tier in one of the [internal IP address
      * ranges](https://www.arin.net/reference/research/statistics/address_filters/)
      * that identifies the range of IP addresses reserved for this instance. For
-     * example, 10.0.0.0/29 or 192.168.0.0/23. The range you specify can't overlap
-     * with either existing subnets or assigned IP address ranges for other Cloud
-     * Filestore instances in the selected VPC network.
+     * example, 10.0.0.0/29, 192.168.0.0/24, or 192.168.0.0/26, respectively. The
+     * range you specify can't overlap with either existing subnets or assigned IP
+     * address ranges for other Filestore instances in the selected VPC
+     * network.
      * 
* * string reserved_ip_range = 4; @@ -1389,13 +1666,23 @@ public Builder setReservedIpRange(java.lang.String value) { * * *
-     * A /29 CIDR block for Basic or a /23 CIDR block for High Scale in one of the
-     * [internal IP address
+     * Optional, reserved_ip_range can have one of the following two types of
+     * values.
+     * * CIDR range value when using DIRECT_PEERING connect mode.
+     * * [Allocated IP address
+     * range](https://cloud.google.com/compute/docs/ip-addresses/reserve-static-internal-ip-address)
+     * when using PRIVATE_SERVICE_ACCESS connect mode.
+     * When the name of an allocated IP address range is specified, it must be one
+     * of the ranges associated with the private service access connection.
+     * When specified as a direct CIDR value, it must be a /29 CIDR block for
+     * Basic tier, a /24 CIDR block for High Scale tier, or a /26 CIDR block for
+     * Enterprise tier in one of the [internal IP address
      * ranges](https://www.arin.net/reference/research/statistics/address_filters/)
      * that identifies the range of IP addresses reserved for this instance. For
-     * example, 10.0.0.0/29 or 192.168.0.0/23. The range you specify can't overlap
-     * with either existing subnets or assigned IP address ranges for other Cloud
-     * Filestore instances in the selected VPC network.
+     * example, 10.0.0.0/29, 192.168.0.0/24, or 192.168.0.0/26, respectively. The
+     * range you specify can't overlap with either existing subnets or assigned IP
+     * address ranges for other Filestore instances in the selected VPC
+     * network.
      * 
* * string reserved_ip_range = 4; @@ -1412,13 +1699,23 @@ public Builder clearReservedIpRange() { * * *
-     * A /29 CIDR block for Basic or a /23 CIDR block for High Scale in one of the
-     * [internal IP address
+     * Optional, reserved_ip_range can have one of the following two types of
+     * values.
+     * * CIDR range value when using DIRECT_PEERING connect mode.
+     * * [Allocated IP address
+     * range](https://cloud.google.com/compute/docs/ip-addresses/reserve-static-internal-ip-address)
+     * when using PRIVATE_SERVICE_ACCESS connect mode.
+     * When the name of an allocated IP address range is specified, it must be one
+     * of the ranges associated with the private service access connection.
+     * When specified as a direct CIDR value, it must be a /29 CIDR block for
+     * Basic tier, a /24 CIDR block for High Scale tier, or a /26 CIDR block for
+     * Enterprise tier in one of the [internal IP address
      * ranges](https://www.arin.net/reference/research/statistics/address_filters/)
      * that identifies the range of IP addresses reserved for this instance. For
-     * example, 10.0.0.0/29 or 192.168.0.0/23. The range you specify can't overlap
-     * with either existing subnets or assigned IP address ranges for other Cloud
-     * Filestore instances in the selected VPC network.
+     * example, 10.0.0.0/29, 192.168.0.0/24, or 192.168.0.0/26, respectively. The
+     * range you specify can't overlap with either existing subnets or assigned IP
+     * address ranges for other Filestore instances in the selected VPC
+     * network.
      * 
* * string reserved_ip_range = 4; @@ -1450,8 +1747,8 @@ private void ensureIpAddressesIsMutable() { * * *
-     * Output only. IPv4 addresses in the format
-     * `{octet1}.{octet2}.{octet3}.{octet4}` or IPv6 addresses in the format
+     * Output only. IPv4 addresses in the format `{octet1}.{octet2}.{octet3}.{octet4}` or
+     * IPv6 addresses in the format
      * `{block1}:{block2}:{block3}:{block4}:{block5}:{block6}:{block7}:{block8}`.
      * 
* @@ -1466,8 +1763,8 @@ public com.google.protobuf.ProtocolStringList getIpAddressesList() { * * *
-     * Output only. IPv4 addresses in the format
-     * `{octet1}.{octet2}.{octet3}.{octet4}` or IPv6 addresses in the format
+     * Output only. IPv4 addresses in the format `{octet1}.{octet2}.{octet3}.{octet4}` or
+     * IPv6 addresses in the format
      * `{block1}:{block2}:{block3}:{block4}:{block5}:{block6}:{block7}:{block8}`.
      * 
* @@ -1482,8 +1779,8 @@ public int getIpAddressesCount() { * * *
-     * Output only. IPv4 addresses in the format
-     * `{octet1}.{octet2}.{octet3}.{octet4}` or IPv6 addresses in the format
+     * Output only. IPv4 addresses in the format `{octet1}.{octet2}.{octet3}.{octet4}` or
+     * IPv6 addresses in the format
      * `{block1}:{block2}:{block3}:{block4}:{block5}:{block6}:{block7}:{block8}`.
      * 
* @@ -1499,8 +1796,8 @@ public java.lang.String getIpAddresses(int index) { * * *
-     * Output only. IPv4 addresses in the format
-     * `{octet1}.{octet2}.{octet3}.{octet4}` or IPv6 addresses in the format
+     * Output only. IPv4 addresses in the format `{octet1}.{octet2}.{octet3}.{octet4}` or
+     * IPv6 addresses in the format
      * `{block1}:{block2}:{block3}:{block4}:{block5}:{block6}:{block7}:{block8}`.
      * 
* @@ -1516,8 +1813,8 @@ public com.google.protobuf.ByteString getIpAddressesBytes(int index) { * * *
-     * Output only. IPv4 addresses in the format
-     * `{octet1}.{octet2}.{octet3}.{octet4}` or IPv6 addresses in the format
+     * Output only. IPv4 addresses in the format `{octet1}.{octet2}.{octet3}.{octet4}` or
+     * IPv6 addresses in the format
      * `{block1}:{block2}:{block3}:{block4}:{block5}:{block6}:{block7}:{block8}`.
      * 
* @@ -1540,8 +1837,8 @@ public Builder setIpAddresses(int index, java.lang.String value) { * * *
-     * Output only. IPv4 addresses in the format
-     * `{octet1}.{octet2}.{octet3}.{octet4}` or IPv6 addresses in the format
+     * Output only. IPv4 addresses in the format `{octet1}.{octet2}.{octet3}.{octet4}` or
+     * IPv6 addresses in the format
      * `{block1}:{block2}:{block3}:{block4}:{block5}:{block6}:{block7}:{block8}`.
      * 
* @@ -1563,8 +1860,8 @@ public Builder addIpAddresses(java.lang.String value) { * * *
-     * Output only. IPv4 addresses in the format
-     * `{octet1}.{octet2}.{octet3}.{octet4}` or IPv6 addresses in the format
+     * Output only. IPv4 addresses in the format `{octet1}.{octet2}.{octet3}.{octet4}` or
+     * IPv6 addresses in the format
      * `{block1}:{block2}:{block3}:{block4}:{block5}:{block6}:{block7}:{block8}`.
      * 
* @@ -1583,8 +1880,8 @@ public Builder addAllIpAddresses(java.lang.Iterable values) { * * *
-     * Output only. IPv4 addresses in the format
-     * `{octet1}.{octet2}.{octet3}.{octet4}` or IPv6 addresses in the format
+     * Output only. IPv4 addresses in the format `{octet1}.{octet2}.{octet3}.{octet4}` or
+     * IPv6 addresses in the format
      * `{block1}:{block2}:{block3}:{block4}:{block5}:{block6}:{block7}:{block8}`.
      * 
* @@ -1602,8 +1899,8 @@ public Builder clearIpAddresses() { * * *
-     * Output only. IPv4 addresses in the format
-     * `{octet1}.{octet2}.{octet3}.{octet4}` or IPv6 addresses in the format
+     * Output only. IPv4 addresses in the format `{octet1}.{octet2}.{octet3}.{octet4}` or
+     * IPv6 addresses in the format
      * `{block1}:{block2}:{block3}:{block4}:{block5}:{block6}:{block7}:{block8}`.
      * 
* @@ -1623,6 +1920,105 @@ public Builder addIpAddressesBytes(com.google.protobuf.ByteString value) { return this; } + private int connectMode_ = 0; + /** + * + * + *
+     * The network connect mode of the Filestore instance.
+     * If not provided, the connect mode defaults to DIRECT_PEERING.
+     * 
+ * + * .google.cloud.filestore.v1beta1.NetworkConfig.ConnectMode connect_mode = 6; + * + * @return The enum numeric value on the wire for connectMode. + */ + @java.lang.Override + public int getConnectModeValue() { + return connectMode_; + } + /** + * + * + *
+     * The network connect mode of the Filestore instance.
+     * If not provided, the connect mode defaults to DIRECT_PEERING.
+     * 
+ * + * .google.cloud.filestore.v1beta1.NetworkConfig.ConnectMode connect_mode = 6; + * + * @param value The enum numeric value on the wire for connectMode to set. + * @return This builder for chaining. + */ + public Builder setConnectModeValue(int value) { + + connectMode_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The network connect mode of the Filestore instance.
+     * If not provided, the connect mode defaults to DIRECT_PEERING.
+     * 
+ * + * .google.cloud.filestore.v1beta1.NetworkConfig.ConnectMode connect_mode = 6; + * + * @return The connectMode. + */ + @java.lang.Override + public com.google.cloud.filestore.v1beta1.NetworkConfig.ConnectMode getConnectMode() { + @SuppressWarnings("deprecation") + com.google.cloud.filestore.v1beta1.NetworkConfig.ConnectMode result = + com.google.cloud.filestore.v1beta1.NetworkConfig.ConnectMode.valueOf(connectMode_); + return result == null + ? com.google.cloud.filestore.v1beta1.NetworkConfig.ConnectMode.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * The network connect mode of the Filestore instance.
+     * If not provided, the connect mode defaults to DIRECT_PEERING.
+     * 
+ * + * .google.cloud.filestore.v1beta1.NetworkConfig.ConnectMode connect_mode = 6; + * + * @param value The connectMode to set. + * @return This builder for chaining. + */ + public Builder setConnectMode( + com.google.cloud.filestore.v1beta1.NetworkConfig.ConnectMode value) { + if (value == null) { + throw new NullPointerException(); + } + + connectMode_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * The network connect mode of the Filestore instance.
+     * If not provided, the connect mode defaults to DIRECT_PEERING.
+     * 
+ * + * .google.cloud.filestore.v1beta1.NetworkConfig.ConnectMode connect_mode = 6; + * + * @return This builder for chaining. + */ + public Builder clearConnectMode() { + + connectMode_ = 0; + onChanged(); + return this; + } + @java.lang.Override public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { return super.setUnknownFields(unknownFields); diff --git a/java-filestore/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/NetworkConfigOrBuilder.java b/java-filestore/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/NetworkConfigOrBuilder.java index 5956bb86b3b7..a923cb8ed67d 100644 --- a/java-filestore/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/NetworkConfigOrBuilder.java +++ b/java-filestore/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/NetworkConfigOrBuilder.java @@ -124,13 +124,23 @@ public interface NetworkConfigOrBuilder * * *
-   * A /29 CIDR block for Basic or a /23 CIDR block for High Scale in one of the
-   * [internal IP address
+   * Optional, reserved_ip_range can have one of the following two types of
+   * values.
+   * * CIDR range value when using DIRECT_PEERING connect mode.
+   * * [Allocated IP address
+   * range](https://cloud.google.com/compute/docs/ip-addresses/reserve-static-internal-ip-address)
+   * when using PRIVATE_SERVICE_ACCESS connect mode.
+   * When the name of an allocated IP address range is specified, it must be one
+   * of the ranges associated with the private service access connection.
+   * When specified as a direct CIDR value, it must be a /29 CIDR block for
+   * Basic tier, a /24 CIDR block for High Scale tier, or a /26 CIDR block for
+   * Enterprise tier in one of the [internal IP address
    * ranges](https://www.arin.net/reference/research/statistics/address_filters/)
    * that identifies the range of IP addresses reserved for this instance. For
-   * example, 10.0.0.0/29 or 192.168.0.0/23. The range you specify can't overlap
-   * with either existing subnets or assigned IP address ranges for other Cloud
-   * Filestore instances in the selected VPC network.
+   * example, 10.0.0.0/29, 192.168.0.0/24, or 192.168.0.0/26, respectively. The
+   * range you specify can't overlap with either existing subnets or assigned IP
+   * address ranges for other Filestore instances in the selected VPC
+   * network.
    * 
* * string reserved_ip_range = 4; @@ -142,13 +152,23 @@ public interface NetworkConfigOrBuilder * * *
-   * A /29 CIDR block for Basic or a /23 CIDR block for High Scale in one of the
-   * [internal IP address
+   * Optional, reserved_ip_range can have one of the following two types of
+   * values.
+   * * CIDR range value when using DIRECT_PEERING connect mode.
+   * * [Allocated IP address
+   * range](https://cloud.google.com/compute/docs/ip-addresses/reserve-static-internal-ip-address)
+   * when using PRIVATE_SERVICE_ACCESS connect mode.
+   * When the name of an allocated IP address range is specified, it must be one
+   * of the ranges associated with the private service access connection.
+   * When specified as a direct CIDR value, it must be a /29 CIDR block for
+   * Basic tier, a /24 CIDR block for High Scale tier, or a /26 CIDR block for
+   * Enterprise tier in one of the [internal IP address
    * ranges](https://www.arin.net/reference/research/statistics/address_filters/)
    * that identifies the range of IP addresses reserved for this instance. For
-   * example, 10.0.0.0/29 or 192.168.0.0/23. The range you specify can't overlap
-   * with either existing subnets or assigned IP address ranges for other Cloud
-   * Filestore instances in the selected VPC network.
+   * example, 10.0.0.0/29, 192.168.0.0/24, or 192.168.0.0/26, respectively. The
+   * range you specify can't overlap with either existing subnets or assigned IP
+   * address ranges for other Filestore instances in the selected VPC
+   * network.
    * 
* * string reserved_ip_range = 4; @@ -161,8 +181,8 @@ public interface NetworkConfigOrBuilder * * *
-   * Output only. IPv4 addresses in the format
-   * `{octet1}.{octet2}.{octet3}.{octet4}` or IPv6 addresses in the format
+   * Output only. IPv4 addresses in the format `{octet1}.{octet2}.{octet3}.{octet4}` or
+   * IPv6 addresses in the format
    * `{block1}:{block2}:{block3}:{block4}:{block5}:{block6}:{block7}:{block8}`.
    * 
* @@ -175,8 +195,8 @@ public interface NetworkConfigOrBuilder * * *
-   * Output only. IPv4 addresses in the format
-   * `{octet1}.{octet2}.{octet3}.{octet4}` or IPv6 addresses in the format
+   * Output only. IPv4 addresses in the format `{octet1}.{octet2}.{octet3}.{octet4}` or
+   * IPv6 addresses in the format
    * `{block1}:{block2}:{block3}:{block4}:{block5}:{block6}:{block7}:{block8}`.
    * 
* @@ -189,8 +209,8 @@ public interface NetworkConfigOrBuilder * * *
-   * Output only. IPv4 addresses in the format
-   * `{octet1}.{octet2}.{octet3}.{octet4}` or IPv6 addresses in the format
+   * Output only. IPv4 addresses in the format `{octet1}.{octet2}.{octet3}.{octet4}` or
+   * IPv6 addresses in the format
    * `{block1}:{block2}:{block3}:{block4}:{block5}:{block6}:{block7}:{block8}`.
    * 
* @@ -204,8 +224,8 @@ public interface NetworkConfigOrBuilder * * *
-   * Output only. IPv4 addresses in the format
-   * `{octet1}.{octet2}.{octet3}.{octet4}` or IPv6 addresses in the format
+   * Output only. IPv4 addresses in the format `{octet1}.{octet2}.{octet3}.{octet4}` or
+   * IPv6 addresses in the format
    * `{block1}:{block2}:{block3}:{block4}:{block5}:{block6}:{block7}:{block8}`.
    * 
* @@ -215,4 +235,31 @@ public interface NetworkConfigOrBuilder * @return The bytes of the ipAddresses at the given index. */ com.google.protobuf.ByteString getIpAddressesBytes(int index); + + /** + * + * + *
+   * The network connect mode of the Filestore instance.
+   * If not provided, the connect mode defaults to DIRECT_PEERING.
+   * 
+ * + * .google.cloud.filestore.v1beta1.NetworkConfig.ConnectMode connect_mode = 6; + * + * @return The enum numeric value on the wire for connectMode. + */ + int getConnectModeValue(); + /** + * + * + *
+   * The network connect mode of the Filestore instance.
+   * If not provided, the connect mode defaults to DIRECT_PEERING.
+   * 
+ * + * .google.cloud.filestore.v1beta1.NetworkConfig.ConnectMode connect_mode = 6; + * + * @return The connectMode. + */ + com.google.cloud.filestore.v1beta1.NetworkConfig.ConnectMode getConnectMode(); } diff --git a/java-filestore/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/RestoreInstanceRequest.java b/java-filestore/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/RestoreInstanceRequest.java index e96f7184228f..7865aca5d513 100644 --- a/java-filestore/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/RestoreInstanceRequest.java +++ b/java-filestore/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/RestoreInstanceRequest.java @@ -22,7 +22,7 @@ * * *
- * RestoreInstanceRequest restores an existing instances's file share from a
+ * RestoreInstanceRequest restores an existing instance's file share from a
  * snapshot or backup.
  * 
* @@ -177,7 +177,7 @@ public com.google.protobuf.ByteString getNameBytes() { * * *
-   * Required. Name of the file share in the Cloud Filestore instance that the snapshot
+   * Required. Name of the file share in the Filestore instance that the snapshot
    * is being restored to.
    * 
* @@ -201,7 +201,7 @@ public java.lang.String getFileShare() { * * *
-   * Required. Name of the file share in the Cloud Filestore instance that the snapshot
+   * Required. Name of the file share in the Filestore instance that the snapshot
    * is being restored to.
    * 
* @@ -576,7 +576,7 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build * * *
-   * RestoreInstanceRequest restores an existing instances's file share from a
+   * RestoreInstanceRequest restores an existing instance's file share from a
    * snapshot or backup.
    * 
* @@ -940,7 +940,7 @@ public Builder setNameBytes(com.google.protobuf.ByteString value) { * * *
-     * Required. Name of the file share in the Cloud Filestore instance that the snapshot
+     * Required. Name of the file share in the Filestore instance that the snapshot
      * is being restored to.
      * 
* @@ -963,7 +963,7 @@ public java.lang.String getFileShare() { * * *
-     * Required. Name of the file share in the Cloud Filestore instance that the snapshot
+     * Required. Name of the file share in the Filestore instance that the snapshot
      * is being restored to.
      * 
* @@ -986,7 +986,7 @@ public com.google.protobuf.ByteString getFileShareBytes() { * * *
-     * Required. Name of the file share in the Cloud Filestore instance that the snapshot
+     * Required. Name of the file share in the Filestore instance that the snapshot
      * is being restored to.
      * 
* @@ -1008,7 +1008,7 @@ public Builder setFileShare(java.lang.String value) { * * *
-     * Required. Name of the file share in the Cloud Filestore instance that the snapshot
+     * Required. Name of the file share in the Filestore instance that the snapshot
      * is being restored to.
      * 
* @@ -1026,7 +1026,7 @@ public Builder clearFileShare() { * * *
-     * Required. Name of the file share in the Cloud Filestore instance that the snapshot
+     * Required. Name of the file share in the Filestore instance that the snapshot
      * is being restored to.
      * 
* diff --git a/java-filestore/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/RestoreInstanceRequestOrBuilder.java b/java-filestore/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/RestoreInstanceRequestOrBuilder.java index 7170db12cb35..6e7c543b97f7 100644 --- a/java-filestore/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/RestoreInstanceRequestOrBuilder.java +++ b/java-filestore/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/RestoreInstanceRequestOrBuilder.java @@ -58,7 +58,7 @@ public interface RestoreInstanceRequestOrBuilder * * *
-   * Required. Name of the file share in the Cloud Filestore instance that the snapshot
+   * Required. Name of the file share in the Filestore instance that the snapshot
    * is being restored to.
    * 
* @@ -71,7 +71,7 @@ public interface RestoreInstanceRequestOrBuilder * * *
-   * Required. Name of the file share in the Cloud Filestore instance that the snapshot
+   * Required. Name of the file share in the Filestore instance that the snapshot
    * is being restored to.
    * 
* diff --git a/java-filestore/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/RevertInstanceRequest.java b/java-filestore/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/RevertInstanceRequest.java new file mode 100644 index 000000000000..30430fc3c8e3 --- /dev/null +++ b/java-filestore/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/RevertInstanceRequest.java @@ -0,0 +1,831 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/filestore/v1beta1/cloud_filestore_service.proto + +package com.google.cloud.filestore.v1beta1; + +/** + * + * + *
+ * RevertInstanceRequest reverts the given instance's file share to the
+ * specified snapshot.
+ * 
+ * + * Protobuf type {@code google.cloud.filestore.v1beta1.RevertInstanceRequest} + */ +public final class RevertInstanceRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.filestore.v1beta1.RevertInstanceRequest) + RevertInstanceRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use RevertInstanceRequest.newBuilder() to construct. + private RevertInstanceRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private RevertInstanceRequest() { + name_ = ""; + targetSnapshotId_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new RevertInstanceRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.filestore.v1beta1.CloudFilestoreServiceProto + .internal_static_google_cloud_filestore_v1beta1_RevertInstanceRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.filestore.v1beta1.CloudFilestoreServiceProto + .internal_static_google_cloud_filestore_v1beta1_RevertInstanceRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.filestore.v1beta1.RevertInstanceRequest.class, + com.google.cloud.filestore.v1beta1.RevertInstanceRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Required. projects/{project_id}/locations/{location_id}/instances/{instance_id}.
+   * The resource name of the instance, in the format
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Required. projects/{project_id}/locations/{location_id}/instances/{instance_id}.
+   * The resource name of the instance, in the format
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int TARGET_SNAPSHOT_ID_FIELD_NUMBER = 2; + private volatile java.lang.Object targetSnapshotId_; + /** + * + * + *
+   * Required. The snapshot resource ID, in the format 'my-snapshot', where the specified
+   * ID is the {snapshot_id} of the fully qualified name like
+   * projects/{project_id}/locations/{location_id}/instances/{instance_id}/snapshots/{snapshot_id}
+   * 
+ * + * string target_snapshot_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The targetSnapshotId. + */ + @java.lang.Override + public java.lang.String getTargetSnapshotId() { + java.lang.Object ref = targetSnapshotId_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + targetSnapshotId_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The snapshot resource ID, in the format 'my-snapshot', where the specified
+   * ID is the {snapshot_id} of the fully qualified name like
+   * projects/{project_id}/locations/{location_id}/instances/{instance_id}/snapshots/{snapshot_id}
+   * 
+ * + * string target_snapshot_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for targetSnapshotId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getTargetSnapshotIdBytes() { + java.lang.Object ref = targetSnapshotId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + targetSnapshotId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(targetSnapshotId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, targetSnapshotId_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(targetSnapshotId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, targetSnapshotId_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.filestore.v1beta1.RevertInstanceRequest)) { + return super.equals(obj); + } + com.google.cloud.filestore.v1beta1.RevertInstanceRequest other = + (com.google.cloud.filestore.v1beta1.RevertInstanceRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!getTargetSnapshotId().equals(other.getTargetSnapshotId())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (37 * hash) + TARGET_SNAPSHOT_ID_FIELD_NUMBER; + hash = (53 * hash) + getTargetSnapshotId().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.filestore.v1beta1.RevertInstanceRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.filestore.v1beta1.RevertInstanceRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.filestore.v1beta1.RevertInstanceRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.filestore.v1beta1.RevertInstanceRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.filestore.v1beta1.RevertInstanceRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.filestore.v1beta1.RevertInstanceRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.filestore.v1beta1.RevertInstanceRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.filestore.v1beta1.RevertInstanceRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.filestore.v1beta1.RevertInstanceRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.filestore.v1beta1.RevertInstanceRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.filestore.v1beta1.RevertInstanceRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.filestore.v1beta1.RevertInstanceRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.filestore.v1beta1.RevertInstanceRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * RevertInstanceRequest reverts the given instance's file share to the
+   * specified snapshot.
+   * 
+ * + * Protobuf type {@code google.cloud.filestore.v1beta1.RevertInstanceRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.filestore.v1beta1.RevertInstanceRequest) + com.google.cloud.filestore.v1beta1.RevertInstanceRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.filestore.v1beta1.CloudFilestoreServiceProto + .internal_static_google_cloud_filestore_v1beta1_RevertInstanceRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.filestore.v1beta1.CloudFilestoreServiceProto + .internal_static_google_cloud_filestore_v1beta1_RevertInstanceRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.filestore.v1beta1.RevertInstanceRequest.class, + com.google.cloud.filestore.v1beta1.RevertInstanceRequest.Builder.class); + } + + // Construct using com.google.cloud.filestore.v1beta1.RevertInstanceRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + targetSnapshotId_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.filestore.v1beta1.CloudFilestoreServiceProto + .internal_static_google_cloud_filestore_v1beta1_RevertInstanceRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.filestore.v1beta1.RevertInstanceRequest getDefaultInstanceForType() { + return com.google.cloud.filestore.v1beta1.RevertInstanceRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.filestore.v1beta1.RevertInstanceRequest build() { + com.google.cloud.filestore.v1beta1.RevertInstanceRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.filestore.v1beta1.RevertInstanceRequest buildPartial() { + com.google.cloud.filestore.v1beta1.RevertInstanceRequest result = + new com.google.cloud.filestore.v1beta1.RevertInstanceRequest(this); + result.name_ = name_; + result.targetSnapshotId_ = targetSnapshotId_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.filestore.v1beta1.RevertInstanceRequest) { + return mergeFrom((com.google.cloud.filestore.v1beta1.RevertInstanceRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.filestore.v1beta1.RevertInstanceRequest other) { + if (other == com.google.cloud.filestore.v1beta1.RevertInstanceRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (!other.getTargetSnapshotId().isEmpty()) { + targetSnapshotId_ = other.targetSnapshotId_; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + + break; + } // case 10 + case 18: + { + targetSnapshotId_ = input.readStringRequireUtf8(); + + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. projects/{project_id}/locations/{location_id}/instances/{instance_id}.
+     * The resource name of the instance, in the format
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. projects/{project_id}/locations/{location_id}/instances/{instance_id}.
+     * The resource name of the instance, in the format
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. projects/{project_id}/locations/{location_id}/instances/{instance_id}.
+     * The resource name of the instance, in the format
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. projects/{project_id}/locations/{location_id}/instances/{instance_id}.
+     * The resource name of the instance, in the format
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. projects/{project_id}/locations/{location_id}/instances/{instance_id}.
+     * The resource name of the instance, in the format
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + private java.lang.Object targetSnapshotId_ = ""; + /** + * + * + *
+     * Required. The snapshot resource ID, in the format 'my-snapshot', where the specified
+     * ID is the {snapshot_id} of the fully qualified name like
+     * projects/{project_id}/locations/{location_id}/instances/{instance_id}/snapshots/{snapshot_id}
+     * 
+ * + * string target_snapshot_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The targetSnapshotId. + */ + public java.lang.String getTargetSnapshotId() { + java.lang.Object ref = targetSnapshotId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + targetSnapshotId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The snapshot resource ID, in the format 'my-snapshot', where the specified
+     * ID is the {snapshot_id} of the fully qualified name like
+     * projects/{project_id}/locations/{location_id}/instances/{instance_id}/snapshots/{snapshot_id}
+     * 
+ * + * string target_snapshot_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for targetSnapshotId. + */ + public com.google.protobuf.ByteString getTargetSnapshotIdBytes() { + java.lang.Object ref = targetSnapshotId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + targetSnapshotId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The snapshot resource ID, in the format 'my-snapshot', where the specified
+     * ID is the {snapshot_id} of the fully qualified name like
+     * projects/{project_id}/locations/{location_id}/instances/{instance_id}/snapshots/{snapshot_id}
+     * 
+ * + * string target_snapshot_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The targetSnapshotId to set. + * @return This builder for chaining. + */ + public Builder setTargetSnapshotId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + targetSnapshotId_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The snapshot resource ID, in the format 'my-snapshot', where the specified
+     * ID is the {snapshot_id} of the fully qualified name like
+     * projects/{project_id}/locations/{location_id}/instances/{instance_id}/snapshots/{snapshot_id}
+     * 
+ * + * string target_snapshot_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearTargetSnapshotId() { + + targetSnapshotId_ = getDefaultInstance().getTargetSnapshotId(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The snapshot resource ID, in the format 'my-snapshot', where the specified
+     * ID is the {snapshot_id} of the fully qualified name like
+     * projects/{project_id}/locations/{location_id}/instances/{instance_id}/snapshots/{snapshot_id}
+     * 
+ * + * string target_snapshot_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for targetSnapshotId to set. + * @return This builder for chaining. + */ + public Builder setTargetSnapshotIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + targetSnapshotId_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.filestore.v1beta1.RevertInstanceRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.filestore.v1beta1.RevertInstanceRequest) + private static final com.google.cloud.filestore.v1beta1.RevertInstanceRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.filestore.v1beta1.RevertInstanceRequest(); + } + + public static com.google.cloud.filestore.v1beta1.RevertInstanceRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public RevertInstanceRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.filestore.v1beta1.RevertInstanceRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-filestore/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/RevertInstanceRequestOrBuilder.java b/java-filestore/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/RevertInstanceRequestOrBuilder.java new file mode 100644 index 000000000000..305641a18e48 --- /dev/null +++ b/java-filestore/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/RevertInstanceRequestOrBuilder.java @@ -0,0 +1,85 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/filestore/v1beta1/cloud_filestore_service.proto + +package com.google.cloud.filestore.v1beta1; + +public interface RevertInstanceRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.filestore.v1beta1.RevertInstanceRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. projects/{project_id}/locations/{location_id}/instances/{instance_id}.
+   * The resource name of the instance, in the format
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. projects/{project_id}/locations/{location_id}/instances/{instance_id}.
+   * The resource name of the instance, in the format
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Required. The snapshot resource ID, in the format 'my-snapshot', where the specified
+   * ID is the {snapshot_id} of the fully qualified name like
+   * projects/{project_id}/locations/{location_id}/instances/{instance_id}/snapshots/{snapshot_id}
+   * 
+ * + * string target_snapshot_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The targetSnapshotId. + */ + java.lang.String getTargetSnapshotId(); + /** + * + * + *
+   * Required. The snapshot resource ID, in the format 'my-snapshot', where the specified
+   * ID is the {snapshot_id} of the fully qualified name like
+   * projects/{project_id}/locations/{location_id}/instances/{instance_id}/snapshots/{snapshot_id}
+   * 
+ * + * string target_snapshot_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for targetSnapshotId. + */ + com.google.protobuf.ByteString getTargetSnapshotIdBytes(); +} diff --git a/java-filestore/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/Share.java b/java-filestore/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/Share.java new file mode 100644 index 000000000000..7a2e3d9d2abd --- /dev/null +++ b/java-filestore/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/Share.java @@ -0,0 +1,2577 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/filestore/v1beta1/cloud_filestore_service.proto + +package com.google.cloud.filestore.v1beta1; + +/** + * + * + *
+ * A Filestore share.
+ * 
+ * + * Protobuf type {@code google.cloud.filestore.v1beta1.Share} + */ +public final class Share extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.filestore.v1beta1.Share) + ShareOrBuilder { + private static final long serialVersionUID = 0L; + // Use Share.newBuilder() to construct. + private Share(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Share() { + name_ = ""; + mountName_ = ""; + description_ = ""; + nfsExportOptions_ = java.util.Collections.emptyList(); + state_ = 0; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Share(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.filestore.v1beta1.CloudFilestoreServiceProto + .internal_static_google_cloud_filestore_v1beta1_Share_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 8: + return internalGetLabels(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.filestore.v1beta1.CloudFilestoreServiceProto + .internal_static_google_cloud_filestore_v1beta1_Share_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.filestore.v1beta1.Share.class, + com.google.cloud.filestore.v1beta1.Share.Builder.class); + } + + /** + * + * + *
+   * The share state.
+   * 
+ * + * Protobuf enum {@code google.cloud.filestore.v1beta1.Share.State} + */ + public enum State implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * State not set.
+     * 
+ * + * STATE_UNSPECIFIED = 0; + */ + STATE_UNSPECIFIED(0), + /** + * + * + *
+     * Share is being created.
+     * 
+ * + * CREATING = 1; + */ + CREATING(1), + /** + * + * + *
+     * Share is ready for use.
+     * 
+ * + * READY = 3; + */ + READY(3), + /** + * + * + *
+     * Share is being deleted.
+     * 
+ * + * DELETING = 4; + */ + DELETING(4), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * State not set.
+     * 
+ * + * STATE_UNSPECIFIED = 0; + */ + public static final int STATE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * Share is being created.
+     * 
+ * + * CREATING = 1; + */ + public static final int CREATING_VALUE = 1; + /** + * + * + *
+     * Share is ready for use.
+     * 
+ * + * READY = 3; + */ + public static final int READY_VALUE = 3; + /** + * + * + *
+     * Share is being deleted.
+     * 
+ * + * DELETING = 4; + */ + public static final int DELETING_VALUE = 4; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static State valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static State forNumber(int value) { + switch (value) { + case 0: + return STATE_UNSPECIFIED; + case 1: + return CREATING; + case 3: + return READY; + case 4: + return DELETING; + default: + return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() { + return internalValueMap; + } + + private static final com.google.protobuf.Internal.EnumLiteMap internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public State findValueByNumber(int number) { + return State.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.filestore.v1beta1.Share.getDescriptor().getEnumTypes().get(0); + } + + private static final State[] VALUES = values(); + + public static State valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private State(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.filestore.v1beta1.Share.State) + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Output only. The resource name of the share, in the format
+   * `projects/{project_id}/locations/{location_id}/instances/{instance_id}/shares/{share_id}`.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. The resource name of the share, in the format
+   * `projects/{project_id}/locations/{location_id}/instances/{instance_id}/shares/{share_id}`.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int MOUNT_NAME_FIELD_NUMBER = 2; + private volatile java.lang.Object mountName_; + /** + * + * + *
+   * The mount name of the share. Must be 63 characters or less and consist of
+   * uppercase or lowercase letters, numbers, and underscores.
+   * 
+ * + * string mount_name = 2; + * + * @return The mountName. + */ + @java.lang.Override + public java.lang.String getMountName() { + java.lang.Object ref = mountName_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + mountName_ = s; + return s; + } + } + /** + * + * + *
+   * The mount name of the share. Must be 63 characters or less and consist of
+   * uppercase or lowercase letters, numbers, and underscores.
+   * 
+ * + * string mount_name = 2; + * + * @return The bytes for mountName. + */ + @java.lang.Override + public com.google.protobuf.ByteString getMountNameBytes() { + java.lang.Object ref = mountName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + mountName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DESCRIPTION_FIELD_NUMBER = 3; + private volatile java.lang.Object description_; + /** + * + * + *
+   * A description of the share with 2048 characters or less. Requests with
+   * longer descriptions will be rejected.
+   * 
+ * + * string description = 3; + * + * @return The description. + */ + @java.lang.Override + public java.lang.String getDescription() { + java.lang.Object ref = description_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + description_ = s; + return s; + } + } + /** + * + * + *
+   * A description of the share with 2048 characters or less. Requests with
+   * longer descriptions will be rejected.
+   * 
+ * + * string description = 3; + * + * @return The bytes for description. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDescriptionBytes() { + java.lang.Object ref = description_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + description_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CAPACITY_GB_FIELD_NUMBER = 4; + private long capacityGb_; + /** + * + * + *
+   * File share capacity in gigabytes (GB). Filestore defines 1 GB as
+   * 1024^3 bytes. Must be greater than 0.
+   * 
+ * + * int64 capacity_gb = 4; + * + * @return The capacityGb. + */ + @java.lang.Override + public long getCapacityGb() { + return capacityGb_; + } + + public static final int NFS_EXPORT_OPTIONS_FIELD_NUMBER = 5; + private java.util.List nfsExportOptions_; + /** + * + * + *
+   * Nfs Export Options.
+   * There is a limit of 10 export options per file share.
+   * 
+ * + * repeated .google.cloud.filestore.v1beta1.NfsExportOptions nfs_export_options = 5; + */ + @java.lang.Override + public java.util.List + getNfsExportOptionsList() { + return nfsExportOptions_; + } + /** + * + * + *
+   * Nfs Export Options.
+   * There is a limit of 10 export options per file share.
+   * 
+ * + * repeated .google.cloud.filestore.v1beta1.NfsExportOptions nfs_export_options = 5; + */ + @java.lang.Override + public java.util.List + getNfsExportOptionsOrBuilderList() { + return nfsExportOptions_; + } + /** + * + * + *
+   * Nfs Export Options.
+   * There is a limit of 10 export options per file share.
+   * 
+ * + * repeated .google.cloud.filestore.v1beta1.NfsExportOptions nfs_export_options = 5; + */ + @java.lang.Override + public int getNfsExportOptionsCount() { + return nfsExportOptions_.size(); + } + /** + * + * + *
+   * Nfs Export Options.
+   * There is a limit of 10 export options per file share.
+   * 
+ * + * repeated .google.cloud.filestore.v1beta1.NfsExportOptions nfs_export_options = 5; + */ + @java.lang.Override + public com.google.cloud.filestore.v1beta1.NfsExportOptions getNfsExportOptions(int index) { + return nfsExportOptions_.get(index); + } + /** + * + * + *
+   * Nfs Export Options.
+   * There is a limit of 10 export options per file share.
+   * 
+ * + * repeated .google.cloud.filestore.v1beta1.NfsExportOptions nfs_export_options = 5; + */ + @java.lang.Override + public com.google.cloud.filestore.v1beta1.NfsExportOptionsOrBuilder getNfsExportOptionsOrBuilder( + int index) { + return nfsExportOptions_.get(index); + } + + public static final int STATE_FIELD_NUMBER = 6; + private int state_; + /** + * + * + *
+   * Output only. The share state.
+   * 
+ * + * + * .google.cloud.filestore.v1beta1.Share.State state = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for state. + */ + @java.lang.Override + public int getStateValue() { + return state_; + } + /** + * + * + *
+   * Output only. The share state.
+   * 
+ * + * + * .google.cloud.filestore.v1beta1.Share.State state = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The state. + */ + @java.lang.Override + public com.google.cloud.filestore.v1beta1.Share.State getState() { + @SuppressWarnings("deprecation") + com.google.cloud.filestore.v1beta1.Share.State result = + com.google.cloud.filestore.v1beta1.Share.State.valueOf(state_); + return result == null ? com.google.cloud.filestore.v1beta1.Share.State.UNRECOGNIZED : result; + } + + public static final int CREATE_TIME_FIELD_NUMBER = 7; + private com.google.protobuf.Timestamp createTime_; + /** + * + * + *
+   * Output only. The time when the share was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + @java.lang.Override + public boolean hasCreateTime() { + return createTime_ != null; + } + /** + * + * + *
+   * Output only. The time when the share was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The createTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getCreateTime() { + return createTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : createTime_; + } + /** + * + * + *
+   * Output only. The time when the share was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { + return getCreateTime(); + } + + public static final int LABELS_FIELD_NUMBER = 8; + + private static final class LabelsDefaultEntryHolder { + static final com.google.protobuf.MapEntry defaultEntry = + com.google.protobuf.MapEntry.newDefaultInstance( + com.google.cloud.filestore.v1beta1.CloudFilestoreServiceProto + .internal_static_google_cloud_filestore_v1beta1_Share_LabelsEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.STRING, + ""); + } + + private com.google.protobuf.MapField labels_; + + private com.google.protobuf.MapField internalGetLabels() { + if (labels_ == null) { + return com.google.protobuf.MapField.emptyMapField(LabelsDefaultEntryHolder.defaultEntry); + } + return labels_; + } + + public int getLabelsCount() { + return internalGetLabels().getMap().size(); + } + /** + * + * + *
+   * Resource labels to represent user provided metadata.
+   * 
+ * + * map<string, string> labels = 8; + */ + @java.lang.Override + public boolean containsLabels(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetLabels().getMap().containsKey(key); + } + /** Use {@link #getLabelsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getLabels() { + return getLabelsMap(); + } + /** + * + * + *
+   * Resource labels to represent user provided metadata.
+   * 
+ * + * map<string, string> labels = 8; + */ + @java.lang.Override + public java.util.Map getLabelsMap() { + return internalGetLabels().getMap(); + } + /** + * + * + *
+   * Resource labels to represent user provided metadata.
+   * 
+ * + * map<string, string> labels = 8; + */ + @java.lang.Override + public java.lang.String getLabelsOrDefault(java.lang.String key, java.lang.String defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetLabels().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+   * Resource labels to represent user provided metadata.
+   * 
+ * + * map<string, string> labels = 8; + */ + @java.lang.Override + public java.lang.String getLabelsOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetLabels().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(mountName_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, mountName_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(description_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, description_); + } + if (capacityGb_ != 0L) { + output.writeInt64(4, capacityGb_); + } + for (int i = 0; i < nfsExportOptions_.size(); i++) { + output.writeMessage(5, nfsExportOptions_.get(i)); + } + if (state_ != com.google.cloud.filestore.v1beta1.Share.State.STATE_UNSPECIFIED.getNumber()) { + output.writeEnum(6, state_); + } + if (createTime_ != null) { + output.writeMessage(7, getCreateTime()); + } + com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( + output, internalGetLabels(), LabelsDefaultEntryHolder.defaultEntry, 8); + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(mountName_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, mountName_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(description_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, description_); + } + if (capacityGb_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(4, capacityGb_); + } + for (int i = 0; i < nfsExportOptions_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, nfsExportOptions_.get(i)); + } + if (state_ != com.google.cloud.filestore.v1beta1.Share.State.STATE_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(6, state_); + } + if (createTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(7, getCreateTime()); + } + for (java.util.Map.Entry entry : + internalGetLabels().getMap().entrySet()) { + com.google.protobuf.MapEntry labels__ = + LabelsDefaultEntryHolder.defaultEntry + .newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream.computeMessageSize(8, labels__); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.filestore.v1beta1.Share)) { + return super.equals(obj); + } + com.google.cloud.filestore.v1beta1.Share other = (com.google.cloud.filestore.v1beta1.Share) obj; + + if (!getName().equals(other.getName())) return false; + if (!getMountName().equals(other.getMountName())) return false; + if (!getDescription().equals(other.getDescription())) return false; + if (getCapacityGb() != other.getCapacityGb()) return false; + if (!getNfsExportOptionsList().equals(other.getNfsExportOptionsList())) return false; + if (state_ != other.state_) return false; + if (hasCreateTime() != other.hasCreateTime()) return false; + if (hasCreateTime()) { + if (!getCreateTime().equals(other.getCreateTime())) return false; + } + if (!internalGetLabels().equals(other.internalGetLabels())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (37 * hash) + MOUNT_NAME_FIELD_NUMBER; + hash = (53 * hash) + getMountName().hashCode(); + hash = (37 * hash) + DESCRIPTION_FIELD_NUMBER; + hash = (53 * hash) + getDescription().hashCode(); + hash = (37 * hash) + CAPACITY_GB_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getCapacityGb()); + if (getNfsExportOptionsCount() > 0) { + hash = (37 * hash) + NFS_EXPORT_OPTIONS_FIELD_NUMBER; + hash = (53 * hash) + getNfsExportOptionsList().hashCode(); + } + hash = (37 * hash) + STATE_FIELD_NUMBER; + hash = (53 * hash) + state_; + if (hasCreateTime()) { + hash = (37 * hash) + CREATE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getCreateTime().hashCode(); + } + if (!internalGetLabels().getMap().isEmpty()) { + hash = (37 * hash) + LABELS_FIELD_NUMBER; + hash = (53 * hash) + internalGetLabels().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.filestore.v1beta1.Share parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.filestore.v1beta1.Share parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.filestore.v1beta1.Share parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.filestore.v1beta1.Share parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.filestore.v1beta1.Share parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.filestore.v1beta1.Share parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.filestore.v1beta1.Share parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.filestore.v1beta1.Share parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.filestore.v1beta1.Share parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.filestore.v1beta1.Share parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.filestore.v1beta1.Share parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.filestore.v1beta1.Share parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.filestore.v1beta1.Share prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * A Filestore share.
+   * 
+ * + * Protobuf type {@code google.cloud.filestore.v1beta1.Share} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.filestore.v1beta1.Share) + com.google.cloud.filestore.v1beta1.ShareOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.filestore.v1beta1.CloudFilestoreServiceProto + .internal_static_google_cloud_filestore_v1beta1_Share_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 8: + return internalGetLabels(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMutableMapField(int number) { + switch (number) { + case 8: + return internalGetMutableLabels(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.filestore.v1beta1.CloudFilestoreServiceProto + .internal_static_google_cloud_filestore_v1beta1_Share_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.filestore.v1beta1.Share.class, + com.google.cloud.filestore.v1beta1.Share.Builder.class); + } + + // Construct using com.google.cloud.filestore.v1beta1.Share.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + mountName_ = ""; + + description_ = ""; + + capacityGb_ = 0L; + + if (nfsExportOptionsBuilder_ == null) { + nfsExportOptions_ = java.util.Collections.emptyList(); + } else { + nfsExportOptions_ = null; + nfsExportOptionsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + state_ = 0; + + if (createTimeBuilder_ == null) { + createTime_ = null; + } else { + createTime_ = null; + createTimeBuilder_ = null; + } + internalGetMutableLabels().clear(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.filestore.v1beta1.CloudFilestoreServiceProto + .internal_static_google_cloud_filestore_v1beta1_Share_descriptor; + } + + @java.lang.Override + public com.google.cloud.filestore.v1beta1.Share getDefaultInstanceForType() { + return com.google.cloud.filestore.v1beta1.Share.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.filestore.v1beta1.Share build() { + com.google.cloud.filestore.v1beta1.Share result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.filestore.v1beta1.Share buildPartial() { + com.google.cloud.filestore.v1beta1.Share result = + new com.google.cloud.filestore.v1beta1.Share(this); + int from_bitField0_ = bitField0_; + result.name_ = name_; + result.mountName_ = mountName_; + result.description_ = description_; + result.capacityGb_ = capacityGb_; + if (nfsExportOptionsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + nfsExportOptions_ = java.util.Collections.unmodifiableList(nfsExportOptions_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.nfsExportOptions_ = nfsExportOptions_; + } else { + result.nfsExportOptions_ = nfsExportOptionsBuilder_.build(); + } + result.state_ = state_; + if (createTimeBuilder_ == null) { + result.createTime_ = createTime_; + } else { + result.createTime_ = createTimeBuilder_.build(); + } + result.labels_ = internalGetLabels(); + result.labels_.makeImmutable(); + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.filestore.v1beta1.Share) { + return mergeFrom((com.google.cloud.filestore.v1beta1.Share) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.filestore.v1beta1.Share other) { + if (other == com.google.cloud.filestore.v1beta1.Share.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (!other.getMountName().isEmpty()) { + mountName_ = other.mountName_; + onChanged(); + } + if (!other.getDescription().isEmpty()) { + description_ = other.description_; + onChanged(); + } + if (other.getCapacityGb() != 0L) { + setCapacityGb(other.getCapacityGb()); + } + if (nfsExportOptionsBuilder_ == null) { + if (!other.nfsExportOptions_.isEmpty()) { + if (nfsExportOptions_.isEmpty()) { + nfsExportOptions_ = other.nfsExportOptions_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureNfsExportOptionsIsMutable(); + nfsExportOptions_.addAll(other.nfsExportOptions_); + } + onChanged(); + } + } else { + if (!other.nfsExportOptions_.isEmpty()) { + if (nfsExportOptionsBuilder_.isEmpty()) { + nfsExportOptionsBuilder_.dispose(); + nfsExportOptionsBuilder_ = null; + nfsExportOptions_ = other.nfsExportOptions_; + bitField0_ = (bitField0_ & ~0x00000001); + nfsExportOptionsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getNfsExportOptionsFieldBuilder() + : null; + } else { + nfsExportOptionsBuilder_.addAllMessages(other.nfsExportOptions_); + } + } + } + if (other.state_ != 0) { + setStateValue(other.getStateValue()); + } + if (other.hasCreateTime()) { + mergeCreateTime(other.getCreateTime()); + } + internalGetMutableLabels().mergeFrom(other.internalGetLabels()); + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + + break; + } // case 10 + case 18: + { + mountName_ = input.readStringRequireUtf8(); + + break; + } // case 18 + case 26: + { + description_ = input.readStringRequireUtf8(); + + break; + } // case 26 + case 32: + { + capacityGb_ = input.readInt64(); + + break; + } // case 32 + case 42: + { + com.google.cloud.filestore.v1beta1.NfsExportOptions m = + input.readMessage( + com.google.cloud.filestore.v1beta1.NfsExportOptions.parser(), + extensionRegistry); + if (nfsExportOptionsBuilder_ == null) { + ensureNfsExportOptionsIsMutable(); + nfsExportOptions_.add(m); + } else { + nfsExportOptionsBuilder_.addMessage(m); + } + break; + } // case 42 + case 48: + { + state_ = input.readEnum(); + + break; + } // case 48 + case 58: + { + input.readMessage(getCreateTimeFieldBuilder().getBuilder(), extensionRegistry); + + break; + } // case 58 + case 66: + { + com.google.protobuf.MapEntry labels__ = + input.readMessage( + LabelsDefaultEntryHolder.defaultEntry.getParserForType(), + extensionRegistry); + internalGetMutableLabels() + .getMutableMap() + .put(labels__.getKey(), labels__.getValue()); + break; + } // case 66 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Output only. The resource name of the share, in the format
+     * `projects/{project_id}/locations/{location_id}/instances/{instance_id}/shares/{share_id}`.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. The resource name of the share, in the format
+     * `projects/{project_id}/locations/{location_id}/instances/{instance_id}/shares/{share_id}`.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. The resource name of the share, in the format
+     * `projects/{project_id}/locations/{location_id}/instances/{instance_id}/shares/{share_id}`.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The resource name of the share, in the format
+     * `projects/{project_id}/locations/{location_id}/instances/{instance_id}/shares/{share_id}`.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The resource name of the share, in the format
+     * `projects/{project_id}/locations/{location_id}/instances/{instance_id}/shares/{share_id}`.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + private java.lang.Object mountName_ = ""; + /** + * + * + *
+     * The mount name of the share. Must be 63 characters or less and consist of
+     * uppercase or lowercase letters, numbers, and underscores.
+     * 
+ * + * string mount_name = 2; + * + * @return The mountName. + */ + public java.lang.String getMountName() { + java.lang.Object ref = mountName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + mountName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The mount name of the share. Must be 63 characters or less and consist of
+     * uppercase or lowercase letters, numbers, and underscores.
+     * 
+ * + * string mount_name = 2; + * + * @return The bytes for mountName. + */ + public com.google.protobuf.ByteString getMountNameBytes() { + java.lang.Object ref = mountName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + mountName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The mount name of the share. Must be 63 characters or less and consist of
+     * uppercase or lowercase letters, numbers, and underscores.
+     * 
+ * + * string mount_name = 2; + * + * @param value The mountName to set. + * @return This builder for chaining. + */ + public Builder setMountName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + mountName_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The mount name of the share. Must be 63 characters or less and consist of
+     * uppercase or lowercase letters, numbers, and underscores.
+     * 
+ * + * string mount_name = 2; + * + * @return This builder for chaining. + */ + public Builder clearMountName() { + + mountName_ = getDefaultInstance().getMountName(); + onChanged(); + return this; + } + /** + * + * + *
+     * The mount name of the share. Must be 63 characters or less and consist of
+     * uppercase or lowercase letters, numbers, and underscores.
+     * 
+ * + * string mount_name = 2; + * + * @param value The bytes for mountName to set. + * @return This builder for chaining. + */ + public Builder setMountNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + mountName_ = value; + onChanged(); + return this; + } + + private java.lang.Object description_ = ""; + /** + * + * + *
+     * A description of the share with 2048 characters or less. Requests with
+     * longer descriptions will be rejected.
+     * 
+ * + * string description = 3; + * + * @return The description. + */ + public java.lang.String getDescription() { + java.lang.Object ref = description_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + description_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * A description of the share with 2048 characters or less. Requests with
+     * longer descriptions will be rejected.
+     * 
+ * + * string description = 3; + * + * @return The bytes for description. + */ + public com.google.protobuf.ByteString getDescriptionBytes() { + java.lang.Object ref = description_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + description_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * A description of the share with 2048 characters or less. Requests with
+     * longer descriptions will be rejected.
+     * 
+ * + * string description = 3; + * + * @param value The description to set. + * @return This builder for chaining. + */ + public Builder setDescription(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + description_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * A description of the share with 2048 characters or less. Requests with
+     * longer descriptions will be rejected.
+     * 
+ * + * string description = 3; + * + * @return This builder for chaining. + */ + public Builder clearDescription() { + + description_ = getDefaultInstance().getDescription(); + onChanged(); + return this; + } + /** + * + * + *
+     * A description of the share with 2048 characters or less. Requests with
+     * longer descriptions will be rejected.
+     * 
+ * + * string description = 3; + * + * @param value The bytes for description to set. + * @return This builder for chaining. + */ + public Builder setDescriptionBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + description_ = value; + onChanged(); + return this; + } + + private long capacityGb_; + /** + * + * + *
+     * File share capacity in gigabytes (GB). Filestore defines 1 GB as
+     * 1024^3 bytes. Must be greater than 0.
+     * 
+ * + * int64 capacity_gb = 4; + * + * @return The capacityGb. + */ + @java.lang.Override + public long getCapacityGb() { + return capacityGb_; + } + /** + * + * + *
+     * File share capacity in gigabytes (GB). Filestore defines 1 GB as
+     * 1024^3 bytes. Must be greater than 0.
+     * 
+ * + * int64 capacity_gb = 4; + * + * @param value The capacityGb to set. + * @return This builder for chaining. + */ + public Builder setCapacityGb(long value) { + + capacityGb_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * File share capacity in gigabytes (GB). Filestore defines 1 GB as
+     * 1024^3 bytes. Must be greater than 0.
+     * 
+ * + * int64 capacity_gb = 4; + * + * @return This builder for chaining. + */ + public Builder clearCapacityGb() { + + capacityGb_ = 0L; + onChanged(); + return this; + } + + private java.util.List nfsExportOptions_ = + java.util.Collections.emptyList(); + + private void ensureNfsExportOptionsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + nfsExportOptions_ = + new java.util.ArrayList( + nfsExportOptions_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.filestore.v1beta1.NfsExportOptions, + com.google.cloud.filestore.v1beta1.NfsExportOptions.Builder, + com.google.cloud.filestore.v1beta1.NfsExportOptionsOrBuilder> + nfsExportOptionsBuilder_; + + /** + * + * + *
+     * Nfs Export Options.
+     * There is a limit of 10 export options per file share.
+     * 
+ * + * repeated .google.cloud.filestore.v1beta1.NfsExportOptions nfs_export_options = 5; + * + */ + public java.util.List + getNfsExportOptionsList() { + if (nfsExportOptionsBuilder_ == null) { + return java.util.Collections.unmodifiableList(nfsExportOptions_); + } else { + return nfsExportOptionsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * Nfs Export Options.
+     * There is a limit of 10 export options per file share.
+     * 
+ * + * repeated .google.cloud.filestore.v1beta1.NfsExportOptions nfs_export_options = 5; + * + */ + public int getNfsExportOptionsCount() { + if (nfsExportOptionsBuilder_ == null) { + return nfsExportOptions_.size(); + } else { + return nfsExportOptionsBuilder_.getCount(); + } + } + /** + * + * + *
+     * Nfs Export Options.
+     * There is a limit of 10 export options per file share.
+     * 
+ * + * repeated .google.cloud.filestore.v1beta1.NfsExportOptions nfs_export_options = 5; + * + */ + public com.google.cloud.filestore.v1beta1.NfsExportOptions getNfsExportOptions(int index) { + if (nfsExportOptionsBuilder_ == null) { + return nfsExportOptions_.get(index); + } else { + return nfsExportOptionsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * Nfs Export Options.
+     * There is a limit of 10 export options per file share.
+     * 
+ * + * repeated .google.cloud.filestore.v1beta1.NfsExportOptions nfs_export_options = 5; + * + */ + public Builder setNfsExportOptions( + int index, com.google.cloud.filestore.v1beta1.NfsExportOptions value) { + if (nfsExportOptionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureNfsExportOptionsIsMutable(); + nfsExportOptions_.set(index, value); + onChanged(); + } else { + nfsExportOptionsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Nfs Export Options.
+     * There is a limit of 10 export options per file share.
+     * 
+ * + * repeated .google.cloud.filestore.v1beta1.NfsExportOptions nfs_export_options = 5; + * + */ + public Builder setNfsExportOptions( + int index, com.google.cloud.filestore.v1beta1.NfsExportOptions.Builder builderForValue) { + if (nfsExportOptionsBuilder_ == null) { + ensureNfsExportOptionsIsMutable(); + nfsExportOptions_.set(index, builderForValue.build()); + onChanged(); + } else { + nfsExportOptionsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Nfs Export Options.
+     * There is a limit of 10 export options per file share.
+     * 
+ * + * repeated .google.cloud.filestore.v1beta1.NfsExportOptions nfs_export_options = 5; + * + */ + public Builder addNfsExportOptions(com.google.cloud.filestore.v1beta1.NfsExportOptions value) { + if (nfsExportOptionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureNfsExportOptionsIsMutable(); + nfsExportOptions_.add(value); + onChanged(); + } else { + nfsExportOptionsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * Nfs Export Options.
+     * There is a limit of 10 export options per file share.
+     * 
+ * + * repeated .google.cloud.filestore.v1beta1.NfsExportOptions nfs_export_options = 5; + * + */ + public Builder addNfsExportOptions( + int index, com.google.cloud.filestore.v1beta1.NfsExportOptions value) { + if (nfsExportOptionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureNfsExportOptionsIsMutable(); + nfsExportOptions_.add(index, value); + onChanged(); + } else { + nfsExportOptionsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Nfs Export Options.
+     * There is a limit of 10 export options per file share.
+     * 
+ * + * repeated .google.cloud.filestore.v1beta1.NfsExportOptions nfs_export_options = 5; + * + */ + public Builder addNfsExportOptions( + com.google.cloud.filestore.v1beta1.NfsExportOptions.Builder builderForValue) { + if (nfsExportOptionsBuilder_ == null) { + ensureNfsExportOptionsIsMutable(); + nfsExportOptions_.add(builderForValue.build()); + onChanged(); + } else { + nfsExportOptionsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Nfs Export Options.
+     * There is a limit of 10 export options per file share.
+     * 
+ * + * repeated .google.cloud.filestore.v1beta1.NfsExportOptions nfs_export_options = 5; + * + */ + public Builder addNfsExportOptions( + int index, com.google.cloud.filestore.v1beta1.NfsExportOptions.Builder builderForValue) { + if (nfsExportOptionsBuilder_ == null) { + ensureNfsExportOptionsIsMutable(); + nfsExportOptions_.add(index, builderForValue.build()); + onChanged(); + } else { + nfsExportOptionsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Nfs Export Options.
+     * There is a limit of 10 export options per file share.
+     * 
+ * + * repeated .google.cloud.filestore.v1beta1.NfsExportOptions nfs_export_options = 5; + * + */ + public Builder addAllNfsExportOptions( + java.lang.Iterable values) { + if (nfsExportOptionsBuilder_ == null) { + ensureNfsExportOptionsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, nfsExportOptions_); + onChanged(); + } else { + nfsExportOptionsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * Nfs Export Options.
+     * There is a limit of 10 export options per file share.
+     * 
+ * + * repeated .google.cloud.filestore.v1beta1.NfsExportOptions nfs_export_options = 5; + * + */ + public Builder clearNfsExportOptions() { + if (nfsExportOptionsBuilder_ == null) { + nfsExportOptions_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + nfsExportOptionsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Nfs Export Options.
+     * There is a limit of 10 export options per file share.
+     * 
+ * + * repeated .google.cloud.filestore.v1beta1.NfsExportOptions nfs_export_options = 5; + * + */ + public Builder removeNfsExportOptions(int index) { + if (nfsExportOptionsBuilder_ == null) { + ensureNfsExportOptionsIsMutable(); + nfsExportOptions_.remove(index); + onChanged(); + } else { + nfsExportOptionsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * Nfs Export Options.
+     * There is a limit of 10 export options per file share.
+     * 
+ * + * repeated .google.cloud.filestore.v1beta1.NfsExportOptions nfs_export_options = 5; + * + */ + public com.google.cloud.filestore.v1beta1.NfsExportOptions.Builder getNfsExportOptionsBuilder( + int index) { + return getNfsExportOptionsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * Nfs Export Options.
+     * There is a limit of 10 export options per file share.
+     * 
+ * + * repeated .google.cloud.filestore.v1beta1.NfsExportOptions nfs_export_options = 5; + * + */ + public com.google.cloud.filestore.v1beta1.NfsExportOptionsOrBuilder + getNfsExportOptionsOrBuilder(int index) { + if (nfsExportOptionsBuilder_ == null) { + return nfsExportOptions_.get(index); + } else { + return nfsExportOptionsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * Nfs Export Options.
+     * There is a limit of 10 export options per file share.
+     * 
+ * + * repeated .google.cloud.filestore.v1beta1.NfsExportOptions nfs_export_options = 5; + * + */ + public java.util.List + getNfsExportOptionsOrBuilderList() { + if (nfsExportOptionsBuilder_ != null) { + return nfsExportOptionsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(nfsExportOptions_); + } + } + /** + * + * + *
+     * Nfs Export Options.
+     * There is a limit of 10 export options per file share.
+     * 
+ * + * repeated .google.cloud.filestore.v1beta1.NfsExportOptions nfs_export_options = 5; + * + */ + public com.google.cloud.filestore.v1beta1.NfsExportOptions.Builder + addNfsExportOptionsBuilder() { + return getNfsExportOptionsFieldBuilder() + .addBuilder(com.google.cloud.filestore.v1beta1.NfsExportOptions.getDefaultInstance()); + } + /** + * + * + *
+     * Nfs Export Options.
+     * There is a limit of 10 export options per file share.
+     * 
+ * + * repeated .google.cloud.filestore.v1beta1.NfsExportOptions nfs_export_options = 5; + * + */ + public com.google.cloud.filestore.v1beta1.NfsExportOptions.Builder addNfsExportOptionsBuilder( + int index) { + return getNfsExportOptionsFieldBuilder() + .addBuilder( + index, com.google.cloud.filestore.v1beta1.NfsExportOptions.getDefaultInstance()); + } + /** + * + * + *
+     * Nfs Export Options.
+     * There is a limit of 10 export options per file share.
+     * 
+ * + * repeated .google.cloud.filestore.v1beta1.NfsExportOptions nfs_export_options = 5; + * + */ + public java.util.List + getNfsExportOptionsBuilderList() { + return getNfsExportOptionsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.filestore.v1beta1.NfsExportOptions, + com.google.cloud.filestore.v1beta1.NfsExportOptions.Builder, + com.google.cloud.filestore.v1beta1.NfsExportOptionsOrBuilder> + getNfsExportOptionsFieldBuilder() { + if (nfsExportOptionsBuilder_ == null) { + nfsExportOptionsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.filestore.v1beta1.NfsExportOptions, + com.google.cloud.filestore.v1beta1.NfsExportOptions.Builder, + com.google.cloud.filestore.v1beta1.NfsExportOptionsOrBuilder>( + nfsExportOptions_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + nfsExportOptions_ = null; + } + return nfsExportOptionsBuilder_; + } + + private int state_ = 0; + /** + * + * + *
+     * Output only. The share state.
+     * 
+ * + * + * .google.cloud.filestore.v1beta1.Share.State state = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for state. + */ + @java.lang.Override + public int getStateValue() { + return state_; + } + /** + * + * + *
+     * Output only. The share state.
+     * 
+ * + * + * .google.cloud.filestore.v1beta1.Share.State state = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The enum numeric value on the wire for state to set. + * @return This builder for chaining. + */ + public Builder setStateValue(int value) { + + state_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The share state.
+     * 
+ * + * + * .google.cloud.filestore.v1beta1.Share.State state = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The state. + */ + @java.lang.Override + public com.google.cloud.filestore.v1beta1.Share.State getState() { + @SuppressWarnings("deprecation") + com.google.cloud.filestore.v1beta1.Share.State result = + com.google.cloud.filestore.v1beta1.Share.State.valueOf(state_); + return result == null ? com.google.cloud.filestore.v1beta1.Share.State.UNRECOGNIZED : result; + } + /** + * + * + *
+     * Output only. The share state.
+     * 
+ * + * + * .google.cloud.filestore.v1beta1.Share.State state = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The state to set. + * @return This builder for chaining. + */ + public Builder setState(com.google.cloud.filestore.v1beta1.Share.State value) { + if (value == null) { + throw new NullPointerException(); + } + + state_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The share state.
+     * 
+ * + * + * .google.cloud.filestore.v1beta1.Share.State state = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return This builder for chaining. + */ + public Builder clearState() { + + state_ = 0; + onChanged(); + return this; + } + + private com.google.protobuf.Timestamp createTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + createTimeBuilder_; + /** + * + * + *
+     * Output only. The time when the share was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + public boolean hasCreateTime() { + return createTimeBuilder_ != null || createTime_ != null; + } + /** + * + * + *
+     * Output only. The time when the share was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The createTime. + */ + public com.google.protobuf.Timestamp getCreateTime() { + if (createTimeBuilder_ == null) { + return createTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : createTime_; + } else { + return createTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Output only. The time when the share was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setCreateTime(com.google.protobuf.Timestamp value) { + if (createTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + createTime_ = value; + onChanged(); + } else { + createTimeBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Output only. The time when the share was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setCreateTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (createTimeBuilder_ == null) { + createTime_ = builderForValue.build(); + onChanged(); + } else { + createTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Output only. The time when the share was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeCreateTime(com.google.protobuf.Timestamp value) { + if (createTimeBuilder_ == null) { + if (createTime_ != null) { + createTime_ = + com.google.protobuf.Timestamp.newBuilder(createTime_).mergeFrom(value).buildPartial(); + } else { + createTime_ = value; + } + onChanged(); + } else { + createTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Output only. The time when the share was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearCreateTime() { + if (createTimeBuilder_ == null) { + createTime_ = null; + onChanged(); + } else { + createTime_ = null; + createTimeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Output only. The time when the share was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getCreateTimeBuilder() { + + onChanged(); + return getCreateTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. The time when the share was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { + if (createTimeBuilder_ != null) { + return createTimeBuilder_.getMessageOrBuilder(); + } else { + return createTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : createTime_; + } + } + /** + * + * + *
+     * Output only. The time when the share was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getCreateTimeFieldBuilder() { + if (createTimeBuilder_ == null) { + createTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getCreateTime(), getParentForChildren(), isClean()); + createTime_ = null; + } + return createTimeBuilder_; + } + + private com.google.protobuf.MapField labels_; + + private com.google.protobuf.MapField internalGetLabels() { + if (labels_ == null) { + return com.google.protobuf.MapField.emptyMapField(LabelsDefaultEntryHolder.defaultEntry); + } + return labels_; + } + + private com.google.protobuf.MapField + internalGetMutableLabels() { + onChanged(); + ; + if (labels_ == null) { + labels_ = com.google.protobuf.MapField.newMapField(LabelsDefaultEntryHolder.defaultEntry); + } + if (!labels_.isMutable()) { + labels_ = labels_.copy(); + } + return labels_; + } + + public int getLabelsCount() { + return internalGetLabels().getMap().size(); + } + /** + * + * + *
+     * Resource labels to represent user provided metadata.
+     * 
+ * + * map<string, string> labels = 8; + */ + @java.lang.Override + public boolean containsLabels(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetLabels().getMap().containsKey(key); + } + /** Use {@link #getLabelsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getLabels() { + return getLabelsMap(); + } + /** + * + * + *
+     * Resource labels to represent user provided metadata.
+     * 
+ * + * map<string, string> labels = 8; + */ + @java.lang.Override + public java.util.Map getLabelsMap() { + return internalGetLabels().getMap(); + } + /** + * + * + *
+     * Resource labels to represent user provided metadata.
+     * 
+ * + * map<string, string> labels = 8; + */ + @java.lang.Override + public java.lang.String getLabelsOrDefault( + java.lang.String key, java.lang.String defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetLabels().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+     * Resource labels to represent user provided metadata.
+     * 
+ * + * map<string, string> labels = 8; + */ + @java.lang.Override + public java.lang.String getLabelsOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetLabels().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearLabels() { + internalGetMutableLabels().getMutableMap().clear(); + return this; + } + /** + * + * + *
+     * Resource labels to represent user provided metadata.
+     * 
+ * + * map<string, string> labels = 8; + */ + public Builder removeLabels(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + internalGetMutableLabels().getMutableMap().remove(key); + return this; + } + /** Use alternate mutation accessors instead. */ + @java.lang.Deprecated + public java.util.Map getMutableLabels() { + return internalGetMutableLabels().getMutableMap(); + } + /** + * + * + *
+     * Resource labels to represent user provided metadata.
+     * 
+ * + * map<string, string> labels = 8; + */ + public Builder putLabels(java.lang.String key, java.lang.String value) { + if (key == null) { + throw new NullPointerException("map key"); + } + if (value == null) { + throw new NullPointerException("map value"); + } + + internalGetMutableLabels().getMutableMap().put(key, value); + return this; + } + /** + * + * + *
+     * Resource labels to represent user provided metadata.
+     * 
+ * + * map<string, string> labels = 8; + */ + public Builder putAllLabels(java.util.Map values) { + internalGetMutableLabels().getMutableMap().putAll(values); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.filestore.v1beta1.Share) + } + + // @@protoc_insertion_point(class_scope:google.cloud.filestore.v1beta1.Share) + private static final com.google.cloud.filestore.v1beta1.Share DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.filestore.v1beta1.Share(); + } + + public static com.google.cloud.filestore.v1beta1.Share getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Share parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.filestore.v1beta1.Share getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-filestore/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/ShareName.java b/java-filestore/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/ShareName.java new file mode 100644 index 000000000000..f0adfda3222f --- /dev/null +++ b/java-filestore/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/ShareName.java @@ -0,0 +1,257 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.filestore.v1beta1; + +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +@Generated("by gapic-generator-java") +public class ShareName implements ResourceName { + private static final PathTemplate PROJECT_LOCATION_INSTANCE_SHARE = + PathTemplate.createWithoutUrlEncoding( + "projects/{project}/locations/{location}/instances/{instance}/shares/{share}"); + private volatile Map fieldValuesMap; + private final String project; + private final String location; + private final String instance; + private final String share; + + @Deprecated + protected ShareName() { + project = null; + location = null; + instance = null; + share = null; + } + + private ShareName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + location = Preconditions.checkNotNull(builder.getLocation()); + instance = Preconditions.checkNotNull(builder.getInstance()); + share = Preconditions.checkNotNull(builder.getShare()); + } + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getInstance() { + return instance; + } + + public String getShare() { + return share; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static ShareName of(String project, String location, String instance, String share) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setInstance(instance) + .setShare(share) + .build(); + } + + public static String format(String project, String location, String instance, String share) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setInstance(instance) + .setShare(share) + .build() + .toString(); + } + + public static ShareName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PROJECT_LOCATION_INSTANCE_SHARE.validatedMatch( + formattedString, "ShareName.parse: formattedString not in valid format"); + return of( + matchMap.get("project"), + matchMap.get("location"), + matchMap.get("instance"), + matchMap.get("share")); + } + + public static List parseList(List formattedStrings) { + List list = new ArrayList<>(formattedStrings.size()); + for (String formattedString : formattedStrings) { + list.add(parse(formattedString)); + } + return list; + } + + public static List toStringList(List values) { + List list = new ArrayList<>(values.size()); + for (ShareName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PROJECT_LOCATION_INSTANCE_SHARE.matches(formattedString); + } + + @Override + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + if (project != null) { + fieldMapBuilder.put("project", project); + } + if (location != null) { + fieldMapBuilder.put("location", location); + } + if (instance != null) { + fieldMapBuilder.put("instance", instance); + } + if (share != null) { + fieldMapBuilder.put("share", share); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return PROJECT_LOCATION_INSTANCE_SHARE.instantiate( + "project", project, "location", location, "instance", instance, "share", share); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null || getClass() == o.getClass()) { + ShareName that = ((ShareName) o); + return Objects.equals(this.project, that.project) + && Objects.equals(this.location, that.location) + && Objects.equals(this.instance, that.instance) + && Objects.equals(this.share, that.share); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(project); + h *= 1000003; + h ^= Objects.hashCode(location); + h *= 1000003; + h ^= Objects.hashCode(instance); + h *= 1000003; + h ^= Objects.hashCode(share); + return h; + } + + /** Builder for projects/{project}/locations/{location}/instances/{instance}/shares/{share}. */ + public static class Builder { + private String project; + private String location; + private String instance; + private String share; + + protected Builder() {} + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getInstance() { + return instance; + } + + public String getShare() { + return share; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setLocation(String location) { + this.location = location; + return this; + } + + public Builder setInstance(String instance) { + this.instance = instance; + return this; + } + + public Builder setShare(String share) { + this.share = share; + return this; + } + + private Builder(ShareName shareName) { + this.project = shareName.project; + this.location = shareName.location; + this.instance = shareName.instance; + this.share = shareName.share; + } + + public ShareName build() { + return new ShareName(this); + } + } +} diff --git a/java-filestore/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/ShareOrBuilder.java b/java-filestore/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/ShareOrBuilder.java new file mode 100644 index 000000000000..e13cade88f90 --- /dev/null +++ b/java-filestore/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/ShareOrBuilder.java @@ -0,0 +1,304 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/filestore/v1beta1/cloud_filestore_service.proto + +package com.google.cloud.filestore.v1beta1; + +public interface ShareOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.filestore.v1beta1.Share) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Output only. The resource name of the share, in the format
+   * `projects/{project_id}/locations/{location_id}/instances/{instance_id}/shares/{share_id}`.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Output only. The resource name of the share, in the format
+   * `projects/{project_id}/locations/{location_id}/instances/{instance_id}/shares/{share_id}`.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * The mount name of the share. Must be 63 characters or less and consist of
+   * uppercase or lowercase letters, numbers, and underscores.
+   * 
+ * + * string mount_name = 2; + * + * @return The mountName. + */ + java.lang.String getMountName(); + /** + * + * + *
+   * The mount name of the share. Must be 63 characters or less and consist of
+   * uppercase or lowercase letters, numbers, and underscores.
+   * 
+ * + * string mount_name = 2; + * + * @return The bytes for mountName. + */ + com.google.protobuf.ByteString getMountNameBytes(); + + /** + * + * + *
+   * A description of the share with 2048 characters or less. Requests with
+   * longer descriptions will be rejected.
+   * 
+ * + * string description = 3; + * + * @return The description. + */ + java.lang.String getDescription(); + /** + * + * + *
+   * A description of the share with 2048 characters or less. Requests with
+   * longer descriptions will be rejected.
+   * 
+ * + * string description = 3; + * + * @return The bytes for description. + */ + com.google.protobuf.ByteString getDescriptionBytes(); + + /** + * + * + *
+   * File share capacity in gigabytes (GB). Filestore defines 1 GB as
+   * 1024^3 bytes. Must be greater than 0.
+   * 
+ * + * int64 capacity_gb = 4; + * + * @return The capacityGb. + */ + long getCapacityGb(); + + /** + * + * + *
+   * Nfs Export Options.
+   * There is a limit of 10 export options per file share.
+   * 
+ * + * repeated .google.cloud.filestore.v1beta1.NfsExportOptions nfs_export_options = 5; + */ + java.util.List getNfsExportOptionsList(); + /** + * + * + *
+   * Nfs Export Options.
+   * There is a limit of 10 export options per file share.
+   * 
+ * + * repeated .google.cloud.filestore.v1beta1.NfsExportOptions nfs_export_options = 5; + */ + com.google.cloud.filestore.v1beta1.NfsExportOptions getNfsExportOptions(int index); + /** + * + * + *
+   * Nfs Export Options.
+   * There is a limit of 10 export options per file share.
+   * 
+ * + * repeated .google.cloud.filestore.v1beta1.NfsExportOptions nfs_export_options = 5; + */ + int getNfsExportOptionsCount(); + /** + * + * + *
+   * Nfs Export Options.
+   * There is a limit of 10 export options per file share.
+   * 
+ * + * repeated .google.cloud.filestore.v1beta1.NfsExportOptions nfs_export_options = 5; + */ + java.util.List + getNfsExportOptionsOrBuilderList(); + /** + * + * + *
+   * Nfs Export Options.
+   * There is a limit of 10 export options per file share.
+   * 
+ * + * repeated .google.cloud.filestore.v1beta1.NfsExportOptions nfs_export_options = 5; + */ + com.google.cloud.filestore.v1beta1.NfsExportOptionsOrBuilder getNfsExportOptionsOrBuilder( + int index); + + /** + * + * + *
+   * Output only. The share state.
+   * 
+ * + * + * .google.cloud.filestore.v1beta1.Share.State state = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for state. + */ + int getStateValue(); + /** + * + * + *
+   * Output only. The share state.
+   * 
+ * + * + * .google.cloud.filestore.v1beta1.Share.State state = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The state. + */ + com.google.cloud.filestore.v1beta1.Share.State getState(); + + /** + * + * + *
+   * Output only. The time when the share was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + boolean hasCreateTime(); + /** + * + * + *
+   * Output only. The time when the share was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The createTime. + */ + com.google.protobuf.Timestamp getCreateTime(); + /** + * + * + *
+   * Output only. The time when the share was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder(); + + /** + * + * + *
+   * Resource labels to represent user provided metadata.
+   * 
+ * + * map<string, string> labels = 8; + */ + int getLabelsCount(); + /** + * + * + *
+   * Resource labels to represent user provided metadata.
+   * 
+ * + * map<string, string> labels = 8; + */ + boolean containsLabels(java.lang.String key); + /** Use {@link #getLabelsMap()} instead. */ + @java.lang.Deprecated + java.util.Map getLabels(); + /** + * + * + *
+   * Resource labels to represent user provided metadata.
+   * 
+ * + * map<string, string> labels = 8; + */ + java.util.Map getLabelsMap(); + /** + * + * + *
+   * Resource labels to represent user provided metadata.
+   * 
+ * + * map<string, string> labels = 8; + */ + + /* nullable */ + java.lang.String getLabelsOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue); + /** + * + * + *
+   * Resource labels to represent user provided metadata.
+   * 
+ * + * map<string, string> labels = 8; + */ + java.lang.String getLabelsOrThrow(java.lang.String key); +} diff --git a/java-filestore/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/Snapshot.java b/java-filestore/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/Snapshot.java index 4aab9492e94a..d98e59966851 100644 --- a/java-filestore/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/Snapshot.java +++ b/java-filestore/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/Snapshot.java @@ -22,7 +22,7 @@ * * *
- * A Cloud Filestore snapshot.
+ * A Filestore snapshot.
  * 
* * Protobuf type {@code google.cloud.filestore.v1beta1.Snapshot} @@ -787,7 +787,7 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build * * *
-   * A Cloud Filestore snapshot.
+   * A Filestore snapshot.
    * 
* * Protobuf type {@code google.cloud.filestore.v1beta1.Snapshot} diff --git a/java-filestore/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/UpdateShareRequest.java b/java-filestore/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/UpdateShareRequest.java new file mode 100644 index 000000000000..3eb418eeaf3a --- /dev/null +++ b/java-filestore/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/UpdateShareRequest.java @@ -0,0 +1,1085 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/filestore/v1beta1/cloud_filestore_service.proto + +package com.google.cloud.filestore.v1beta1; + +/** + * + * + *
+ * UpdateShareRequest updates the settings of a share.
+ * 
+ * + * Protobuf type {@code google.cloud.filestore.v1beta1.UpdateShareRequest} + */ +public final class UpdateShareRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.filestore.v1beta1.UpdateShareRequest) + UpdateShareRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use UpdateShareRequest.newBuilder() to construct. + private UpdateShareRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private UpdateShareRequest() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new UpdateShareRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.filestore.v1beta1.CloudFilestoreServiceProto + .internal_static_google_cloud_filestore_v1beta1_UpdateShareRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.filestore.v1beta1.CloudFilestoreServiceProto + .internal_static_google_cloud_filestore_v1beta1_UpdateShareRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.filestore.v1beta1.UpdateShareRequest.class, + com.google.cloud.filestore.v1beta1.UpdateShareRequest.Builder.class); + } + + public static final int SHARE_FIELD_NUMBER = 1; + private com.google.cloud.filestore.v1beta1.Share share_; + /** + * + * + *
+   * Required. A share resource.
+   * Only fields specified in update_mask are updated.
+   * 
+ * + * + * .google.cloud.filestore.v1beta1.Share share = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the share field is set. + */ + @java.lang.Override + public boolean hasShare() { + return share_ != null; + } + /** + * + * + *
+   * Required. A share resource.
+   * Only fields specified in update_mask are updated.
+   * 
+ * + * + * .google.cloud.filestore.v1beta1.Share share = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The share. + */ + @java.lang.Override + public com.google.cloud.filestore.v1beta1.Share getShare() { + return share_ == null ? com.google.cloud.filestore.v1beta1.Share.getDefaultInstance() : share_; + } + /** + * + * + *
+   * Required. A share resource.
+   * Only fields specified in update_mask are updated.
+   * 
+ * + * + * .google.cloud.filestore.v1beta1.Share share = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.filestore.v1beta1.ShareOrBuilder getShareOrBuilder() { + return getShare(); + } + + public static final int UPDATE_MASK_FIELD_NUMBER = 2; + private com.google.protobuf.FieldMask updateMask_; + /** + * + * + *
+   * Required. Mask of fields to update. At least one path must be supplied in this
+   * field.
+   * The elements of the repeated paths field may only include these fields:
+   * * "description"
+   * * "capacity_gb"
+   * * "labels"
+   * * "nfs_export_options"
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the updateMask field is set. + */ + @java.lang.Override + public boolean hasUpdateMask() { + return updateMask_ != null; + } + /** + * + * + *
+   * Required. Mask of fields to update. At least one path must be supplied in this
+   * field.
+   * The elements of the repeated paths field may only include these fields:
+   * * "description"
+   * * "capacity_gb"
+   * * "labels"
+   * * "nfs_export_options"
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The updateMask. + */ + @java.lang.Override + public com.google.protobuf.FieldMask getUpdateMask() { + return updateMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; + } + /** + * + * + *
+   * Required. Mask of fields to update. At least one path must be supplied in this
+   * field.
+   * The elements of the repeated paths field may only include these fields:
+   * * "description"
+   * * "capacity_gb"
+   * * "labels"
+   * * "nfs_export_options"
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + return getUpdateMask(); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (share_ != null) { + output.writeMessage(1, getShare()); + } + if (updateMask_ != null) { + output.writeMessage(2, getUpdateMask()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (share_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getShare()); + } + if (updateMask_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getUpdateMask()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.filestore.v1beta1.UpdateShareRequest)) { + return super.equals(obj); + } + com.google.cloud.filestore.v1beta1.UpdateShareRequest other = + (com.google.cloud.filestore.v1beta1.UpdateShareRequest) obj; + + if (hasShare() != other.hasShare()) return false; + if (hasShare()) { + if (!getShare().equals(other.getShare())) return false; + } + if (hasUpdateMask() != other.hasUpdateMask()) return false; + if (hasUpdateMask()) { + if (!getUpdateMask().equals(other.getUpdateMask())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasShare()) { + hash = (37 * hash) + SHARE_FIELD_NUMBER; + hash = (53 * hash) + getShare().hashCode(); + } + if (hasUpdateMask()) { + hash = (37 * hash) + UPDATE_MASK_FIELD_NUMBER; + hash = (53 * hash) + getUpdateMask().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.filestore.v1beta1.UpdateShareRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.filestore.v1beta1.UpdateShareRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.filestore.v1beta1.UpdateShareRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.filestore.v1beta1.UpdateShareRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.filestore.v1beta1.UpdateShareRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.filestore.v1beta1.UpdateShareRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.filestore.v1beta1.UpdateShareRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.filestore.v1beta1.UpdateShareRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.filestore.v1beta1.UpdateShareRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.filestore.v1beta1.UpdateShareRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.filestore.v1beta1.UpdateShareRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.filestore.v1beta1.UpdateShareRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.filestore.v1beta1.UpdateShareRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * UpdateShareRequest updates the settings of a share.
+   * 
+ * + * Protobuf type {@code google.cloud.filestore.v1beta1.UpdateShareRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.filestore.v1beta1.UpdateShareRequest) + com.google.cloud.filestore.v1beta1.UpdateShareRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.filestore.v1beta1.CloudFilestoreServiceProto + .internal_static_google_cloud_filestore_v1beta1_UpdateShareRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.filestore.v1beta1.CloudFilestoreServiceProto + .internal_static_google_cloud_filestore_v1beta1_UpdateShareRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.filestore.v1beta1.UpdateShareRequest.class, + com.google.cloud.filestore.v1beta1.UpdateShareRequest.Builder.class); + } + + // Construct using com.google.cloud.filestore.v1beta1.UpdateShareRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (shareBuilder_ == null) { + share_ = null; + } else { + share_ = null; + shareBuilder_ = null; + } + if (updateMaskBuilder_ == null) { + updateMask_ = null; + } else { + updateMask_ = null; + updateMaskBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.filestore.v1beta1.CloudFilestoreServiceProto + .internal_static_google_cloud_filestore_v1beta1_UpdateShareRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.filestore.v1beta1.UpdateShareRequest getDefaultInstanceForType() { + return com.google.cloud.filestore.v1beta1.UpdateShareRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.filestore.v1beta1.UpdateShareRequest build() { + com.google.cloud.filestore.v1beta1.UpdateShareRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.filestore.v1beta1.UpdateShareRequest buildPartial() { + com.google.cloud.filestore.v1beta1.UpdateShareRequest result = + new com.google.cloud.filestore.v1beta1.UpdateShareRequest(this); + if (shareBuilder_ == null) { + result.share_ = share_; + } else { + result.share_ = shareBuilder_.build(); + } + if (updateMaskBuilder_ == null) { + result.updateMask_ = updateMask_; + } else { + result.updateMask_ = updateMaskBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.filestore.v1beta1.UpdateShareRequest) { + return mergeFrom((com.google.cloud.filestore.v1beta1.UpdateShareRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.filestore.v1beta1.UpdateShareRequest other) { + if (other == com.google.cloud.filestore.v1beta1.UpdateShareRequest.getDefaultInstance()) + return this; + if (other.hasShare()) { + mergeShare(other.getShare()); + } + if (other.hasUpdateMask()) { + mergeUpdateMask(other.getUpdateMask()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage(getShareFieldBuilder().getBuilder(), extensionRegistry); + + break; + } // case 10 + case 18: + { + input.readMessage(getUpdateMaskFieldBuilder().getBuilder(), extensionRegistry); + + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private com.google.cloud.filestore.v1beta1.Share share_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.filestore.v1beta1.Share, + com.google.cloud.filestore.v1beta1.Share.Builder, + com.google.cloud.filestore.v1beta1.ShareOrBuilder> + shareBuilder_; + /** + * + * + *
+     * Required. A share resource.
+     * Only fields specified in update_mask are updated.
+     * 
+ * + * + * .google.cloud.filestore.v1beta1.Share share = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the share field is set. + */ + public boolean hasShare() { + return shareBuilder_ != null || share_ != null; + } + /** + * + * + *
+     * Required. A share resource.
+     * Only fields specified in update_mask are updated.
+     * 
+ * + * + * .google.cloud.filestore.v1beta1.Share share = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The share. + */ + public com.google.cloud.filestore.v1beta1.Share getShare() { + if (shareBuilder_ == null) { + return share_ == null + ? com.google.cloud.filestore.v1beta1.Share.getDefaultInstance() + : share_; + } else { + return shareBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. A share resource.
+     * Only fields specified in update_mask are updated.
+     * 
+ * + * + * .google.cloud.filestore.v1beta1.Share share = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setShare(com.google.cloud.filestore.v1beta1.Share value) { + if (shareBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + share_ = value; + onChanged(); + } else { + shareBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Required. A share resource.
+     * Only fields specified in update_mask are updated.
+     * 
+ * + * + * .google.cloud.filestore.v1beta1.Share share = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setShare(com.google.cloud.filestore.v1beta1.Share.Builder builderForValue) { + if (shareBuilder_ == null) { + share_ = builderForValue.build(); + onChanged(); + } else { + shareBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Required. A share resource.
+     * Only fields specified in update_mask are updated.
+     * 
+ * + * + * .google.cloud.filestore.v1beta1.Share share = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeShare(com.google.cloud.filestore.v1beta1.Share value) { + if (shareBuilder_ == null) { + if (share_ != null) { + share_ = + com.google.cloud.filestore.v1beta1.Share.newBuilder(share_) + .mergeFrom(value) + .buildPartial(); + } else { + share_ = value; + } + onChanged(); + } else { + shareBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Required. A share resource.
+     * Only fields specified in update_mask are updated.
+     * 
+ * + * + * .google.cloud.filestore.v1beta1.Share share = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearShare() { + if (shareBuilder_ == null) { + share_ = null; + onChanged(); + } else { + share_ = null; + shareBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Required. A share resource.
+     * Only fields specified in update_mask are updated.
+     * 
+ * + * + * .google.cloud.filestore.v1beta1.Share share = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.filestore.v1beta1.Share.Builder getShareBuilder() { + + onChanged(); + return getShareFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. A share resource.
+     * Only fields specified in update_mask are updated.
+     * 
+ * + * + * .google.cloud.filestore.v1beta1.Share share = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.filestore.v1beta1.ShareOrBuilder getShareOrBuilder() { + if (shareBuilder_ != null) { + return shareBuilder_.getMessageOrBuilder(); + } else { + return share_ == null + ? com.google.cloud.filestore.v1beta1.Share.getDefaultInstance() + : share_; + } + } + /** + * + * + *
+     * Required. A share resource.
+     * Only fields specified in update_mask are updated.
+     * 
+ * + * + * .google.cloud.filestore.v1beta1.Share share = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.filestore.v1beta1.Share, + com.google.cloud.filestore.v1beta1.Share.Builder, + com.google.cloud.filestore.v1beta1.ShareOrBuilder> + getShareFieldBuilder() { + if (shareBuilder_ == null) { + shareBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.filestore.v1beta1.Share, + com.google.cloud.filestore.v1beta1.Share.Builder, + com.google.cloud.filestore.v1beta1.ShareOrBuilder>( + getShare(), getParentForChildren(), isClean()); + share_ = null; + } + return shareBuilder_; + } + + private com.google.protobuf.FieldMask updateMask_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder> + updateMaskBuilder_; + /** + * + * + *
+     * Required. Mask of fields to update. At least one path must be supplied in this
+     * field.
+     * The elements of the repeated paths field may only include these fields:
+     * * "description"
+     * * "capacity_gb"
+     * * "labels"
+     * * "nfs_export_options"
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the updateMask field is set. + */ + public boolean hasUpdateMask() { + return updateMaskBuilder_ != null || updateMask_ != null; + } + /** + * + * + *
+     * Required. Mask of fields to update. At least one path must be supplied in this
+     * field.
+     * The elements of the repeated paths field may only include these fields:
+     * * "description"
+     * * "capacity_gb"
+     * * "labels"
+     * * "nfs_export_options"
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The updateMask. + */ + public com.google.protobuf.FieldMask getUpdateMask() { + if (updateMaskBuilder_ == null) { + return updateMask_ == null + ? com.google.protobuf.FieldMask.getDefaultInstance() + : updateMask_; + } else { + return updateMaskBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. Mask of fields to update. At least one path must be supplied in this
+     * field.
+     * The elements of the repeated paths field may only include these fields:
+     * * "description"
+     * * "capacity_gb"
+     * * "labels"
+     * * "nfs_export_options"
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setUpdateMask(com.google.protobuf.FieldMask value) { + if (updateMaskBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + updateMask_ = value; + onChanged(); + } else { + updateMaskBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Required. Mask of fields to update. At least one path must be supplied in this
+     * field.
+     * The elements of the repeated paths field may only include these fields:
+     * * "description"
+     * * "capacity_gb"
+     * * "labels"
+     * * "nfs_export_options"
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setUpdateMask(com.google.protobuf.FieldMask.Builder builderForValue) { + if (updateMaskBuilder_ == null) { + updateMask_ = builderForValue.build(); + onChanged(); + } else { + updateMaskBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Required. Mask of fields to update. At least one path must be supplied in this
+     * field.
+     * The elements of the repeated paths field may only include these fields:
+     * * "description"
+     * * "capacity_gb"
+     * * "labels"
+     * * "nfs_export_options"
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeUpdateMask(com.google.protobuf.FieldMask value) { + if (updateMaskBuilder_ == null) { + if (updateMask_ != null) { + updateMask_ = + com.google.protobuf.FieldMask.newBuilder(updateMask_).mergeFrom(value).buildPartial(); + } else { + updateMask_ = value; + } + onChanged(); + } else { + updateMaskBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Required. Mask of fields to update. At least one path must be supplied in this
+     * field.
+     * The elements of the repeated paths field may only include these fields:
+     * * "description"
+     * * "capacity_gb"
+     * * "labels"
+     * * "nfs_export_options"
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearUpdateMask() { + if (updateMaskBuilder_ == null) { + updateMask_ = null; + onChanged(); + } else { + updateMask_ = null; + updateMaskBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Required. Mask of fields to update. At least one path must be supplied in this
+     * field.
+     * The elements of the repeated paths field may only include these fields:
+     * * "description"
+     * * "capacity_gb"
+     * * "labels"
+     * * "nfs_export_options"
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.protobuf.FieldMask.Builder getUpdateMaskBuilder() { + + onChanged(); + return getUpdateMaskFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. Mask of fields to update. At least one path must be supplied in this
+     * field.
+     * The elements of the repeated paths field may only include these fields:
+     * * "description"
+     * * "capacity_gb"
+     * * "labels"
+     * * "nfs_export_options"
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + if (updateMaskBuilder_ != null) { + return updateMaskBuilder_.getMessageOrBuilder(); + } else { + return updateMask_ == null + ? com.google.protobuf.FieldMask.getDefaultInstance() + : updateMask_; + } + } + /** + * + * + *
+     * Required. Mask of fields to update. At least one path must be supplied in this
+     * field.
+     * The elements of the repeated paths field may only include these fields:
+     * * "description"
+     * * "capacity_gb"
+     * * "labels"
+     * * "nfs_export_options"
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder> + getUpdateMaskFieldBuilder() { + if (updateMaskBuilder_ == null) { + updateMaskBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder>( + getUpdateMask(), getParentForChildren(), isClean()); + updateMask_ = null; + } + return updateMaskBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.filestore.v1beta1.UpdateShareRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.filestore.v1beta1.UpdateShareRequest) + private static final com.google.cloud.filestore.v1beta1.UpdateShareRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.filestore.v1beta1.UpdateShareRequest(); + } + + public static com.google.cloud.filestore.v1beta1.UpdateShareRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public UpdateShareRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.filestore.v1beta1.UpdateShareRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-filestore/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/UpdateShareRequestOrBuilder.java b/java-filestore/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/UpdateShareRequestOrBuilder.java new file mode 100644 index 000000000000..3f6d94b25bf1 --- /dev/null +++ b/java-filestore/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/UpdateShareRequestOrBuilder.java @@ -0,0 +1,125 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/filestore/v1beta1/cloud_filestore_service.proto + +package com.google.cloud.filestore.v1beta1; + +public interface UpdateShareRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.filestore.v1beta1.UpdateShareRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. A share resource.
+   * Only fields specified in update_mask are updated.
+   * 
+ * + * + * .google.cloud.filestore.v1beta1.Share share = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the share field is set. + */ + boolean hasShare(); + /** + * + * + *
+   * Required. A share resource.
+   * Only fields specified in update_mask are updated.
+   * 
+ * + * + * .google.cloud.filestore.v1beta1.Share share = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The share. + */ + com.google.cloud.filestore.v1beta1.Share getShare(); + /** + * + * + *
+   * Required. A share resource.
+   * Only fields specified in update_mask are updated.
+   * 
+ * + * + * .google.cloud.filestore.v1beta1.Share share = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.filestore.v1beta1.ShareOrBuilder getShareOrBuilder(); + + /** + * + * + *
+   * Required. Mask of fields to update. At least one path must be supplied in this
+   * field.
+   * The elements of the repeated paths field may only include these fields:
+   * * "description"
+   * * "capacity_gb"
+   * * "labels"
+   * * "nfs_export_options"
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the updateMask field is set. + */ + boolean hasUpdateMask(); + /** + * + * + *
+   * Required. Mask of fields to update. At least one path must be supplied in this
+   * field.
+   * The elements of the repeated paths field may only include these fields:
+   * * "description"
+   * * "capacity_gb"
+   * * "labels"
+   * * "nfs_export_options"
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The updateMask. + */ + com.google.protobuf.FieldMask getUpdateMask(); + /** + * + * + *
+   * Required. Mask of fields to update. At least one path must be supplied in this
+   * field.
+   * The elements of the repeated paths field may only include these fields:
+   * * "description"
+   * * "capacity_gb"
+   * * "labels"
+   * * "nfs_export_options"
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder(); +} diff --git a/java-filestore/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/UpdateSnapshotRequest.java b/java-filestore/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/UpdateSnapshotRequest.java new file mode 100644 index 000000000000..9b431bc6598e --- /dev/null +++ b/java-filestore/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/UpdateSnapshotRequest.java @@ -0,0 +1,1016 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/filestore/v1beta1/cloud_filestore_service.proto + +package com.google.cloud.filestore.v1beta1; + +/** + * + * + *
+ * UpdateSnapshotRequest updates description and/or labels for a snapshot.
+ * 
+ * + * Protobuf type {@code google.cloud.filestore.v1beta1.UpdateSnapshotRequest} + */ +public final class UpdateSnapshotRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.filestore.v1beta1.UpdateSnapshotRequest) + UpdateSnapshotRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use UpdateSnapshotRequest.newBuilder() to construct. + private UpdateSnapshotRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private UpdateSnapshotRequest() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new UpdateSnapshotRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.filestore.v1beta1.CloudFilestoreServiceProto + .internal_static_google_cloud_filestore_v1beta1_UpdateSnapshotRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.filestore.v1beta1.CloudFilestoreServiceProto + .internal_static_google_cloud_filestore_v1beta1_UpdateSnapshotRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.filestore.v1beta1.UpdateSnapshotRequest.class, + com.google.cloud.filestore.v1beta1.UpdateSnapshotRequest.Builder.class); + } + + public static final int UPDATE_MASK_FIELD_NUMBER = 1; + private com.google.protobuf.FieldMask updateMask_; + /** + * + * + *
+   * Required. Mask of fields to update.  At least one path must be supplied in this
+   * field.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the updateMask field is set. + */ + @java.lang.Override + public boolean hasUpdateMask() { + return updateMask_ != null; + } + /** + * + * + *
+   * Required. Mask of fields to update.  At least one path must be supplied in this
+   * field.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The updateMask. + */ + @java.lang.Override + public com.google.protobuf.FieldMask getUpdateMask() { + return updateMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; + } + /** + * + * + *
+   * Required. Mask of fields to update.  At least one path must be supplied in this
+   * field.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + return getUpdateMask(); + } + + public static final int SNAPSHOT_FIELD_NUMBER = 2; + private com.google.cloud.filestore.v1beta1.Snapshot snapshot_; + /** + * + * + *
+   * Required. A snapshot resource
+   * 
+ * + * + * .google.cloud.filestore.v1beta1.Snapshot snapshot = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the snapshot field is set. + */ + @java.lang.Override + public boolean hasSnapshot() { + return snapshot_ != null; + } + /** + * + * + *
+   * Required. A snapshot resource
+   * 
+ * + * + * .google.cloud.filestore.v1beta1.Snapshot snapshot = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The snapshot. + */ + @java.lang.Override + public com.google.cloud.filestore.v1beta1.Snapshot getSnapshot() { + return snapshot_ == null + ? com.google.cloud.filestore.v1beta1.Snapshot.getDefaultInstance() + : snapshot_; + } + /** + * + * + *
+   * Required. A snapshot resource
+   * 
+ * + * + * .google.cloud.filestore.v1beta1.Snapshot snapshot = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.filestore.v1beta1.SnapshotOrBuilder getSnapshotOrBuilder() { + return getSnapshot(); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (updateMask_ != null) { + output.writeMessage(1, getUpdateMask()); + } + if (snapshot_ != null) { + output.writeMessage(2, getSnapshot()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (updateMask_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getUpdateMask()); + } + if (snapshot_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getSnapshot()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.filestore.v1beta1.UpdateSnapshotRequest)) { + return super.equals(obj); + } + com.google.cloud.filestore.v1beta1.UpdateSnapshotRequest other = + (com.google.cloud.filestore.v1beta1.UpdateSnapshotRequest) obj; + + if (hasUpdateMask() != other.hasUpdateMask()) return false; + if (hasUpdateMask()) { + if (!getUpdateMask().equals(other.getUpdateMask())) return false; + } + if (hasSnapshot() != other.hasSnapshot()) return false; + if (hasSnapshot()) { + if (!getSnapshot().equals(other.getSnapshot())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasUpdateMask()) { + hash = (37 * hash) + UPDATE_MASK_FIELD_NUMBER; + hash = (53 * hash) + getUpdateMask().hashCode(); + } + if (hasSnapshot()) { + hash = (37 * hash) + SNAPSHOT_FIELD_NUMBER; + hash = (53 * hash) + getSnapshot().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.filestore.v1beta1.UpdateSnapshotRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.filestore.v1beta1.UpdateSnapshotRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.filestore.v1beta1.UpdateSnapshotRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.filestore.v1beta1.UpdateSnapshotRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.filestore.v1beta1.UpdateSnapshotRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.filestore.v1beta1.UpdateSnapshotRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.filestore.v1beta1.UpdateSnapshotRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.filestore.v1beta1.UpdateSnapshotRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.filestore.v1beta1.UpdateSnapshotRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.filestore.v1beta1.UpdateSnapshotRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.filestore.v1beta1.UpdateSnapshotRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.filestore.v1beta1.UpdateSnapshotRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.filestore.v1beta1.UpdateSnapshotRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * UpdateSnapshotRequest updates description and/or labels for a snapshot.
+   * 
+ * + * Protobuf type {@code google.cloud.filestore.v1beta1.UpdateSnapshotRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.filestore.v1beta1.UpdateSnapshotRequest) + com.google.cloud.filestore.v1beta1.UpdateSnapshotRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.filestore.v1beta1.CloudFilestoreServiceProto + .internal_static_google_cloud_filestore_v1beta1_UpdateSnapshotRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.filestore.v1beta1.CloudFilestoreServiceProto + .internal_static_google_cloud_filestore_v1beta1_UpdateSnapshotRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.filestore.v1beta1.UpdateSnapshotRequest.class, + com.google.cloud.filestore.v1beta1.UpdateSnapshotRequest.Builder.class); + } + + // Construct using com.google.cloud.filestore.v1beta1.UpdateSnapshotRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (updateMaskBuilder_ == null) { + updateMask_ = null; + } else { + updateMask_ = null; + updateMaskBuilder_ = null; + } + if (snapshotBuilder_ == null) { + snapshot_ = null; + } else { + snapshot_ = null; + snapshotBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.filestore.v1beta1.CloudFilestoreServiceProto + .internal_static_google_cloud_filestore_v1beta1_UpdateSnapshotRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.filestore.v1beta1.UpdateSnapshotRequest getDefaultInstanceForType() { + return com.google.cloud.filestore.v1beta1.UpdateSnapshotRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.filestore.v1beta1.UpdateSnapshotRequest build() { + com.google.cloud.filestore.v1beta1.UpdateSnapshotRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.filestore.v1beta1.UpdateSnapshotRequest buildPartial() { + com.google.cloud.filestore.v1beta1.UpdateSnapshotRequest result = + new com.google.cloud.filestore.v1beta1.UpdateSnapshotRequest(this); + if (updateMaskBuilder_ == null) { + result.updateMask_ = updateMask_; + } else { + result.updateMask_ = updateMaskBuilder_.build(); + } + if (snapshotBuilder_ == null) { + result.snapshot_ = snapshot_; + } else { + result.snapshot_ = snapshotBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.filestore.v1beta1.UpdateSnapshotRequest) { + return mergeFrom((com.google.cloud.filestore.v1beta1.UpdateSnapshotRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.filestore.v1beta1.UpdateSnapshotRequest other) { + if (other == com.google.cloud.filestore.v1beta1.UpdateSnapshotRequest.getDefaultInstance()) + return this; + if (other.hasUpdateMask()) { + mergeUpdateMask(other.getUpdateMask()); + } + if (other.hasSnapshot()) { + mergeSnapshot(other.getSnapshot()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage(getUpdateMaskFieldBuilder().getBuilder(), extensionRegistry); + + break; + } // case 10 + case 18: + { + input.readMessage(getSnapshotFieldBuilder().getBuilder(), extensionRegistry); + + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private com.google.protobuf.FieldMask updateMask_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder> + updateMaskBuilder_; + /** + * + * + *
+     * Required. Mask of fields to update.  At least one path must be supplied in this
+     * field.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the updateMask field is set. + */ + public boolean hasUpdateMask() { + return updateMaskBuilder_ != null || updateMask_ != null; + } + /** + * + * + *
+     * Required. Mask of fields to update.  At least one path must be supplied in this
+     * field.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The updateMask. + */ + public com.google.protobuf.FieldMask getUpdateMask() { + if (updateMaskBuilder_ == null) { + return updateMask_ == null + ? com.google.protobuf.FieldMask.getDefaultInstance() + : updateMask_; + } else { + return updateMaskBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. Mask of fields to update.  At least one path must be supplied in this
+     * field.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setUpdateMask(com.google.protobuf.FieldMask value) { + if (updateMaskBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + updateMask_ = value; + onChanged(); + } else { + updateMaskBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Required. Mask of fields to update.  At least one path must be supplied in this
+     * field.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setUpdateMask(com.google.protobuf.FieldMask.Builder builderForValue) { + if (updateMaskBuilder_ == null) { + updateMask_ = builderForValue.build(); + onChanged(); + } else { + updateMaskBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Required. Mask of fields to update.  At least one path must be supplied in this
+     * field.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeUpdateMask(com.google.protobuf.FieldMask value) { + if (updateMaskBuilder_ == null) { + if (updateMask_ != null) { + updateMask_ = + com.google.protobuf.FieldMask.newBuilder(updateMask_).mergeFrom(value).buildPartial(); + } else { + updateMask_ = value; + } + onChanged(); + } else { + updateMaskBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Required. Mask of fields to update.  At least one path must be supplied in this
+     * field.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearUpdateMask() { + if (updateMaskBuilder_ == null) { + updateMask_ = null; + onChanged(); + } else { + updateMask_ = null; + updateMaskBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Required. Mask of fields to update.  At least one path must be supplied in this
+     * field.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.protobuf.FieldMask.Builder getUpdateMaskBuilder() { + + onChanged(); + return getUpdateMaskFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. Mask of fields to update.  At least one path must be supplied in this
+     * field.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + if (updateMaskBuilder_ != null) { + return updateMaskBuilder_.getMessageOrBuilder(); + } else { + return updateMask_ == null + ? com.google.protobuf.FieldMask.getDefaultInstance() + : updateMask_; + } + } + /** + * + * + *
+     * Required. Mask of fields to update.  At least one path must be supplied in this
+     * field.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder> + getUpdateMaskFieldBuilder() { + if (updateMaskBuilder_ == null) { + updateMaskBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder>( + getUpdateMask(), getParentForChildren(), isClean()); + updateMask_ = null; + } + return updateMaskBuilder_; + } + + private com.google.cloud.filestore.v1beta1.Snapshot snapshot_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.filestore.v1beta1.Snapshot, + com.google.cloud.filestore.v1beta1.Snapshot.Builder, + com.google.cloud.filestore.v1beta1.SnapshotOrBuilder> + snapshotBuilder_; + /** + * + * + *
+     * Required. A snapshot resource
+     * 
+ * + * + * .google.cloud.filestore.v1beta1.Snapshot snapshot = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the snapshot field is set. + */ + public boolean hasSnapshot() { + return snapshotBuilder_ != null || snapshot_ != null; + } + /** + * + * + *
+     * Required. A snapshot resource
+     * 
+ * + * + * .google.cloud.filestore.v1beta1.Snapshot snapshot = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The snapshot. + */ + public com.google.cloud.filestore.v1beta1.Snapshot getSnapshot() { + if (snapshotBuilder_ == null) { + return snapshot_ == null + ? com.google.cloud.filestore.v1beta1.Snapshot.getDefaultInstance() + : snapshot_; + } else { + return snapshotBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. A snapshot resource
+     * 
+ * + * + * .google.cloud.filestore.v1beta1.Snapshot snapshot = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setSnapshot(com.google.cloud.filestore.v1beta1.Snapshot value) { + if (snapshotBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + snapshot_ = value; + onChanged(); + } else { + snapshotBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Required. A snapshot resource
+     * 
+ * + * + * .google.cloud.filestore.v1beta1.Snapshot snapshot = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setSnapshot( + com.google.cloud.filestore.v1beta1.Snapshot.Builder builderForValue) { + if (snapshotBuilder_ == null) { + snapshot_ = builderForValue.build(); + onChanged(); + } else { + snapshotBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Required. A snapshot resource
+     * 
+ * + * + * .google.cloud.filestore.v1beta1.Snapshot snapshot = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeSnapshot(com.google.cloud.filestore.v1beta1.Snapshot value) { + if (snapshotBuilder_ == null) { + if (snapshot_ != null) { + snapshot_ = + com.google.cloud.filestore.v1beta1.Snapshot.newBuilder(snapshot_) + .mergeFrom(value) + .buildPartial(); + } else { + snapshot_ = value; + } + onChanged(); + } else { + snapshotBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Required. A snapshot resource
+     * 
+ * + * + * .google.cloud.filestore.v1beta1.Snapshot snapshot = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearSnapshot() { + if (snapshotBuilder_ == null) { + snapshot_ = null; + onChanged(); + } else { + snapshot_ = null; + snapshotBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Required. A snapshot resource
+     * 
+ * + * + * .google.cloud.filestore.v1beta1.Snapshot snapshot = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.filestore.v1beta1.Snapshot.Builder getSnapshotBuilder() { + + onChanged(); + return getSnapshotFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. A snapshot resource
+     * 
+ * + * + * .google.cloud.filestore.v1beta1.Snapshot snapshot = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.filestore.v1beta1.SnapshotOrBuilder getSnapshotOrBuilder() { + if (snapshotBuilder_ != null) { + return snapshotBuilder_.getMessageOrBuilder(); + } else { + return snapshot_ == null + ? com.google.cloud.filestore.v1beta1.Snapshot.getDefaultInstance() + : snapshot_; + } + } + /** + * + * + *
+     * Required. A snapshot resource
+     * 
+ * + * + * .google.cloud.filestore.v1beta1.Snapshot snapshot = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.filestore.v1beta1.Snapshot, + com.google.cloud.filestore.v1beta1.Snapshot.Builder, + com.google.cloud.filestore.v1beta1.SnapshotOrBuilder> + getSnapshotFieldBuilder() { + if (snapshotBuilder_ == null) { + snapshotBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.filestore.v1beta1.Snapshot, + com.google.cloud.filestore.v1beta1.Snapshot.Builder, + com.google.cloud.filestore.v1beta1.SnapshotOrBuilder>( + getSnapshot(), getParentForChildren(), isClean()); + snapshot_ = null; + } + return snapshotBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.filestore.v1beta1.UpdateSnapshotRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.filestore.v1beta1.UpdateSnapshotRequest) + private static final com.google.cloud.filestore.v1beta1.UpdateSnapshotRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.filestore.v1beta1.UpdateSnapshotRequest(); + } + + public static com.google.cloud.filestore.v1beta1.UpdateSnapshotRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public UpdateSnapshotRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.filestore.v1beta1.UpdateSnapshotRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-filestore/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/UpdateSnapshotRequestOrBuilder.java b/java-filestore/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/UpdateSnapshotRequestOrBuilder.java new file mode 100644 index 000000000000..3c8b06a5052d --- /dev/null +++ b/java-filestore/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/UpdateSnapshotRequestOrBuilder.java @@ -0,0 +1,107 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/filestore/v1beta1/cloud_filestore_service.proto + +package com.google.cloud.filestore.v1beta1; + +public interface UpdateSnapshotRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.filestore.v1beta1.UpdateSnapshotRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Mask of fields to update.  At least one path must be supplied in this
+   * field.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the updateMask field is set. + */ + boolean hasUpdateMask(); + /** + * + * + *
+   * Required. Mask of fields to update.  At least one path must be supplied in this
+   * field.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The updateMask. + */ + com.google.protobuf.FieldMask getUpdateMask(); + /** + * + * + *
+   * Required. Mask of fields to update.  At least one path must be supplied in this
+   * field.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder(); + + /** + * + * + *
+   * Required. A snapshot resource
+   * 
+ * + * + * .google.cloud.filestore.v1beta1.Snapshot snapshot = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the snapshot field is set. + */ + boolean hasSnapshot(); + /** + * + * + *
+   * Required. A snapshot resource
+   * 
+ * + * + * .google.cloud.filestore.v1beta1.Snapshot snapshot = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The snapshot. + */ + com.google.cloud.filestore.v1beta1.Snapshot getSnapshot(); + /** + * + * + *
+   * Required. A snapshot resource
+   * 
+ * + * + * .google.cloud.filestore.v1beta1.Snapshot snapshot = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.filestore.v1beta1.SnapshotOrBuilder getSnapshotOrBuilder(); +} diff --git a/java-filestore/proto-google-cloud-filestore-v1beta1/src/main/proto/google/cloud/filestore/v1beta1/cloud_filestore_service.proto b/java-filestore/proto-google-cloud-filestore-v1beta1/src/main/proto/google/cloud/filestore/v1beta1/cloud_filestore_service.proto index eff84710592b..bf600312e2d4 100644 --- a/java-filestore/proto-google-cloud-filestore-v1beta1/src/main/proto/google/cloud/filestore/v1beta1/cloud_filestore_service.proto +++ b/java-filestore/proto-google-cloud-filestore-v1beta1/src/main/proto/google/cloud/filestore/v1beta1/cloud_filestore_service.proto @@ -1,4 +1,4 @@ -// Copyright 2021 Google LLC +// Copyright 2022 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -20,6 +20,7 @@ import "google/api/annotations.proto"; import "google/api/client.proto"; import "google/api/field_behavior.proto"; import "google/api/resource.proto"; +import "google/cloud/common/operation_metadata.proto"; import "google/longrunning/operations.proto"; import "google/protobuf/field_mask.proto"; import "google/protobuf/timestamp.proto"; @@ -32,17 +33,17 @@ option java_outer_classname = "CloudFilestoreServiceProto"; option java_package = "com.google.cloud.filestore.v1beta1"; option php_namespace = "Google\\Cloud\\Filestore\\V1beta1"; -// Configures and manages Cloud Filestore resources. +// Configures and manages Filestore resources. // -// Cloud Filestore Manager v1beta1. +// Filestore Manager v1beta1. // -// The `file.googleapis.com` service implements the Cloud Filestore API and +// The `file.googleapis.com` service implements the Filestore API and // defines the following model for managing resources: // * The service works with a collection of cloud projects, named: `/projects/*` // * Each project has a collection of available locations, named: `/locations/*` // * Each location has a collection of instances and backups, named: // `/instances/*` and `/backups/*` respectively. -// * As such, Cloud Filestore instances are resources of the form: +// * As such, Filestore instances are resources of the form: // `/projects/{project_id}/locations/{location_id}/instances/{instance_id}` // backups are resources of the form: // `/projects/{project_id}/locations/{location_id}/backup/{backup_id}` @@ -120,6 +121,18 @@ service CloudFilestoreManager { }; } + // Revert an existing instance's file system to a specified snapshot. + rpc RevertInstance(RevertInstanceRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1beta1/{name=projects/*/locations/*/instances/*}:revert" + body: "*" + }; + option (google.longrunning.operation_info) = { + response_type: "Instance" + metadata_type: "google.cloud.common.OperationMetadata" + }; + } + // Deletes an instance. rpc DeleteInstance(DeleteInstanceRequest) returns (google.longrunning.Operation) { option (google.api.http) = { @@ -132,6 +145,61 @@ service CloudFilestoreManager { }; } + // Lists all snapshots in a project for either a specified location + // or for all locations. + rpc ListSnapshots(ListSnapshotsRequest) returns (ListSnapshotsResponse) { + option (google.api.http) = { + get: "/v1beta1/{parent=projects/*/locations/*/instances/*}/snapshots" + }; + option (google.api.method_signature) = "parent"; + } + + // Gets the details of a specific snapshot. + rpc GetSnapshot(GetSnapshotRequest) returns (Snapshot) { + option (google.api.http) = { + get: "/v1beta1/{name=projects/*/locations/*/instances/*/snapshots/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Creates a snapshot. + rpc CreateSnapshot(CreateSnapshotRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1beta1/{parent=projects/*/locations/*/instances/*}/snapshots" + body: "snapshot" + }; + option (google.api.method_signature) = "parent,snapshot,snapshot_id"; + option (google.longrunning.operation_info) = { + response_type: "Snapshot" + metadata_type: "google.cloud.common.OperationMetadata" + }; + } + + // Deletes a snapshot. + rpc DeleteSnapshot(DeleteSnapshotRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1beta1/{name=projects/*/locations/*/instances/*/snapshots/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "google.cloud.common.OperationMetadata" + }; + } + + // Updates the settings of a specific snapshot. + rpc UpdateSnapshot(UpdateSnapshotRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v1beta1/{snapshot.name=projects/*/locations/*/instances/*/snapshots/*}" + body: "snapshot" + }; + option (google.api.method_signature) = "snapshot,update_mask"; + option (google.longrunning.operation_info) = { + response_type: "Snapshot" + metadata_type: "google.cloud.common.OperationMetadata" + }; + } + // Lists all backups in a project for either a specified location or for all // locations. rpc ListBackups(ListBackupsRequest) returns (ListBackupsResponse) { @@ -186,11 +254,65 @@ service CloudFilestoreManager { metadata_type: "google.cloud.common.OperationMetadata" }; } + + // Lists all shares for a specified instance. + rpc ListShares(ListSharesRequest) returns (ListSharesResponse) { + option (google.api.http) = { + get: "/v1beta1/{parent=projects/*/locations/*/instances/*}/shares" + }; + option (google.api.method_signature) = "parent"; + } + + // Gets the details of a specific share. + rpc GetShare(GetShareRequest) returns (Share) { + option (google.api.http) = { + get: "/v1beta1/{name=projects/*/locations/*/instances/*/shares/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Creates a share. + rpc CreateShare(CreateShareRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1beta1/{parent=projects/*/locations/*/instances/*}/shares" + body: "share" + }; + option (google.api.method_signature) = "parent,share,share_id"; + option (google.longrunning.operation_info) = { + response_type: "Share" + metadata_type: "google.cloud.common.OperationMetadata" + }; + } + + // Deletes a share. + rpc DeleteShare(DeleteShareRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1beta1/{name=projects/*/locations/*/instances/*/shares/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "google.cloud.common.OperationMetadata" + }; + } + + // Updates the settings of a specific share. + rpc UpdateShare(UpdateShareRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v1beta1/{share.name=projects/*/locations/*/instances/*/shares/*}" + body: "share" + }; + option (google.api.method_signature) = "share,update_mask"; + option (google.longrunning.operation_info) = { + response_type: "Share" + metadata_type: "google.cloud.common.OperationMetadata" + }; + } } // Network configuration for the instance. message NetworkConfig { - // Internet protocol versions supported by Cloud Filestore. + // Internet protocol versions supported by Filestore. enum AddressMode { // Internet protocol not set. ADDRESS_MODE_UNSPECIFIED = 0; @@ -199,6 +321,20 @@ message NetworkConfig { MODE_IPV4 = 1; } + // Available connection modes. + enum ConnectMode { + // ConnectMode not set. + CONNECT_MODE_UNSPECIFIED = 0; + + // Connect via direct peering to the Filestore service. + DIRECT_PEERING = 1; + + // Connect to your Filestore instance using Private Service + // Access. Private services access provides an IP address range for multiple + // Google Cloud services, including Filestore. + PRIVATE_SERVICE_ACCESS = 2; + } + // The name of the Google Compute Engine // [VPC network](https://cloud.google.com/vpc/docs/vpc) to which the // instance is connected. @@ -208,28 +344,46 @@ message NetworkConfig { // assigned. For this version, only MODE_IPV4 is supported. repeated AddressMode modes = 3; - // A /29 CIDR block for Basic or a /23 CIDR block for High Scale in one of the - // [internal IP address + // Optional, reserved_ip_range can have one of the following two types of + // values. + // + // * CIDR range value when using DIRECT_PEERING connect mode. + // * [Allocated IP address + // range](https://cloud.google.com/compute/docs/ip-addresses/reserve-static-internal-ip-address) + // when using PRIVATE_SERVICE_ACCESS connect mode. + // + // When the name of an allocated IP address range is specified, it must be one + // of the ranges associated with the private service access connection. + // When specified as a direct CIDR value, it must be a /29 CIDR block for + // Basic tier, a /24 CIDR block for High Scale tier, or a /26 CIDR block for + // Enterprise tier in one of the [internal IP address // ranges](https://www.arin.net/reference/research/statistics/address_filters/) // that identifies the range of IP addresses reserved for this instance. For - // example, 10.0.0.0/29 or 192.168.0.0/23. The range you specify can't overlap - // with either existing subnets or assigned IP address ranges for other Cloud - // Filestore instances in the selected VPC network. + // example, 10.0.0.0/29, 192.168.0.0/24, or 192.168.0.0/26, respectively. The + // range you specify can't overlap with either existing subnets or assigned IP + // address ranges for other Filestore instances in the selected VPC + // network. string reserved_ip_range = 4; - // Output only. IPv4 addresses in the format - // `{octet1}.{octet2}.{octet3}.{octet4}` or IPv6 addresses in the format + // Output only. IPv4 addresses in the format `{octet1}.{octet2}.{octet3}.{octet4}` or + // IPv6 addresses in the format // `{block1}:{block2}:{block3}:{block4}:{block5}:{block6}:{block7}:{block8}`. repeated string ip_addresses = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The network connect mode of the Filestore instance. + // If not provided, the connect mode defaults to DIRECT_PEERING. + ConnectMode connect_mode = 6; } // File share configuration for the instance. message FileShareConfig { - // The name of the file share (must be 16 characters or less). + // The name of the file share (must be 32 characters or less for + // Enterprise and High Scale SSD tiers and 16 characters or less for all other + // tiers). string name = 1; // File share capacity in gigabytes (GB). - // Cloud Filestore defines 1 GB as 1024^3 bytes. + // Filestore defines 1 GB as 1024^3 bytes. int64 capacity_gb = 2; // The source that this file share has been restored from. Empty if the file @@ -307,7 +461,7 @@ message NfsExportOptions { int64 anon_gid = 5; } -// A Cloud Filestore instance. +// A Filestore instance. message Instance { option (google.api.resource) = { type: "file.googleapis.com/Instance" @@ -340,6 +494,19 @@ message Instance { // The instance is restoring a snapshot or backup to an existing file share // and may be unusable during this time. RESTORING = 7; + + // The instance is suspended. You can get further details from + // the `suspension_reasons` field of the `Instance` resource. + SUSPENDED = 8; + + // The instance is reverting to a snapshot. + REVERTING = 9; + + // The instance is in the process of becoming suspended. + SUSPENDING = 10; + + // The instance is in the process of becoming active. + RESUMING = 11; } // Available service tiers. @@ -366,6 +533,19 @@ message Instance { // HIGH_SCALE instances offer expanded capacity and performance scaling // capabilities. HIGH_SCALE_SSD = 6; + + // ENTERPRISE instances offer the features and availability needed for + // mission-critical workloads. + ENTERPRISE = 7; + } + + // SuspensionReason contains the possible reasons for a suspension. + enum SuspensionReason { + // Not set. + SUSPENSION_REASON_UNSPECIFIED = 0; + + // The KMS key used by the instance is either revoked or denied access to. + KMS_KEY_ISSUE = 1; } // Output only. The resource name of the instance, in the format @@ -404,12 +584,37 @@ message Instance { // Output only. Reserved for future use. google.protobuf.BoolValue satisfies_pzs = 13 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // KMS key name used for data encryption. + string kms_key_name = 14; + + // Output only. Field indicates all the reasons the instance is in "SUSPENDED" state. + repeated SuspensionReason suspension_reasons = 15 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The max capacity of the instance. + int64 max_capacity_gb = 16 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The increase/decrease capacity step size. + int64 capacity_step_size_gb = 17 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The max number of shares allowed. + int64 max_share_count = 18 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The storage capacity of the instance in gigabytes (GB = 1024^3 bytes). + // This capacity can be increased up to `max_capacity_gb` GB in multipliers + // of `capacity_step_size_gb` GB. + int64 capacity_gb = 19; + + // Indicates whether this instance uses a multi-share configuration with which + // it can have more than one file-share or none at all. File-shares are added, + // updated and removed through the separate file-share APIs. + bool multi_share_enabled = 20; } // CreateInstanceRequest creates an instance. message CreateInstanceRequest { // Required. The instance's project and location, in the format - // `projects/{project_id}/locations/{location}`. In Cloud Filestore, + // `projects/{project_id}/locations/{location}`. In Filestore, // locations map to GCP zones, for example **us-west1-b**. string parent = 1 [ (google.api.field_behavior) = REQUIRED, @@ -456,7 +661,7 @@ message UpdateInstanceRequest { Instance instance = 2 [(google.api.field_behavior) = REQUIRED]; } -// RestoreInstanceRequest restores an existing instances's file share from a +// RestoreInstanceRequest restores an existing instance's file share from a // snapshot or backup. message RestoreInstanceRequest { // Required. The resource name of the instance, in the format @@ -468,7 +673,7 @@ message RestoreInstanceRequest { } ]; - // Required. Name of the file share in the Cloud Filestore instance that the snapshot + // Required. Name of the file share in the Filestore instance that the snapshot // is being restored to. string file_share = 2 [(google.api.field_behavior) = REQUIRED]; @@ -487,6 +692,24 @@ message RestoreInstanceRequest { } } +// RevertInstanceRequest reverts the given instance's file share to the +// specified snapshot. +message RevertInstanceRequest { + // Required. projects/{project_id}/locations/{location_id}/instances/{instance_id}. + // The resource name of the instance, in the format + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "file.googleapis.com/Instance" + } + ]; + + // Required. The snapshot resource ID, in the format 'my-snapshot', where the specified + // ID is the {snapshot_id} of the fully qualified name like + // projects/{project_id}/locations/{location_id}/instances/{instance_id}/snapshots/{snapshot_id} + string target_snapshot_id = 2 [(google.api.field_behavior) = REQUIRED]; +} + // DeleteInstanceRequest deletes an instance. message DeleteInstanceRequest { // Required. The instance resource name, in the format @@ -497,6 +720,10 @@ message DeleteInstanceRequest { type: "file.googleapis.com/Instance" } ]; + + // If set to true, any snapshots of the instance will also be deleted. + // (Otherwise, the request will only work if the instance has no snapshots.) + bool force = 2; } // ListInstancesRequest lists instances. @@ -545,7 +772,7 @@ message ListInstancesResponse { repeated string unreachable = 3; } -// A Cloud Filestore snapshot. +// A Filestore snapshot. message Snapshot { option (google.api.resource) = { type: "file.googleapis.com/Snapshot" @@ -588,7 +815,99 @@ message Snapshot { int64 filesystem_used_bytes = 12 [(google.api.field_behavior) = OUTPUT_ONLY]; } -// A Cloud Filestore backup. +// CreateSnapshotRequest creates a snapshot. +message CreateSnapshotRequest { + // Required. The Filestore Instance to create the snapshots of, in the format + // `projects/{project_id}/locations/{location}/instances/{instance_id}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "file.googleapis.com/Instance" + } + ]; + + // Required. The ID to use for the snapshot. + // The ID must be unique within the specified instance. + // + // This value must start with a lowercase letter followed by up to 62 + // lowercase letters, numbers, or hyphens, and cannot end with a hyphen. + string snapshot_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. A snapshot resource + Snapshot snapshot = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// GetSnapshotRequest gets the state of a snapshot. +message GetSnapshotRequest { + // Required. The snapshot resource name, in the format + // `projects/{project_id}/locations/{location}/instances/{instance_id}/snapshots/{snapshot_id}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "file.googleapis.com/Snapshot" + } + ]; +} + +// DeleteSnapshotRequest deletes a snapshot. +message DeleteSnapshotRequest { + // Required. The snapshot resource name, in the format + // `projects/{project_id}/locations/{location}/instances/{instance_id}/snapshots/{snapshot_id}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "file.googleapis.com/Snapshot" + } + ]; +} + +// UpdateSnapshotRequest updates description and/or labels for a snapshot. +message UpdateSnapshotRequest { + // Required. Mask of fields to update. At least one path must be supplied in this + // field. + google.protobuf.FieldMask update_mask = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. A snapshot resource + Snapshot snapshot = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// ListSnapshotsRequest lists snapshots. +message ListSnapshotsRequest { + // Required. The instance for which to retrieve snapshot information, + // in the format + // `projects/{project_id}/locations/{location}/instances/{instance_id}`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "file.googleapis.com/Instance" + } + ]; + + // The maximum number of items to return. + int32 page_size = 2; + + // The next_page_token value to use if there are additional + // results to retrieve for this list request. + string page_token = 3; + + // Sort results. Supported values are "name", "name desc" or "" (unsorted). + string order_by = 4; + + // List filter. + string filter = 5; +} + +// ListSnapshotsResponse is the result of ListSnapshotsRequest. +message ListSnapshotsResponse { + // A list of snapshots in the project for the specified instance. + repeated Snapshot snapshots = 1; + + // The token you can use to retrieve the next page of results. Not returned + // if there are no more results in the list. + string next_page_token = 2; +} + +// A Filestore backup. message Backup { option (google.api.resource) = { type: "file.googleapis.com/Backup" @@ -638,18 +957,18 @@ message Backup { // this number is expected to change with backup creation/deletion. int64 storage_bytes = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; - // The resource name of the source Cloud Filestore instance, in the format + // The resource name of the source Filestore instance, in the format // `projects/{project_id}/locations/{location_id}/instances/{instance_id}`, // used to create this backup. string source_instance = 8 [(google.api.resource_reference) = { type: "file.googleapis.com/Instance" }]; - // Name of the file share in the source Cloud Filestore instance that the + // Name of the file share in the source Filestore instance that the // backup is created from. string source_file_share = 9; - // Output only. The service tier of the source Cloud Filestore instance that this backup + // Output only. The service tier of the source Filestore instance that this backup // is created from. Instance.Tier source_instance_tier = 10 [(google.api.field_behavior) = OUTPUT_ONLY]; @@ -658,12 +977,15 @@ message Backup { // Output only. Reserved for future use. google.protobuf.BoolValue satisfies_pzs = 12 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Immutable. KMS key name used for data encryption. + string kms_key_name = 13 [(google.api.field_behavior) = IMMUTABLE]; } // CreateBackupRequest creates a backup. message CreateBackupRequest { // Required. The backup's project and location, in the format - // `projects/{project_id}/locations/{location}`. In Cloud Filestore, + // `projects/{project_id}/locations/{location}`. In Filestore, // backup locations map to GCP regions, for example **us-west1**. string parent = 1 [ (google.api.field_behavior) = REQUIRED, @@ -721,7 +1043,7 @@ message GetBackupRequest { message ListBackupsRequest { // Required. The project and location for which to retrieve backup information, // in the format `projects/{project_id}/locations/{location}`. - // In Cloud Filestore, backup locations map to GCP regions, + // In Filestore, backup locations map to GCP regions, // for example **us-west1**. // To retrieve backup information for all locations, use "-" for the // `{location}` value. @@ -764,3 +1086,157 @@ message ListBackupsResponse { // Locations that could not be reached. repeated string unreachable = 3; } + +// A Filestore share. +message Share { + option (google.api.resource) = { + type: "file.googleapis.com/Share" + pattern: "projects/{project}/locations/{location}/instances/{instance}/shares/{share}" + }; + + // The share state. + enum State { + // State not set. + STATE_UNSPECIFIED = 0; + + // Share is being created. + CREATING = 1; + + // Share is ready for use. + READY = 3; + + // Share is being deleted. + DELETING = 4; + } + + // Output only. The resource name of the share, in the format + // `projects/{project_id}/locations/{location_id}/instances/{instance_id}/shares/{share_id}`. + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The mount name of the share. Must be 63 characters or less and consist of + // uppercase or lowercase letters, numbers, and underscores. + string mount_name = 2; + + // A description of the share with 2048 characters or less. Requests with + // longer descriptions will be rejected. + string description = 3; + + // File share capacity in gigabytes (GB). Filestore defines 1 GB as + // 1024^3 bytes. Must be greater than 0. + int64 capacity_gb = 4; + + // Nfs Export Options. + // There is a limit of 10 export options per file share. + repeated NfsExportOptions nfs_export_options = 5; + + // Output only. The share state. + State state = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time when the share was created. + google.protobuf.Timestamp create_time = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Resource labels to represent user provided metadata. + map labels = 8; +} + +// CreateShareRequest creates a share. +message CreateShareRequest { + // Required. The Filestore Instance to create the share for, in the format + // `projects/{project_id}/locations/{location}/instances/{instance_id}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "file.googleapis.com/Instance" + } + ]; + + // Required. The ID to use for the share. + // The ID must be unique within the specified instance. + // + // This value must start with a lowercase letter followed by up to 62 + // lowercase letters, numbers, or hyphens, and cannot end with a hyphen. + string share_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. A share resource + Share share = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// GetShareRequest gets the state of a share. +message GetShareRequest { + // Required. The share resource name, in the format + // `projects/{project_id}/locations/{location}/instances/{instance_id}/shares/{share_id}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "file.googleapis.com/Share" + } + ]; +} + +// DeleteShareRequest deletes a share. +message DeleteShareRequest { + // Required. The share resource name, in the format + // `projects/{project_id}/locations/{location}/instances/{instance_id}/share/{share_id}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "file.googleapis.com/Share" + } + ]; +} + +// ListSharesRequest lists shares. +message ListSharesRequest { + // Required. The instance for which to retrieve share information, + // in the format + // `projects/{project_id}/locations/{location}/instances/{instance_id}`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "file.googleapis.com/Instance" + } + ]; + + // The maximum number of items to return. + int32 page_size = 2; + + // The next_page_token value to use if there are additional + // results to retrieve for this list request. + string page_token = 3; + + // Sort results. Supported values are "name", "name desc" or "" (unsorted). + string order_by = 4; + + // List filter. + string filter = 5; +} + +// ListSharesResponse is the result of ListSharesRequest. +message ListSharesResponse { + // A list of shares in the project for the specified instance. + repeated Share shares = 1; + + // The token you can use to retrieve the next page of results. Not returned + // if there are no more results in the list. + string next_page_token = 2; + + // Locations that could not be reached. + repeated string unreachable = 3; +} + +// UpdateShareRequest updates the settings of a share. +message UpdateShareRequest { + // Required. A share resource. + // Only fields specified in update_mask are updated. + Share share = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. Mask of fields to update. At least one path must be supplied in this + // field. + // The elements of the repeated paths field may only include these fields: + // + // * "description" + // * "capacity_gb" + // * "labels" + // * "nfs_export_options" + google.protobuf.FieldMask update_mask = 2 [(google.api.field_behavior) = REQUIRED]; +} diff --git a/java-filestore/samples/snippets/generated/com/google/cloud/filestore/v1beta1/cloudfilestoremanager/createshare/AsyncCreateShare.java b/java-filestore/samples/snippets/generated/com/google/cloud/filestore/v1beta1/cloudfilestoremanager/createshare/AsyncCreateShare.java new file mode 100644 index 000000000000..52e1197484ff --- /dev/null +++ b/java-filestore/samples/snippets/generated/com/google/cloud/filestore/v1beta1/cloudfilestoremanager/createshare/AsyncCreateShare.java @@ -0,0 +1,54 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.filestore.v1beta1.samples; + +// [START file_v1beta1_generated_CloudFilestoreManager_CreateShare_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.filestore.v1beta1.CloudFilestoreManagerClient; +import com.google.cloud.filestore.v1beta1.CreateShareRequest; +import com.google.cloud.filestore.v1beta1.InstanceName; +import com.google.cloud.filestore.v1beta1.Share; +import com.google.longrunning.Operation; + +public class AsyncCreateShare { + + public static void main(String[] args) throws Exception { + asyncCreateShare(); + } + + public static void asyncCreateShare() throws Exception { + // 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 (CloudFilestoreManagerClient cloudFilestoreManagerClient = + CloudFilestoreManagerClient.create()) { + CreateShareRequest request = + CreateShareRequest.newBuilder() + .setParent(InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString()) + .setShareId("shareId2054217050") + .setShare(Share.newBuilder().build()) + .build(); + ApiFuture future = + cloudFilestoreManagerClient.createShareCallable().futureCall(request); + // Do something. + Operation response = future.get(); + } + } +} +// [END file_v1beta1_generated_CloudFilestoreManager_CreateShare_async] diff --git a/java-filestore/samples/snippets/generated/com/google/cloud/filestore/v1beta1/cloudfilestoremanager/createshare/AsyncCreateShareLRO.java b/java-filestore/samples/snippets/generated/com/google/cloud/filestore/v1beta1/cloudfilestoremanager/createshare/AsyncCreateShareLRO.java new file mode 100644 index 000000000000..a862eecf047c --- /dev/null +++ b/java-filestore/samples/snippets/generated/com/google/cloud/filestore/v1beta1/cloudfilestoremanager/createshare/AsyncCreateShareLRO.java @@ -0,0 +1,54 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.filestore.v1beta1.samples; + +// [START file_v1beta1_generated_CloudFilestoreManager_CreateShare_LRO_async] +import com.google.api.gax.longrunning.OperationFuture; +import com.google.cloud.common.OperationMetadata; +import com.google.cloud.filestore.v1beta1.CloudFilestoreManagerClient; +import com.google.cloud.filestore.v1beta1.CreateShareRequest; +import com.google.cloud.filestore.v1beta1.InstanceName; +import com.google.cloud.filestore.v1beta1.Share; + +public class AsyncCreateShareLRO { + + public static void main(String[] args) throws Exception { + asyncCreateShareLRO(); + } + + public static void asyncCreateShareLRO() throws Exception { + // 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 (CloudFilestoreManagerClient cloudFilestoreManagerClient = + CloudFilestoreManagerClient.create()) { + CreateShareRequest request = + CreateShareRequest.newBuilder() + .setParent(InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString()) + .setShareId("shareId2054217050") + .setShare(Share.newBuilder().build()) + .build(); + OperationFuture future = + cloudFilestoreManagerClient.createShareOperationCallable().futureCall(request); + // Do something. + Share response = future.get(); + } + } +} +// [END file_v1beta1_generated_CloudFilestoreManager_CreateShare_LRO_async] diff --git a/java-filestore/samples/snippets/generated/com/google/cloud/filestore/v1beta1/cloudfilestoremanager/createshare/SyncCreateShare.java b/java-filestore/samples/snippets/generated/com/google/cloud/filestore/v1beta1/cloudfilestoremanager/createshare/SyncCreateShare.java new file mode 100644 index 000000000000..df4790cd868e --- /dev/null +++ b/java-filestore/samples/snippets/generated/com/google/cloud/filestore/v1beta1/cloudfilestoremanager/createshare/SyncCreateShare.java @@ -0,0 +1,49 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.filestore.v1beta1.samples; + +// [START file_v1beta1_generated_CloudFilestoreManager_CreateShare_sync] +import com.google.cloud.filestore.v1beta1.CloudFilestoreManagerClient; +import com.google.cloud.filestore.v1beta1.CreateShareRequest; +import com.google.cloud.filestore.v1beta1.InstanceName; +import com.google.cloud.filestore.v1beta1.Share; + +public class SyncCreateShare { + + public static void main(String[] args) throws Exception { + syncCreateShare(); + } + + public static void syncCreateShare() throws Exception { + // 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 (CloudFilestoreManagerClient cloudFilestoreManagerClient = + CloudFilestoreManagerClient.create()) { + CreateShareRequest request = + CreateShareRequest.newBuilder() + .setParent(InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString()) + .setShareId("shareId2054217050") + .setShare(Share.newBuilder().build()) + .build(); + Share response = cloudFilestoreManagerClient.createShareAsync(request).get(); + } + } +} +// [END file_v1beta1_generated_CloudFilestoreManager_CreateShare_sync] diff --git a/java-filestore/samples/snippets/generated/com/google/cloud/filestore/v1beta1/cloudfilestoremanager/createshare/SyncCreateShareInstancenameShareString.java b/java-filestore/samples/snippets/generated/com/google/cloud/filestore/v1beta1/cloudfilestoremanager/createshare/SyncCreateShareInstancenameShareString.java new file mode 100644 index 000000000000..bff80f3fa576 --- /dev/null +++ b/java-filestore/samples/snippets/generated/com/google/cloud/filestore/v1beta1/cloudfilestoremanager/createshare/SyncCreateShareInstancenameShareString.java @@ -0,0 +1,45 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.filestore.v1beta1.samples; + +// [START file_v1beta1_generated_CloudFilestoreManager_CreateShare_InstancenameShareString_sync] +import com.google.cloud.filestore.v1beta1.CloudFilestoreManagerClient; +import com.google.cloud.filestore.v1beta1.InstanceName; +import com.google.cloud.filestore.v1beta1.Share; + +public class SyncCreateShareInstancenameShareString { + + public static void main(String[] args) throws Exception { + syncCreateShareInstancenameShareString(); + } + + public static void syncCreateShareInstancenameShareString() throws Exception { + // 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 (CloudFilestoreManagerClient cloudFilestoreManagerClient = + CloudFilestoreManagerClient.create()) { + InstanceName parent = InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]"); + Share share = Share.newBuilder().build(); + String shareId = "shareId2054217050"; + Share response = cloudFilestoreManagerClient.createShareAsync(parent, share, shareId).get(); + } + } +} +// [END file_v1beta1_generated_CloudFilestoreManager_CreateShare_InstancenameShareString_sync] diff --git a/java-filestore/samples/snippets/generated/com/google/cloud/filestore/v1beta1/cloudfilestoremanager/createshare/SyncCreateShareStringShareString.java b/java-filestore/samples/snippets/generated/com/google/cloud/filestore/v1beta1/cloudfilestoremanager/createshare/SyncCreateShareStringShareString.java new file mode 100644 index 000000000000..3764ebb7fdb5 --- /dev/null +++ b/java-filestore/samples/snippets/generated/com/google/cloud/filestore/v1beta1/cloudfilestoremanager/createshare/SyncCreateShareStringShareString.java @@ -0,0 +1,45 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.filestore.v1beta1.samples; + +// [START file_v1beta1_generated_CloudFilestoreManager_CreateShare_StringShareString_sync] +import com.google.cloud.filestore.v1beta1.CloudFilestoreManagerClient; +import com.google.cloud.filestore.v1beta1.InstanceName; +import com.google.cloud.filestore.v1beta1.Share; + +public class SyncCreateShareStringShareString { + + public static void main(String[] args) throws Exception { + syncCreateShareStringShareString(); + } + + public static void syncCreateShareStringShareString() throws Exception { + // 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 (CloudFilestoreManagerClient cloudFilestoreManagerClient = + CloudFilestoreManagerClient.create()) { + String parent = InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString(); + Share share = Share.newBuilder().build(); + String shareId = "shareId2054217050"; + Share response = cloudFilestoreManagerClient.createShareAsync(parent, share, shareId).get(); + } + } +} +// [END file_v1beta1_generated_CloudFilestoreManager_CreateShare_StringShareString_sync] diff --git a/java-filestore/samples/snippets/generated/com/google/cloud/filestore/v1beta1/cloudfilestoremanager/createsnapshot/AsyncCreateSnapshot.java b/java-filestore/samples/snippets/generated/com/google/cloud/filestore/v1beta1/cloudfilestoremanager/createsnapshot/AsyncCreateSnapshot.java new file mode 100644 index 000000000000..068682cdfa28 --- /dev/null +++ b/java-filestore/samples/snippets/generated/com/google/cloud/filestore/v1beta1/cloudfilestoremanager/createsnapshot/AsyncCreateSnapshot.java @@ -0,0 +1,54 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.filestore.v1beta1.samples; + +// [START file_v1beta1_generated_CloudFilestoreManager_CreateSnapshot_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.filestore.v1beta1.CloudFilestoreManagerClient; +import com.google.cloud.filestore.v1beta1.CreateSnapshotRequest; +import com.google.cloud.filestore.v1beta1.InstanceName; +import com.google.cloud.filestore.v1beta1.Snapshot; +import com.google.longrunning.Operation; + +public class AsyncCreateSnapshot { + + public static void main(String[] args) throws Exception { + asyncCreateSnapshot(); + } + + public static void asyncCreateSnapshot() throws Exception { + // 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 (CloudFilestoreManagerClient cloudFilestoreManagerClient = + CloudFilestoreManagerClient.create()) { + CreateSnapshotRequest request = + CreateSnapshotRequest.newBuilder() + .setParent(InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString()) + .setSnapshotId("snapshotId-1113817601") + .setSnapshot(Snapshot.newBuilder().build()) + .build(); + ApiFuture future = + cloudFilestoreManagerClient.createSnapshotCallable().futureCall(request); + // Do something. + Operation response = future.get(); + } + } +} +// [END file_v1beta1_generated_CloudFilestoreManager_CreateSnapshot_async] diff --git a/java-filestore/samples/snippets/generated/com/google/cloud/filestore/v1beta1/cloudfilestoremanager/createsnapshot/AsyncCreateSnapshotLRO.java b/java-filestore/samples/snippets/generated/com/google/cloud/filestore/v1beta1/cloudfilestoremanager/createsnapshot/AsyncCreateSnapshotLRO.java new file mode 100644 index 000000000000..e834f4350f40 --- /dev/null +++ b/java-filestore/samples/snippets/generated/com/google/cloud/filestore/v1beta1/cloudfilestoremanager/createsnapshot/AsyncCreateSnapshotLRO.java @@ -0,0 +1,54 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.filestore.v1beta1.samples; + +// [START file_v1beta1_generated_CloudFilestoreManager_CreateSnapshot_LRO_async] +import com.google.api.gax.longrunning.OperationFuture; +import com.google.cloud.common.OperationMetadata; +import com.google.cloud.filestore.v1beta1.CloudFilestoreManagerClient; +import com.google.cloud.filestore.v1beta1.CreateSnapshotRequest; +import com.google.cloud.filestore.v1beta1.InstanceName; +import com.google.cloud.filestore.v1beta1.Snapshot; + +public class AsyncCreateSnapshotLRO { + + public static void main(String[] args) throws Exception { + asyncCreateSnapshotLRO(); + } + + public static void asyncCreateSnapshotLRO() throws Exception { + // 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 (CloudFilestoreManagerClient cloudFilestoreManagerClient = + CloudFilestoreManagerClient.create()) { + CreateSnapshotRequest request = + CreateSnapshotRequest.newBuilder() + .setParent(InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString()) + .setSnapshotId("snapshotId-1113817601") + .setSnapshot(Snapshot.newBuilder().build()) + .build(); + OperationFuture future = + cloudFilestoreManagerClient.createSnapshotOperationCallable().futureCall(request); + // Do something. + Snapshot response = future.get(); + } + } +} +// [END file_v1beta1_generated_CloudFilestoreManager_CreateSnapshot_LRO_async] diff --git a/java-filestore/samples/snippets/generated/com/google/cloud/filestore/v1beta1/cloudfilestoremanager/createsnapshot/SyncCreateSnapshot.java b/java-filestore/samples/snippets/generated/com/google/cloud/filestore/v1beta1/cloudfilestoremanager/createsnapshot/SyncCreateSnapshot.java new file mode 100644 index 000000000000..22ee6c9ab889 --- /dev/null +++ b/java-filestore/samples/snippets/generated/com/google/cloud/filestore/v1beta1/cloudfilestoremanager/createsnapshot/SyncCreateSnapshot.java @@ -0,0 +1,49 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.filestore.v1beta1.samples; + +// [START file_v1beta1_generated_CloudFilestoreManager_CreateSnapshot_sync] +import com.google.cloud.filestore.v1beta1.CloudFilestoreManagerClient; +import com.google.cloud.filestore.v1beta1.CreateSnapshotRequest; +import com.google.cloud.filestore.v1beta1.InstanceName; +import com.google.cloud.filestore.v1beta1.Snapshot; + +public class SyncCreateSnapshot { + + public static void main(String[] args) throws Exception { + syncCreateSnapshot(); + } + + public static void syncCreateSnapshot() throws Exception { + // 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 (CloudFilestoreManagerClient cloudFilestoreManagerClient = + CloudFilestoreManagerClient.create()) { + CreateSnapshotRequest request = + CreateSnapshotRequest.newBuilder() + .setParent(InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString()) + .setSnapshotId("snapshotId-1113817601") + .setSnapshot(Snapshot.newBuilder().build()) + .build(); + Snapshot response = cloudFilestoreManagerClient.createSnapshotAsync(request).get(); + } + } +} +// [END file_v1beta1_generated_CloudFilestoreManager_CreateSnapshot_sync] diff --git a/java-filestore/samples/snippets/generated/com/google/cloud/filestore/v1beta1/cloudfilestoremanager/createsnapshot/SyncCreateSnapshotInstancenameSnapshotString.java b/java-filestore/samples/snippets/generated/com/google/cloud/filestore/v1beta1/cloudfilestoremanager/createsnapshot/SyncCreateSnapshotInstancenameSnapshotString.java new file mode 100644 index 000000000000..6526bdd0ce36 --- /dev/null +++ b/java-filestore/samples/snippets/generated/com/google/cloud/filestore/v1beta1/cloudfilestoremanager/createsnapshot/SyncCreateSnapshotInstancenameSnapshotString.java @@ -0,0 +1,46 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.filestore.v1beta1.samples; + +// [START file_v1beta1_generated_CloudFilestoreManager_CreateSnapshot_InstancenameSnapshotString_sync] +import com.google.cloud.filestore.v1beta1.CloudFilestoreManagerClient; +import com.google.cloud.filestore.v1beta1.InstanceName; +import com.google.cloud.filestore.v1beta1.Snapshot; + +public class SyncCreateSnapshotInstancenameSnapshotString { + + public static void main(String[] args) throws Exception { + syncCreateSnapshotInstancenameSnapshotString(); + } + + public static void syncCreateSnapshotInstancenameSnapshotString() throws Exception { + // 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 (CloudFilestoreManagerClient cloudFilestoreManagerClient = + CloudFilestoreManagerClient.create()) { + InstanceName parent = InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]"); + Snapshot snapshot = Snapshot.newBuilder().build(); + String snapshotId = "snapshotId-1113817601"; + Snapshot response = + cloudFilestoreManagerClient.createSnapshotAsync(parent, snapshot, snapshotId).get(); + } + } +} +// [END file_v1beta1_generated_CloudFilestoreManager_CreateSnapshot_InstancenameSnapshotString_sync] diff --git a/java-filestore/samples/snippets/generated/com/google/cloud/filestore/v1beta1/cloudfilestoremanager/createsnapshot/SyncCreateSnapshotStringSnapshotString.java b/java-filestore/samples/snippets/generated/com/google/cloud/filestore/v1beta1/cloudfilestoremanager/createsnapshot/SyncCreateSnapshotStringSnapshotString.java new file mode 100644 index 000000000000..00cdb400bbc7 --- /dev/null +++ b/java-filestore/samples/snippets/generated/com/google/cloud/filestore/v1beta1/cloudfilestoremanager/createsnapshot/SyncCreateSnapshotStringSnapshotString.java @@ -0,0 +1,46 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.filestore.v1beta1.samples; + +// [START file_v1beta1_generated_CloudFilestoreManager_CreateSnapshot_StringSnapshotString_sync] +import com.google.cloud.filestore.v1beta1.CloudFilestoreManagerClient; +import com.google.cloud.filestore.v1beta1.InstanceName; +import com.google.cloud.filestore.v1beta1.Snapshot; + +public class SyncCreateSnapshotStringSnapshotString { + + public static void main(String[] args) throws Exception { + syncCreateSnapshotStringSnapshotString(); + } + + public static void syncCreateSnapshotStringSnapshotString() throws Exception { + // 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 (CloudFilestoreManagerClient cloudFilestoreManagerClient = + CloudFilestoreManagerClient.create()) { + String parent = InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString(); + Snapshot snapshot = Snapshot.newBuilder().build(); + String snapshotId = "snapshotId-1113817601"; + Snapshot response = + cloudFilestoreManagerClient.createSnapshotAsync(parent, snapshot, snapshotId).get(); + } + } +} +// [END file_v1beta1_generated_CloudFilestoreManager_CreateSnapshot_StringSnapshotString_sync] diff --git a/java-filestore/samples/snippets/generated/com/google/cloud/filestore/v1beta1/cloudfilestoremanager/deleteinstance/AsyncDeleteInstance.java b/java-filestore/samples/snippets/generated/com/google/cloud/filestore/v1beta1/cloudfilestoremanager/deleteinstance/AsyncDeleteInstance.java index 1ef8e4fffd70..e2f1b3e96ceb 100644 --- a/java-filestore/samples/snippets/generated/com/google/cloud/filestore/v1beta1/cloudfilestoremanager/deleteinstance/AsyncDeleteInstance.java +++ b/java-filestore/samples/snippets/generated/com/google/cloud/filestore/v1beta1/cloudfilestoremanager/deleteinstance/AsyncDeleteInstance.java @@ -40,6 +40,7 @@ public static void asyncDeleteInstance() throws Exception { DeleteInstanceRequest request = DeleteInstanceRequest.newBuilder() .setName(InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString()) + .setForce(true) .build(); ApiFuture future = cloudFilestoreManagerClient.deleteInstanceCallable().futureCall(request); diff --git a/java-filestore/samples/snippets/generated/com/google/cloud/filestore/v1beta1/cloudfilestoremanager/deleteinstance/AsyncDeleteInstanceLRO.java b/java-filestore/samples/snippets/generated/com/google/cloud/filestore/v1beta1/cloudfilestoremanager/deleteinstance/AsyncDeleteInstanceLRO.java index 4dfb99a86039..228ff88c39c1 100644 --- a/java-filestore/samples/snippets/generated/com/google/cloud/filestore/v1beta1/cloudfilestoremanager/deleteinstance/AsyncDeleteInstanceLRO.java +++ b/java-filestore/samples/snippets/generated/com/google/cloud/filestore/v1beta1/cloudfilestoremanager/deleteinstance/AsyncDeleteInstanceLRO.java @@ -41,6 +41,7 @@ public static void asyncDeleteInstanceLRO() throws Exception { DeleteInstanceRequest request = DeleteInstanceRequest.newBuilder() .setName(InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString()) + .setForce(true) .build(); OperationFuture future = cloudFilestoreManagerClient.deleteInstanceOperationCallable().futureCall(request); diff --git a/java-filestore/samples/snippets/generated/com/google/cloud/filestore/v1beta1/cloudfilestoremanager/deleteinstance/SyncDeleteInstance.java b/java-filestore/samples/snippets/generated/com/google/cloud/filestore/v1beta1/cloudfilestoremanager/deleteinstance/SyncDeleteInstance.java index 8b09f2e70569..10ed7a3d55b1 100644 --- a/java-filestore/samples/snippets/generated/com/google/cloud/filestore/v1beta1/cloudfilestoremanager/deleteinstance/SyncDeleteInstance.java +++ b/java-filestore/samples/snippets/generated/com/google/cloud/filestore/v1beta1/cloudfilestoremanager/deleteinstance/SyncDeleteInstance.java @@ -39,6 +39,7 @@ public static void syncDeleteInstance() throws Exception { DeleteInstanceRequest request = DeleteInstanceRequest.newBuilder() .setName(InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString()) + .setForce(true) .build(); cloudFilestoreManagerClient.deleteInstanceAsync(request).get(); } diff --git a/java-filestore/samples/snippets/generated/com/google/cloud/filestore/v1beta1/cloudfilestoremanager/deleteshare/AsyncDeleteShare.java b/java-filestore/samples/snippets/generated/com/google/cloud/filestore/v1beta1/cloudfilestoremanager/deleteshare/AsyncDeleteShare.java new file mode 100644 index 000000000000..38d78d2044ca --- /dev/null +++ b/java-filestore/samples/snippets/generated/com/google/cloud/filestore/v1beta1/cloudfilestoremanager/deleteshare/AsyncDeleteShare.java @@ -0,0 +1,51 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.filestore.v1beta1.samples; + +// [START file_v1beta1_generated_CloudFilestoreManager_DeleteShare_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.filestore.v1beta1.CloudFilestoreManagerClient; +import com.google.cloud.filestore.v1beta1.DeleteShareRequest; +import com.google.cloud.filestore.v1beta1.ShareName; +import com.google.longrunning.Operation; + +public class AsyncDeleteShare { + + public static void main(String[] args) throws Exception { + asyncDeleteShare(); + } + + public static void asyncDeleteShare() throws Exception { + // 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 (CloudFilestoreManagerClient cloudFilestoreManagerClient = + CloudFilestoreManagerClient.create()) { + DeleteShareRequest request = + DeleteShareRequest.newBuilder() + .setName(ShareName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]", "[SHARE]").toString()) + .build(); + ApiFuture future = + cloudFilestoreManagerClient.deleteShareCallable().futureCall(request); + // Do something. + future.get(); + } + } +} +// [END file_v1beta1_generated_CloudFilestoreManager_DeleteShare_async] diff --git a/java-filestore/samples/snippets/generated/com/google/cloud/filestore/v1beta1/cloudfilestoremanager/deleteshare/AsyncDeleteShareLRO.java b/java-filestore/samples/snippets/generated/com/google/cloud/filestore/v1beta1/cloudfilestoremanager/deleteshare/AsyncDeleteShareLRO.java new file mode 100644 index 000000000000..bc35b35a2f4a --- /dev/null +++ b/java-filestore/samples/snippets/generated/com/google/cloud/filestore/v1beta1/cloudfilestoremanager/deleteshare/AsyncDeleteShareLRO.java @@ -0,0 +1,52 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.filestore.v1beta1.samples; + +// [START file_v1beta1_generated_CloudFilestoreManager_DeleteShare_LRO_async] +import com.google.api.gax.longrunning.OperationFuture; +import com.google.cloud.common.OperationMetadata; +import com.google.cloud.filestore.v1beta1.CloudFilestoreManagerClient; +import com.google.cloud.filestore.v1beta1.DeleteShareRequest; +import com.google.cloud.filestore.v1beta1.ShareName; +import com.google.protobuf.Empty; + +public class AsyncDeleteShareLRO { + + public static void main(String[] args) throws Exception { + asyncDeleteShareLRO(); + } + + public static void asyncDeleteShareLRO() throws Exception { + // 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 (CloudFilestoreManagerClient cloudFilestoreManagerClient = + CloudFilestoreManagerClient.create()) { + DeleteShareRequest request = + DeleteShareRequest.newBuilder() + .setName(ShareName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]", "[SHARE]").toString()) + .build(); + OperationFuture future = + cloudFilestoreManagerClient.deleteShareOperationCallable().futureCall(request); + // Do something. + future.get(); + } + } +} +// [END file_v1beta1_generated_CloudFilestoreManager_DeleteShare_LRO_async] diff --git a/java-filestore/samples/snippets/generated/com/google/cloud/filestore/v1beta1/cloudfilestoremanager/deleteshare/SyncDeleteShare.java b/java-filestore/samples/snippets/generated/com/google/cloud/filestore/v1beta1/cloudfilestoremanager/deleteshare/SyncDeleteShare.java new file mode 100644 index 000000000000..4d89e6181235 --- /dev/null +++ b/java-filestore/samples/snippets/generated/com/google/cloud/filestore/v1beta1/cloudfilestoremanager/deleteshare/SyncDeleteShare.java @@ -0,0 +1,47 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.filestore.v1beta1.samples; + +// [START file_v1beta1_generated_CloudFilestoreManager_DeleteShare_sync] +import com.google.cloud.filestore.v1beta1.CloudFilestoreManagerClient; +import com.google.cloud.filestore.v1beta1.DeleteShareRequest; +import com.google.cloud.filestore.v1beta1.ShareName; +import com.google.protobuf.Empty; + +public class SyncDeleteShare { + + public static void main(String[] args) throws Exception { + syncDeleteShare(); + } + + public static void syncDeleteShare() throws Exception { + // 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 (CloudFilestoreManagerClient cloudFilestoreManagerClient = + CloudFilestoreManagerClient.create()) { + DeleteShareRequest request = + DeleteShareRequest.newBuilder() + .setName(ShareName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]", "[SHARE]").toString()) + .build(); + cloudFilestoreManagerClient.deleteShareAsync(request).get(); + } + } +} +// [END file_v1beta1_generated_CloudFilestoreManager_DeleteShare_sync] diff --git a/java-filestore/samples/snippets/generated/com/google/cloud/filestore/v1beta1/cloudfilestoremanager/deleteshare/SyncDeleteShareSharename.java b/java-filestore/samples/snippets/generated/com/google/cloud/filestore/v1beta1/cloudfilestoremanager/deleteshare/SyncDeleteShareSharename.java new file mode 100644 index 000000000000..14326cd20d4f --- /dev/null +++ b/java-filestore/samples/snippets/generated/com/google/cloud/filestore/v1beta1/cloudfilestoremanager/deleteshare/SyncDeleteShareSharename.java @@ -0,0 +1,43 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.filestore.v1beta1.samples; + +// [START file_v1beta1_generated_CloudFilestoreManager_DeleteShare_Sharename_sync] +import com.google.cloud.filestore.v1beta1.CloudFilestoreManagerClient; +import com.google.cloud.filestore.v1beta1.ShareName; +import com.google.protobuf.Empty; + +public class SyncDeleteShareSharename { + + public static void main(String[] args) throws Exception { + syncDeleteShareSharename(); + } + + public static void syncDeleteShareSharename() throws Exception { + // 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 (CloudFilestoreManagerClient cloudFilestoreManagerClient = + CloudFilestoreManagerClient.create()) { + ShareName name = ShareName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]", "[SHARE]"); + cloudFilestoreManagerClient.deleteShareAsync(name).get(); + } + } +} +// [END file_v1beta1_generated_CloudFilestoreManager_DeleteShare_Sharename_sync] diff --git a/java-filestore/samples/snippets/generated/com/google/cloud/filestore/v1beta1/cloudfilestoremanager/deleteshare/SyncDeleteShareString.java b/java-filestore/samples/snippets/generated/com/google/cloud/filestore/v1beta1/cloudfilestoremanager/deleteshare/SyncDeleteShareString.java new file mode 100644 index 000000000000..b17ad8e436e2 --- /dev/null +++ b/java-filestore/samples/snippets/generated/com/google/cloud/filestore/v1beta1/cloudfilestoremanager/deleteshare/SyncDeleteShareString.java @@ -0,0 +1,43 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.filestore.v1beta1.samples; + +// [START file_v1beta1_generated_CloudFilestoreManager_DeleteShare_String_sync] +import com.google.cloud.filestore.v1beta1.CloudFilestoreManagerClient; +import com.google.cloud.filestore.v1beta1.ShareName; +import com.google.protobuf.Empty; + +public class SyncDeleteShareString { + + public static void main(String[] args) throws Exception { + syncDeleteShareString(); + } + + public static void syncDeleteShareString() throws Exception { + // 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 (CloudFilestoreManagerClient cloudFilestoreManagerClient = + CloudFilestoreManagerClient.create()) { + String name = ShareName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]", "[SHARE]").toString(); + cloudFilestoreManagerClient.deleteShareAsync(name).get(); + } + } +} +// [END file_v1beta1_generated_CloudFilestoreManager_DeleteShare_String_sync] diff --git a/java-filestore/samples/snippets/generated/com/google/cloud/filestore/v1beta1/cloudfilestoremanager/deletesnapshot/AsyncDeleteSnapshot.java b/java-filestore/samples/snippets/generated/com/google/cloud/filestore/v1beta1/cloudfilestoremanager/deletesnapshot/AsyncDeleteSnapshot.java new file mode 100644 index 000000000000..d5ec8e356fc8 --- /dev/null +++ b/java-filestore/samples/snippets/generated/com/google/cloud/filestore/v1beta1/cloudfilestoremanager/deletesnapshot/AsyncDeleteSnapshot.java @@ -0,0 +1,52 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.filestore.v1beta1.samples; + +// [START file_v1beta1_generated_CloudFilestoreManager_DeleteSnapshot_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.filestore.v1beta1.CloudFilestoreManagerClient; +import com.google.cloud.filestore.v1beta1.DeleteSnapshotRequest; +import com.google.cloud.filestore.v1beta1.SnapshotName; +import com.google.longrunning.Operation; + +public class AsyncDeleteSnapshot { + + public static void main(String[] args) throws Exception { + asyncDeleteSnapshot(); + } + + public static void asyncDeleteSnapshot() throws Exception { + // 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 (CloudFilestoreManagerClient cloudFilestoreManagerClient = + CloudFilestoreManagerClient.create()) { + DeleteSnapshotRequest request = + DeleteSnapshotRequest.newBuilder() + .setName( + SnapshotName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]", "[SNAPSHOT]").toString()) + .build(); + ApiFuture future = + cloudFilestoreManagerClient.deleteSnapshotCallable().futureCall(request); + // Do something. + future.get(); + } + } +} +// [END file_v1beta1_generated_CloudFilestoreManager_DeleteSnapshot_async] diff --git a/java-filestore/samples/snippets/generated/com/google/cloud/filestore/v1beta1/cloudfilestoremanager/deletesnapshot/AsyncDeleteSnapshotLRO.java b/java-filestore/samples/snippets/generated/com/google/cloud/filestore/v1beta1/cloudfilestoremanager/deletesnapshot/AsyncDeleteSnapshotLRO.java new file mode 100644 index 000000000000..7a9d8f3ce65b --- /dev/null +++ b/java-filestore/samples/snippets/generated/com/google/cloud/filestore/v1beta1/cloudfilestoremanager/deletesnapshot/AsyncDeleteSnapshotLRO.java @@ -0,0 +1,53 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.filestore.v1beta1.samples; + +// [START file_v1beta1_generated_CloudFilestoreManager_DeleteSnapshot_LRO_async] +import com.google.api.gax.longrunning.OperationFuture; +import com.google.cloud.common.OperationMetadata; +import com.google.cloud.filestore.v1beta1.CloudFilestoreManagerClient; +import com.google.cloud.filestore.v1beta1.DeleteSnapshotRequest; +import com.google.cloud.filestore.v1beta1.SnapshotName; +import com.google.protobuf.Empty; + +public class AsyncDeleteSnapshotLRO { + + public static void main(String[] args) throws Exception { + asyncDeleteSnapshotLRO(); + } + + public static void asyncDeleteSnapshotLRO() throws Exception { + // 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 (CloudFilestoreManagerClient cloudFilestoreManagerClient = + CloudFilestoreManagerClient.create()) { + DeleteSnapshotRequest request = + DeleteSnapshotRequest.newBuilder() + .setName( + SnapshotName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]", "[SNAPSHOT]").toString()) + .build(); + OperationFuture future = + cloudFilestoreManagerClient.deleteSnapshotOperationCallable().futureCall(request); + // Do something. + future.get(); + } + } +} +// [END file_v1beta1_generated_CloudFilestoreManager_DeleteSnapshot_LRO_async] diff --git a/java-filestore/samples/snippets/generated/com/google/cloud/filestore/v1beta1/cloudfilestoremanager/deletesnapshot/SyncDeleteSnapshot.java b/java-filestore/samples/snippets/generated/com/google/cloud/filestore/v1beta1/cloudfilestoremanager/deletesnapshot/SyncDeleteSnapshot.java new file mode 100644 index 000000000000..ce1654943624 --- /dev/null +++ b/java-filestore/samples/snippets/generated/com/google/cloud/filestore/v1beta1/cloudfilestoremanager/deletesnapshot/SyncDeleteSnapshot.java @@ -0,0 +1,48 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.filestore.v1beta1.samples; + +// [START file_v1beta1_generated_CloudFilestoreManager_DeleteSnapshot_sync] +import com.google.cloud.filestore.v1beta1.CloudFilestoreManagerClient; +import com.google.cloud.filestore.v1beta1.DeleteSnapshotRequest; +import com.google.cloud.filestore.v1beta1.SnapshotName; +import com.google.protobuf.Empty; + +public class SyncDeleteSnapshot { + + public static void main(String[] args) throws Exception { + syncDeleteSnapshot(); + } + + public static void syncDeleteSnapshot() throws Exception { + // 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 (CloudFilestoreManagerClient cloudFilestoreManagerClient = + CloudFilestoreManagerClient.create()) { + DeleteSnapshotRequest request = + DeleteSnapshotRequest.newBuilder() + .setName( + SnapshotName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]", "[SNAPSHOT]").toString()) + .build(); + cloudFilestoreManagerClient.deleteSnapshotAsync(request).get(); + } + } +} +// [END file_v1beta1_generated_CloudFilestoreManager_DeleteSnapshot_sync] diff --git a/java-filestore/samples/snippets/generated/com/google/cloud/filestore/v1beta1/cloudfilestoremanager/deletesnapshot/SyncDeleteSnapshotSnapshotname.java b/java-filestore/samples/snippets/generated/com/google/cloud/filestore/v1beta1/cloudfilestoremanager/deletesnapshot/SyncDeleteSnapshotSnapshotname.java new file mode 100644 index 000000000000..c40de0057191 --- /dev/null +++ b/java-filestore/samples/snippets/generated/com/google/cloud/filestore/v1beta1/cloudfilestoremanager/deletesnapshot/SyncDeleteSnapshotSnapshotname.java @@ -0,0 +1,43 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.filestore.v1beta1.samples; + +// [START file_v1beta1_generated_CloudFilestoreManager_DeleteSnapshot_Snapshotname_sync] +import com.google.cloud.filestore.v1beta1.CloudFilestoreManagerClient; +import com.google.cloud.filestore.v1beta1.SnapshotName; +import com.google.protobuf.Empty; + +public class SyncDeleteSnapshotSnapshotname { + + public static void main(String[] args) throws Exception { + syncDeleteSnapshotSnapshotname(); + } + + public static void syncDeleteSnapshotSnapshotname() throws Exception { + // 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 (CloudFilestoreManagerClient cloudFilestoreManagerClient = + CloudFilestoreManagerClient.create()) { + SnapshotName name = SnapshotName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]", "[SNAPSHOT]"); + cloudFilestoreManagerClient.deleteSnapshotAsync(name).get(); + } + } +} +// [END file_v1beta1_generated_CloudFilestoreManager_DeleteSnapshot_Snapshotname_sync] diff --git a/java-filestore/samples/snippets/generated/com/google/cloud/filestore/v1beta1/cloudfilestoremanager/deletesnapshot/SyncDeleteSnapshotString.java b/java-filestore/samples/snippets/generated/com/google/cloud/filestore/v1beta1/cloudfilestoremanager/deletesnapshot/SyncDeleteSnapshotString.java new file mode 100644 index 000000000000..487efa6d510e --- /dev/null +++ b/java-filestore/samples/snippets/generated/com/google/cloud/filestore/v1beta1/cloudfilestoremanager/deletesnapshot/SyncDeleteSnapshotString.java @@ -0,0 +1,44 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.filestore.v1beta1.samples; + +// [START file_v1beta1_generated_CloudFilestoreManager_DeleteSnapshot_String_sync] +import com.google.cloud.filestore.v1beta1.CloudFilestoreManagerClient; +import com.google.cloud.filestore.v1beta1.SnapshotName; +import com.google.protobuf.Empty; + +public class SyncDeleteSnapshotString { + + public static void main(String[] args) throws Exception { + syncDeleteSnapshotString(); + } + + public static void syncDeleteSnapshotString() throws Exception { + // 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 (CloudFilestoreManagerClient cloudFilestoreManagerClient = + CloudFilestoreManagerClient.create()) { + String name = + SnapshotName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]", "[SNAPSHOT]").toString(); + cloudFilestoreManagerClient.deleteSnapshotAsync(name).get(); + } + } +} +// [END file_v1beta1_generated_CloudFilestoreManager_DeleteSnapshot_String_sync] diff --git a/java-filestore/samples/snippets/generated/com/google/cloud/filestore/v1beta1/cloudfilestoremanager/getshare/AsyncGetShare.java b/java-filestore/samples/snippets/generated/com/google/cloud/filestore/v1beta1/cloudfilestoremanager/getshare/AsyncGetShare.java new file mode 100644 index 000000000000..9fcaa61af89f --- /dev/null +++ b/java-filestore/samples/snippets/generated/com/google/cloud/filestore/v1beta1/cloudfilestoremanager/getshare/AsyncGetShare.java @@ -0,0 +1,50 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.filestore.v1beta1.samples; + +// [START file_v1beta1_generated_CloudFilestoreManager_GetShare_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.filestore.v1beta1.CloudFilestoreManagerClient; +import com.google.cloud.filestore.v1beta1.GetShareRequest; +import com.google.cloud.filestore.v1beta1.Share; +import com.google.cloud.filestore.v1beta1.ShareName; + +public class AsyncGetShare { + + public static void main(String[] args) throws Exception { + asyncGetShare(); + } + + public static void asyncGetShare() throws Exception { + // 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 (CloudFilestoreManagerClient cloudFilestoreManagerClient = + CloudFilestoreManagerClient.create()) { + GetShareRequest request = + GetShareRequest.newBuilder() + .setName(ShareName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]", "[SHARE]").toString()) + .build(); + ApiFuture future = cloudFilestoreManagerClient.getShareCallable().futureCall(request); + // Do something. + Share response = future.get(); + } + } +} +// [END file_v1beta1_generated_CloudFilestoreManager_GetShare_async] diff --git a/java-filestore/samples/snippets/generated/com/google/cloud/filestore/v1beta1/cloudfilestoremanager/getshare/SyncGetShare.java b/java-filestore/samples/snippets/generated/com/google/cloud/filestore/v1beta1/cloudfilestoremanager/getshare/SyncGetShare.java new file mode 100644 index 000000000000..16cc52589186 --- /dev/null +++ b/java-filestore/samples/snippets/generated/com/google/cloud/filestore/v1beta1/cloudfilestoremanager/getshare/SyncGetShare.java @@ -0,0 +1,47 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.filestore.v1beta1.samples; + +// [START file_v1beta1_generated_CloudFilestoreManager_GetShare_sync] +import com.google.cloud.filestore.v1beta1.CloudFilestoreManagerClient; +import com.google.cloud.filestore.v1beta1.GetShareRequest; +import com.google.cloud.filestore.v1beta1.Share; +import com.google.cloud.filestore.v1beta1.ShareName; + +public class SyncGetShare { + + public static void main(String[] args) throws Exception { + syncGetShare(); + } + + public static void syncGetShare() throws Exception { + // 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 (CloudFilestoreManagerClient cloudFilestoreManagerClient = + CloudFilestoreManagerClient.create()) { + GetShareRequest request = + GetShareRequest.newBuilder() + .setName(ShareName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]", "[SHARE]").toString()) + .build(); + Share response = cloudFilestoreManagerClient.getShare(request); + } + } +} +// [END file_v1beta1_generated_CloudFilestoreManager_GetShare_sync] diff --git a/java-filestore/samples/snippets/generated/com/google/cloud/filestore/v1beta1/cloudfilestoremanager/getshare/SyncGetShareSharename.java b/java-filestore/samples/snippets/generated/com/google/cloud/filestore/v1beta1/cloudfilestoremanager/getshare/SyncGetShareSharename.java new file mode 100644 index 000000000000..1b3ccd13c842 --- /dev/null +++ b/java-filestore/samples/snippets/generated/com/google/cloud/filestore/v1beta1/cloudfilestoremanager/getshare/SyncGetShareSharename.java @@ -0,0 +1,43 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.filestore.v1beta1.samples; + +// [START file_v1beta1_generated_CloudFilestoreManager_GetShare_Sharename_sync] +import com.google.cloud.filestore.v1beta1.CloudFilestoreManagerClient; +import com.google.cloud.filestore.v1beta1.Share; +import com.google.cloud.filestore.v1beta1.ShareName; + +public class SyncGetShareSharename { + + public static void main(String[] args) throws Exception { + syncGetShareSharename(); + } + + public static void syncGetShareSharename() throws Exception { + // 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 (CloudFilestoreManagerClient cloudFilestoreManagerClient = + CloudFilestoreManagerClient.create()) { + ShareName name = ShareName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]", "[SHARE]"); + Share response = cloudFilestoreManagerClient.getShare(name); + } + } +} +// [END file_v1beta1_generated_CloudFilestoreManager_GetShare_Sharename_sync] diff --git a/java-filestore/samples/snippets/generated/com/google/cloud/filestore/v1beta1/cloudfilestoremanager/getshare/SyncGetShareString.java b/java-filestore/samples/snippets/generated/com/google/cloud/filestore/v1beta1/cloudfilestoremanager/getshare/SyncGetShareString.java new file mode 100644 index 000000000000..a3de992b84b0 --- /dev/null +++ b/java-filestore/samples/snippets/generated/com/google/cloud/filestore/v1beta1/cloudfilestoremanager/getshare/SyncGetShareString.java @@ -0,0 +1,43 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.filestore.v1beta1.samples; + +// [START file_v1beta1_generated_CloudFilestoreManager_GetShare_String_sync] +import com.google.cloud.filestore.v1beta1.CloudFilestoreManagerClient; +import com.google.cloud.filestore.v1beta1.Share; +import com.google.cloud.filestore.v1beta1.ShareName; + +public class SyncGetShareString { + + public static void main(String[] args) throws Exception { + syncGetShareString(); + } + + public static void syncGetShareString() throws Exception { + // 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 (CloudFilestoreManagerClient cloudFilestoreManagerClient = + CloudFilestoreManagerClient.create()) { + String name = ShareName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]", "[SHARE]").toString(); + Share response = cloudFilestoreManagerClient.getShare(name); + } + } +} +// [END file_v1beta1_generated_CloudFilestoreManager_GetShare_String_sync] diff --git a/java-filestore/samples/snippets/generated/com/google/cloud/filestore/v1beta1/cloudfilestoremanager/getsnapshot/AsyncGetSnapshot.java b/java-filestore/samples/snippets/generated/com/google/cloud/filestore/v1beta1/cloudfilestoremanager/getsnapshot/AsyncGetSnapshot.java new file mode 100644 index 000000000000..ddbb51b55ba5 --- /dev/null +++ b/java-filestore/samples/snippets/generated/com/google/cloud/filestore/v1beta1/cloudfilestoremanager/getsnapshot/AsyncGetSnapshot.java @@ -0,0 +1,52 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.filestore.v1beta1.samples; + +// [START file_v1beta1_generated_CloudFilestoreManager_GetSnapshot_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.filestore.v1beta1.CloudFilestoreManagerClient; +import com.google.cloud.filestore.v1beta1.GetSnapshotRequest; +import com.google.cloud.filestore.v1beta1.Snapshot; +import com.google.cloud.filestore.v1beta1.SnapshotName; + +public class AsyncGetSnapshot { + + public static void main(String[] args) throws Exception { + asyncGetSnapshot(); + } + + public static void asyncGetSnapshot() throws Exception { + // 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 (CloudFilestoreManagerClient cloudFilestoreManagerClient = + CloudFilestoreManagerClient.create()) { + GetSnapshotRequest request = + GetSnapshotRequest.newBuilder() + .setName( + SnapshotName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]", "[SNAPSHOT]").toString()) + .build(); + ApiFuture future = + cloudFilestoreManagerClient.getSnapshotCallable().futureCall(request); + // Do something. + Snapshot response = future.get(); + } + } +} +// [END file_v1beta1_generated_CloudFilestoreManager_GetSnapshot_async] diff --git a/java-filestore/samples/snippets/generated/com/google/cloud/filestore/v1beta1/cloudfilestoremanager/getsnapshot/SyncGetSnapshot.java b/java-filestore/samples/snippets/generated/com/google/cloud/filestore/v1beta1/cloudfilestoremanager/getsnapshot/SyncGetSnapshot.java new file mode 100644 index 000000000000..6e272616bb1c --- /dev/null +++ b/java-filestore/samples/snippets/generated/com/google/cloud/filestore/v1beta1/cloudfilestoremanager/getsnapshot/SyncGetSnapshot.java @@ -0,0 +1,48 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.filestore.v1beta1.samples; + +// [START file_v1beta1_generated_CloudFilestoreManager_GetSnapshot_sync] +import com.google.cloud.filestore.v1beta1.CloudFilestoreManagerClient; +import com.google.cloud.filestore.v1beta1.GetSnapshotRequest; +import com.google.cloud.filestore.v1beta1.Snapshot; +import com.google.cloud.filestore.v1beta1.SnapshotName; + +public class SyncGetSnapshot { + + public static void main(String[] args) throws Exception { + syncGetSnapshot(); + } + + public static void syncGetSnapshot() throws Exception { + // 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 (CloudFilestoreManagerClient cloudFilestoreManagerClient = + CloudFilestoreManagerClient.create()) { + GetSnapshotRequest request = + GetSnapshotRequest.newBuilder() + .setName( + SnapshotName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]", "[SNAPSHOT]").toString()) + .build(); + Snapshot response = cloudFilestoreManagerClient.getSnapshot(request); + } + } +} +// [END file_v1beta1_generated_CloudFilestoreManager_GetSnapshot_sync] diff --git a/java-filestore/samples/snippets/generated/com/google/cloud/filestore/v1beta1/cloudfilestoremanager/getsnapshot/SyncGetSnapshotSnapshotname.java b/java-filestore/samples/snippets/generated/com/google/cloud/filestore/v1beta1/cloudfilestoremanager/getsnapshot/SyncGetSnapshotSnapshotname.java new file mode 100644 index 000000000000..fa8bacb22fb1 --- /dev/null +++ b/java-filestore/samples/snippets/generated/com/google/cloud/filestore/v1beta1/cloudfilestoremanager/getsnapshot/SyncGetSnapshotSnapshotname.java @@ -0,0 +1,43 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.filestore.v1beta1.samples; + +// [START file_v1beta1_generated_CloudFilestoreManager_GetSnapshot_Snapshotname_sync] +import com.google.cloud.filestore.v1beta1.CloudFilestoreManagerClient; +import com.google.cloud.filestore.v1beta1.Snapshot; +import com.google.cloud.filestore.v1beta1.SnapshotName; + +public class SyncGetSnapshotSnapshotname { + + public static void main(String[] args) throws Exception { + syncGetSnapshotSnapshotname(); + } + + public static void syncGetSnapshotSnapshotname() throws Exception { + // 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 (CloudFilestoreManagerClient cloudFilestoreManagerClient = + CloudFilestoreManagerClient.create()) { + SnapshotName name = SnapshotName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]", "[SNAPSHOT]"); + Snapshot response = cloudFilestoreManagerClient.getSnapshot(name); + } + } +} +// [END file_v1beta1_generated_CloudFilestoreManager_GetSnapshot_Snapshotname_sync] diff --git a/java-filestore/samples/snippets/generated/com/google/cloud/filestore/v1beta1/cloudfilestoremanager/getsnapshot/SyncGetSnapshotString.java b/java-filestore/samples/snippets/generated/com/google/cloud/filestore/v1beta1/cloudfilestoremanager/getsnapshot/SyncGetSnapshotString.java new file mode 100644 index 000000000000..5427d856564c --- /dev/null +++ b/java-filestore/samples/snippets/generated/com/google/cloud/filestore/v1beta1/cloudfilestoremanager/getsnapshot/SyncGetSnapshotString.java @@ -0,0 +1,44 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.filestore.v1beta1.samples; + +// [START file_v1beta1_generated_CloudFilestoreManager_GetSnapshot_String_sync] +import com.google.cloud.filestore.v1beta1.CloudFilestoreManagerClient; +import com.google.cloud.filestore.v1beta1.Snapshot; +import com.google.cloud.filestore.v1beta1.SnapshotName; + +public class SyncGetSnapshotString { + + public static void main(String[] args) throws Exception { + syncGetSnapshotString(); + } + + public static void syncGetSnapshotString() throws Exception { + // 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 (CloudFilestoreManagerClient cloudFilestoreManagerClient = + CloudFilestoreManagerClient.create()) { + String name = + SnapshotName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]", "[SNAPSHOT]").toString(); + Snapshot response = cloudFilestoreManagerClient.getSnapshot(name); + } + } +} +// [END file_v1beta1_generated_CloudFilestoreManager_GetSnapshot_String_sync] diff --git a/java-filestore/samples/snippets/generated/com/google/cloud/filestore/v1beta1/cloudfilestoremanager/listshares/AsyncListShares.java b/java-filestore/samples/snippets/generated/com/google/cloud/filestore/v1beta1/cloudfilestoremanager/listshares/AsyncListShares.java new file mode 100644 index 000000000000..8c2b69480469 --- /dev/null +++ b/java-filestore/samples/snippets/generated/com/google/cloud/filestore/v1beta1/cloudfilestoremanager/listshares/AsyncListShares.java @@ -0,0 +1,57 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.filestore.v1beta1.samples; + +// [START file_v1beta1_generated_CloudFilestoreManager_ListShares_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.filestore.v1beta1.CloudFilestoreManagerClient; +import com.google.cloud.filestore.v1beta1.InstanceName; +import com.google.cloud.filestore.v1beta1.ListSharesRequest; +import com.google.cloud.filestore.v1beta1.Share; + +public class AsyncListShares { + + public static void main(String[] args) throws Exception { + asyncListShares(); + } + + public static void asyncListShares() throws Exception { + // 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 (CloudFilestoreManagerClient cloudFilestoreManagerClient = + CloudFilestoreManagerClient.create()) { + ListSharesRequest request = + ListSharesRequest.newBuilder() + .setParent(InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .setOrderBy("orderBy-1207110587") + .setFilter("filter-1274492040") + .build(); + ApiFuture future = + cloudFilestoreManagerClient.listSharesPagedCallable().futureCall(request); + // Do something. + for (Share element : future.get().iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END file_v1beta1_generated_CloudFilestoreManager_ListShares_async] diff --git a/java-filestore/samples/snippets/generated/com/google/cloud/filestore/v1beta1/cloudfilestoremanager/listshares/AsyncListSharesPaged.java b/java-filestore/samples/snippets/generated/com/google/cloud/filestore/v1beta1/cloudfilestoremanager/listshares/AsyncListSharesPaged.java new file mode 100644 index 000000000000..85bdcabe5c08 --- /dev/null +++ b/java-filestore/samples/snippets/generated/com/google/cloud/filestore/v1beta1/cloudfilestoremanager/listshares/AsyncListSharesPaged.java @@ -0,0 +1,65 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.filestore.v1beta1.samples; + +// [START file_v1beta1_generated_CloudFilestoreManager_ListShares_Paged_async] +import com.google.cloud.filestore.v1beta1.CloudFilestoreManagerClient; +import com.google.cloud.filestore.v1beta1.InstanceName; +import com.google.cloud.filestore.v1beta1.ListSharesRequest; +import com.google.cloud.filestore.v1beta1.ListSharesResponse; +import com.google.cloud.filestore.v1beta1.Share; +import com.google.common.base.Strings; + +public class AsyncListSharesPaged { + + public static void main(String[] args) throws Exception { + asyncListSharesPaged(); + } + + public static void asyncListSharesPaged() throws Exception { + // 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 (CloudFilestoreManagerClient cloudFilestoreManagerClient = + CloudFilestoreManagerClient.create()) { + ListSharesRequest request = + ListSharesRequest.newBuilder() + .setParent(InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .setOrderBy("orderBy-1207110587") + .setFilter("filter-1274492040") + .build(); + while (true) { + ListSharesResponse response = + cloudFilestoreManagerClient.listSharesCallable().call(request); + for (Share element : response.getSharesList()) { + // doThingsWith(element); + } + String nextPageToken = response.getNextPageToken(); + if (!Strings.isNullOrEmpty(nextPageToken)) { + request = request.toBuilder().setPageToken(nextPageToken).build(); + } else { + break; + } + } + } + } +} +// [END file_v1beta1_generated_CloudFilestoreManager_ListShares_Paged_async] diff --git a/java-filestore/samples/snippets/generated/com/google/cloud/filestore/v1beta1/cloudfilestoremanager/listshares/SyncListShares.java b/java-filestore/samples/snippets/generated/com/google/cloud/filestore/v1beta1/cloudfilestoremanager/listshares/SyncListShares.java new file mode 100644 index 000000000000..e43e36f65243 --- /dev/null +++ b/java-filestore/samples/snippets/generated/com/google/cloud/filestore/v1beta1/cloudfilestoremanager/listshares/SyncListShares.java @@ -0,0 +1,53 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.filestore.v1beta1.samples; + +// [START file_v1beta1_generated_CloudFilestoreManager_ListShares_sync] +import com.google.cloud.filestore.v1beta1.CloudFilestoreManagerClient; +import com.google.cloud.filestore.v1beta1.InstanceName; +import com.google.cloud.filestore.v1beta1.ListSharesRequest; +import com.google.cloud.filestore.v1beta1.Share; + +public class SyncListShares { + + public static void main(String[] args) throws Exception { + syncListShares(); + } + + public static void syncListShares() throws Exception { + // 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 (CloudFilestoreManagerClient cloudFilestoreManagerClient = + CloudFilestoreManagerClient.create()) { + ListSharesRequest request = + ListSharesRequest.newBuilder() + .setParent(InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .setOrderBy("orderBy-1207110587") + .setFilter("filter-1274492040") + .build(); + for (Share element : cloudFilestoreManagerClient.listShares(request).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END file_v1beta1_generated_CloudFilestoreManager_ListShares_sync] diff --git a/java-filestore/samples/snippets/generated/com/google/cloud/filestore/v1beta1/cloudfilestoremanager/listshares/SyncListSharesInstancename.java b/java-filestore/samples/snippets/generated/com/google/cloud/filestore/v1beta1/cloudfilestoremanager/listshares/SyncListSharesInstancename.java new file mode 100644 index 000000000000..8af882feca79 --- /dev/null +++ b/java-filestore/samples/snippets/generated/com/google/cloud/filestore/v1beta1/cloudfilestoremanager/listshares/SyncListSharesInstancename.java @@ -0,0 +1,45 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.filestore.v1beta1.samples; + +// [START file_v1beta1_generated_CloudFilestoreManager_ListShares_Instancename_sync] +import com.google.cloud.filestore.v1beta1.CloudFilestoreManagerClient; +import com.google.cloud.filestore.v1beta1.InstanceName; +import com.google.cloud.filestore.v1beta1.Share; + +public class SyncListSharesInstancename { + + public static void main(String[] args) throws Exception { + syncListSharesInstancename(); + } + + public static void syncListSharesInstancename() throws Exception { + // 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 (CloudFilestoreManagerClient cloudFilestoreManagerClient = + CloudFilestoreManagerClient.create()) { + InstanceName parent = InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]"); + for (Share element : cloudFilestoreManagerClient.listShares(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END file_v1beta1_generated_CloudFilestoreManager_ListShares_Instancename_sync] diff --git a/java-filestore/samples/snippets/generated/com/google/cloud/filestore/v1beta1/cloudfilestoremanager/listshares/SyncListSharesString.java b/java-filestore/samples/snippets/generated/com/google/cloud/filestore/v1beta1/cloudfilestoremanager/listshares/SyncListSharesString.java new file mode 100644 index 000000000000..73014024d1f7 --- /dev/null +++ b/java-filestore/samples/snippets/generated/com/google/cloud/filestore/v1beta1/cloudfilestoremanager/listshares/SyncListSharesString.java @@ -0,0 +1,45 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.filestore.v1beta1.samples; + +// [START file_v1beta1_generated_CloudFilestoreManager_ListShares_String_sync] +import com.google.cloud.filestore.v1beta1.CloudFilestoreManagerClient; +import com.google.cloud.filestore.v1beta1.InstanceName; +import com.google.cloud.filestore.v1beta1.Share; + +public class SyncListSharesString { + + public static void main(String[] args) throws Exception { + syncListSharesString(); + } + + public static void syncListSharesString() throws Exception { + // 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 (CloudFilestoreManagerClient cloudFilestoreManagerClient = + CloudFilestoreManagerClient.create()) { + String parent = InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString(); + for (Share element : cloudFilestoreManagerClient.listShares(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END file_v1beta1_generated_CloudFilestoreManager_ListShares_String_sync] diff --git a/java-filestore/samples/snippets/generated/com/google/cloud/filestore/v1beta1/cloudfilestoremanager/listsnapshots/AsyncListSnapshots.java b/java-filestore/samples/snippets/generated/com/google/cloud/filestore/v1beta1/cloudfilestoremanager/listsnapshots/AsyncListSnapshots.java new file mode 100644 index 000000000000..6b9250c5b567 --- /dev/null +++ b/java-filestore/samples/snippets/generated/com/google/cloud/filestore/v1beta1/cloudfilestoremanager/listsnapshots/AsyncListSnapshots.java @@ -0,0 +1,57 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.filestore.v1beta1.samples; + +// [START file_v1beta1_generated_CloudFilestoreManager_ListSnapshots_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.filestore.v1beta1.CloudFilestoreManagerClient; +import com.google.cloud.filestore.v1beta1.InstanceName; +import com.google.cloud.filestore.v1beta1.ListSnapshotsRequest; +import com.google.cloud.filestore.v1beta1.Snapshot; + +public class AsyncListSnapshots { + + public static void main(String[] args) throws Exception { + asyncListSnapshots(); + } + + public static void asyncListSnapshots() throws Exception { + // 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 (CloudFilestoreManagerClient cloudFilestoreManagerClient = + CloudFilestoreManagerClient.create()) { + ListSnapshotsRequest request = + ListSnapshotsRequest.newBuilder() + .setParent(InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .setOrderBy("orderBy-1207110587") + .setFilter("filter-1274492040") + .build(); + ApiFuture future = + cloudFilestoreManagerClient.listSnapshotsPagedCallable().futureCall(request); + // Do something. + for (Snapshot element : future.get().iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END file_v1beta1_generated_CloudFilestoreManager_ListSnapshots_async] diff --git a/java-filestore/samples/snippets/generated/com/google/cloud/filestore/v1beta1/cloudfilestoremanager/listsnapshots/AsyncListSnapshotsPaged.java b/java-filestore/samples/snippets/generated/com/google/cloud/filestore/v1beta1/cloudfilestoremanager/listsnapshots/AsyncListSnapshotsPaged.java new file mode 100644 index 000000000000..eefd08c7d51f --- /dev/null +++ b/java-filestore/samples/snippets/generated/com/google/cloud/filestore/v1beta1/cloudfilestoremanager/listsnapshots/AsyncListSnapshotsPaged.java @@ -0,0 +1,65 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.filestore.v1beta1.samples; + +// [START file_v1beta1_generated_CloudFilestoreManager_ListSnapshots_Paged_async] +import com.google.cloud.filestore.v1beta1.CloudFilestoreManagerClient; +import com.google.cloud.filestore.v1beta1.InstanceName; +import com.google.cloud.filestore.v1beta1.ListSnapshotsRequest; +import com.google.cloud.filestore.v1beta1.ListSnapshotsResponse; +import com.google.cloud.filestore.v1beta1.Snapshot; +import com.google.common.base.Strings; + +public class AsyncListSnapshotsPaged { + + public static void main(String[] args) throws Exception { + asyncListSnapshotsPaged(); + } + + public static void asyncListSnapshotsPaged() throws Exception { + // 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 (CloudFilestoreManagerClient cloudFilestoreManagerClient = + CloudFilestoreManagerClient.create()) { + ListSnapshotsRequest request = + ListSnapshotsRequest.newBuilder() + .setParent(InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .setOrderBy("orderBy-1207110587") + .setFilter("filter-1274492040") + .build(); + while (true) { + ListSnapshotsResponse response = + cloudFilestoreManagerClient.listSnapshotsCallable().call(request); + for (Snapshot element : response.getSnapshotsList()) { + // doThingsWith(element); + } + String nextPageToken = response.getNextPageToken(); + if (!Strings.isNullOrEmpty(nextPageToken)) { + request = request.toBuilder().setPageToken(nextPageToken).build(); + } else { + break; + } + } + } + } +} +// [END file_v1beta1_generated_CloudFilestoreManager_ListSnapshots_Paged_async] diff --git a/java-filestore/samples/snippets/generated/com/google/cloud/filestore/v1beta1/cloudfilestoremanager/listsnapshots/SyncListSnapshots.java b/java-filestore/samples/snippets/generated/com/google/cloud/filestore/v1beta1/cloudfilestoremanager/listsnapshots/SyncListSnapshots.java new file mode 100644 index 000000000000..a7d58c23e39a --- /dev/null +++ b/java-filestore/samples/snippets/generated/com/google/cloud/filestore/v1beta1/cloudfilestoremanager/listsnapshots/SyncListSnapshots.java @@ -0,0 +1,53 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.filestore.v1beta1.samples; + +// [START file_v1beta1_generated_CloudFilestoreManager_ListSnapshots_sync] +import com.google.cloud.filestore.v1beta1.CloudFilestoreManagerClient; +import com.google.cloud.filestore.v1beta1.InstanceName; +import com.google.cloud.filestore.v1beta1.ListSnapshotsRequest; +import com.google.cloud.filestore.v1beta1.Snapshot; + +public class SyncListSnapshots { + + public static void main(String[] args) throws Exception { + syncListSnapshots(); + } + + public static void syncListSnapshots() throws Exception { + // 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 (CloudFilestoreManagerClient cloudFilestoreManagerClient = + CloudFilestoreManagerClient.create()) { + ListSnapshotsRequest request = + ListSnapshotsRequest.newBuilder() + .setParent(InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .setOrderBy("orderBy-1207110587") + .setFilter("filter-1274492040") + .build(); + for (Snapshot element : cloudFilestoreManagerClient.listSnapshots(request).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END file_v1beta1_generated_CloudFilestoreManager_ListSnapshots_sync] diff --git a/java-filestore/samples/snippets/generated/com/google/cloud/filestore/v1beta1/cloudfilestoremanager/listsnapshots/SyncListSnapshotsInstancename.java b/java-filestore/samples/snippets/generated/com/google/cloud/filestore/v1beta1/cloudfilestoremanager/listsnapshots/SyncListSnapshotsInstancename.java new file mode 100644 index 000000000000..35c14ea538ce --- /dev/null +++ b/java-filestore/samples/snippets/generated/com/google/cloud/filestore/v1beta1/cloudfilestoremanager/listsnapshots/SyncListSnapshotsInstancename.java @@ -0,0 +1,45 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.filestore.v1beta1.samples; + +// [START file_v1beta1_generated_CloudFilestoreManager_ListSnapshots_Instancename_sync] +import com.google.cloud.filestore.v1beta1.CloudFilestoreManagerClient; +import com.google.cloud.filestore.v1beta1.InstanceName; +import com.google.cloud.filestore.v1beta1.Snapshot; + +public class SyncListSnapshotsInstancename { + + public static void main(String[] args) throws Exception { + syncListSnapshotsInstancename(); + } + + public static void syncListSnapshotsInstancename() throws Exception { + // 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 (CloudFilestoreManagerClient cloudFilestoreManagerClient = + CloudFilestoreManagerClient.create()) { + InstanceName parent = InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]"); + for (Snapshot element : cloudFilestoreManagerClient.listSnapshots(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END file_v1beta1_generated_CloudFilestoreManager_ListSnapshots_Instancename_sync] diff --git a/java-filestore/samples/snippets/generated/com/google/cloud/filestore/v1beta1/cloudfilestoremanager/listsnapshots/SyncListSnapshotsString.java b/java-filestore/samples/snippets/generated/com/google/cloud/filestore/v1beta1/cloudfilestoremanager/listsnapshots/SyncListSnapshotsString.java new file mode 100644 index 000000000000..126232d512f9 --- /dev/null +++ b/java-filestore/samples/snippets/generated/com/google/cloud/filestore/v1beta1/cloudfilestoremanager/listsnapshots/SyncListSnapshotsString.java @@ -0,0 +1,45 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.filestore.v1beta1.samples; + +// [START file_v1beta1_generated_CloudFilestoreManager_ListSnapshots_String_sync] +import com.google.cloud.filestore.v1beta1.CloudFilestoreManagerClient; +import com.google.cloud.filestore.v1beta1.InstanceName; +import com.google.cloud.filestore.v1beta1.Snapshot; + +public class SyncListSnapshotsString { + + public static void main(String[] args) throws Exception { + syncListSnapshotsString(); + } + + public static void syncListSnapshotsString() throws Exception { + // 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 (CloudFilestoreManagerClient cloudFilestoreManagerClient = + CloudFilestoreManagerClient.create()) { + String parent = InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString(); + for (Snapshot element : cloudFilestoreManagerClient.listSnapshots(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END file_v1beta1_generated_CloudFilestoreManager_ListSnapshots_String_sync] diff --git a/java-filestore/samples/snippets/generated/com/google/cloud/filestore/v1beta1/cloudfilestoremanager/revertinstance/AsyncRevertInstance.java b/java-filestore/samples/snippets/generated/com/google/cloud/filestore/v1beta1/cloudfilestoremanager/revertinstance/AsyncRevertInstance.java new file mode 100644 index 000000000000..32129b57f3a6 --- /dev/null +++ b/java-filestore/samples/snippets/generated/com/google/cloud/filestore/v1beta1/cloudfilestoremanager/revertinstance/AsyncRevertInstance.java @@ -0,0 +1,52 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.filestore.v1beta1.samples; + +// [START file_v1beta1_generated_CloudFilestoreManager_RevertInstance_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.filestore.v1beta1.CloudFilestoreManagerClient; +import com.google.cloud.filestore.v1beta1.InstanceName; +import com.google.cloud.filestore.v1beta1.RevertInstanceRequest; +import com.google.longrunning.Operation; + +public class AsyncRevertInstance { + + public static void main(String[] args) throws Exception { + asyncRevertInstance(); + } + + public static void asyncRevertInstance() throws Exception { + // 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 (CloudFilestoreManagerClient cloudFilestoreManagerClient = + CloudFilestoreManagerClient.create()) { + RevertInstanceRequest request = + RevertInstanceRequest.newBuilder() + .setName(InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString()) + .setTargetSnapshotId("targetSnapshotId-2099459472") + .build(); + ApiFuture future = + cloudFilestoreManagerClient.revertInstanceCallable().futureCall(request); + // Do something. + Operation response = future.get(); + } + } +} +// [END file_v1beta1_generated_CloudFilestoreManager_RevertInstance_async] diff --git a/java-filestore/samples/snippets/generated/com/google/cloud/filestore/v1beta1/cloudfilestoremanager/revertinstance/AsyncRevertInstanceLRO.java b/java-filestore/samples/snippets/generated/com/google/cloud/filestore/v1beta1/cloudfilestoremanager/revertinstance/AsyncRevertInstanceLRO.java new file mode 100644 index 000000000000..2ff04350485f --- /dev/null +++ b/java-filestore/samples/snippets/generated/com/google/cloud/filestore/v1beta1/cloudfilestoremanager/revertinstance/AsyncRevertInstanceLRO.java @@ -0,0 +1,53 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.filestore.v1beta1.samples; + +// [START file_v1beta1_generated_CloudFilestoreManager_RevertInstance_LRO_async] +import com.google.api.gax.longrunning.OperationFuture; +import com.google.cloud.common.OperationMetadata; +import com.google.cloud.filestore.v1beta1.CloudFilestoreManagerClient; +import com.google.cloud.filestore.v1beta1.Instance; +import com.google.cloud.filestore.v1beta1.InstanceName; +import com.google.cloud.filestore.v1beta1.RevertInstanceRequest; + +public class AsyncRevertInstanceLRO { + + public static void main(String[] args) throws Exception { + asyncRevertInstanceLRO(); + } + + public static void asyncRevertInstanceLRO() throws Exception { + // 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 (CloudFilestoreManagerClient cloudFilestoreManagerClient = + CloudFilestoreManagerClient.create()) { + RevertInstanceRequest request = + RevertInstanceRequest.newBuilder() + .setName(InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString()) + .setTargetSnapshotId("targetSnapshotId-2099459472") + .build(); + OperationFuture future = + cloudFilestoreManagerClient.revertInstanceOperationCallable().futureCall(request); + // Do something. + Instance response = future.get(); + } + } +} +// [END file_v1beta1_generated_CloudFilestoreManager_RevertInstance_LRO_async] diff --git a/java-filestore/samples/snippets/generated/com/google/cloud/filestore/v1beta1/cloudfilestoremanager/revertinstance/SyncRevertInstance.java b/java-filestore/samples/snippets/generated/com/google/cloud/filestore/v1beta1/cloudfilestoremanager/revertinstance/SyncRevertInstance.java new file mode 100644 index 000000000000..7caff794ed04 --- /dev/null +++ b/java-filestore/samples/snippets/generated/com/google/cloud/filestore/v1beta1/cloudfilestoremanager/revertinstance/SyncRevertInstance.java @@ -0,0 +1,48 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.filestore.v1beta1.samples; + +// [START file_v1beta1_generated_CloudFilestoreManager_RevertInstance_sync] +import com.google.cloud.filestore.v1beta1.CloudFilestoreManagerClient; +import com.google.cloud.filestore.v1beta1.Instance; +import com.google.cloud.filestore.v1beta1.InstanceName; +import com.google.cloud.filestore.v1beta1.RevertInstanceRequest; + +public class SyncRevertInstance { + + public static void main(String[] args) throws Exception { + syncRevertInstance(); + } + + public static void syncRevertInstance() throws Exception { + // 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 (CloudFilestoreManagerClient cloudFilestoreManagerClient = + CloudFilestoreManagerClient.create()) { + RevertInstanceRequest request = + RevertInstanceRequest.newBuilder() + .setName(InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString()) + .setTargetSnapshotId("targetSnapshotId-2099459472") + .build(); + Instance response = cloudFilestoreManagerClient.revertInstanceAsync(request).get(); + } + } +} +// [END file_v1beta1_generated_CloudFilestoreManager_RevertInstance_sync] diff --git a/java-filestore/samples/snippets/generated/com/google/cloud/filestore/v1beta1/cloudfilestoremanager/updateshare/AsyncUpdateShare.java b/java-filestore/samples/snippets/generated/com/google/cloud/filestore/v1beta1/cloudfilestoremanager/updateshare/AsyncUpdateShare.java new file mode 100644 index 000000000000..c3b8d827d376 --- /dev/null +++ b/java-filestore/samples/snippets/generated/com/google/cloud/filestore/v1beta1/cloudfilestoremanager/updateshare/AsyncUpdateShare.java @@ -0,0 +1,53 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.filestore.v1beta1.samples; + +// [START file_v1beta1_generated_CloudFilestoreManager_UpdateShare_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.filestore.v1beta1.CloudFilestoreManagerClient; +import com.google.cloud.filestore.v1beta1.Share; +import com.google.cloud.filestore.v1beta1.UpdateShareRequest; +import com.google.longrunning.Operation; +import com.google.protobuf.FieldMask; + +public class AsyncUpdateShare { + + public static void main(String[] args) throws Exception { + asyncUpdateShare(); + } + + public static void asyncUpdateShare() throws Exception { + // 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 (CloudFilestoreManagerClient cloudFilestoreManagerClient = + CloudFilestoreManagerClient.create()) { + UpdateShareRequest request = + UpdateShareRequest.newBuilder() + .setShare(Share.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + ApiFuture future = + cloudFilestoreManagerClient.updateShareCallable().futureCall(request); + // Do something. + Operation response = future.get(); + } + } +} +// [END file_v1beta1_generated_CloudFilestoreManager_UpdateShare_async] diff --git a/java-filestore/samples/snippets/generated/com/google/cloud/filestore/v1beta1/cloudfilestoremanager/updateshare/AsyncUpdateShareLRO.java b/java-filestore/samples/snippets/generated/com/google/cloud/filestore/v1beta1/cloudfilestoremanager/updateshare/AsyncUpdateShareLRO.java new file mode 100644 index 000000000000..0b7f4d8b0a56 --- /dev/null +++ b/java-filestore/samples/snippets/generated/com/google/cloud/filestore/v1beta1/cloudfilestoremanager/updateshare/AsyncUpdateShareLRO.java @@ -0,0 +1,53 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.filestore.v1beta1.samples; + +// [START file_v1beta1_generated_CloudFilestoreManager_UpdateShare_LRO_async] +import com.google.api.gax.longrunning.OperationFuture; +import com.google.cloud.common.OperationMetadata; +import com.google.cloud.filestore.v1beta1.CloudFilestoreManagerClient; +import com.google.cloud.filestore.v1beta1.Share; +import com.google.cloud.filestore.v1beta1.UpdateShareRequest; +import com.google.protobuf.FieldMask; + +public class AsyncUpdateShareLRO { + + public static void main(String[] args) throws Exception { + asyncUpdateShareLRO(); + } + + public static void asyncUpdateShareLRO() throws Exception { + // 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 (CloudFilestoreManagerClient cloudFilestoreManagerClient = + CloudFilestoreManagerClient.create()) { + UpdateShareRequest request = + UpdateShareRequest.newBuilder() + .setShare(Share.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + OperationFuture future = + cloudFilestoreManagerClient.updateShareOperationCallable().futureCall(request); + // Do something. + Share response = future.get(); + } + } +} +// [END file_v1beta1_generated_CloudFilestoreManager_UpdateShare_LRO_async] diff --git a/java-filestore/samples/snippets/generated/com/google/cloud/filestore/v1beta1/cloudfilestoremanager/updateshare/SyncUpdateShare.java b/java-filestore/samples/snippets/generated/com/google/cloud/filestore/v1beta1/cloudfilestoremanager/updateshare/SyncUpdateShare.java new file mode 100644 index 000000000000..50280a11ab94 --- /dev/null +++ b/java-filestore/samples/snippets/generated/com/google/cloud/filestore/v1beta1/cloudfilestoremanager/updateshare/SyncUpdateShare.java @@ -0,0 +1,48 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.filestore.v1beta1.samples; + +// [START file_v1beta1_generated_CloudFilestoreManager_UpdateShare_sync] +import com.google.cloud.filestore.v1beta1.CloudFilestoreManagerClient; +import com.google.cloud.filestore.v1beta1.Share; +import com.google.cloud.filestore.v1beta1.UpdateShareRequest; +import com.google.protobuf.FieldMask; + +public class SyncUpdateShare { + + public static void main(String[] args) throws Exception { + syncUpdateShare(); + } + + public static void syncUpdateShare() throws Exception { + // 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 (CloudFilestoreManagerClient cloudFilestoreManagerClient = + CloudFilestoreManagerClient.create()) { + UpdateShareRequest request = + UpdateShareRequest.newBuilder() + .setShare(Share.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + Share response = cloudFilestoreManagerClient.updateShareAsync(request).get(); + } + } +} +// [END file_v1beta1_generated_CloudFilestoreManager_UpdateShare_sync] diff --git a/java-filestore/samples/snippets/generated/com/google/cloud/filestore/v1beta1/cloudfilestoremanager/updateshare/SyncUpdateShareShareFieldmask.java b/java-filestore/samples/snippets/generated/com/google/cloud/filestore/v1beta1/cloudfilestoremanager/updateshare/SyncUpdateShareShareFieldmask.java new file mode 100644 index 000000000000..90e84eba75d7 --- /dev/null +++ b/java-filestore/samples/snippets/generated/com/google/cloud/filestore/v1beta1/cloudfilestoremanager/updateshare/SyncUpdateShareShareFieldmask.java @@ -0,0 +1,44 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.filestore.v1beta1.samples; + +// [START file_v1beta1_generated_CloudFilestoreManager_UpdateShare_ShareFieldmask_sync] +import com.google.cloud.filestore.v1beta1.CloudFilestoreManagerClient; +import com.google.cloud.filestore.v1beta1.Share; +import com.google.protobuf.FieldMask; + +public class SyncUpdateShareShareFieldmask { + + public static void main(String[] args) throws Exception { + syncUpdateShareShareFieldmask(); + } + + public static void syncUpdateShareShareFieldmask() throws Exception { + // 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 (CloudFilestoreManagerClient cloudFilestoreManagerClient = + CloudFilestoreManagerClient.create()) { + Share share = Share.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + Share response = cloudFilestoreManagerClient.updateShareAsync(share, updateMask).get(); + } + } +} +// [END file_v1beta1_generated_CloudFilestoreManager_UpdateShare_ShareFieldmask_sync] diff --git a/java-filestore/samples/snippets/generated/com/google/cloud/filestore/v1beta1/cloudfilestoremanager/updatesnapshot/AsyncUpdateSnapshot.java b/java-filestore/samples/snippets/generated/com/google/cloud/filestore/v1beta1/cloudfilestoremanager/updatesnapshot/AsyncUpdateSnapshot.java new file mode 100644 index 000000000000..cf59de062098 --- /dev/null +++ b/java-filestore/samples/snippets/generated/com/google/cloud/filestore/v1beta1/cloudfilestoremanager/updatesnapshot/AsyncUpdateSnapshot.java @@ -0,0 +1,53 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.filestore.v1beta1.samples; + +// [START file_v1beta1_generated_CloudFilestoreManager_UpdateSnapshot_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.filestore.v1beta1.CloudFilestoreManagerClient; +import com.google.cloud.filestore.v1beta1.Snapshot; +import com.google.cloud.filestore.v1beta1.UpdateSnapshotRequest; +import com.google.longrunning.Operation; +import com.google.protobuf.FieldMask; + +public class AsyncUpdateSnapshot { + + public static void main(String[] args) throws Exception { + asyncUpdateSnapshot(); + } + + public static void asyncUpdateSnapshot() throws Exception { + // 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 (CloudFilestoreManagerClient cloudFilestoreManagerClient = + CloudFilestoreManagerClient.create()) { + UpdateSnapshotRequest request = + UpdateSnapshotRequest.newBuilder() + .setUpdateMask(FieldMask.newBuilder().build()) + .setSnapshot(Snapshot.newBuilder().build()) + .build(); + ApiFuture future = + cloudFilestoreManagerClient.updateSnapshotCallable().futureCall(request); + // Do something. + Operation response = future.get(); + } + } +} +// [END file_v1beta1_generated_CloudFilestoreManager_UpdateSnapshot_async] diff --git a/java-filestore/samples/snippets/generated/com/google/cloud/filestore/v1beta1/cloudfilestoremanager/updatesnapshot/AsyncUpdateSnapshotLRO.java b/java-filestore/samples/snippets/generated/com/google/cloud/filestore/v1beta1/cloudfilestoremanager/updatesnapshot/AsyncUpdateSnapshotLRO.java new file mode 100644 index 000000000000..d6333b076c0e --- /dev/null +++ b/java-filestore/samples/snippets/generated/com/google/cloud/filestore/v1beta1/cloudfilestoremanager/updatesnapshot/AsyncUpdateSnapshotLRO.java @@ -0,0 +1,53 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.filestore.v1beta1.samples; + +// [START file_v1beta1_generated_CloudFilestoreManager_UpdateSnapshot_LRO_async] +import com.google.api.gax.longrunning.OperationFuture; +import com.google.cloud.common.OperationMetadata; +import com.google.cloud.filestore.v1beta1.CloudFilestoreManagerClient; +import com.google.cloud.filestore.v1beta1.Snapshot; +import com.google.cloud.filestore.v1beta1.UpdateSnapshotRequest; +import com.google.protobuf.FieldMask; + +public class AsyncUpdateSnapshotLRO { + + public static void main(String[] args) throws Exception { + asyncUpdateSnapshotLRO(); + } + + public static void asyncUpdateSnapshotLRO() throws Exception { + // 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 (CloudFilestoreManagerClient cloudFilestoreManagerClient = + CloudFilestoreManagerClient.create()) { + UpdateSnapshotRequest request = + UpdateSnapshotRequest.newBuilder() + .setUpdateMask(FieldMask.newBuilder().build()) + .setSnapshot(Snapshot.newBuilder().build()) + .build(); + OperationFuture future = + cloudFilestoreManagerClient.updateSnapshotOperationCallable().futureCall(request); + // Do something. + Snapshot response = future.get(); + } + } +} +// [END file_v1beta1_generated_CloudFilestoreManager_UpdateSnapshot_LRO_async] diff --git a/java-filestore/samples/snippets/generated/com/google/cloud/filestore/v1beta1/cloudfilestoremanager/updatesnapshot/SyncUpdateSnapshot.java b/java-filestore/samples/snippets/generated/com/google/cloud/filestore/v1beta1/cloudfilestoremanager/updatesnapshot/SyncUpdateSnapshot.java new file mode 100644 index 000000000000..eb9eed6104b1 --- /dev/null +++ b/java-filestore/samples/snippets/generated/com/google/cloud/filestore/v1beta1/cloudfilestoremanager/updatesnapshot/SyncUpdateSnapshot.java @@ -0,0 +1,48 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.filestore.v1beta1.samples; + +// [START file_v1beta1_generated_CloudFilestoreManager_UpdateSnapshot_sync] +import com.google.cloud.filestore.v1beta1.CloudFilestoreManagerClient; +import com.google.cloud.filestore.v1beta1.Snapshot; +import com.google.cloud.filestore.v1beta1.UpdateSnapshotRequest; +import com.google.protobuf.FieldMask; + +public class SyncUpdateSnapshot { + + public static void main(String[] args) throws Exception { + syncUpdateSnapshot(); + } + + public static void syncUpdateSnapshot() throws Exception { + // 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 (CloudFilestoreManagerClient cloudFilestoreManagerClient = + CloudFilestoreManagerClient.create()) { + UpdateSnapshotRequest request = + UpdateSnapshotRequest.newBuilder() + .setUpdateMask(FieldMask.newBuilder().build()) + .setSnapshot(Snapshot.newBuilder().build()) + .build(); + Snapshot response = cloudFilestoreManagerClient.updateSnapshotAsync(request).get(); + } + } +} +// [END file_v1beta1_generated_CloudFilestoreManager_UpdateSnapshot_sync] diff --git a/java-filestore/samples/snippets/generated/com/google/cloud/filestore/v1beta1/cloudfilestoremanager/updatesnapshot/SyncUpdateSnapshotSnapshotFieldmask.java b/java-filestore/samples/snippets/generated/com/google/cloud/filestore/v1beta1/cloudfilestoremanager/updatesnapshot/SyncUpdateSnapshotSnapshotFieldmask.java new file mode 100644 index 000000000000..5fb1021a2d50 --- /dev/null +++ b/java-filestore/samples/snippets/generated/com/google/cloud/filestore/v1beta1/cloudfilestoremanager/updatesnapshot/SyncUpdateSnapshotSnapshotFieldmask.java @@ -0,0 +1,45 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.filestore.v1beta1.samples; + +// [START file_v1beta1_generated_CloudFilestoreManager_UpdateSnapshot_SnapshotFieldmask_sync] +import com.google.cloud.filestore.v1beta1.CloudFilestoreManagerClient; +import com.google.cloud.filestore.v1beta1.Snapshot; +import com.google.protobuf.FieldMask; + +public class SyncUpdateSnapshotSnapshotFieldmask { + + public static void main(String[] args) throws Exception { + syncUpdateSnapshotSnapshotFieldmask(); + } + + public static void syncUpdateSnapshotSnapshotFieldmask() throws Exception { + // 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 (CloudFilestoreManagerClient cloudFilestoreManagerClient = + CloudFilestoreManagerClient.create()) { + Snapshot snapshot = Snapshot.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + Snapshot response = + cloudFilestoreManagerClient.updateSnapshotAsync(snapshot, updateMask).get(); + } + } +} +// [END file_v1beta1_generated_CloudFilestoreManager_UpdateSnapshot_SnapshotFieldmask_sync]