From 2fb5319166fdf4beed919286f2ebe53397b11a64 Mon Sep 17 00:00:00 2001 From: Neenu1995 Date: Thu, 24 Jun 2021 17:30:29 -0400 Subject: [PATCH] feat: initial generation --- .github/.OwlBot.lock.yaml | 3 + .github/.OwlBot.yaml | 32 + .github/CODEOWNERS | 10 + .github/ISSUE_TEMPLATE/bug_report.md | 51 + .github/ISSUE_TEMPLATE/feature_request.md | 21 + .github/ISSUE_TEMPLATE/support_request.md | 7 + .github/PULL_REQUEST_TEMPLATE.md | 7 + .github/blunderbuss.yml | 7 + .github/generated-files-bot.yml | 12 + .github/readme/synth.py | 19 + .github/release-please.yml | 3 + .github/snippet-bot.yml | 0 .github/sync-repo-settings.yaml | 49 + .github/trusted-contribution.yml | 2 + .github/workflows/approve-readme.yaml | 54 + .github/workflows/auto-release.yaml | 88 + .github/workflows/ci.yaml | 79 + .github/workflows/samples.yaml | 14 + .gitignore | 17 + .kokoro/build.bat | 3 + .kokoro/build.sh | 125 + .kokoro/coerce_logs.sh | 37 + .kokoro/common.cfg | 13 + .kokoro/common.sh | 58 + .kokoro/continuous/common.cfg | 25 + .kokoro/continuous/java8.cfg | 12 + .kokoro/continuous/readme.cfg | 55 + .kokoro/dependencies.sh | 91 + .kokoro/nightly/common.cfg | 25 + .kokoro/nightly/integration.cfg | 37 + .kokoro/nightly/java11.cfg | 7 + .kokoro/nightly/java7.cfg | 7 + .kokoro/nightly/java8-osx.cfg | 3 + .kokoro/nightly/java8-win.cfg | 3 + .kokoro/nightly/java8.cfg | 12 + .kokoro/nightly/samples.cfg | 38 + .kokoro/populate-secrets.sh | 43 + .kokoro/presubmit/clirr.cfg | 13 + .kokoro/presubmit/common.cfg | 34 + .kokoro/presubmit/dependencies.cfg | 12 + .kokoro/presubmit/integration.cfg | 33 + .kokoro/presubmit/java11.cfg | 7 + .kokoro/presubmit/java7.cfg | 7 + .kokoro/presubmit/java8-osx.cfg | 3 + .kokoro/presubmit/java8-win.cfg | 3 + .kokoro/presubmit/java8.cfg | 12 + .kokoro/presubmit/linkage-monitor.cfg | 12 + .kokoro/presubmit/lint.cfg | 13 + .kokoro/presubmit/samples.cfg | 33 + .kokoro/readme.sh | 45 + .kokoro/release/bump_snapshot.cfg | 53 + .kokoro/release/common.cfg | 49 + .kokoro/release/common.sh | 50 + .kokoro/release/drop.cfg | 6 + .kokoro/release/drop.sh | 32 + .kokoro/release/promote.cfg | 6 + .kokoro/release/promote.sh | 34 + .kokoro/release/publish_javadoc.cfg | 23 + .kokoro/release/publish_javadoc.sh | 53 + .kokoro/release/publish_javadoc11.cfg | 30 + .kokoro/release/publish_javadoc11.sh | 67 + .kokoro/release/snapshot.cfg | 6 + .kokoro/release/snapshot.sh | 33 + .kokoro/release/stage.cfg | 19 + .kokoro/release/stage.sh | 45 + .kokoro/trampoline.sh | 26 + .repo-metadata.json | 16 + CODE_OF_CONDUCT.md | 94 + CONTRIBUTING.md | 139 + LICENSE | 201 + SECURITY.md | 7 + codecov.yaml | 4 + google-cloud-filestore-bom/pom.xml | 95 + google-cloud-filestore/pom.xml | 120 + .../v1/CloudFilestoreManagerClient.java | 1754 ++++++++ .../v1/CloudFilestoreManagerSettings.java | 386 ++ .../cloud/filestore/v1/gapic_metadata.json | 51 + .../cloud/filestore/v1/package-info.java | 61 + .../v1/stub/CloudFilestoreManagerStub.java | 149 + .../CloudFilestoreManagerStubSettings.java | 996 +++++ ...cCloudFilestoreManagerCallableFactory.java | 113 + .../stub/GrpcCloudFilestoreManagerStub.java | 614 +++ .../v1beta1/CloudFilestoreManagerClient.java | 1757 ++++++++ .../CloudFilestoreManagerSettings.java | 387 ++ .../filestore/v1beta1/gapic_metadata.json | 51 + .../cloud/filestore/v1beta1/package-info.java | 61 + .../stub/CloudFilestoreManagerStub.java | 151 + .../CloudFilestoreManagerStubSettings.java | 997 +++++ ...cCloudFilestoreManagerCallableFactory.java | 115 + .../stub/GrpcCloudFilestoreManagerStub.java | 624 +++ .../v1/CloudFilestoreManagerClientTest.java | 1043 +++++ .../v1/MockCloudFilestoreManager.java | 59 + .../v1/MockCloudFilestoreManagerImpl.java | 290 ++ .../CloudFilestoreManagerClientTest.java | 1044 +++++ .../v1beta1/MockCloudFilestoreManager.java | 59 + .../MockCloudFilestoreManagerImpl.java | 290 ++ grpc-google-cloud-filestore-v1/pom.xml | 69 + .../v1/CloudFilestoreManagerGrpc.java | 1601 +++++++ grpc-google-cloud-filestore-v1beta1/pom.xml | 69 + .../v1beta1/CloudFilestoreManagerGrpc.java | 1640 +++++++ java.header | 15 + license-checks.xml | 10 + owlbot.py | 24 + pom.xml | 200 + .../clirr-ignored-differences.xml | 33 + proto-google-cloud-filestore-v1/pom.xml | 46 + .../cloud/common/OperationMetadata.java | 1846 ++++++++ .../common/OperationMetadataOrBuilder.java | 217 + .../common/OperationMetadataOuterClass.java | 88 + .../com/google/cloud/filestore/v1/Backup.java | 2942 ++++++++++++ .../google/cloud/filestore/v1/BackupName.java | 223 + .../cloud/filestore/v1/BackupOrBuilder.java | 370 ++ .../v1/CloudFilestoreServiceProto.java | 512 +++ .../filestore/v1/CreateBackupRequest.java | 1177 +++++ .../v1/CreateBackupRequestOrBuilder.java | 134 + .../filestore/v1/CreateInstanceRequest.java | 1163 +++++ .../v1/CreateInstanceRequestOrBuilder.java | 129 + .../filestore/v1/DeleteBackupRequest.java | 657 +++ .../v1/DeleteBackupRequestOrBuilder.java | 56 + .../filestore/v1/DeleteInstanceRequest.java | 657 +++ .../v1/DeleteInstanceRequestOrBuilder.java | 56 + .../cloud/filestore/v1/FileShareConfig.java | 1585 +++++++ .../v1/FileShareConfigOrBuilder.java | 166 + .../cloud/filestore/v1/GetBackupRequest.java | 655 +++ .../v1/GetBackupRequestOrBuilder.java | 56 + .../filestore/v1/GetInstanceRequest.java | 656 +++ .../v1/GetInstanceRequestOrBuilder.java | 56 + .../google/cloud/filestore/v1/Instance.java | 3927 ++++++++++++++++ .../cloud/filestore/v1/InstanceName.java | 223 + .../cloud/filestore/v1/InstanceOrBuilder.java | 430 ++ .../filestore/v1/ListBackupsRequest.java | 1318 ++++++ .../v1/ListBackupsRequestOrBuilder.java | 154 + .../filestore/v1/ListBackupsResponse.java | 1525 +++++++ .../v1/ListBackupsResponseOrBuilder.java | 179 + .../filestore/v1/ListInstancesRequest.java | 1312 ++++++ .../v1/ListInstancesRequestOrBuilder.java | 152 + .../filestore/v1/ListInstancesResponse.java | 1503 +++++++ .../v1/ListInstancesResponseOrBuilder.java | 175 + .../cloud/filestore/v1/LocationName.java | 192 + .../cloud/filestore/v1/NetworkConfig.java | 1733 ++++++++ .../filestore/v1/NetworkConfigOrBuilder.java | 222 + .../cloud/filestore/v1/NfsExportOptions.java | 1688 +++++++ .../v1/NfsExportOptionsOrBuilder.java | 194 + .../filestore/v1/RestoreInstanceRequest.java | 1164 +++++ .../v1/RestoreInstanceRequestOrBuilder.java | 125 + .../filestore/v1/UpdateBackupRequest.java | 1051 +++++ .../v1/UpdateBackupRequestOrBuilder.java | 107 + .../filestore/v1/UpdateInstanceRequest.java | 1065 +++++ .../v1/UpdateInstanceRequestOrBuilder.java | 110 + .../v1/cloud_filestore_service.proto | 719 +++ .../clirr-ignored-differences.xml | 33 + proto-google-cloud-filestore-v1beta1/pom.xml | 46 + .../cloud/common/OperationMetadata.java | 1846 ++++++++ .../common/OperationMetadataOrBuilder.java | 217 + .../common/OperationMetadataOuterClass.java | 88 + .../cloud/filestore/v1beta1/Backup.java | 2939 ++++++++++++ .../cloud/filestore/v1beta1/BackupName.java | 223 + .../filestore/v1beta1/BackupOrBuilder.java | 368 ++ .../v1beta1/CloudFilestoreServiceProto.java | 524 +++ .../v1beta1/CreateBackupRequest.java | 1178 +++++ .../v1beta1/CreateBackupRequestOrBuilder.java | 133 + .../v1beta1/CreateInstanceRequest.java | 1179 +++++ .../CreateInstanceRequestOrBuilder.java | 133 + .../v1beta1/DeleteBackupRequest.java | 658 +++ .../v1beta1/DeleteBackupRequestOrBuilder.java | 56 + .../v1beta1/DeleteInstanceRequest.java | 658 +++ .../DeleteInstanceRequestOrBuilder.java | 56 + .../filestore/v1beta1/FileShareConfig.java | 1609 +++++++ .../v1beta1/FileShareConfigOrBuilder.java | 167 + .../filestore/v1beta1/GetBackupRequest.java | 657 +++ .../v1beta1/GetBackupRequestOrBuilder.java | 56 + .../filestore/v1beta1/GetInstanceRequest.java | 658 +++ .../v1beta1/GetInstanceRequestOrBuilder.java | 56 + .../cloud/filestore/v1beta1/Instance.java | 3944 +++++++++++++++++ .../cloud/filestore/v1beta1/InstanceName.java | 223 + .../filestore/v1beta1/InstanceOrBuilder.java | 430 ++ .../filestore/v1beta1/ListBackupsRequest.java | 1320 ++++++ .../v1beta1/ListBackupsRequestOrBuilder.java | 154 + .../v1beta1/ListBackupsResponse.java | 1527 +++++++ .../v1beta1/ListBackupsResponseOrBuilder.java | 180 + .../v1beta1/ListInstancesRequest.java | 1313 ++++++ .../ListInstancesRequestOrBuilder.java | 152 + .../v1beta1/ListInstancesResponse.java | 1506 +++++++ .../ListInstancesResponseOrBuilder.java | 175 + .../cloud/filestore/v1beta1/LocationName.java | 192 + .../filestore/v1beta1/NetworkConfig.java | 1736 ++++++++ .../v1beta1/NetworkConfigOrBuilder.java | 222 + .../filestore/v1beta1/NfsExportOptions.java | 1696 +++++++ .../v1beta1/NfsExportOptionsOrBuilder.java | 194 + .../v1beta1/RestoreInstanceRequest.java | 1411 ++++++ .../RestoreInstanceRequestOrBuilder.java | 165 + .../cloud/filestore/v1beta1/SnapshotName.java | 223 + .../v1beta1/UpdateBackupRequest.java | 1066 +++++ .../v1beta1/UpdateBackupRequestOrBuilder.java | 110 + .../v1beta1/UpdateInstanceRequest.java | 1103 +++++ .../UpdateInstanceRequestOrBuilder.java | 119 + .../v1beta1/cloud_filestore_service.proto | 732 +++ renovate.json | 73 + samples/install-without-bom/pom.xml | 84 + samples/pom.xml | 56 + samples/snapshot/pom.xml | 83 + samples/snippets/pom.xml | 47 + versions.txt | 8 + 203 files changed, 83714 insertions(+) create mode 100644 .github/.OwlBot.lock.yaml create mode 100644 .github/.OwlBot.yaml create mode 100644 .github/CODEOWNERS create mode 100644 .github/ISSUE_TEMPLATE/bug_report.md create mode 100644 .github/ISSUE_TEMPLATE/feature_request.md create mode 100644 .github/ISSUE_TEMPLATE/support_request.md create mode 100644 .github/PULL_REQUEST_TEMPLATE.md create mode 100644 .github/blunderbuss.yml create mode 100644 .github/generated-files-bot.yml create mode 100644 .github/readme/synth.py create mode 100644 .github/release-please.yml create mode 100644 .github/snippet-bot.yml create mode 100644 .github/sync-repo-settings.yaml create mode 100644 .github/trusted-contribution.yml create mode 100644 .github/workflows/approve-readme.yaml create mode 100644 .github/workflows/auto-release.yaml create mode 100644 .github/workflows/ci.yaml create mode 100644 .github/workflows/samples.yaml create mode 100644 .gitignore create mode 100644 .kokoro/build.bat create mode 100755 .kokoro/build.sh create mode 100755 .kokoro/coerce_logs.sh create mode 100644 .kokoro/common.cfg create mode 100644 .kokoro/common.sh create mode 100644 .kokoro/continuous/common.cfg create mode 100644 .kokoro/continuous/java8.cfg create mode 100644 .kokoro/continuous/readme.cfg create mode 100755 .kokoro/dependencies.sh create mode 100644 .kokoro/nightly/common.cfg create mode 100644 .kokoro/nightly/integration.cfg create mode 100644 .kokoro/nightly/java11.cfg create mode 100644 .kokoro/nightly/java7.cfg create mode 100644 .kokoro/nightly/java8-osx.cfg create mode 100644 .kokoro/nightly/java8-win.cfg create mode 100644 .kokoro/nightly/java8.cfg create mode 100644 .kokoro/nightly/samples.cfg create mode 100755 .kokoro/populate-secrets.sh create mode 100644 .kokoro/presubmit/clirr.cfg create mode 100644 .kokoro/presubmit/common.cfg create mode 100644 .kokoro/presubmit/dependencies.cfg create mode 100644 .kokoro/presubmit/integration.cfg create mode 100644 .kokoro/presubmit/java11.cfg create mode 100644 .kokoro/presubmit/java7.cfg create mode 100644 .kokoro/presubmit/java8-osx.cfg create mode 100644 .kokoro/presubmit/java8-win.cfg create mode 100644 .kokoro/presubmit/java8.cfg create mode 100644 .kokoro/presubmit/linkage-monitor.cfg create mode 100644 .kokoro/presubmit/lint.cfg create mode 100644 .kokoro/presubmit/samples.cfg create mode 100755 .kokoro/readme.sh create mode 100644 .kokoro/release/bump_snapshot.cfg create mode 100644 .kokoro/release/common.cfg create mode 100755 .kokoro/release/common.sh create mode 100644 .kokoro/release/drop.cfg create mode 100755 .kokoro/release/drop.sh create mode 100644 .kokoro/release/promote.cfg create mode 100755 .kokoro/release/promote.sh create mode 100644 .kokoro/release/publish_javadoc.cfg create mode 100755 .kokoro/release/publish_javadoc.sh create mode 100644 .kokoro/release/publish_javadoc11.cfg create mode 100755 .kokoro/release/publish_javadoc11.sh create mode 100644 .kokoro/release/snapshot.cfg create mode 100755 .kokoro/release/snapshot.sh create mode 100644 .kokoro/release/stage.cfg create mode 100755 .kokoro/release/stage.sh create mode 100644 .kokoro/trampoline.sh create mode 100644 .repo-metadata.json create mode 100644 CODE_OF_CONDUCT.md create mode 100644 CONTRIBUTING.md create mode 100644 LICENSE create mode 100644 SECURITY.md create mode 100644 codecov.yaml create mode 100644 google-cloud-filestore-bom/pom.xml create mode 100644 google-cloud-filestore/pom.xml create mode 100644 google-cloud-filestore/src/main/java/com/google/cloud/filestore/v1/CloudFilestoreManagerClient.java create mode 100644 google-cloud-filestore/src/main/java/com/google/cloud/filestore/v1/CloudFilestoreManagerSettings.java create mode 100644 google-cloud-filestore/src/main/java/com/google/cloud/filestore/v1/gapic_metadata.json create mode 100644 google-cloud-filestore/src/main/java/com/google/cloud/filestore/v1/package-info.java create mode 100644 google-cloud-filestore/src/main/java/com/google/cloud/filestore/v1/stub/CloudFilestoreManagerStub.java create mode 100644 google-cloud-filestore/src/main/java/com/google/cloud/filestore/v1/stub/CloudFilestoreManagerStubSettings.java create mode 100644 google-cloud-filestore/src/main/java/com/google/cloud/filestore/v1/stub/GrpcCloudFilestoreManagerCallableFactory.java create mode 100644 google-cloud-filestore/src/main/java/com/google/cloud/filestore/v1/stub/GrpcCloudFilestoreManagerStub.java create mode 100644 google-cloud-filestore/src/main/java/com/google/cloud/filestore/v1beta1/CloudFilestoreManagerClient.java create mode 100644 google-cloud-filestore/src/main/java/com/google/cloud/filestore/v1beta1/CloudFilestoreManagerSettings.java create mode 100644 google-cloud-filestore/src/main/java/com/google/cloud/filestore/v1beta1/gapic_metadata.json create mode 100644 google-cloud-filestore/src/main/java/com/google/cloud/filestore/v1beta1/package-info.java create mode 100644 google-cloud-filestore/src/main/java/com/google/cloud/filestore/v1beta1/stub/CloudFilestoreManagerStub.java create mode 100644 google-cloud-filestore/src/main/java/com/google/cloud/filestore/v1beta1/stub/CloudFilestoreManagerStubSettings.java create mode 100644 google-cloud-filestore/src/main/java/com/google/cloud/filestore/v1beta1/stub/GrpcCloudFilestoreManagerCallableFactory.java create mode 100644 google-cloud-filestore/src/main/java/com/google/cloud/filestore/v1beta1/stub/GrpcCloudFilestoreManagerStub.java create mode 100644 google-cloud-filestore/src/test/java/com/google/cloud/filestore/v1/CloudFilestoreManagerClientTest.java create mode 100644 google-cloud-filestore/src/test/java/com/google/cloud/filestore/v1/MockCloudFilestoreManager.java create mode 100644 google-cloud-filestore/src/test/java/com/google/cloud/filestore/v1/MockCloudFilestoreManagerImpl.java create mode 100644 google-cloud-filestore/src/test/java/com/google/cloud/filestore/v1beta1/CloudFilestoreManagerClientTest.java create mode 100644 google-cloud-filestore/src/test/java/com/google/cloud/filestore/v1beta1/MockCloudFilestoreManager.java create mode 100644 google-cloud-filestore/src/test/java/com/google/cloud/filestore/v1beta1/MockCloudFilestoreManagerImpl.java create mode 100644 grpc-google-cloud-filestore-v1/pom.xml create mode 100644 grpc-google-cloud-filestore-v1/src/main/java/com/google/cloud/filestore/v1/CloudFilestoreManagerGrpc.java create mode 100644 grpc-google-cloud-filestore-v1beta1/pom.xml create mode 100644 grpc-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/CloudFilestoreManagerGrpc.java create mode 100644 java.header create mode 100644 license-checks.xml create mode 100644 owlbot.py create mode 100644 pom.xml create mode 100644 proto-google-cloud-filestore-v1/clirr-ignored-differences.xml create mode 100644 proto-google-cloud-filestore-v1/pom.xml create mode 100644 proto-google-cloud-filestore-v1/src/main/java/com/google/cloud/common/OperationMetadata.java create mode 100644 proto-google-cloud-filestore-v1/src/main/java/com/google/cloud/common/OperationMetadataOrBuilder.java create mode 100644 proto-google-cloud-filestore-v1/src/main/java/com/google/cloud/common/OperationMetadataOuterClass.java create mode 100644 proto-google-cloud-filestore-v1/src/main/java/com/google/cloud/filestore/v1/Backup.java create mode 100644 proto-google-cloud-filestore-v1/src/main/java/com/google/cloud/filestore/v1/BackupName.java create mode 100644 proto-google-cloud-filestore-v1/src/main/java/com/google/cloud/filestore/v1/BackupOrBuilder.java create mode 100644 proto-google-cloud-filestore-v1/src/main/java/com/google/cloud/filestore/v1/CloudFilestoreServiceProto.java create mode 100644 proto-google-cloud-filestore-v1/src/main/java/com/google/cloud/filestore/v1/CreateBackupRequest.java create mode 100644 proto-google-cloud-filestore-v1/src/main/java/com/google/cloud/filestore/v1/CreateBackupRequestOrBuilder.java create mode 100644 proto-google-cloud-filestore-v1/src/main/java/com/google/cloud/filestore/v1/CreateInstanceRequest.java create mode 100644 proto-google-cloud-filestore-v1/src/main/java/com/google/cloud/filestore/v1/CreateInstanceRequestOrBuilder.java create mode 100644 proto-google-cloud-filestore-v1/src/main/java/com/google/cloud/filestore/v1/DeleteBackupRequest.java create mode 100644 proto-google-cloud-filestore-v1/src/main/java/com/google/cloud/filestore/v1/DeleteBackupRequestOrBuilder.java create mode 100644 proto-google-cloud-filestore-v1/src/main/java/com/google/cloud/filestore/v1/DeleteInstanceRequest.java create mode 100644 proto-google-cloud-filestore-v1/src/main/java/com/google/cloud/filestore/v1/DeleteInstanceRequestOrBuilder.java create mode 100644 proto-google-cloud-filestore-v1/src/main/java/com/google/cloud/filestore/v1/FileShareConfig.java create mode 100644 proto-google-cloud-filestore-v1/src/main/java/com/google/cloud/filestore/v1/FileShareConfigOrBuilder.java create mode 100644 proto-google-cloud-filestore-v1/src/main/java/com/google/cloud/filestore/v1/GetBackupRequest.java create mode 100644 proto-google-cloud-filestore-v1/src/main/java/com/google/cloud/filestore/v1/GetBackupRequestOrBuilder.java create mode 100644 proto-google-cloud-filestore-v1/src/main/java/com/google/cloud/filestore/v1/GetInstanceRequest.java create mode 100644 proto-google-cloud-filestore-v1/src/main/java/com/google/cloud/filestore/v1/GetInstanceRequestOrBuilder.java create mode 100644 proto-google-cloud-filestore-v1/src/main/java/com/google/cloud/filestore/v1/Instance.java create mode 100644 proto-google-cloud-filestore-v1/src/main/java/com/google/cloud/filestore/v1/InstanceName.java create mode 100644 proto-google-cloud-filestore-v1/src/main/java/com/google/cloud/filestore/v1/InstanceOrBuilder.java create mode 100644 proto-google-cloud-filestore-v1/src/main/java/com/google/cloud/filestore/v1/ListBackupsRequest.java create mode 100644 proto-google-cloud-filestore-v1/src/main/java/com/google/cloud/filestore/v1/ListBackupsRequestOrBuilder.java create mode 100644 proto-google-cloud-filestore-v1/src/main/java/com/google/cloud/filestore/v1/ListBackupsResponse.java create mode 100644 proto-google-cloud-filestore-v1/src/main/java/com/google/cloud/filestore/v1/ListBackupsResponseOrBuilder.java create mode 100644 proto-google-cloud-filestore-v1/src/main/java/com/google/cloud/filestore/v1/ListInstancesRequest.java create mode 100644 proto-google-cloud-filestore-v1/src/main/java/com/google/cloud/filestore/v1/ListInstancesRequestOrBuilder.java create mode 100644 proto-google-cloud-filestore-v1/src/main/java/com/google/cloud/filestore/v1/ListInstancesResponse.java create mode 100644 proto-google-cloud-filestore-v1/src/main/java/com/google/cloud/filestore/v1/ListInstancesResponseOrBuilder.java create mode 100644 proto-google-cloud-filestore-v1/src/main/java/com/google/cloud/filestore/v1/LocationName.java create mode 100644 proto-google-cloud-filestore-v1/src/main/java/com/google/cloud/filestore/v1/NetworkConfig.java create mode 100644 proto-google-cloud-filestore-v1/src/main/java/com/google/cloud/filestore/v1/NetworkConfigOrBuilder.java create mode 100644 proto-google-cloud-filestore-v1/src/main/java/com/google/cloud/filestore/v1/NfsExportOptions.java create mode 100644 proto-google-cloud-filestore-v1/src/main/java/com/google/cloud/filestore/v1/NfsExportOptionsOrBuilder.java create mode 100644 proto-google-cloud-filestore-v1/src/main/java/com/google/cloud/filestore/v1/RestoreInstanceRequest.java create mode 100644 proto-google-cloud-filestore-v1/src/main/java/com/google/cloud/filestore/v1/RestoreInstanceRequestOrBuilder.java create mode 100644 proto-google-cloud-filestore-v1/src/main/java/com/google/cloud/filestore/v1/UpdateBackupRequest.java create mode 100644 proto-google-cloud-filestore-v1/src/main/java/com/google/cloud/filestore/v1/UpdateBackupRequestOrBuilder.java create mode 100644 proto-google-cloud-filestore-v1/src/main/java/com/google/cloud/filestore/v1/UpdateInstanceRequest.java create mode 100644 proto-google-cloud-filestore-v1/src/main/java/com/google/cloud/filestore/v1/UpdateInstanceRequestOrBuilder.java create mode 100644 proto-google-cloud-filestore-v1/src/main/proto/google/cloud/filestore/v1/cloud_filestore_service.proto create mode 100644 proto-google-cloud-filestore-v1beta1/clirr-ignored-differences.xml create mode 100644 proto-google-cloud-filestore-v1beta1/pom.xml create mode 100644 proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/common/OperationMetadata.java create mode 100644 proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/common/OperationMetadataOrBuilder.java create mode 100644 proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/common/OperationMetadataOuterClass.java create mode 100644 proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/Backup.java create mode 100644 proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/BackupName.java create mode 100644 proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/BackupOrBuilder.java create mode 100644 proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/CloudFilestoreServiceProto.java create mode 100644 proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/CreateBackupRequest.java create mode 100644 proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/CreateBackupRequestOrBuilder.java create mode 100644 proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/CreateInstanceRequest.java create mode 100644 proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/CreateInstanceRequestOrBuilder.java create mode 100644 proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/DeleteBackupRequest.java create mode 100644 proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/DeleteBackupRequestOrBuilder.java create mode 100644 proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/DeleteInstanceRequest.java create mode 100644 proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/DeleteInstanceRequestOrBuilder.java create mode 100644 proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/FileShareConfig.java create mode 100644 proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/FileShareConfigOrBuilder.java create mode 100644 proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/GetBackupRequest.java create mode 100644 proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/GetBackupRequestOrBuilder.java create mode 100644 proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/GetInstanceRequest.java create mode 100644 proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/GetInstanceRequestOrBuilder.java create mode 100644 proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/Instance.java create mode 100644 proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/InstanceName.java create mode 100644 proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/InstanceOrBuilder.java create mode 100644 proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/ListBackupsRequest.java create mode 100644 proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/ListBackupsRequestOrBuilder.java create mode 100644 proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/ListBackupsResponse.java create mode 100644 proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/ListBackupsResponseOrBuilder.java create mode 100644 proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/ListInstancesRequest.java create mode 100644 proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/ListInstancesRequestOrBuilder.java create mode 100644 proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/ListInstancesResponse.java create mode 100644 proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/ListInstancesResponseOrBuilder.java create mode 100644 proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/LocationName.java create mode 100644 proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/NetworkConfig.java create mode 100644 proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/NetworkConfigOrBuilder.java create mode 100644 proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/NfsExportOptions.java create mode 100644 proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/NfsExportOptionsOrBuilder.java create mode 100644 proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/RestoreInstanceRequest.java create mode 100644 proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/RestoreInstanceRequestOrBuilder.java create mode 100644 proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/SnapshotName.java create mode 100644 proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/UpdateBackupRequest.java create mode 100644 proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/UpdateBackupRequestOrBuilder.java create mode 100644 proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/UpdateInstanceRequest.java create mode 100644 proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/UpdateInstanceRequestOrBuilder.java create mode 100644 proto-google-cloud-filestore-v1beta1/src/main/proto/google/cloud/filestore/v1beta1/cloud_filestore_service.proto create mode 100644 renovate.json create mode 100644 samples/install-without-bom/pom.xml create mode 100644 samples/pom.xml create mode 100644 samples/snapshot/pom.xml create mode 100644 samples/snippets/pom.xml create mode 100644 versions.txt diff --git a/.github/.OwlBot.lock.yaml b/.github/.OwlBot.lock.yaml new file mode 100644 index 00000000..5f0e5d39 --- /dev/null +++ b/.github/.OwlBot.lock.yaml @@ -0,0 +1,3 @@ +docker: + digest: sha256:a9b83a276c82987d284b733713fe86a3c8a2cc457933767eeb2688b882e54c6a + image: gcr.io/repo-automation-bots/owlbot-java:latest \ No newline at end of file diff --git a/.github/.OwlBot.yaml b/.github/.OwlBot.yaml new file mode 100644 index 00000000..28864ae0 --- /dev/null +++ b/.github/.OwlBot.yaml @@ -0,0 +1,32 @@ +# Copyright 2021 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 +# +# http://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. + +docker: + image: "gcr.io/repo-automation-bots/owlbot-java:latest" + +deep-remove-regex: +- "/grpc-google-.*/src" +- "/proto-google-.*/src" +- "/google-.*/src" + +deep-preserve-regex: +- "/google-.*/src/test/java/com/google/cloud/.*/v.*/it/IT.*Test.java" + +deep-copy-regex: +- source: "/google/cloud/filestore/(v.*)/.*-java/proto-google-.*/src" + dest: "/owl-bot-staging/$1/proto-google-cloud-filestore-$1/src" +- source: "/google/cloud/filestore/(v.*)/.*-java/grpc-google-.*/src" + dest: "/owl-bot-staging/$1/grpc-google-cloud-filestore-$1/src" +- source: "/google/cloud/filestore/(v.*)/.*-java/gapic-google-.*/src" + dest: "/owl-bot-staging/$1/google-cloud-filestore/src" \ No newline at end of file diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS new file mode 100644 index 00000000..30fdb7b9 --- /dev/null +++ b/.github/CODEOWNERS @@ -0,0 +1,10 @@ +# Code owners file. +# This file controls who is tagged for review for any given pull request. + +# For syntax help see: +# https://help.github.com/en/github/creating-cloning-and-archiving-repositories/about-code-owners#codeowners-syntax + +* @googleapis/yoshi-java + +# The java-samples-reviewers team is the default owner for samples changes +samples/**/*.java @googleapis/java-samples-reviewers diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md new file mode 100644 index 00000000..395df839 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -0,0 +1,51 @@ +--- +name: Bug report +about: Create a report to help us improve + +--- + +Thanks for stopping by to let us know something could be better! + +**PLEASE READ**: If you have a support contract with Google, please create an issue in the [support console](https://cloud.google.com/support/) instead of filing on GitHub. This will ensure a timely response. + +Please run down the following list and make sure you've tried the usual "quick fixes": + + - Search the issues already opened: https://github.com/googleapis/java-filestore/issues + - Check for answers on StackOverflow: http://stackoverflow.com/questions/tagged/google-cloud-platform + +If you are still having issues, please include as much information as possible: + +#### Environment details + +1. Specify the API at the beginning of the title. For example, "BigQuery: ..."). + General, Core, and Other are also allowed as types +2. OS type and version: +3. Java version: +4. filestore version(s): + +#### Steps to reproduce + + 1. ? + 2. ? + +#### Code example + +```java +// example +``` + +#### Stack trace +``` +Any relevant stacktrace here. +``` + +#### External references such as API reference guides + +- ? + +#### Any additional information below + + +Following these steps guarantees the quickest resolution possible. + +Thanks! diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md new file mode 100644 index 00000000..754e30c6 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -0,0 +1,21 @@ +--- +name: Feature request +about: Suggest an idea for this library + +--- + +Thanks for stopping by to let us know something could be better! + +**PLEASE READ**: If you have a support contract with Google, please create an issue in the [support console](https://cloud.google.com/support/) instead of filing on GitHub. This will ensure a timely response. + +**Is your feature request related to a problem? Please describe.** +What the problem is. Example: I'm always frustrated when [...] + +**Describe the solution you'd like** +What you want to happen. + +**Describe alternatives you've considered** +Any alternative solutions or features you've considered. + +**Additional context** +Any other context or screenshots about the feature request. diff --git a/.github/ISSUE_TEMPLATE/support_request.md b/.github/ISSUE_TEMPLATE/support_request.md new file mode 100644 index 00000000..99586903 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/support_request.md @@ -0,0 +1,7 @@ +--- +name: Support request +about: If you have a support contract with Google, please create an issue in the Google Cloud Support console. + +--- + +**PLEASE READ**: If you have a support contract with Google, please create an issue in the [support console](https://cloud.google.com/support/) instead of filing on GitHub. This will ensure a timely response. diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 00000000..0115e623 --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,7 @@ +Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly: +- [ ] Make sure to open an issue as a [bug/issue](https://github.com/googleapis/java-filestore/issues/new/choose) before writing your code! That way we can discuss the change, evaluate designs, and agree on the general idea +- [ ] Ensure the tests and linter pass +- [ ] Code coverage does not decrease (if any source code was changed) +- [ ] Appropriate docs were updated (if necessary) + +Fixes # ☕️ diff --git a/.github/blunderbuss.yml b/.github/blunderbuss.yml new file mode 100644 index 00000000..1a23ea42 --- /dev/null +++ b/.github/blunderbuss.yml @@ -0,0 +1,7 @@ +# Configuration for the Blunderbuss GitHub app. For more info see +# https://github.com/googleapis/repo-automation-bots/tree/master/packages/blunderbuss +assign_prs_by: +- labels: + - samples + to: + - googleapis/java-samples-reviewers \ No newline at end of file diff --git a/.github/generated-files-bot.yml b/.github/generated-files-bot.yml new file mode 100644 index 00000000..c644a24e --- /dev/null +++ b/.github/generated-files-bot.yml @@ -0,0 +1,12 @@ +externalManifests: +- type: json + file: 'synth.metadata' + jsonpath: '$.generatedFiles[*]' +- type: json + file: '.github/readme/synth.metadata/synth.metadata' + jsonpath: '$.generatedFiles[*]' +ignoreAuthors: +- 'renovate-bot' +- 'yoshi-automation' +- 'release-please[bot]' +- 'gcf-owl-bot[bot]' diff --git a/.github/readme/synth.py b/.github/readme/synth.py new file mode 100644 index 00000000..7b48cc28 --- /dev/null +++ b/.github/readme/synth.py @@ -0,0 +1,19 @@ +# 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 +# +# http://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. + +"""This script is used to synthesize generated the README for this library.""" + +from synthtool.languages import java + +java.custom_templates(["java_library/README.md"]) diff --git a/.github/release-please.yml b/.github/release-please.yml new file mode 100644 index 00000000..8ca7f9ca --- /dev/null +++ b/.github/release-please.yml @@ -0,0 +1,3 @@ +bumpMinorPreMajor: true +handleGHRelease: true +releaseType: java-yoshi diff --git a/.github/snippet-bot.yml b/.github/snippet-bot.yml new file mode 100644 index 00000000..e69de29b diff --git a/.github/sync-repo-settings.yaml b/.github/sync-repo-settings.yaml new file mode 100644 index 00000000..e100454f --- /dev/null +++ b/.github/sync-repo-settings.yaml @@ -0,0 +1,49 @@ + +# Whether or not rebase-merging is enabled on this repository. +# Defaults to `true` +rebaseMergeAllowed: false + +# Whether or not squash-merging is enabled on this repository. +# Defaults to `true` +squashMergeAllowed: true + +# Whether or not PRs are merged with a merge commit on this repository. +# Defaults to `false` +mergeCommitAllowed: false + +# Rules for master branch protection +branchProtectionRules: +# Identifies the protection rule pattern. Name of the branch to be protected. +# Defaults to `master` +- pattern: master + # Can admins overwrite branch protection. + # Defaults to `true` + isAdminEnforced: true + # Number of approving reviews required to update matching branches. + # Defaults to `1` + requiredApprovingReviewCount: 1 + # Are reviews from code owners required to update matching branches. + # Defaults to `false` + requiresCodeOwnerReviews: true + # Require up to date branches + requiresStrictStatusChecks: false + # List of required status check contexts that must pass for commits to be accepted to matching branches. + requiredStatusCheckContexts: + - "dependencies (8)" + - "dependencies (11)" + - "linkage-monitor" + - "lint" + - "clirr" + - "units (7)" + - "units (8)" + - "units (11)" + - "Kokoro - Test: Integration" + - "cla/google" +# List of explicit permissions to add (additive only) +permissionRules: +- team: yoshi-admins + permission: admin +- team: yoshi-java-admins + permission: admin +- team: yoshi-java + permission: push diff --git a/.github/trusted-contribution.yml b/.github/trusted-contribution.yml new file mode 100644 index 00000000..f247d5c7 --- /dev/null +++ b/.github/trusted-contribution.yml @@ -0,0 +1,2 @@ +trustedContributors: +- renovate-bot \ No newline at end of file diff --git a/.github/workflows/approve-readme.yaml b/.github/workflows/approve-readme.yaml new file mode 100644 index 00000000..7513acae --- /dev/null +++ b/.github/workflows/approve-readme.yaml @@ -0,0 +1,54 @@ +on: + pull_request: +name: auto-merge-readme +jobs: + approve: + runs-on: ubuntu-latest + if: github.repository_owner == 'googleapis' && github.head_ref == 'autosynth-readme' + steps: + - uses: actions/github-script@v3 + with: + github-token: ${{secrets.YOSHI_APPROVER_TOKEN}} + script: | + // only approve PRs from yoshi-automation + if (context.payload.pull_request.user.login !== "yoshi-automation") { + return; + } + + // only approve PRs like "chore: release " + if (!context.payload.pull_request.title === "chore: regenerate README") { + return; + } + + // only approve PRs with README.md and synth.metadata changes + const files = new Set( + ( + await github.paginate( + github.pulls.listFiles.endpoint({ + owner: context.repo.owner, + repo: context.repo.repo, + pull_number: context.payload.pull_request.number, + }) + ) + ).map(file => file.filename) + ); + if (files.size != 2 || !files.has("README.md") || !files.has(".github/readme/synth.metadata/synth.metadata")) { + return; + } + + // approve README regeneration PR + await github.pulls.createReview({ + owner: context.repo.owner, + repo: context.repo.repo, + body: 'Rubber stamped PR!', + pull_number: context.payload.pull_request.number, + event: 'APPROVE' + }); + + // attach automerge label + await github.issues.addLabels({ + owner: context.repo.owner, + repo: context.repo.repo, + issue_number: context.payload.pull_request.number, + labels: ['automerge'] + }); diff --git a/.github/workflows/auto-release.yaml b/.github/workflows/auto-release.yaml new file mode 100644 index 00000000..9b4fd4d8 --- /dev/null +++ b/.github/workflows/auto-release.yaml @@ -0,0 +1,88 @@ +on: + pull_request: +name: auto-release +jobs: + approve: + runs-on: ubuntu-latest + if: contains(github.head_ref, 'release-please') + steps: + - uses: actions/github-script@v3 + with: + github-token: ${{secrets.YOSHI_APPROVER_TOKEN}} + debug: true + script: | + // only approve PRs from release-please[bot] + if (context.payload.pull_request.user.login !== "release-please[bot]") { + return; + } + + // only approve PRs like "chore: release " + if ( !context.payload.pull_request.title.startsWith("chore: release") ) { + return; + } + + // only approve PRs with pom.xml and versions.txt changes + const filesPromise = github.pulls.listFiles.endpoint({ + owner: context.repo.owner, + repo: context.repo.repo, + pull_number: context.payload.pull_request.number, + }); + const changed_files = await github.paginate(filesPromise) + + if ( changed_files.length < 1 ) { + console.log( "Not proceeding since PR is empty!" ) + return; + } + + if ( !changed_files.some(v => v.filename.includes("pom")) || !changed_files.some(v => v.filename.includes("versions.txt")) ) { + console.log( "PR file changes do not have pom.xml or versions.txt -- something is wrong. PTAL!" ) + return; + } + + // trigger auto-release when + // 1) it is a SNAPSHOT release (auto-generated post regular release) + // 2) there are dependency updates only + // 3) there are no open dependency update PRs in this repo (to avoid multiple releases) + if ( + context.payload.pull_request.body.includes("Fix") || + context.payload.pull_request.body.includes("Build") || + context.payload.pull_request.body.includes("Documentation") || + context.payload.pull_request.body.includes("BREAKING CHANGES") || + context.payload.pull_request.body.includes("Features") + ) { + console.log( "Not auto-releasing since it is not a dependency-update-only release." ); + return; + } + + const promise = github.pulls.list.endpoint({ + owner: context.repo.owner, + repo: context.repo.repo, + state: 'open' + }); + const open_pulls = await github.paginate(promise) + + if ( open_pulls.length > 1 && !context.payload.pull_request.title.includes("SNAPSHOT") ) { + for ( const pull of open_pulls ) { + if ( pull.title.startsWith("deps: update dependency") ) { + console.log( "Not auto-releasing yet since there are dependency update PRs open in this repo." ); + return; + } + } + } + + // approve release PR + await github.pulls.createReview({ + owner: context.repo.owner, + repo: context.repo.repo, + body: 'Rubber stamped release!', + pull_number: context.payload.pull_request.number, + event: 'APPROVE' + }); + + // attach kokoro:force-run and automerge labels + await github.issues.addLabels({ + owner: context.repo.owner, + repo: context.repo.repo, + issue_number: context.payload.pull_request.number, + labels: ['kokoro:force-run', 'automerge'] + }); diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml new file mode 100644 index 00000000..0195b32f --- /dev/null +++ b/.github/workflows/ci.yaml @@ -0,0 +1,79 @@ +on: + push: + branches: + - master + pull_request: +name: ci +jobs: + units: + runs-on: ubuntu-latest + strategy: + matrix: + java: [7, 8, 11] + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-java@v1 + with: + java-version: ${{matrix.java}} + - run: java -version + - run: .kokoro/build.sh + env: + JOB_TYPE: test + windows: + runs-on: windows-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-java@v1 + with: + java-version: 8 + - run: java -version + - run: .kokoro/build.bat + env: + JOB_TYPE: test + dependencies: + runs-on: ubuntu-latest + strategy: + matrix: + java: [8, 11] + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-java@v1 + with: + java-version: ${{matrix.java}} + - run: java -version + - run: .kokoro/dependencies.sh + linkage-monitor: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-java@v1 + with: + java-version: 8 + - run: java -version + - name: Install artifacts to local Maven repository + run: .kokoro/build.sh + shell: bash + - name: Validate any conflicts with regard to com.google.cloud:libraries-bom (latest release) + uses: GoogleCloudPlatform/cloud-opensource-java/linkage-monitor@v1-linkagemonitor + lint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-java@v1 + with: + java-version: 8 + - run: java -version + - run: .kokoro/build.sh + env: + JOB_TYPE: lint + clirr: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-java@v1 + with: + java-version: 8 + - run: java -version + - run: .kokoro/build.sh + env: + JOB_TYPE: clirr diff --git a/.github/workflows/samples.yaml b/.github/workflows/samples.yaml new file mode 100644 index 00000000..c46230a7 --- /dev/null +++ b/.github/workflows/samples.yaml @@ -0,0 +1,14 @@ +on: + pull_request: +name: samples +jobs: + checkstyle: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-java@v1 + with: + java-version: 8 + - name: Run checkstyle + run: mvn -P lint --quiet --batch-mode checkstyle:check + working-directory: samples/snippets diff --git a/.gitignore b/.gitignore new file mode 100644 index 00000000..069d08fc --- /dev/null +++ b/.gitignore @@ -0,0 +1,17 @@ +# Maven +target/ + +# Eclipse +.classpath +.project +.settings + +# Intellij +*.iml +.idea/ + +# python utilities +*.pyc +__pycache__ + +.flattened-pom.xml diff --git a/.kokoro/build.bat b/.kokoro/build.bat new file mode 100644 index 00000000..05826ad9 --- /dev/null +++ b/.kokoro/build.bat @@ -0,0 +1,3 @@ +:: See documentation in type-shell-output.bat + +"C:\Program Files\Git\bin\bash.exe" %~dp0build.sh diff --git a/.kokoro/build.sh b/.kokoro/build.sh new file mode 100755 index 00000000..af41ebe0 --- /dev/null +++ b/.kokoro/build.sh @@ -0,0 +1,125 @@ +#!/bin/bash +# Copyright 2019 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 +# +# http://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. + +set -eo pipefail + +## Get the directory of the build script +scriptDir=$(realpath $(dirname "${BASH_SOURCE[0]}")) +## cd to the parent directory, i.e. the root of the git repo +cd ${scriptDir}/.. + +# include common functions +source ${scriptDir}/common.sh + +# Print out Maven & Java version +mvn -version +echo ${JOB_TYPE} + +# attempt to install 3 times with exponential backoff (starting with 10 seconds) +retry_with_backoff 3 10 \ + mvn install -B -V -ntp \ + -DskipTests=true \ + -Dclirr.skip=true \ + -Denforcer.skip=true \ + -Dmaven.javadoc.skip=true \ + -Dgcloud.download.skip=true \ + -T 1C + +# if GOOGLE_APPLICATION_CREDENTIALS is specified as a relative path, prepend Kokoro root directory onto it +if [[ ! -z "${GOOGLE_APPLICATION_CREDENTIALS}" && "${GOOGLE_APPLICATION_CREDENTIALS}" != /* ]]; then + export GOOGLE_APPLICATION_CREDENTIALS=$(realpath ${KOKORO_GFILE_DIR}/${GOOGLE_APPLICATION_CREDENTIALS}) +fi + +RETURN_CODE=0 +set +e + +case ${JOB_TYPE} in +test) + mvn test -B -Dclirr.skip=true -Denforcer.skip=true + RETURN_CODE=$? + ;; +lint) + mvn com.coveo:fmt-maven-plugin:check + RETURN_CODE=$? + ;; +javadoc) + mvn javadoc:javadoc javadoc:test-javadoc + RETURN_CODE=$? + ;; +integration) + mvn -B ${INTEGRATION_TEST_ARGS} \ + -ntp \ + -Penable-integration-tests \ + -DtrimStackTrace=false \ + -Dclirr.skip=true \ + -Denforcer.skip=true \ + -fae \ + verify + RETURN_CODE=$? + ;; +samples) + SAMPLES_DIR=samples + # only run ITs in snapshot/ on presubmit PRs. run ITs in all 3 samples/ subdirectories otherwise. + if [[ ! -z ${KOKORO_GITHUB_PULL_REQUEST_NUMBER} ]] + then + SAMPLES_DIR=samples/snapshot + fi + + if [[ -f ${SAMPLES_DIR}/pom.xml ]] + then + for FILE in ${KOKORO_GFILE_DIR}/secret_manager/*-samples-secrets; do + [[ -f "$FILE" ]] || continue + source "$FILE" + done + + pushd ${SAMPLES_DIR} + mvn -B \ + -Penable-samples \ + -ntp \ + -DtrimStackTrace=false \ + -Dclirr.skip=true \ + -Denforcer.skip=true \ + -fae \ + verify + RETURN_CODE=$? + popd + else + echo "no sample pom.xml found - skipping sample tests" + fi + ;; +clirr) + mvn -B -Denforcer.skip=true clirr:check + RETURN_CODE=$? + ;; +*) + ;; +esac + +if [ "${REPORT_COVERAGE}" == "true" ] +then + bash ${KOKORO_GFILE_DIR}/codecov.sh +fi + +# fix output location of logs +bash .kokoro/coerce_logs.sh + +if [[ "${ENABLE_BUILD_COP}" == "true" ]] +then + chmod +x ${KOKORO_GFILE_DIR}/linux_amd64/flakybot + ${KOKORO_GFILE_DIR}/linux_amd64/flakybot -repo=googleapis/java-filestore +fi + +echo "exiting with ${RETURN_CODE}" +exit ${RETURN_CODE} diff --git a/.kokoro/coerce_logs.sh b/.kokoro/coerce_logs.sh new file mode 100755 index 00000000..46edbf7f --- /dev/null +++ b/.kokoro/coerce_logs.sh @@ -0,0 +1,37 @@ +#!/bin/bash +# Copyright 2019 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 +# +# http://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. + +# This script finds and moves sponge logs so that they can be found by placer +# and are not flagged as flaky by sponge. + +set -eo pipefail + +## Get the directory of the build script +scriptDir=$(realpath $(dirname "${BASH_SOURCE[0]}")) +## cd to the parent directory, i.e. the root of the git repo +cd ${scriptDir}/.. + +job=$(basename ${KOKORO_JOB_NAME}) + +echo "coercing sponge logs..." +for xml in `find . -name *-sponge_log.xml` +do + class=$(basename ${xml} | cut -d- -f2) + dir=$(dirname ${xml})/${job}/${class} + text=$(dirname ${xml})/${class}-sponge_log.txt + mkdir -p ${dir} + mv ${xml} ${dir}/sponge_log.xml + mv ${text} ${dir}/sponge_log.txt +done diff --git a/.kokoro/common.cfg b/.kokoro/common.cfg new file mode 100644 index 00000000..90f58f74 --- /dev/null +++ b/.kokoro/common.cfg @@ -0,0 +1,13 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Download trampoline resources. These will be in ${KOKORO_GFILE_DIR} +gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/trampoline" + +# All builds use the trampoline script to run in docker. +build_file: "java-filestore/.kokoro/trampoline.sh" + +# Tell the trampoline which build file to use. +env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: "github/java-filestore/.kokoro/build.sh" +} diff --git a/.kokoro/common.sh b/.kokoro/common.sh new file mode 100644 index 00000000..ace89f45 --- /dev/null +++ b/.kokoro/common.sh @@ -0,0 +1,58 @@ +#!/bin/bash +# 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 +# +# http://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. + +function retry_with_backoff { + attempts_left=$1 + sleep_seconds=$2 + shift 2 + command=$@ + + + # store current flag state + flags=$- + + # allow a failures to continue + set +e + ${command} + exit_code=$? + + # restore "e" flag + if [[ ${flags} =~ e ]] + then set -e + else set +e + fi + + if [[ $exit_code == 0 ]] + then + return 0 + fi + + # failure + if [[ ${attempts_left} > 0 ]] + then + echo "failure (${exit_code}), sleeping ${sleep_seconds}..." + sleep ${sleep_seconds} + new_attempts=$((${attempts_left} - 1)) + new_sleep=$((${sleep_seconds} * 2)) + retry_with_backoff ${new_attempts} ${new_sleep} ${command} + fi + + return $exit_code +} + +## Helper functionss +function now() { date +"%Y-%m-%d %H:%M:%S" | tr -d '\n'; } +function msg() { println "$*" >&2; } +function println() { printf '%s\n' "$(now) $*"; } \ No newline at end of file diff --git a/.kokoro/continuous/common.cfg b/.kokoro/continuous/common.cfg new file mode 100644 index 00000000..a63138eb --- /dev/null +++ b/.kokoro/continuous/common.cfg @@ -0,0 +1,25 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Build logs will be here +action { + define_artifacts { + regex: "**/*sponge_log.xml" + regex: "**/*sponge_log.txt" + } +} + +# Download trampoline resources. +gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/trampoline" + +# Use the trampoline script to run in docker. +build_file: "java-filestore/.kokoro/trampoline.sh" + +env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: "github/java-filestore/.kokoro/build.sh" +} + +env_vars: { + key: "JOB_TYPE" + value: "test" +} diff --git a/.kokoro/continuous/java8.cfg b/.kokoro/continuous/java8.cfg new file mode 100644 index 00000000..495cc7ba --- /dev/null +++ b/.kokoro/continuous/java8.cfg @@ -0,0 +1,12 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Configure the docker image for kokoro-trampoline. +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/java8" +} + +env_vars: { + key: "REPORT_COVERAGE" + value: "true" +} diff --git a/.kokoro/continuous/readme.cfg b/.kokoro/continuous/readme.cfg new file mode 100644 index 00000000..e7c3f8b3 --- /dev/null +++ b/.kokoro/continuous/readme.cfg @@ -0,0 +1,55 @@ +# 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 +# +# http://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. + +# Format: //devtools/kokoro/config/proto/build.proto + +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/python-multi" +} + +env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: "github/java-filestore/.kokoro/readme.sh" +} + +# Build logs will be here +action { + define_artifacts { + regex: "**/*sponge_log.xml" + regex: "**/*sponge_log.log" + } +} + +# The github token is stored here. +before_action { + fetch_keystore { + keystore_resource { + keystore_config_id: 73713 + keyname: "yoshi-automation-github-key" + # TODO(theacodes): remove this after secrets have globally propagated + backend_type: FASTCONFIGPUSH + } + } +} + +# Common env vars for all repositories and builds. +env_vars: { + key: "GITHUB_USER" + value: "yoshi-automation" +} +env_vars: { + key: "GITHUB_EMAIL" + value: "yoshi-automation@google.com" +} diff --git a/.kokoro/dependencies.sh b/.kokoro/dependencies.sh new file mode 100755 index 00000000..9030ba8f --- /dev/null +++ b/.kokoro/dependencies.sh @@ -0,0 +1,91 @@ +#!/bin/bash +# Copyright 2019 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 +# +# http://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. + +set -eo pipefail +shopt -s nullglob + +## Get the directory of the build script +scriptDir=$(realpath $(dirname "${BASH_SOURCE[0]}")) +## cd to the parent directory, i.e. the root of the git repo +cd ${scriptDir}/.. + +# include common functions +source ${scriptDir}/common.sh + +# Print out Java +java -version +echo $JOB_TYPE + +export MAVEN_OPTS="-Xmx1024m -XX:MaxPermSize=128m" + +# this should run maven enforcer +retry_with_backoff 3 10 \ + mvn install -B -V -ntp \ + -DskipTests=true \ + -Dmaven.javadoc.skip=true \ + -Dclirr.skip=true + +mvn -B dependency:analyze -DfailOnWarning=true + +echo "****************** DEPENDENCY LIST COMPLETENESS CHECK *******************" +## Run dependency list completeness check +function completenessCheck() { + # Output dep list with compile scope generated using the original pom + # Running mvn dependency:list on Java versions that support modules will also include the module of the dependency. + # This is stripped from the output as it is not present in the flattened pom. + # Only dependencies with 'compile' or 'runtime' scope are included from original dependency list. + msg "Generating dependency list using original pom..." + mvn dependency:list -f pom.xml -DincludeScope=runtime -Dsort=true | grep '\[INFO] .*:.*:.*:.*:.*' | sed -e 's/ --.*//' >.org-list.txt + + # Output dep list generated using the flattened pom (only 'compile' and 'runtime' scopes) + msg "Generating dependency list using flattened pom..." + mvn dependency:list -f .flattened-pom.xml -DincludeScope=runtime -Dsort=true | grep '\[INFO] .*:.*:.*:.*:.*' >.new-list.txt + + # Compare two dependency lists + msg "Comparing dependency lists..." + diff .org-list.txt .new-list.txt >.diff.txt + if [[ $? == 0 ]] + then + msg "Success. No diff!" + else + msg "Diff found. See below: " + msg "You can also check .diff.txt file located in $1." + cat .diff.txt + return 1 + fi +} + +# Allow failures to continue running the script +set +e + +error_count=0 +for path in **/.flattened-pom.xml +do + # Check flattened pom in each dir that contains it for completeness + dir=$(dirname "$path") + pushd "$dir" + completenessCheck "$dir" + error_count=$(($error_count + $?)) + popd +done + +if [[ $error_count == 0 ]] +then + msg "All checks passed." + exit 0 +else + msg "Errors found. See log statements above." + exit 1 +fi diff --git a/.kokoro/nightly/common.cfg b/.kokoro/nightly/common.cfg new file mode 100644 index 00000000..a63138eb --- /dev/null +++ b/.kokoro/nightly/common.cfg @@ -0,0 +1,25 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Build logs will be here +action { + define_artifacts { + regex: "**/*sponge_log.xml" + regex: "**/*sponge_log.txt" + } +} + +# Download trampoline resources. +gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/trampoline" + +# Use the trampoline script to run in docker. +build_file: "java-filestore/.kokoro/trampoline.sh" + +env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: "github/java-filestore/.kokoro/build.sh" +} + +env_vars: { + key: "JOB_TYPE" + value: "test" +} diff --git a/.kokoro/nightly/integration.cfg b/.kokoro/nightly/integration.cfg new file mode 100644 index 00000000..0048c8ec --- /dev/null +++ b/.kokoro/nightly/integration.cfg @@ -0,0 +1,37 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Configure the docker image for kokoro-trampoline. +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/java8" +} + +env_vars: { + key: "JOB_TYPE" + value: "integration" +} +# TODO: remove this after we've migrated all tests and scripts +env_vars: { + key: "GCLOUD_PROJECT" + value: "gcloud-devel" +} + +env_vars: { + key: "GOOGLE_CLOUD_PROJECT" + value: "gcloud-devel" +} + +env_vars: { + key: "ENABLE_BUILD_COP" + value: "true" +} + +env_vars: { + key: "GOOGLE_APPLICATION_CREDENTIALS" + value: "secret_manager/java-it-service-account" +} + +env_vars: { + key: "SECRET_MANAGER_KEYS" + value: "java-it-service-account" +} diff --git a/.kokoro/nightly/java11.cfg b/.kokoro/nightly/java11.cfg new file mode 100644 index 00000000..709f2b4c --- /dev/null +++ b/.kokoro/nightly/java11.cfg @@ -0,0 +1,7 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Configure the docker image for kokoro-trampoline. +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/java11" +} diff --git a/.kokoro/nightly/java7.cfg b/.kokoro/nightly/java7.cfg new file mode 100644 index 00000000..cb24f44e --- /dev/null +++ b/.kokoro/nightly/java7.cfg @@ -0,0 +1,7 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Configure the docker image for kokoro-trampoline. +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/java7" +} diff --git a/.kokoro/nightly/java8-osx.cfg b/.kokoro/nightly/java8-osx.cfg new file mode 100644 index 00000000..0fe10d30 --- /dev/null +++ b/.kokoro/nightly/java8-osx.cfg @@ -0,0 +1,3 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +build_file: "java-filestore/.kokoro/build.sh" diff --git a/.kokoro/nightly/java8-win.cfg b/.kokoro/nightly/java8-win.cfg new file mode 100644 index 00000000..e34a0f5f --- /dev/null +++ b/.kokoro/nightly/java8-win.cfg @@ -0,0 +1,3 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +build_file: "java-filestore/.kokoro/build.bat" diff --git a/.kokoro/nightly/java8.cfg b/.kokoro/nightly/java8.cfg new file mode 100644 index 00000000..495cc7ba --- /dev/null +++ b/.kokoro/nightly/java8.cfg @@ -0,0 +1,12 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Configure the docker image for kokoro-trampoline. +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/java8" +} + +env_vars: { + key: "REPORT_COVERAGE" + value: "true" +} diff --git a/.kokoro/nightly/samples.cfg b/.kokoro/nightly/samples.cfg new file mode 100644 index 00000000..f2542931 --- /dev/null +++ b/.kokoro/nightly/samples.cfg @@ -0,0 +1,38 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Configure the docker image for kokoro-trampoline. +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/java8" +} + +env_vars: { + key: "JOB_TYPE" + value: "samples" +} + +# TODO: remove this after we've migrated all tests and scripts +env_vars: { + key: "GCLOUD_PROJECT" + value: "java-docs-samples-testing" +} + +env_vars: { + key: "GOOGLE_CLOUD_PROJECT" + value: "java-docs-samples-testing" +} + +env_vars: { + key: "GOOGLE_APPLICATION_CREDENTIALS" + value: "secret_manager/java-docs-samples-service-account" +} + +env_vars: { + key: "SECRET_MANAGER_KEYS" + value: "java-docs-samples-service-account" +} + +env_vars: { + key: "ENABLE_BUILD_COP" + value: "true" +} diff --git a/.kokoro/populate-secrets.sh b/.kokoro/populate-secrets.sh new file mode 100755 index 00000000..f5251425 --- /dev/null +++ b/.kokoro/populate-secrets.sh @@ -0,0 +1,43 @@ +#!/bin/bash +# 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 +# +# http://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. + +set -eo pipefail + +function now { date +"%Y-%m-%d %H:%M:%S" | tr -d '\n' ;} +function msg { println "$*" >&2 ;} +function println { printf '%s\n' "$(now) $*" ;} + + +# Populates requested secrets set in SECRET_MANAGER_KEYS from service account: +# kokoro-trampoline@cloud-devrel-kokoro-resources.iam.gserviceaccount.com +SECRET_LOCATION="${KOKORO_GFILE_DIR}/secret_manager" +msg "Creating folder on disk for secrets: ${SECRET_LOCATION}" +mkdir -p ${SECRET_LOCATION} +for key in $(echo ${SECRET_MANAGER_KEYS} | sed "s/,/ /g") +do + msg "Retrieving secret ${key}" + docker run --entrypoint=gcloud \ + --volume=${KOKORO_GFILE_DIR}:${KOKORO_GFILE_DIR} \ + gcr.io/google.com/cloudsdktool/cloud-sdk \ + secrets versions access latest \ + --project cloud-devrel-kokoro-resources \ + --secret ${key} > \ + "${SECRET_LOCATION}/${key}" + if [[ $? == 0 ]]; then + msg "Secret written to ${SECRET_LOCATION}/${key}" + else + msg "Error retrieving secret ${key}" + fi +done diff --git a/.kokoro/presubmit/clirr.cfg b/.kokoro/presubmit/clirr.cfg new file mode 100644 index 00000000..ec572442 --- /dev/null +++ b/.kokoro/presubmit/clirr.cfg @@ -0,0 +1,13 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Configure the docker image for kokoro-trampoline. + +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/java8" +} + +env_vars: { + key: "JOB_TYPE" + value: "clirr" +} \ No newline at end of file diff --git a/.kokoro/presubmit/common.cfg b/.kokoro/presubmit/common.cfg new file mode 100644 index 00000000..883379be --- /dev/null +++ b/.kokoro/presubmit/common.cfg @@ -0,0 +1,34 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Build logs will be here +action { + define_artifacts { + regex: "**/*sponge_log.xml" + regex: "**/*sponge_log.txt" + } +} + +# Download trampoline resources. +gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/trampoline" + +# Use the trampoline script to run in docker. +build_file: "java-filestore/.kokoro/trampoline.sh" + +env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: "github/java-filestore/.kokoro/build.sh" +} + +env_vars: { + key: "JOB_TYPE" + value: "test" +} + +before_action { + fetch_keystore { + keystore_resource { + keystore_config_id: 73713 + keyname: "dpebot_codecov_token" + } + } +} diff --git a/.kokoro/presubmit/dependencies.cfg b/.kokoro/presubmit/dependencies.cfg new file mode 100644 index 00000000..be8ec60a --- /dev/null +++ b/.kokoro/presubmit/dependencies.cfg @@ -0,0 +1,12 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Configure the docker image for kokoro-trampoline. +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/java8" +} + +env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: "github/java-filestore/.kokoro/dependencies.sh" +} diff --git a/.kokoro/presubmit/integration.cfg b/.kokoro/presubmit/integration.cfg new file mode 100644 index 00000000..dded67a9 --- /dev/null +++ b/.kokoro/presubmit/integration.cfg @@ -0,0 +1,33 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Configure the docker image for kokoro-trampoline. +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/java8" +} + +env_vars: { + key: "JOB_TYPE" + value: "integration" +} + +# TODO: remove this after we've migrated all tests and scripts +env_vars: { + key: "GCLOUD_PROJECT" + value: "gcloud-devel" +} + +env_vars: { + key: "GOOGLE_CLOUD_PROJECT" + value: "gcloud-devel" +} + +env_vars: { + key: "GOOGLE_APPLICATION_CREDENTIALS" + value: "secret_manager/java-it-service-account" +} + +env_vars: { + key: "SECRET_MANAGER_KEYS" + value: "java-it-service-account" +} diff --git a/.kokoro/presubmit/java11.cfg b/.kokoro/presubmit/java11.cfg new file mode 100644 index 00000000..709f2b4c --- /dev/null +++ b/.kokoro/presubmit/java11.cfg @@ -0,0 +1,7 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Configure the docker image for kokoro-trampoline. +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/java11" +} diff --git a/.kokoro/presubmit/java7.cfg b/.kokoro/presubmit/java7.cfg new file mode 100644 index 00000000..cb24f44e --- /dev/null +++ b/.kokoro/presubmit/java7.cfg @@ -0,0 +1,7 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Configure the docker image for kokoro-trampoline. +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/java7" +} diff --git a/.kokoro/presubmit/java8-osx.cfg b/.kokoro/presubmit/java8-osx.cfg new file mode 100644 index 00000000..0fe10d30 --- /dev/null +++ b/.kokoro/presubmit/java8-osx.cfg @@ -0,0 +1,3 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +build_file: "java-filestore/.kokoro/build.sh" diff --git a/.kokoro/presubmit/java8-win.cfg b/.kokoro/presubmit/java8-win.cfg new file mode 100644 index 00000000..e34a0f5f --- /dev/null +++ b/.kokoro/presubmit/java8-win.cfg @@ -0,0 +1,3 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +build_file: "java-filestore/.kokoro/build.bat" diff --git a/.kokoro/presubmit/java8.cfg b/.kokoro/presubmit/java8.cfg new file mode 100644 index 00000000..495cc7ba --- /dev/null +++ b/.kokoro/presubmit/java8.cfg @@ -0,0 +1,12 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Configure the docker image for kokoro-trampoline. +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/java8" +} + +env_vars: { + key: "REPORT_COVERAGE" + value: "true" +} diff --git a/.kokoro/presubmit/linkage-monitor.cfg b/.kokoro/presubmit/linkage-monitor.cfg new file mode 100644 index 00000000..d78a617e --- /dev/null +++ b/.kokoro/presubmit/linkage-monitor.cfg @@ -0,0 +1,12 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Configure the docker image for kokoro-trampoline. +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/java8" +} + +env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: "github/java-filestore/.kokoro/linkage-monitor.sh" +} \ No newline at end of file diff --git a/.kokoro/presubmit/lint.cfg b/.kokoro/presubmit/lint.cfg new file mode 100644 index 00000000..6d323c8a --- /dev/null +++ b/.kokoro/presubmit/lint.cfg @@ -0,0 +1,13 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Configure the docker image for kokoro-trampoline. + +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/java8" +} + +env_vars: { + key: "JOB_TYPE" + value: "lint" +} \ No newline at end of file diff --git a/.kokoro/presubmit/samples.cfg b/.kokoro/presubmit/samples.cfg new file mode 100644 index 00000000..01e09600 --- /dev/null +++ b/.kokoro/presubmit/samples.cfg @@ -0,0 +1,33 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Configure the docker image for kokoro-trampoline. +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/java8" +} + +env_vars: { + key: "JOB_TYPE" + value: "samples" +} + +# TODO: remove this after we've migrated all tests and scripts +env_vars: { + key: "GCLOUD_PROJECT" + value: "java-docs-samples-testing" +} + +env_vars: { + key: "GOOGLE_CLOUD_PROJECT" + value: "java-docs-samples-testing" +} + +env_vars: { + key: "GOOGLE_APPLICATION_CREDENTIALS" + value: "secret_manager/java-docs-samples-service-account" +} + +env_vars: { + key: "SECRET_MANAGER_KEYS" + value: "java-docs-samples-service-account" +} \ No newline at end of file diff --git a/.kokoro/readme.sh b/.kokoro/readme.sh new file mode 100755 index 00000000..5dfeb278 --- /dev/null +++ b/.kokoro/readme.sh @@ -0,0 +1,45 @@ +#!/bin/bash +# 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 +# +# http://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. + +set -eo pipefail + +cd ${KOKORO_ARTIFACTS_DIR}/github/java-filestore + +# Disable buffering, so that the logs stream through. +export PYTHONUNBUFFERED=1 + +# Kokoro exposes this as a file, but the scripts expect just a plain variable. +export GITHUB_TOKEN=$(cat ${KOKORO_KEYSTORE_DIR}/73713_yoshi-automation-github-key) + +# Setup git credentials +echo "https://${GITHUB_TOKEN}:@github.com" >> ~/.git-credentials +git config --global credential.helper 'store --file ~/.git-credentials' + +python3.6 -m pip install git+https://github.com/googleapis/synthtool.git#egg=gcp-synthtool + +set +e +python3.6 -m autosynth.synth \ + --repository=googleapis/java-filestore \ + --synth-file-name=.github/readme/synth.py \ + --metadata-path=.github/readme/synth.metadata \ + --pr-title="chore: regenerate README" \ + --branch-suffix="readme" + +# autosynth returns 28 to signal there are no changes +RETURN_CODE=$? +if [[ ${RETURN_CODE} -ne 0 && ${RETURN_CODE} -ne 28 ]] +then + exit ${RETURN_CODE} +fi diff --git a/.kokoro/release/bump_snapshot.cfg b/.kokoro/release/bump_snapshot.cfg new file mode 100644 index 00000000..69e21f50 --- /dev/null +++ b/.kokoro/release/bump_snapshot.cfg @@ -0,0 +1,53 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Build logs will be here +action { + define_artifacts { + regex: "**/*sponge_log.xml" + } +} + +# Download trampoline resources. +gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/trampoline" + +# Use the trampoline script to run in docker. +build_file: "java-filestore/.kokoro/trampoline.sh" + +# Configure the docker image for kokoro-trampoline. +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/node:10-user" +} + +env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: "github/java-filestore/.kokoro/release/bump_snapshot.sh" +} + +# tokens used by release-please to keep an up-to-date release PR. +before_action { + fetch_keystore { + keystore_resource { + keystore_config_id: 73713 + keyname: "github-magic-proxy-key-release-please" + } + } +} + +before_action { + fetch_keystore { + keystore_resource { + keystore_config_id: 73713 + keyname: "github-magic-proxy-token-release-please" + } + } +} + +before_action { + fetch_keystore { + keystore_resource { + keystore_config_id: 73713 + keyname: "github-magic-proxy-url-release-please" + } + } +} diff --git a/.kokoro/release/common.cfg b/.kokoro/release/common.cfg new file mode 100644 index 00000000..8b5073f8 --- /dev/null +++ b/.kokoro/release/common.cfg @@ -0,0 +1,49 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Download trampoline resources. +gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/trampoline" + +# Use the trampoline script to run in docker. +build_file: "java-filestore/.kokoro/trampoline.sh" + +# Configure the docker image for kokoro-trampoline. +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/java8" +} + +before_action { + fetch_keystore { + keystore_resource { + keystore_config_id: 70247 + keyname: "maven-gpg-keyring" + } + } +} + +before_action { + fetch_keystore { + keystore_resource { + keystore_config_id: 70247 + keyname: "maven-gpg-passphrase" + } + } +} + +before_action { + fetch_keystore { + keystore_resource { + keystore_config_id: 70247 + keyname: "maven-gpg-pubkeyring" + } + } +} + +before_action { + fetch_keystore { + keystore_resource { + keystore_config_id: 70247 + keyname: "sonatype-credentials" + } + } +} diff --git a/.kokoro/release/common.sh b/.kokoro/release/common.sh new file mode 100755 index 00000000..6e3f6599 --- /dev/null +++ b/.kokoro/release/common.sh @@ -0,0 +1,50 @@ +#!/bin/bash +# Copyright 2018 Google Inc. +# +# 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 +# +# http://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. + +set -eo pipefail + +# Get secrets from keystore and set and environment variables +setup_environment_secrets() { + export GPG_PASSPHRASE=$(cat ${KOKORO_KEYSTORE_DIR}/70247_maven-gpg-passphrase) + export GPG_TTY=$(tty) + export GPG_HOMEDIR=/gpg + mkdir $GPG_HOMEDIR + mv ${KOKORO_KEYSTORE_DIR}/70247_maven-gpg-pubkeyring $GPG_HOMEDIR/pubring.gpg + mv ${KOKORO_KEYSTORE_DIR}/70247_maven-gpg-keyring $GPG_HOMEDIR/secring.gpg + export SONATYPE_USERNAME=$(cat ${KOKORO_KEYSTORE_DIR}/70247_sonatype-credentials | cut -f1 -d'|') + export SONATYPE_PASSWORD=$(cat ${KOKORO_KEYSTORE_DIR}/70247_sonatype-credentials | cut -f2 -d'|') +} + +create_settings_xml_file() { + echo " + + + ossrh + ${SONATYPE_USERNAME} + ${SONATYPE_PASSWORD} + + + sonatype-nexus-staging + ${SONATYPE_USERNAME} + ${SONATYPE_PASSWORD} + + + sonatype-nexus-snapshots + ${SONATYPE_USERNAME} + ${SONATYPE_PASSWORD} + + +" > $1 +} \ No newline at end of file diff --git a/.kokoro/release/drop.cfg b/.kokoro/release/drop.cfg new file mode 100644 index 00000000..1d84edc4 --- /dev/null +++ b/.kokoro/release/drop.cfg @@ -0,0 +1,6 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: "github/java-filestore/.kokoro/release/drop.sh" +} diff --git a/.kokoro/release/drop.sh b/.kokoro/release/drop.sh new file mode 100755 index 00000000..5c4551ef --- /dev/null +++ b/.kokoro/release/drop.sh @@ -0,0 +1,32 @@ +#!/bin/bash +# Copyright 2018 Google Inc. +# +# 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 +# +# http://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. + +set -eo pipefail + +# STAGING_REPOSITORY_ID must be set +if [ -z "${STAGING_REPOSITORY_ID}" ]; then + echo "Missing STAGING_REPOSITORY_ID environment variable" + exit 1 +fi + +source $(dirname "$0")/common.sh +pushd $(dirname "$0")/../../ + +setup_environment_secrets +create_settings_xml_file "settings.xml" + +mvn nexus-staging:drop -B \ + --settings=settings.xml \ + -DstagingRepositoryId=${STAGING_REPOSITORY_ID} diff --git a/.kokoro/release/promote.cfg b/.kokoro/release/promote.cfg new file mode 100644 index 00000000..1f6f7c5f --- /dev/null +++ b/.kokoro/release/promote.cfg @@ -0,0 +1,6 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: "github/java-filestore/.kokoro/release/promote.sh" +} diff --git a/.kokoro/release/promote.sh b/.kokoro/release/promote.sh new file mode 100755 index 00000000..1fa95fa5 --- /dev/null +++ b/.kokoro/release/promote.sh @@ -0,0 +1,34 @@ +#!/bin/bash +# Copyright 2018 Google Inc. +# +# 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 +# +# http://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. + +set -eo pipefail + +# STAGING_REPOSITORY_ID must be set +if [ -z "${STAGING_REPOSITORY_ID}" ]; then + echo "Missing STAGING_REPOSITORY_ID environment variable" + exit 1 +fi + +source $(dirname "$0")/common.sh + +pushd $(dirname "$0")/../../ + +setup_environment_secrets +create_settings_xml_file "settings.xml" + +mvn nexus-staging:release -B \ + -DperformRelease=true \ + --settings=settings.xml \ + -DstagingRepositoryId=${STAGING_REPOSITORY_ID} diff --git a/.kokoro/release/publish_javadoc.cfg b/.kokoro/release/publish_javadoc.cfg new file mode 100644 index 00000000..d5be7593 --- /dev/null +++ b/.kokoro/release/publish_javadoc.cfg @@ -0,0 +1,23 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/doc-templates/" + +env_vars: { + key: "STAGING_BUCKET" + value: "docs-staging" +} + +env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: "github/java-filestore/.kokoro/release/publish_javadoc.sh" +} + + +before_action { + fetch_keystore { + keystore_resource { + keystore_config_id: 73713 + keyname: "docuploader_service_account" + } + } +} diff --git a/.kokoro/release/publish_javadoc.sh b/.kokoro/release/publish_javadoc.sh new file mode 100755 index 00000000..cec223de --- /dev/null +++ b/.kokoro/release/publish_javadoc.sh @@ -0,0 +1,53 @@ +#!/bin/bash +# Copyright 2019 Google Inc. +# +# 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 +# +# http://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. + +set -eo pipefail + +if [[ -z "${CREDENTIALS}" ]]; then + CREDENTIALS=${KOKORO_KEYSTORE_DIR}/73713_docuploader_service_account +fi + +if [[ -z "${STAGING_BUCKET}" ]]; then + echo "Need to set STAGING_BUCKET environment variable" + exit 1 +fi + +# work from the git root directory +pushd $(dirname "$0")/../../ + +# install docuploader package +python3 -m pip install gcp-docuploader + +# compile all packages +mvn clean install -B -q -DskipTests=true + +export NAME=google-cloud-filestore +export VERSION=$(grep ${NAME}: versions.txt | cut -d: -f3) + +# build the docs +mvn site -B -q + +pushd target/site/apidocs + +# create metadata +python3 -m docuploader create-metadata \ + --name ${NAME} \ + --version ${VERSION} \ + --language java + +# upload docs +python3 -m docuploader upload . \ + --credentials ${CREDENTIALS} \ + --staging-bucket ${STAGING_BUCKET} diff --git a/.kokoro/release/publish_javadoc11.cfg b/.kokoro/release/publish_javadoc11.cfg new file mode 100644 index 00000000..243b4c5d --- /dev/null +++ b/.kokoro/release/publish_javadoc11.cfg @@ -0,0 +1,30 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# cloud-rad production +env_vars: { + key: "STAGING_BUCKET_V2" + value: "docs-staging-v2" +} + +# Configure the docker image for kokoro-trampoline +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/java11" +} + +env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: "github/java-filestore/.kokoro/release/publish_javadoc11.sh" +} + +before_action { + fetch_keystore { + keystore_resource { + keystore_config_id: 73713 + keyname: "docuploader_service_account" + } + } +} + +# Downloads docfx doclet resource. This will be in ${KOKORO_GFILE_DIR}/ +gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/docfx" diff --git a/.kokoro/release/publish_javadoc11.sh b/.kokoro/release/publish_javadoc11.sh new file mode 100755 index 00000000..26d4ae5f --- /dev/null +++ b/.kokoro/release/publish_javadoc11.sh @@ -0,0 +1,67 @@ +#!/bin/bash +# Copyright 2021 Google Inc. +# +# 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 +# +# http://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. + +set -eo pipefail + +if [[ -z "${CREDENTIALS}" ]]; then + CREDENTIALS=${KOKORO_KEYSTORE_DIR}/73713_docuploader_service_account +fi + +if [[ -z "${STAGING_BUCKET_V2}" ]]; then + echo "Need to set STAGING_BUCKET_V2 environment variable" + exit 1 +fi + +# work from the git root directory +pushd $(dirname "$0")/../../ + +# install docuploader package +python3 -m pip install gcp-docuploader + +# compile all packages +mvn clean install -B -q -DskipTests=true + +export NAME=google-cloud-filestore +export VERSION=$(grep ${NAME}: versions.txt | cut -d: -f3) + +# V3 generates docfx yml from javadoc +# generate yml +mvn clean site -B -q -P docFX + +# copy README to docfx-yml dir and rename index.md +cp README.md target/docfx-yml/index.md +# copy CHANGELOG to docfx-yml dir and rename history.md +cp CHANGELOG.md target/docfx-yml/history.md + +pushd target/docfx-yml + +# create metadata +python3 -m docuploader create-metadata \ + --name ${NAME} \ + --version ${VERSION} \ + --xrefs devsite://java/gax \ + --xrefs devsite://java/google-cloud-core \ + --xrefs devsite://java/api-common \ + --xrefs devsite://java/proto-google-common-protos \ + --xrefs devsite://java/google-api-client \ + --xrefs devsite://java/google-http-client \ + --xrefs devsite://java/protobuf \ + --language java + +# upload yml to production bucket +python3 -m docuploader upload . \ + --credentials ${CREDENTIALS} \ + --staging-bucket ${STAGING_BUCKET_V2} \ + --destination-prefix docfx diff --git a/.kokoro/release/snapshot.cfg b/.kokoro/release/snapshot.cfg new file mode 100644 index 00000000..173e8bcc --- /dev/null +++ b/.kokoro/release/snapshot.cfg @@ -0,0 +1,6 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: "github/java-filestore/.kokoro/release/snapshot.sh" +} \ No newline at end of file diff --git a/.kokoro/release/snapshot.sh b/.kokoro/release/snapshot.sh new file mode 100755 index 00000000..1f55b770 --- /dev/null +++ b/.kokoro/release/snapshot.sh @@ -0,0 +1,33 @@ +#!/bin/bash +# Copyright 2019 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 +# +# http://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. + +set -eo pipefail + +source $(dirname "$0")/common.sh +MAVEN_SETTINGS_FILE=$(realpath $(dirname "$0")/../../)/settings.xml +pushd $(dirname "$0")/../../ + +# ensure we're trying to push a snapshot (no-result returns non-zero exit code) +grep SNAPSHOT versions.txt + +setup_environment_secrets +create_settings_xml_file "settings.xml" + +mvn clean deploy -B \ + --settings ${MAVEN_SETTINGS_FILE} \ + -DperformRelease=true \ + -Dgpg.executable=gpg \ + -Dgpg.passphrase=${GPG_PASSPHRASE} \ + -Dgpg.homedir=${GPG_HOMEDIR} diff --git a/.kokoro/release/stage.cfg b/.kokoro/release/stage.cfg new file mode 100644 index 00000000..225a66db --- /dev/null +++ b/.kokoro/release/stage.cfg @@ -0,0 +1,19 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: "github/java-filestore/.kokoro/release/stage.sh" +} + +# Need to save the properties file +action { + define_artifacts { + regex: "github/java-filestore/target/nexus-staging/staging/*.properties" + strip_prefix: "github/java-filestore" + } +} + +env_vars: { + key: "SECRET_MANAGER_KEYS" + value: "releasetool-publish-reporter-app,releasetool-publish-reporter-googleapis-installation,releasetool-publish-reporter-pem" +} diff --git a/.kokoro/release/stage.sh b/.kokoro/release/stage.sh new file mode 100755 index 00000000..8a103384 --- /dev/null +++ b/.kokoro/release/stage.sh @@ -0,0 +1,45 @@ +#!/bin/bash +# Copyright 2018 Google Inc. +# +# 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 +# +# http://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. + +set -eo pipefail + +# Start the releasetool reporter +python3 -m pip install gcp-releasetool +python3 -m releasetool publish-reporter-script > /tmp/publisher-script; source /tmp/publisher-script + +source $(dirname "$0")/common.sh +source $(dirname "$0")/../common.sh +MAVEN_SETTINGS_FILE=$(realpath $(dirname "$0")/../../)/settings.xml +pushd $(dirname "$0")/../../ + +setup_environment_secrets +create_settings_xml_file "settings.xml" + +# attempt to stage 3 times with exponential backoff (starting with 10 seconds) +retry_with_backoff 3 10 \ + mvn clean deploy -B \ + --settings ${MAVEN_SETTINGS_FILE} \ + -DskipTests=true \ + -DperformRelease=true \ + -Dgpg.executable=gpg \ + -Dgpg.passphrase=${GPG_PASSPHRASE} \ + -Dgpg.homedir=${GPG_HOMEDIR} + +if [[ -n "${AUTORELEASE_PR}" ]] +then + mvn nexus-staging:release -B \ + -DperformRelease=true \ + --settings=settings.xml +fi \ No newline at end of file diff --git a/.kokoro/trampoline.sh b/.kokoro/trampoline.sh new file mode 100644 index 00000000..9da0f839 --- /dev/null +++ b/.kokoro/trampoline.sh @@ -0,0 +1,26 @@ +#!/bin/bash +# Copyright 2018 Google Inc. +# +# 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 +# +# http://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. +set -eo pipefail +# Always run the cleanup script, regardless of the success of bouncing into +# the container. +function cleanup() { + chmod +x ${KOKORO_GFILE_DIR}/trampoline_cleanup.sh + ${KOKORO_GFILE_DIR}/trampoline_cleanup.sh + echo "cleanup"; +} +trap cleanup EXIT + +$(dirname $0)/populate-secrets.sh # Secret Manager secrets. +python3 "${KOKORO_GFILE_DIR}/trampoline_v1.py" diff --git a/.repo-metadata.json b/.repo-metadata.json new file mode 100644 index 00000000..3c54e95d --- /dev/null +++ b/.repo-metadata.json @@ -0,0 +1,16 @@ +{ + "name": "filestore", + "name_pretty": "Cloud Filestore API", + "product_documentation": "https://cloud.google.com/filestore/docs", + "api_description": "instances are fully managed NFS file servers on Google Cloud for use with applications running on Compute Engine virtual machines (VMs) instances or Google Kubernetes Engine clusters.", + "client_documentation": "https://googleapis.dev/java/google-cloud-filestore/latest/index.html", + "release_level": "beta", + "transport": "grpc", + "language": "java", + "repo": "googleapis/java-filestore", + "repo_short": "java-filestore", + "distribution_name": "com.google.cloud:google-cloud-filestore", + "api_id": "filestore.googleapis.com", + "library_type": "GAPIC_AUTO", + "requires_billing": true +} \ No newline at end of file diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md new file mode 100644 index 00000000..2add2547 --- /dev/null +++ b/CODE_OF_CONDUCT.md @@ -0,0 +1,94 @@ + +# Code of Conduct + +## Our Pledge + +In the interest of fostering an open and welcoming environment, we as +contributors and maintainers pledge to making participation in our project and +our community a harassment-free experience for everyone, regardless of age, body +size, disability, ethnicity, gender identity and expression, level of +experience, education, socio-economic status, nationality, personal appearance, +race, religion, or sexual identity and orientation. + +## Our Standards + +Examples of behavior that contributes to creating a positive environment +include: + +* Using welcoming and inclusive language +* Being respectful of differing viewpoints and experiences +* Gracefully accepting constructive criticism +* Focusing on what is best for the community +* Showing empathy towards other community members + +Examples of unacceptable behavior by participants include: + +* The use of sexualized language or imagery and unwelcome sexual attention or + advances +* Trolling, insulting/derogatory comments, and personal or political attacks +* Public or private harassment +* Publishing others' private information, such as a physical or electronic + address, without explicit permission +* Other conduct which could reasonably be considered inappropriate in a + professional setting + +## Our Responsibilities + +Project maintainers are responsible for clarifying the standards of acceptable +behavior and are expected to take appropriate and fair corrective action in +response to any instances of unacceptable behavior. + +Project maintainers have the right and responsibility to remove, edit, or reject +comments, commits, code, wiki edits, issues, and other contributions that are +not aligned to this Code of Conduct, or to ban temporarily or permanently any +contributor for other behaviors that they deem inappropriate, threatening, +offensive, or harmful. + +## Scope + +This Code of Conduct applies both within project spaces and in public spaces +when an individual is representing the project or its community. Examples of +representing a project or community include using an official project e-mail +address, posting via an official social media account, or acting as an appointed +representative at an online or offline event. Representation of a project may be +further defined and clarified by project maintainers. + +This Code of Conduct also applies outside the project spaces when the Project +Steward has a reasonable belief that an individual's behavior may have a +negative impact on the project or its community. + +## Conflict Resolution + +We do not believe that all conflict is bad; healthy debate and disagreement +often yield positive results. However, it is never okay to be disrespectful or +to engage in behavior that violates the project’s code of conduct. + +If you see someone violating the code of conduct, you are encouraged to address +the behavior directly with those involved. Many issues can be resolved quickly +and easily, and this gives people more control over the outcome of their +dispute. If you are unable to resolve the matter for any reason, or if the +behavior is threatening or harassing, report it. We are dedicated to providing +an environment where participants feel welcome and safe. + +Reports should be directed to *googleapis-stewards@google.com*, the +Project Steward(s) for *Google Cloud Client Libraries*. It is the Project Steward’s duty to +receive and address reported violations of the code of conduct. They will then +work with a committee consisting of representatives from the Open Source +Programs Office and the Google Open Source Strategy team. If for any reason you +are uncomfortable reaching out to the Project Steward, please email +opensource@google.com. + +We will investigate every complaint, but you may not receive a direct response. +We will use our discretion in determining when and how to follow up on reported +incidents, which may range from not taking action to permanent expulsion from +the project and project-sponsored spaces. We will notify the accused of the +report and provide them an opportunity to discuss it before any action is taken. +The identity of the reporter will be omitted from the details of the report +supplied to the accused. In potentially harmful situations, such as ongoing +harassment or threats to anyone's safety, we may take action without notice. + +## Attribution + +This Code of Conduct is adapted from the Contributor Covenant, version 1.4, +available at +https://www.contributor-covenant.org/version/1/4/code-of-conduct.html \ No newline at end of file diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 00000000..f2dbdee0 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,139 @@ +# How to Contribute + +We'd love to accept your patches and contributions to this project. There are +just a few small guidelines you need to follow. + +## Contributor License Agreement + +Contributions to this project must be accompanied by a Contributor License +Agreement. You (or your employer) retain the copyright to your contribution; +this simply gives us permission to use and redistribute your contributions as +part of the project. Head over to to see +your current agreements on file or to sign a new one. + +You generally only need to submit a CLA once, so if you've already submitted one +(even if it was for a different project), you probably don't need to do it +again. + +## Code reviews + +All submissions, including submissions by project members, require review. We +use GitHub pull requests for this purpose. Consult +[GitHub Help](https://help.github.com/articles/about-pull-requests/) for more +information on using pull requests. + +## Community Guidelines + +This project follows +[Google's Open Source Community Guidelines](https://opensource.google.com/conduct/). + +## Building the project + +To build, package, and run all unit tests run the command + +``` +mvn clean verify +``` + +### Running Integration tests + +To include integration tests when building the project, you need access to +a GCP Project with a valid service account. + +For instructions on how to generate a service account and corresponding +credentials JSON see: [Creating a Service Account][1]. + +Then run the following to build, package, run all unit tests and run all +integration tests. + +```bash +export GOOGLE_APPLICATION_CREDENTIALS=/path/to/service/account.json +mvn -Penable-integration-tests clean verify +``` + +## Code Samples + +Code Samples must be bundled in separate Maven modules, and guarded by a +Maven profile with the name `enable-samples`. + +The samples must be separate from the primary project for a few reasons: +1. Primary projects have a minimum Java version of Java 7 whereas samples have + a minimum Java version of Java 8. Due to this we need the ability to + selectively exclude samples from a build run. +2. Many code samples depend on external GCP services and need + credentials to access the service. +3. Code samples are not released as Maven artifacts and must be excluded from + release builds. + +### Building + +```bash +mvn -Penable-samples clean verify +``` + +Some samples require access to GCP services and require a service account: + +```bash +export GOOGLE_APPLICATION_CREDENTIALS=/path/to/service/account.json +mvn -Penable-samples clean verify +``` + +### Profile Config + +1. To add samples in a profile to your Maven project, add the following to your +`pom.xml` + + ```xml + + [...] + + + enable-samples + + sample + + + + [...] + + ``` + +2. [Activate](#profile-activation) the profile. +3. Define your samples in a normal Maven project in the `samples/` directory. + +### Code Formatting + +Code in this repo is formatted with +[google-java-format](https://github.com/google/google-java-format). +To run formatting on your project, you can run: +``` +mvn com.coveo:fmt-maven-plugin:format +``` + +### Profile Activation + +To include code samples when building and testing the project, enable the +`enable-samples` Maven profile. + +#### Command line + +To activate the Maven profile on the command line add `-Penable-samples` to your +Maven command. + +#### Maven `settings.xml` + +To activate the Maven profile in your `~/.m2/settings.xml` add an entry of +`enable-samples` following the instructions in [Active Profiles][2]. + +This method has the benefit of applying to all projects you build (and is +respected by IntelliJ IDEA) and is recommended if you are going to be +contributing samples to several projects. + +#### IntelliJ IDEA + +To activate the Maven Profile inside IntelliJ IDEA, follow the instructions in +[Activate Maven profiles][3] to activate `enable-samples`. + +[1]: https://cloud.google.com/docs/authentication/getting-started#creating_a_service_account +[2]: https://maven.apache.org/settings.html#Active_Profiles +[3]: https://www.jetbrains.com/help/idea/work-with-maven-profiles.html#activate_maven_profiles diff --git a/LICENSE b/LICENSE new file mode 100644 index 00000000..261eeb9e --- /dev/null +++ b/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + 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 + + http://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. diff --git a/SECURITY.md b/SECURITY.md new file mode 100644 index 00000000..8b58ae9c --- /dev/null +++ b/SECURITY.md @@ -0,0 +1,7 @@ +# Security Policy + +To report a security issue, please use [g.co/vulnz](https://g.co/vulnz). + +The Google Security Team will respond within 5 working days of your report on g.co/vulnz. + +We use g.co/vulnz for our intake, and do coordination and disclosure here using GitHub Security Advisory to privately discuss and fix the issue. diff --git a/codecov.yaml b/codecov.yaml new file mode 100644 index 00000000..5724ea94 --- /dev/null +++ b/codecov.yaml @@ -0,0 +1,4 @@ +--- +codecov: + ci: + - source.cloud.google.com diff --git a/google-cloud-filestore-bom/pom.xml b/google-cloud-filestore-bom/pom.xml new file mode 100644 index 00000000..bfc3cf5e --- /dev/null +++ b/google-cloud-filestore-bom/pom.xml @@ -0,0 +1,95 @@ + + + 4.0.0 + com.google.cloud + google-cloud-filestore-bom + 0.0.1-SNAPSHOT + pom + + com.google.cloud + google-cloud-shared-config + 0.11.0 + + + Google Cloud Filestore API BOM + https://github.com/googleapis/java-filestore + + BOM for Cloud Filestore API + + + + Google LLC + + + + + chingor13 + Jeff Ching + chingor@google.com + Google LLC + + Developer + + + + + + scm:git:https://github.com/googleapis/java-filestore.git + scm:git:git@github.com:googleapis/java-filestore.git + https://github.com/googleapis/java-filestore + + + + true + + + + + The Apache Software License, Version 2.0 + http://www.apache.org/licenses/LICENSE-2.0.txt + repo + + + + + + + com.google.cloud + google-cloud-filestore + 0.0.1-SNAPSHOT + + + com.google.api.grpc + grpc-google-cloud-filestore-v1beta1 + 0.0.1-SNAPSHOT + + + com.google.api.grpc + grpc-google-cloud-filestore-v1 + 0.0.1-SNAPSHOT + + + com.google.api.grpc + proto-google-cloud-filestore-v1 + 0.0.1-SNAPSHOT + + + com.google.api.grpc + proto-google-cloud-filestore-v1beta1 + 0.0.1-SNAPSHOT + + + + + + + + org.apache.maven.plugins + maven-checkstyle-plugin + + true + + + + + diff --git a/google-cloud-filestore/pom.xml b/google-cloud-filestore/pom.xml new file mode 100644 index 00000000..e72257f3 --- /dev/null +++ b/google-cloud-filestore/pom.xml @@ -0,0 +1,120 @@ + + + 4.0.0 + com.google.cloud + google-cloud-filestore + 0.0.1-SNAPSHOT + jar + Google Cloud Filestore API + https://github.com/googleapis/java-filestore + Cloud Filestore API instances are fully managed NFS file servers on Google Cloud for use with applications running on Compute Engine virtual machines (VMs) instances or Google Kubernetes Engine clusters. + + com.google.cloud + google-cloud-filestore-parent + 0.0.1-SNAPSHOT + + + google-cloud-filestore + + + + io.grpc + grpc-api + + + io.grpc + grpc-stub + + + io.grpc + grpc-protobuf + + + com.google.api + api-common + + + com.google.protobuf + protobuf-java + + + com.google.api.grpc + proto-google-common-protos + + + + com.google.api.grpc + proto-google-cloud-filestore-v1 + + + com.google.api.grpc + proto-google-cloud-filestore-v1beta1 + + + com.google.guava + guava + + + com.google.api + gax + + + com.google.api + gax-grpc + + + org.threeten + threetenbp + + + + + junit + junit + test + 4.13.2 + + + + com.google.api.grpc + grpc-google-cloud-filestore-v1beta1 + test + + + com.google.api.grpc + grpc-google-cloud-filestore-v1 + test + + + + com.google.api + gax-grpc + testlib + test + + + + + + java9 + + [9,) + + + + javax.annotation + javax.annotation-api + + + + + + + + + org.codehaus.mojo + flatten-maven-plugin + + + + \ No newline at end of file diff --git a/google-cloud-filestore/src/main/java/com/google/cloud/filestore/v1/CloudFilestoreManagerClient.java b/google-cloud-filestore/src/main/java/com/google/cloud/filestore/v1/CloudFilestoreManagerClient.java new file mode 100644 index 00000000..e3011430 --- /dev/null +++ b/google-cloud-filestore/src/main/java/com/google/cloud/filestore/v1/CloudFilestoreManagerClient.java @@ -0,0 +1,1754 @@ +/* + * Copyright 2021 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.v1; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.ApiFutures; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.longrunning.OperationFuture; +import com.google.api.gax.paging.AbstractFixedSizeCollection; +import com.google.api.gax.paging.AbstractPage; +import com.google.api.gax.paging.AbstractPagedListResponse; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.common.OperationMetadata; +import com.google.cloud.filestore.v1.stub.CloudFilestoreManagerStub; +import com.google.cloud.filestore.v1.stub.CloudFilestoreManagerStubSettings; +import com.google.common.util.concurrent.MoreExecutors; +import com.google.longrunning.Operation; +import com.google.longrunning.OperationsClient; +import com.google.protobuf.Empty; +import com.google.protobuf.FieldMask; +import java.io.IOException; +import java.util.List; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Service Description: Configures and manages Cloud Filestore resources. + * + *

Cloud Filestore Manager v1. + * + *

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

    + *
  • 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: + * `/projects/{project_number}/locations/{location_id}/instances/{instance_id}` and backups + * are resources of the form: + * `/projects/{project_number}/locations/{location_id}/backup/{backup_id}` + *
+ * + *

Note that location_id must be a GCP `zone` for instances and but to a GCP `region` for + * backups; for example: + * + *

    + *
  • `projects/12345/locations/us-central1-c/instances/my-filestore` + *
  • `projects/12345/locations/us-central1/backups/my-backup` + *
+ * + *

This class provides the ability to make remote calls to the backing service through method + * calls that map to API methods. Sample code to get started: + * + *

{@code
+ * try (CloudFilestoreManagerClient cloudFilestoreManagerClient =
+ *     CloudFilestoreManagerClient.create()) {
+ *   InstanceName name = InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]");
+ *   Instance response = cloudFilestoreManagerClient.getInstance(name);
+ * }
+ * }
+ * + *

Note: close() needs to be called on the CloudFilestoreManagerClient object to clean up + * resources such as threads. In the example above, try-with-resources is used, which automatically + * calls close(). + * + *

The surface of this class includes several types of Java methods for each of the API's + * methods: + * + *

    + *
  1. A "flattened" method. With this type of method, the fields of the request type have been + * converted into function parameters. It may be the case that not all fields are available as + * parameters, and not every API method will have a flattened method entry point. + *
  2. A "request object" method. This type of method only takes one parameter, a request object, + * which must be constructed before the call. Not every API method will have a request object + * method. + *
  3. A "callable" method. This type of method takes no parameters and returns an immutable API + * callable object, which can be used to initiate calls to the service. + *
+ * + *

See the individual methods for example code. + * + *

Many parameters require resource names to be formatted in a particular way. To assist with + * these names, this class includes a format method for each type of name, and additionally a parse + * method to extract the individual identifiers contained within names that are returned. + * + *

This class can be customized by passing in a custom instance of CloudFilestoreManagerSettings + * to create(). For example: + * + *

To customize credentials: + * + *

{@code
+ * CloudFilestoreManagerSettings cloudFilestoreManagerSettings =
+ *     CloudFilestoreManagerSettings.newBuilder()
+ *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ *         .build();
+ * CloudFilestoreManagerClient cloudFilestoreManagerClient =
+ *     CloudFilestoreManagerClient.create(cloudFilestoreManagerSettings);
+ * }
+ * + *

To customize the endpoint: + * + *

{@code
+ * CloudFilestoreManagerSettings cloudFilestoreManagerSettings =
+ *     CloudFilestoreManagerSettings.newBuilder().setEndpoint(myEndpoint).build();
+ * CloudFilestoreManagerClient cloudFilestoreManagerClient =
+ *     CloudFilestoreManagerClient.create(cloudFilestoreManagerSettings);
+ * }
+ * + *

Please refer to the GitHub repository's samples for more quickstart code snippets. + */ +@Generated("by gapic-generator-java") +public class CloudFilestoreManagerClient implements BackgroundResource { + private final CloudFilestoreManagerSettings settings; + private final CloudFilestoreManagerStub stub; + private final OperationsClient operationsClient; + + /** Constructs an instance of CloudFilestoreManagerClient with default settings. */ + public static final CloudFilestoreManagerClient create() throws IOException { + return create(CloudFilestoreManagerSettings.newBuilder().build()); + } + + /** + * Constructs an instance of CloudFilestoreManagerClient, using the given settings. The channels + * are created based on the settings passed in, or defaults for any settings that are not set. + */ + public static final CloudFilestoreManagerClient create(CloudFilestoreManagerSettings settings) + throws IOException { + return new CloudFilestoreManagerClient(settings); + } + + /** + * Constructs an instance of CloudFilestoreManagerClient, using the given stub for making calls. + * This is for advanced usage - prefer using create(CloudFilestoreManagerSettings). + */ + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public static final CloudFilestoreManagerClient create(CloudFilestoreManagerStub stub) { + return new CloudFilestoreManagerClient(stub); + } + + /** + * Constructs an instance of CloudFilestoreManagerClient, using the given settings. This is + * protected so that it is easy to make a subclass, but otherwise, the static factory methods + * should be preferred. + */ + protected CloudFilestoreManagerClient(CloudFilestoreManagerSettings settings) throws IOException { + this.settings = settings; + this.stub = ((CloudFilestoreManagerStubSettings) settings.getStubSettings()).createStub(); + this.operationsClient = OperationsClient.create(this.stub.getOperationsStub()); + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + protected CloudFilestoreManagerClient(CloudFilestoreManagerStub stub) { + this.settings = null; + this.stub = stub; + this.operationsClient = OperationsClient.create(this.stub.getOperationsStub()); + } + + public final CloudFilestoreManagerSettings getSettings() { + return settings; + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public CloudFilestoreManagerStub getStub() { + return stub; + } + + /** + * Returns the OperationsClient that can be used to query the status of a long-running operation + * returned by another API method call. + */ + public final OperationsClient getOperationsClient() { + return operationsClient; + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists all instances in a project for either a specified location or for all locations. + * + *

Sample code: + * + *

{@code
+   * try (CloudFilestoreManagerClient cloudFilestoreManagerClient =
+   *     CloudFilestoreManagerClient.create()) {
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   for (Instance element : cloudFilestoreManagerClient.listInstances(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. The project and location for which to retrieve instance information, in + * the format projects/{project_id}/locations/{location}. In Cloud Filestore, locations map to + * GCP zones, for example **us-west1-b**. To retrieve instance information for + * all locations, use "-" for the {location} value. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListInstancesPagedResponse listInstances(LocationName parent) { + ListInstancesRequest request = + ListInstancesRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .build(); + return listInstances(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists all instances in a project for either a specified location or for all locations. + * + *

Sample code: + * + *

{@code
+   * try (CloudFilestoreManagerClient cloudFilestoreManagerClient =
+   *     CloudFilestoreManagerClient.create()) {
+   *   String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
+   *   for (Instance element : cloudFilestoreManagerClient.listInstances(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. The project and location for which to retrieve instance information, in + * the format projects/{project_id}/locations/{location}. In Cloud Filestore, locations map to + * GCP zones, for example **us-west1-b**. To retrieve instance information for + * all locations, use "-" for the {location} value. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListInstancesPagedResponse listInstances(String parent) { + ListInstancesRequest request = ListInstancesRequest.newBuilder().setParent(parent).build(); + return listInstances(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists all instances in a project for either a specified location or for all locations. + * + *

Sample code: + * + *

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

Sample code: + * + *

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

Sample code: + * + *

{@code
+   * try (CloudFilestoreManagerClient cloudFilestoreManagerClient =
+   *     CloudFilestoreManagerClient.create()) {
+   *   ListInstancesRequest request =
+   *       ListInstancesRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .setOrderBy("orderBy-1207110587")
+   *           .setFilter("filter-1274492040")
+   *           .build();
+   *   while (true) {
+   *     ListInstancesResponse response =
+   *         cloudFilestoreManagerClient.listInstancesCallable().call(request);
+   *     for (Instance element : response.getResponsesList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable listInstancesCallable() { + return stub.listInstancesCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets the details of a specific instance. + * + *

Sample code: + * + *

{@code
+   * try (CloudFilestoreManagerClient cloudFilestoreManagerClient =
+   *     CloudFilestoreManagerClient.create()) {
+   *   InstanceName name = InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]");
+   *   Instance response = cloudFilestoreManagerClient.getInstance(name);
+   * }
+   * }
+ * + * @param name Required. The instance resource name, 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 Instance getInstance(InstanceName name) { + GetInstanceRequest request = + GetInstanceRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return getInstance(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets the details of a specific instance. + * + *

Sample code: + * + *

{@code
+   * try (CloudFilestoreManagerClient cloudFilestoreManagerClient =
+   *     CloudFilestoreManagerClient.create()) {
+   *   String name = InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString();
+   *   Instance response = cloudFilestoreManagerClient.getInstance(name);
+   * }
+   * }
+ * + * @param name Required. The instance resource name, 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 Instance getInstance(String name) { + GetInstanceRequest request = GetInstanceRequest.newBuilder().setName(name).build(); + return getInstance(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets the details of a specific instance. + * + *

Sample code: + * + *

{@code
+   * try (CloudFilestoreManagerClient cloudFilestoreManagerClient =
+   *     CloudFilestoreManagerClient.create()) {
+   *   GetInstanceRequest request =
+   *       GetInstanceRequest.newBuilder()
+   *           .setName(InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString())
+   *           .build();
+   *   Instance response = cloudFilestoreManagerClient.getInstance(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 Instance getInstance(GetInstanceRequest request) { + return getInstanceCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets the details of a specific instance. + * + *

Sample code: + * + *

{@code
+   * try (CloudFilestoreManagerClient cloudFilestoreManagerClient =
+   *     CloudFilestoreManagerClient.create()) {
+   *   GetInstanceRequest request =
+   *       GetInstanceRequest.newBuilder()
+   *           .setName(InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString())
+   *           .build();
+   *   ApiFuture future =
+   *       cloudFilestoreManagerClient.getInstanceCallable().futureCall(request);
+   *   // Do something.
+   *   Instance response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable getInstanceCallable() { + return stub.getInstanceCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * 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). + * + *

Sample code: + * + *

{@code
+   * try (CloudFilestoreManagerClient cloudFilestoreManagerClient =
+   *     CloudFilestoreManagerClient.create()) {
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   Instance instance = Instance.newBuilder().build();
+   *   String instanceId = "instanceId902024336";
+   *   Instance response =
+   *       cloudFilestoreManagerClient.createInstanceAsync(parent, instance, instanceId).get();
+   * }
+   * }
+ * + * @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**. + * @param instance Required. A [instance resource] + * (/cloud-filestore/reference/rest/v1/projects.locations.instances) + * @param instanceId Required. The name of the instance to create. The name must be unique for the + * specified project and location. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture createInstanceAsync( + LocationName parent, Instance instance, String instanceId) { + CreateInstanceRequest request = + CreateInstanceRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .setInstance(instance) + .setInstanceId(instanceId) + .build(); + return createInstanceAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * 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). + * + *

Sample code: + * + *

{@code
+   * try (CloudFilestoreManagerClient cloudFilestoreManagerClient =
+   *     CloudFilestoreManagerClient.create()) {
+   *   String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
+   *   Instance instance = Instance.newBuilder().build();
+   *   String instanceId = "instanceId902024336";
+   *   Instance response =
+   *       cloudFilestoreManagerClient.createInstanceAsync(parent, instance, instanceId).get();
+   * }
+   * }
+ * + * @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**. + * @param instance Required. A [instance resource] + * (/cloud-filestore/reference/rest/v1/projects.locations.instances) + * @param instanceId Required. The name of the instance to create. The name must be unique for the + * specified project and location. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture createInstanceAsync( + String parent, Instance instance, String instanceId) { + CreateInstanceRequest request = + CreateInstanceRequest.newBuilder() + .setParent(parent) + .setInstance(instance) + .setInstanceId(instanceId) + .build(); + return createInstanceAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * 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). + * + *

Sample code: + * + *

{@code
+   * try (CloudFilestoreManagerClient cloudFilestoreManagerClient =
+   *     CloudFilestoreManagerClient.create()) {
+   *   CreateInstanceRequest request =
+   *       CreateInstanceRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setInstanceId("instanceId902024336")
+   *           .setInstance(Instance.newBuilder().build())
+   *           .build();
+   *   Instance response = cloudFilestoreManagerClient.createInstanceAsync(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 createInstanceAsync( + CreateInstanceRequest request) { + return createInstanceOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * 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). + * + *

Sample code: + * + *

{@code
+   * try (CloudFilestoreManagerClient cloudFilestoreManagerClient =
+   *     CloudFilestoreManagerClient.create()) {
+   *   CreateInstanceRequest request =
+   *       CreateInstanceRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setInstanceId("instanceId902024336")
+   *           .setInstance(Instance.newBuilder().build())
+   *           .build();
+   *   OperationFuture future =
+   *       cloudFilestoreManagerClient.createInstanceOperationCallable().futureCall(request);
+   *   // Do something.
+   *   Instance response = future.get();
+   * }
+   * }
+ */ + public final OperationCallable + createInstanceOperationCallable() { + return stub.createInstanceOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * 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). + * + *

Sample code: + * + *

{@code
+   * try (CloudFilestoreManagerClient cloudFilestoreManagerClient =
+   *     CloudFilestoreManagerClient.create()) {
+   *   CreateInstanceRequest request =
+   *       CreateInstanceRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setInstanceId("instanceId902024336")
+   *           .setInstance(Instance.newBuilder().build())
+   *           .build();
+   *   ApiFuture future =
+   *       cloudFilestoreManagerClient.createInstanceCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable createInstanceCallable() { + return stub.createInstanceCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates the settings of a specific instance. + * + *

Sample code: + * + *

{@code
+   * try (CloudFilestoreManagerClient cloudFilestoreManagerClient =
+   *     CloudFilestoreManagerClient.create()) {
+   *   Instance instance = Instance.newBuilder().build();
+   *   FieldMask updateMask = FieldMask.newBuilder().build();
+   *   Instance response =
+   *       cloudFilestoreManagerClient.updateInstanceAsync(instance, updateMask).get();
+   * }
+   * }
+ * + * @param instance Only fields specified in update_mask are updated. + * @param updateMask 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" + *
  • "file_shares" + *
  • "labels" + *
+ * + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture updateInstanceAsync( + Instance instance, FieldMask updateMask) { + UpdateInstanceRequest request = + UpdateInstanceRequest.newBuilder().setInstance(instance).setUpdateMask(updateMask).build(); + return updateInstanceAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates the settings of a specific instance. + * + *

Sample code: + * + *

{@code
+   * try (CloudFilestoreManagerClient cloudFilestoreManagerClient =
+   *     CloudFilestoreManagerClient.create()) {
+   *   UpdateInstanceRequest request =
+   *       UpdateInstanceRequest.newBuilder()
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .setInstance(Instance.newBuilder().build())
+   *           .build();
+   *   Instance response = cloudFilestoreManagerClient.updateInstanceAsync(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 updateInstanceAsync( + UpdateInstanceRequest request) { + return updateInstanceOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates the settings of a specific instance. + * + *

Sample code: + * + *

{@code
+   * try (CloudFilestoreManagerClient cloudFilestoreManagerClient =
+   *     CloudFilestoreManagerClient.create()) {
+   *   UpdateInstanceRequest request =
+   *       UpdateInstanceRequest.newBuilder()
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .setInstance(Instance.newBuilder().build())
+   *           .build();
+   *   OperationFuture future =
+   *       cloudFilestoreManagerClient.updateInstanceOperationCallable().futureCall(request);
+   *   // Do something.
+   *   Instance response = future.get();
+   * }
+   * }
+ */ + public final OperationCallable + updateInstanceOperationCallable() { + return stub.updateInstanceOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates the settings of a specific instance. + * + *

Sample code: + * + *

{@code
+   * try (CloudFilestoreManagerClient cloudFilestoreManagerClient =
+   *     CloudFilestoreManagerClient.create()) {
+   *   UpdateInstanceRequest request =
+   *       UpdateInstanceRequest.newBuilder()
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .setInstance(Instance.newBuilder().build())
+   *           .build();
+   *   ApiFuture future =
+   *       cloudFilestoreManagerClient.updateInstanceCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable updateInstanceCallable() { + return stub.updateInstanceCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * 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). + * + *

Sample code: + * + *

{@code
+   * try (CloudFilestoreManagerClient cloudFilestoreManagerClient =
+   *     CloudFilestoreManagerClient.create()) {
+   *   RestoreInstanceRequest request =
+   *       RestoreInstanceRequest.newBuilder()
+   *           .setName(InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString())
+   *           .setFileShare("fileShare-1327728701")
+   *           .build();
+   *   Instance response = cloudFilestoreManagerClient.restoreInstanceAsync(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 restoreInstanceAsync( + RestoreInstanceRequest request) { + return restoreInstanceOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * 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). + * + *

Sample code: + * + *

{@code
+   * try (CloudFilestoreManagerClient cloudFilestoreManagerClient =
+   *     CloudFilestoreManagerClient.create()) {
+   *   RestoreInstanceRequest request =
+   *       RestoreInstanceRequest.newBuilder()
+   *           .setName(InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString())
+   *           .setFileShare("fileShare-1327728701")
+   *           .build();
+   *   OperationFuture future =
+   *       cloudFilestoreManagerClient.restoreInstanceOperationCallable().futureCall(request);
+   *   // Do something.
+   *   Instance response = future.get();
+   * }
+   * }
+ */ + public final OperationCallable + restoreInstanceOperationCallable() { + return stub.restoreInstanceOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * 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). + * + *

Sample code: + * + *

{@code
+   * try (CloudFilestoreManagerClient cloudFilestoreManagerClient =
+   *     CloudFilestoreManagerClient.create()) {
+   *   RestoreInstanceRequest request =
+   *       RestoreInstanceRequest.newBuilder()
+   *           .setName(InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString())
+   *           .setFileShare("fileShare-1327728701")
+   *           .build();
+   *   ApiFuture future =
+   *       cloudFilestoreManagerClient.restoreInstanceCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable restoreInstanceCallable() { + return stub.restoreInstanceCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes an instance. + * + *

Sample code: + * + *

{@code
+   * try (CloudFilestoreManagerClient cloudFilestoreManagerClient =
+   *     CloudFilestoreManagerClient.create()) {
+   *   InstanceName name = InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]");
+   *   cloudFilestoreManagerClient.deleteInstanceAsync(name).get();
+   * }
+   * }
+ * + * @param name Required. The instance resource name, 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 OperationFuture deleteInstanceAsync(InstanceName name) { + DeleteInstanceRequest request = + DeleteInstanceRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return deleteInstanceAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes an instance. + * + *

Sample code: + * + *

{@code
+   * try (CloudFilestoreManagerClient cloudFilestoreManagerClient =
+   *     CloudFilestoreManagerClient.create()) {
+   *   String name = InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString();
+   *   cloudFilestoreManagerClient.deleteInstanceAsync(name).get();
+   * }
+   * }
+ * + * @param name Required. The instance resource name, 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 OperationFuture deleteInstanceAsync(String name) { + DeleteInstanceRequest request = DeleteInstanceRequest.newBuilder().setName(name).build(); + return deleteInstanceAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes an instance. + * + *

Sample code: + * + *

{@code
+   * try (CloudFilestoreManagerClient cloudFilestoreManagerClient =
+   *     CloudFilestoreManagerClient.create()) {
+   *   DeleteInstanceRequest request =
+   *       DeleteInstanceRequest.newBuilder()
+   *           .setName(InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString())
+   *           .build();
+   *   cloudFilestoreManagerClient.deleteInstanceAsync(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 deleteInstanceAsync( + DeleteInstanceRequest request) { + return deleteInstanceOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes an instance. + * + *

Sample code: + * + *

{@code
+   * try (CloudFilestoreManagerClient cloudFilestoreManagerClient =
+   *     CloudFilestoreManagerClient.create()) {
+   *   DeleteInstanceRequest request =
+   *       DeleteInstanceRequest.newBuilder()
+   *           .setName(InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString())
+   *           .build();
+   *   OperationFuture future =
+   *       cloudFilestoreManagerClient.deleteInstanceOperationCallable().futureCall(request);
+   *   // Do something.
+   *   future.get();
+   * }
+   * }
+ */ + public final OperationCallable + deleteInstanceOperationCallable() { + return stub.deleteInstanceOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes an instance. + * + *

Sample code: + * + *

{@code
+   * try (CloudFilestoreManagerClient cloudFilestoreManagerClient =
+   *     CloudFilestoreManagerClient.create()) {
+   *   DeleteInstanceRequest request =
+   *       DeleteInstanceRequest.newBuilder()
+   *           .setName(InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString())
+   *           .build();
+   *   ApiFuture future =
+   *       cloudFilestoreManagerClient.deleteInstanceCallable().futureCall(request);
+   *   // Do something.
+   *   future.get();
+   * }
+   * }
+ */ + public final UnaryCallable deleteInstanceCallable() { + return stub.deleteInstanceCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists all backups in a project for either a specified location or for all locations. + * + *

Sample code: + * + *

{@code
+   * 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_number}/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. + * @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
+   * 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_number}/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. + * @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
+   * 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
+   * 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
+   * 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.getResponsesList()) {
+   *       // 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
+   * 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_number}/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
+   * 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_number}/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
+   * 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
+   * 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
+   * 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_number}/locations/{location}. In Cloud Filestore, backup locations map to + * GCP regions, for example **us-west1**. + * @param backup Required. A [backup resource] + * (/cloud-filestore/reference/rest/v1/projects.locations.backups) + * @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. Values that do not match this pattern + * will trigger an INVALID_ARGUMENT error. + * @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
+   * 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_number}/locations/{location}. In Cloud Filestore, backup locations map to + * GCP regions, for example **us-west1**. + * @param backup Required. A [backup resource] + * (/cloud-filestore/reference/rest/v1/projects.locations.backups) + * @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. Values that do not match this pattern + * will trigger an INVALID_ARGUMENT error. + * @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
+   * 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
+   * 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
+   * 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
+   * 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_number}/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
+   * 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_number}/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
+   * 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
+   * 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
+   * 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
+   * 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] + * (/cloud-filestore/reference/rest/v1/projects.locations.backups) + * @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 updateBackupAsync( + Backup backup, FieldMask updateMask) { + UpdateBackupRequest request = + UpdateBackupRequest.newBuilder().setBackup(backup).setUpdateMask(updateMask).build(); + return updateBackupAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates the settings of a specific backup. + * + *

Sample code: + * + *

{@code
+   * 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
+   * 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
+   * 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(); + } + + @Override + public final void close() { + stub.close(); + } + + @Override + public void shutdown() { + stub.shutdown(); + } + + @Override + public boolean isShutdown() { + return stub.isShutdown(); + } + + @Override + public boolean isTerminated() { + return stub.isTerminated(); + } + + @Override + public void shutdownNow() { + stub.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return stub.awaitTermination(duration, unit); + } + + public static class ListInstancesPagedResponse + extends AbstractPagedListResponse< + ListInstancesRequest, + ListInstancesResponse, + Instance, + ListInstancesPage, + ListInstancesFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListInstancesPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + new ApiFunction() { + @Override + public ListInstancesPagedResponse apply(ListInstancesPage input) { + return new ListInstancesPagedResponse(input); + } + }, + MoreExecutors.directExecutor()); + } + + private ListInstancesPagedResponse(ListInstancesPage page) { + super(page, ListInstancesFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListInstancesPage + extends AbstractPage< + ListInstancesRequest, ListInstancesResponse, Instance, ListInstancesPage> { + + private ListInstancesPage( + PageContext context, + ListInstancesResponse response) { + super(context, response); + } + + private static ListInstancesPage createEmptyPage() { + return new ListInstancesPage(null, null); + } + + @Override + protected ListInstancesPage createPage( + PageContext context, + ListInstancesResponse response) { + return new ListInstancesPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListInstancesFixedSizeCollection + extends AbstractFixedSizeCollection< + ListInstancesRequest, + ListInstancesResponse, + Instance, + ListInstancesPage, + ListInstancesFixedSizeCollection> { + + private ListInstancesFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListInstancesFixedSizeCollection createEmptyCollection() { + return new ListInstancesFixedSizeCollection(null, 0); + } + + @Override + protected ListInstancesFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListInstancesFixedSizeCollection(pages, collectionSize); + } + } + + public static class ListBackupsPagedResponse + extends AbstractPagedListResponse< + ListBackupsRequest, + ListBackupsResponse, + Backup, + ListBackupsPage, + ListBackupsFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListBackupsPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + new ApiFunction() { + @Override + public ListBackupsPagedResponse apply(ListBackupsPage input) { + return new ListBackupsPagedResponse(input); + } + }, + MoreExecutors.directExecutor()); + } + + private ListBackupsPagedResponse(ListBackupsPage page) { + super(page, ListBackupsFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListBackupsPage + extends AbstractPage { + + private ListBackupsPage( + PageContext context, + ListBackupsResponse response) { + super(context, response); + } + + private static ListBackupsPage createEmptyPage() { + return new ListBackupsPage(null, null); + } + + @Override + protected ListBackupsPage createPage( + PageContext context, + ListBackupsResponse response) { + return new ListBackupsPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListBackupsFixedSizeCollection + extends AbstractFixedSizeCollection< + ListBackupsRequest, + ListBackupsResponse, + Backup, + ListBackupsPage, + ListBackupsFixedSizeCollection> { + + private ListBackupsFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListBackupsFixedSizeCollection createEmptyCollection() { + return new ListBackupsFixedSizeCollection(null, 0); + } + + @Override + protected ListBackupsFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListBackupsFixedSizeCollection(pages, collectionSize); + } + } +} diff --git a/google-cloud-filestore/src/main/java/com/google/cloud/filestore/v1/CloudFilestoreManagerSettings.java b/google-cloud-filestore/src/main/java/com/google/cloud/filestore/v1/CloudFilestoreManagerSettings.java new file mode 100644 index 00000000..1b1605c5 --- /dev/null +++ b/google-cloud-filestore/src/main/java/com/google/cloud/filestore/v1/CloudFilestoreManagerSettings.java @@ -0,0 +1,386 @@ +/* + * Copyright 2021 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.v1; + +import static com.google.cloud.filestore.v1.CloudFilestoreManagerClient.ListBackupsPagedResponse; +import static com.google.cloud.filestore.v1.CloudFilestoreManagerClient.ListInstancesPagedResponse; + +import com.google.api.core.ApiFunction; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientSettings; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.cloud.common.OperationMetadata; +import com.google.cloud.filestore.v1.stub.CloudFilestoreManagerStubSettings; +import com.google.longrunning.Operation; +import com.google.protobuf.Empty; +import java.io.IOException; +import java.util.List; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Settings class to configure an instance of {@link CloudFilestoreManagerClient}. + * + *

The default instance has everything set to sensible defaults: + * + *

    + *
  • The default service address (file.googleapis.com) and default port (443) are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
+ * + *

The builder of this class is recursive, so contained classes are themselves builders. When + * build() is called, the tree of builders is called to create the complete settings object. + * + *

For example, to set the total timeout of getInstance to 30 seconds: + * + *

{@code
+ * CloudFilestoreManagerSettings.Builder cloudFilestoreManagerSettingsBuilder =
+ *     CloudFilestoreManagerSettings.newBuilder();
+ * cloudFilestoreManagerSettingsBuilder
+ *     .getInstanceSettings()
+ *     .setRetrySettings(
+ *         cloudFilestoreManagerSettingsBuilder
+ *             .getInstanceSettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
+ *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .build());
+ * CloudFilestoreManagerSettings cloudFilestoreManagerSettings =
+ *     cloudFilestoreManagerSettingsBuilder.build();
+ * }
+ */ +@Generated("by gapic-generator-java") +public class CloudFilestoreManagerSettings extends ClientSettings { + + /** Returns the object with the settings used for calls to listInstances. */ + public PagedCallSettings + listInstancesSettings() { + return ((CloudFilestoreManagerStubSettings) getStubSettings()).listInstancesSettings(); + } + + /** Returns the object with the settings used for calls to getInstance. */ + public UnaryCallSettings getInstanceSettings() { + return ((CloudFilestoreManagerStubSettings) getStubSettings()).getInstanceSettings(); + } + + /** Returns the object with the settings used for calls to createInstance. */ + public UnaryCallSettings createInstanceSettings() { + return ((CloudFilestoreManagerStubSettings) getStubSettings()).createInstanceSettings(); + } + + /** Returns the object with the settings used for calls to createInstance. */ + public OperationCallSettings + createInstanceOperationSettings() { + return ((CloudFilestoreManagerStubSettings) getStubSettings()) + .createInstanceOperationSettings(); + } + + /** Returns the object with the settings used for calls to updateInstance. */ + public UnaryCallSettings updateInstanceSettings() { + return ((CloudFilestoreManagerStubSettings) getStubSettings()).updateInstanceSettings(); + } + + /** Returns the object with the settings used for calls to updateInstance. */ + public OperationCallSettings + updateInstanceOperationSettings() { + return ((CloudFilestoreManagerStubSettings) getStubSettings()) + .updateInstanceOperationSettings(); + } + + /** Returns the object with the settings used for calls to restoreInstance. */ + public UnaryCallSettings restoreInstanceSettings() { + return ((CloudFilestoreManagerStubSettings) getStubSettings()).restoreInstanceSettings(); + } + + /** Returns the object with the settings used for calls to restoreInstance. */ + public OperationCallSettings + restoreInstanceOperationSettings() { + return ((CloudFilestoreManagerStubSettings) getStubSettings()) + .restoreInstanceOperationSettings(); + } + + /** Returns the object with the settings used for calls to deleteInstance. */ + public UnaryCallSettings deleteInstanceSettings() { + return ((CloudFilestoreManagerStubSettings) getStubSettings()).deleteInstanceSettings(); + } + + /** Returns the object with the settings used for calls to deleteInstance. */ + public OperationCallSettings + deleteInstanceOperationSettings() { + return ((CloudFilestoreManagerStubSettings) getStubSettings()) + .deleteInstanceOperationSettings(); + } + + /** Returns the object with the settings used for calls to listBackups. */ + public PagedCallSettings + listBackupsSettings() { + return ((CloudFilestoreManagerStubSettings) getStubSettings()).listBackupsSettings(); + } + + /** Returns the object with the settings used for calls to getBackup. */ + public UnaryCallSettings getBackupSettings() { + return ((CloudFilestoreManagerStubSettings) getStubSettings()).getBackupSettings(); + } + + /** Returns the object with the settings used for calls to createBackup. */ + public UnaryCallSettings createBackupSettings() { + return ((CloudFilestoreManagerStubSettings) getStubSettings()).createBackupSettings(); + } + + /** Returns the object with the settings used for calls to createBackup. */ + public OperationCallSettings + createBackupOperationSettings() { + return ((CloudFilestoreManagerStubSettings) getStubSettings()).createBackupOperationSettings(); + } + + /** Returns the object with the settings used for calls to deleteBackup. */ + public UnaryCallSettings deleteBackupSettings() { + return ((CloudFilestoreManagerStubSettings) getStubSettings()).deleteBackupSettings(); + } + + /** Returns the object with the settings used for calls to deleteBackup. */ + public OperationCallSettings + deleteBackupOperationSettings() { + return ((CloudFilestoreManagerStubSettings) getStubSettings()).deleteBackupOperationSettings(); + } + + /** Returns the object with the settings used for calls to updateBackup. */ + public UnaryCallSettings updateBackupSettings() { + return ((CloudFilestoreManagerStubSettings) getStubSettings()).updateBackupSettings(); + } + + /** Returns the object with the settings used for calls to updateBackup. */ + public OperationCallSettings + updateBackupOperationSettings() { + return ((CloudFilestoreManagerStubSettings) getStubSettings()).updateBackupOperationSettings(); + } + + public static final CloudFilestoreManagerSettings create(CloudFilestoreManagerStubSettings stub) + throws IOException { + return new CloudFilestoreManagerSettings.Builder(stub.toBuilder()).build(); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return CloudFilestoreManagerStubSettings.defaultExecutorProviderBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return CloudFilestoreManagerStubSettings.getDefaultEndpoint(); + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return CloudFilestoreManagerStubSettings.getDefaultServiceScopes(); + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return CloudFilestoreManagerStubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return CloudFilestoreManagerStubSettings.defaultGrpcTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return CloudFilestoreManagerStubSettings.defaultTransportChannelProvider(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return CloudFilestoreManagerStubSettings.defaultApiClientHeaderProviderBuilder(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** Returns a builder containing all the values of this settings class. */ + public Builder toBuilder() { + return new Builder(this); + } + + protected CloudFilestoreManagerSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** Builder for CloudFilestoreManagerSettings. */ + public static class Builder + extends ClientSettings.Builder { + + protected Builder() throws IOException { + this(((ClientContext) null)); + } + + protected Builder(ClientContext clientContext) { + super(CloudFilestoreManagerStubSettings.newBuilder(clientContext)); + } + + protected Builder(CloudFilestoreManagerSettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(CloudFilestoreManagerStubSettings.Builder stubSettings) { + super(stubSettings); + } + + private static Builder createDefault() { + return new Builder(CloudFilestoreManagerStubSettings.newBuilder()); + } + + public CloudFilestoreManagerStubSettings.Builder getStubSettingsBuilder() { + return ((CloudFilestoreManagerStubSettings.Builder) getStubSettings()); + } + + // NEXT_MAJOR_VER: remove 'throws Exception'. + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + *

Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) throws Exception { + super.applyToAllUnaryMethods( + getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); + return this; + } + + /** Returns the builder for the settings used for calls to listInstances. */ + public PagedCallSettings.Builder< + ListInstancesRequest, ListInstancesResponse, ListInstancesPagedResponse> + listInstancesSettings() { + return getStubSettingsBuilder().listInstancesSettings(); + } + + /** Returns the builder for the settings used for calls to getInstance. */ + public UnaryCallSettings.Builder getInstanceSettings() { + return getStubSettingsBuilder().getInstanceSettings(); + } + + /** Returns the builder for the settings used for calls to createInstance. */ + public UnaryCallSettings.Builder createInstanceSettings() { + return getStubSettingsBuilder().createInstanceSettings(); + } + + /** Returns the builder for the settings used for calls to createInstance. */ + public OperationCallSettings.Builder + createInstanceOperationSettings() { + return getStubSettingsBuilder().createInstanceOperationSettings(); + } + + /** Returns the builder for the settings used for calls to updateInstance. */ + public UnaryCallSettings.Builder updateInstanceSettings() { + return getStubSettingsBuilder().updateInstanceSettings(); + } + + /** Returns the builder for the settings used for calls to updateInstance. */ + public OperationCallSettings.Builder + updateInstanceOperationSettings() { + return getStubSettingsBuilder().updateInstanceOperationSettings(); + } + + /** Returns the builder for the settings used for calls to restoreInstance. */ + public UnaryCallSettings.Builder restoreInstanceSettings() { + return getStubSettingsBuilder().restoreInstanceSettings(); + } + + /** Returns the builder for the settings used for calls to restoreInstance. */ + public OperationCallSettings.Builder + restoreInstanceOperationSettings() { + return getStubSettingsBuilder().restoreInstanceOperationSettings(); + } + + /** Returns the builder for the settings used for calls to deleteInstance. */ + public UnaryCallSettings.Builder deleteInstanceSettings() { + return getStubSettingsBuilder().deleteInstanceSettings(); + } + + /** Returns the builder for the settings used for calls to deleteInstance. */ + public OperationCallSettings.Builder + deleteInstanceOperationSettings() { + return getStubSettingsBuilder().deleteInstanceOperationSettings(); + } + + /** Returns the builder for the settings used for calls to listBackups. */ + public PagedCallSettings.Builder< + ListBackupsRequest, ListBackupsResponse, ListBackupsPagedResponse> + listBackupsSettings() { + return getStubSettingsBuilder().listBackupsSettings(); + } + + /** Returns the builder for the settings used for calls to getBackup. */ + public UnaryCallSettings.Builder getBackupSettings() { + return getStubSettingsBuilder().getBackupSettings(); + } + + /** Returns the builder for the settings used for calls to createBackup. */ + public UnaryCallSettings.Builder createBackupSettings() { + return getStubSettingsBuilder().createBackupSettings(); + } + + /** Returns the builder for the settings used for calls to createBackup. */ + public OperationCallSettings.Builder + createBackupOperationSettings() { + return getStubSettingsBuilder().createBackupOperationSettings(); + } + + /** Returns the builder for the settings used for calls to deleteBackup. */ + public UnaryCallSettings.Builder deleteBackupSettings() { + return getStubSettingsBuilder().deleteBackupSettings(); + } + + /** Returns the builder for the settings used for calls to deleteBackup. */ + public OperationCallSettings.Builder + deleteBackupOperationSettings() { + return getStubSettingsBuilder().deleteBackupOperationSettings(); + } + + /** Returns the builder for the settings used for calls to updateBackup. */ + public UnaryCallSettings.Builder updateBackupSettings() { + return getStubSettingsBuilder().updateBackupSettings(); + } + + /** Returns the builder for the settings used for calls to updateBackup. */ + public OperationCallSettings.Builder + updateBackupOperationSettings() { + return getStubSettingsBuilder().updateBackupOperationSettings(); + } + + @Override + public CloudFilestoreManagerSettings build() throws IOException { + return new CloudFilestoreManagerSettings(this); + } + } +} diff --git a/google-cloud-filestore/src/main/java/com/google/cloud/filestore/v1/gapic_metadata.json b/google-cloud-filestore/src/main/java/com/google/cloud/filestore/v1/gapic_metadata.json new file mode 100644 index 00000000..9a96f22a --- /dev/null +++ b/google-cloud-filestore/src/main/java/com/google/cloud/filestore/v1/gapic_metadata.json @@ -0,0 +1,51 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "java", + "protoPackage": "google.cloud.filestore.v1", + "libraryPackage": "com.google.cloud.filestore.v1", + "services": { + "CloudFilestoreManager": { + "clients": { + "grpc": { + "libraryClient": "CloudFilestoreManagerClient", + "rpcs": { + "CreateBackup": { + "methods": ["createBackupAsync", "createBackupAsync", "createBackupAsync", "createBackupOperationCallable", "createBackupCallable"] + }, + "CreateInstance": { + "methods": ["createInstanceAsync", "createInstanceAsync", "createInstanceAsync", "createInstanceOperationCallable", "createInstanceCallable"] + }, + "DeleteBackup": { + "methods": ["deleteBackupAsync", "deleteBackupAsync", "deleteBackupAsync", "deleteBackupOperationCallable", "deleteBackupCallable"] + }, + "DeleteInstance": { + "methods": ["deleteInstanceAsync", "deleteInstanceAsync", "deleteInstanceAsync", "deleteInstanceOperationCallable", "deleteInstanceCallable"] + }, + "GetBackup": { + "methods": ["getBackup", "getBackup", "getBackup", "getBackupCallable"] + }, + "GetInstance": { + "methods": ["getInstance", "getInstance", "getInstance", "getInstanceCallable"] + }, + "ListBackups": { + "methods": ["listBackups", "listBackups", "listBackups", "listBackupsPagedCallable", "listBackupsCallable"] + }, + "ListInstances": { + "methods": ["listInstances", "listInstances", "listInstances", "listInstancesPagedCallable", "listInstancesCallable"] + }, + "RestoreInstance": { + "methods": ["restoreInstanceAsync", "restoreInstanceOperationCallable", "restoreInstanceCallable"] + }, + "UpdateBackup": { + "methods": ["updateBackupAsync", "updateBackupAsync", "updateBackupOperationCallable", "updateBackupCallable"] + }, + "UpdateInstance": { + "methods": ["updateInstanceAsync", "updateInstanceAsync", "updateInstanceOperationCallable", "updateInstanceCallable"] + } + } + } + } + } + } +} \ No newline at end of file diff --git a/google-cloud-filestore/src/main/java/com/google/cloud/filestore/v1/package-info.java b/google-cloud-filestore/src/main/java/com/google/cloud/filestore/v1/package-info.java new file mode 100644 index 00000000..0978e29f --- /dev/null +++ b/google-cloud-filestore/src/main/java/com/google/cloud/filestore/v1/package-info.java @@ -0,0 +1,61 @@ +/* + * Copyright 2021 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. + */ + +/** + * The interfaces provided are listed below, along with usage samples. + * + *

======================= CloudFilestoreManagerClient ======================= + * + *

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

Cloud Filestore Manager v1. + * + *

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

    + *
  • 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: + * `/projects/{project_number}/locations/{location_id}/instances/{instance_id}` and backups + * are resources of the form: + * `/projects/{project_number}/locations/{location_id}/backup/{backup_id}` + *
+ * + *

Note that location_id must be a GCP `zone` for instances and but to a GCP `region` for + * backups; for example: + * + *

    + *
  • `projects/12345/locations/us-central1-c/instances/my-filestore` + *
  • `projects/12345/locations/us-central1/backups/my-backup` + *
+ * + *

Sample for CloudFilestoreManagerClient: + * + *

{@code
+ * try (CloudFilestoreManagerClient cloudFilestoreManagerClient =
+ *     CloudFilestoreManagerClient.create()) {
+ *   InstanceName name = InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]");
+ *   Instance response = cloudFilestoreManagerClient.getInstance(name);
+ * }
+ * }
+ */ +@Generated("by gapic-generator-java") +package com.google.cloud.filestore.v1; + +import javax.annotation.Generated; diff --git a/google-cloud-filestore/src/main/java/com/google/cloud/filestore/v1/stub/CloudFilestoreManagerStub.java b/google-cloud-filestore/src/main/java/com/google/cloud/filestore/v1/stub/CloudFilestoreManagerStub.java new file mode 100644 index 00000000..69d35a87 --- /dev/null +++ b/google-cloud-filestore/src/main/java/com/google/cloud/filestore/v1/stub/CloudFilestoreManagerStub.java @@ -0,0 +1,149 @@ +/* + * Copyright 2021 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.v1.stub; + +import static com.google.cloud.filestore.v1.CloudFilestoreManagerClient.ListBackupsPagedResponse; +import static com.google.cloud.filestore.v1.CloudFilestoreManagerClient.ListInstancesPagedResponse; + +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.common.OperationMetadata; +import com.google.cloud.filestore.v1.Backup; +import com.google.cloud.filestore.v1.CreateBackupRequest; +import com.google.cloud.filestore.v1.CreateInstanceRequest; +import com.google.cloud.filestore.v1.DeleteBackupRequest; +import com.google.cloud.filestore.v1.DeleteInstanceRequest; +import com.google.cloud.filestore.v1.GetBackupRequest; +import com.google.cloud.filestore.v1.GetInstanceRequest; +import com.google.cloud.filestore.v1.Instance; +import com.google.cloud.filestore.v1.ListBackupsRequest; +import com.google.cloud.filestore.v1.ListBackupsResponse; +import com.google.cloud.filestore.v1.ListInstancesRequest; +import com.google.cloud.filestore.v1.ListInstancesResponse; +import com.google.cloud.filestore.v1.RestoreInstanceRequest; +import com.google.cloud.filestore.v1.UpdateBackupRequest; +import com.google.cloud.filestore.v1.UpdateInstanceRequest; +import com.google.longrunning.Operation; +import com.google.longrunning.stub.OperationsStub; +import com.google.protobuf.Empty; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Base stub class for the CloudFilestoreManager service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator-java") +public abstract class CloudFilestoreManagerStub implements BackgroundResource { + + public OperationsStub getOperationsStub() { + throw new UnsupportedOperationException("Not implemented: getOperationsStub()"); + } + + public UnaryCallable + listInstancesPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listInstancesPagedCallable()"); + } + + public UnaryCallable listInstancesCallable() { + throw new UnsupportedOperationException("Not implemented: listInstancesCallable()"); + } + + public UnaryCallable getInstanceCallable() { + throw new UnsupportedOperationException("Not implemented: getInstanceCallable()"); + } + + public OperationCallable + createInstanceOperationCallable() { + throw new UnsupportedOperationException("Not implemented: createInstanceOperationCallable()"); + } + + public UnaryCallable createInstanceCallable() { + throw new UnsupportedOperationException("Not implemented: createInstanceCallable()"); + } + + public OperationCallable + updateInstanceOperationCallable() { + throw new UnsupportedOperationException("Not implemented: updateInstanceOperationCallable()"); + } + + public UnaryCallable updateInstanceCallable() { + throw new UnsupportedOperationException("Not implemented: updateInstanceCallable()"); + } + + public OperationCallable + restoreInstanceOperationCallable() { + throw new UnsupportedOperationException("Not implemented: restoreInstanceOperationCallable()"); + } + + public UnaryCallable restoreInstanceCallable() { + throw new UnsupportedOperationException("Not implemented: restoreInstanceCallable()"); + } + + public OperationCallable + deleteInstanceOperationCallable() { + throw new UnsupportedOperationException("Not implemented: deleteInstanceOperationCallable()"); + } + + public UnaryCallable deleteInstanceCallable() { + throw new UnsupportedOperationException("Not implemented: deleteInstanceCallable()"); + } + + public UnaryCallable listBackupsPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listBackupsPagedCallable()"); + } + + public UnaryCallable listBackupsCallable() { + throw new UnsupportedOperationException("Not implemented: listBackupsCallable()"); + } + + public UnaryCallable getBackupCallable() { + throw new UnsupportedOperationException("Not implemented: getBackupCallable()"); + } + + public OperationCallable + createBackupOperationCallable() { + throw new UnsupportedOperationException("Not implemented: createBackupOperationCallable()"); + } + + public UnaryCallable createBackupCallable() { + throw new UnsupportedOperationException("Not implemented: createBackupCallable()"); + } + + public OperationCallable + deleteBackupOperationCallable() { + throw new UnsupportedOperationException("Not implemented: deleteBackupOperationCallable()"); + } + + public UnaryCallable deleteBackupCallable() { + throw new UnsupportedOperationException("Not implemented: deleteBackupCallable()"); + } + + public OperationCallable + updateBackupOperationCallable() { + throw new UnsupportedOperationException("Not implemented: updateBackupOperationCallable()"); + } + + public UnaryCallable updateBackupCallable() { + throw new UnsupportedOperationException("Not implemented: updateBackupCallable()"); + } + + @Override + public abstract void close(); +} diff --git a/google-cloud-filestore/src/main/java/com/google/cloud/filestore/v1/stub/CloudFilestoreManagerStubSettings.java b/google-cloud-filestore/src/main/java/com/google/cloud/filestore/v1/stub/CloudFilestoreManagerStubSettings.java new file mode 100644 index 00000000..cacde0db --- /dev/null +++ b/google-cloud-filestore/src/main/java/com/google/cloud/filestore/v1/stub/CloudFilestoreManagerStubSettings.java @@ -0,0 +1,996 @@ +/* + * Copyright 2021 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.v1.stub; + +import static com.google.cloud.filestore.v1.CloudFilestoreManagerClient.ListBackupsPagedResponse; +import static com.google.cloud.filestore.v1.CloudFilestoreManagerClient.ListInstancesPagedResponse; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.GaxProperties; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.grpc.GaxGrpcProperties; +import com.google.api.gax.grpc.GrpcTransportChannel; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.grpc.ProtoOperationTransformers; +import com.google.api.gax.longrunning.OperationSnapshot; +import com.google.api.gax.longrunning.OperationTimedPollAlgorithm; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.ApiCallContext; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.PagedListDescriptor; +import com.google.api.gax.rpc.PagedListResponseFactory; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.StubSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.common.OperationMetadata; +import com.google.cloud.filestore.v1.Backup; +import com.google.cloud.filestore.v1.CreateBackupRequest; +import com.google.cloud.filestore.v1.CreateInstanceRequest; +import com.google.cloud.filestore.v1.DeleteBackupRequest; +import com.google.cloud.filestore.v1.DeleteInstanceRequest; +import com.google.cloud.filestore.v1.GetBackupRequest; +import com.google.cloud.filestore.v1.GetInstanceRequest; +import com.google.cloud.filestore.v1.Instance; +import com.google.cloud.filestore.v1.ListBackupsRequest; +import com.google.cloud.filestore.v1.ListBackupsResponse; +import com.google.cloud.filestore.v1.ListInstancesRequest; +import com.google.cloud.filestore.v1.ListInstancesResponse; +import com.google.cloud.filestore.v1.RestoreInstanceRequest; +import com.google.cloud.filestore.v1.UpdateBackupRequest; +import com.google.cloud.filestore.v1.UpdateInstanceRequest; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Lists; +import com.google.longrunning.Operation; +import com.google.protobuf.Empty; +import java.io.IOException; +import java.util.List; +import javax.annotation.Generated; +import org.threeten.bp.Duration; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Settings class to configure an instance of {@link CloudFilestoreManagerStub}. + * + *

The default instance has everything set to sensible defaults: + * + *

    + *
  • The default service address (file.googleapis.com) and default port (443) are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
+ * + *

The builder of this class is recursive, so contained classes are themselves builders. When + * build() is called, the tree of builders is called to create the complete settings object. + * + *

For example, to set the total timeout of getInstance to 30 seconds: + * + *

{@code
+ * CloudFilestoreManagerStubSettings.Builder cloudFilestoreManagerSettingsBuilder =
+ *     CloudFilestoreManagerStubSettings.newBuilder();
+ * cloudFilestoreManagerSettingsBuilder
+ *     .getInstanceSettings()
+ *     .setRetrySettings(
+ *         cloudFilestoreManagerSettingsBuilder
+ *             .getInstanceSettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
+ *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .build());
+ * CloudFilestoreManagerStubSettings cloudFilestoreManagerSettings =
+ *     cloudFilestoreManagerSettingsBuilder.build();
+ * }
+ */ +@Generated("by gapic-generator-java") +public class CloudFilestoreManagerStubSettings + extends StubSettings { + /** The default scopes of the service. */ + private static final ImmutableList DEFAULT_SERVICE_SCOPES = + ImmutableList.builder().add("https://www.googleapis.com/auth/cloud-platform").build(); + + private final PagedCallSettings< + ListInstancesRequest, ListInstancesResponse, ListInstancesPagedResponse> + listInstancesSettings; + private final UnaryCallSettings getInstanceSettings; + private final UnaryCallSettings createInstanceSettings; + private final OperationCallSettings + createInstanceOperationSettings; + private final UnaryCallSettings updateInstanceSettings; + private final OperationCallSettings + updateInstanceOperationSettings; + private final UnaryCallSettings restoreInstanceSettings; + private final OperationCallSettings + restoreInstanceOperationSettings; + private final UnaryCallSettings deleteInstanceSettings; + private final OperationCallSettings + deleteInstanceOperationSettings; + private final PagedCallSettings + listBackupsSettings; + private final UnaryCallSettings getBackupSettings; + private final UnaryCallSettings createBackupSettings; + private final OperationCallSettings + createBackupOperationSettings; + private final UnaryCallSettings deleteBackupSettings; + private final OperationCallSettings + deleteBackupOperationSettings; + private final UnaryCallSettings updateBackupSettings; + private final OperationCallSettings + updateBackupOperationSettings; + + private static final PagedListDescriptor + LIST_INSTANCES_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListInstancesRequest injectToken(ListInstancesRequest payload, String token) { + return ListInstancesRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListInstancesRequest injectPageSize(ListInstancesRequest payload, int pageSize) { + return ListInstancesRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListInstancesRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListInstancesResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListInstancesResponse payload) { + return payload.getInstancesList() == null + ? ImmutableList.of() + : payload.getInstancesList(); + } + }; + + private static final PagedListDescriptor + LIST_BACKUPS_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListBackupsRequest injectToken(ListBackupsRequest payload, String token) { + return ListBackupsRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListBackupsRequest injectPageSize(ListBackupsRequest payload, int pageSize) { + return ListBackupsRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListBackupsRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListBackupsResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListBackupsResponse payload) { + return payload.getBackupsList() == null + ? ImmutableList.of() + : payload.getBackupsList(); + } + }; + + private static final PagedListResponseFactory< + ListInstancesRequest, ListInstancesResponse, ListInstancesPagedResponse> + LIST_INSTANCES_PAGE_STR_FACT = + new PagedListResponseFactory< + ListInstancesRequest, ListInstancesResponse, ListInstancesPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListInstancesRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_INSTANCES_PAGE_STR_DESC, request, context); + return ListInstancesPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + private static final PagedListResponseFactory< + ListBackupsRequest, ListBackupsResponse, ListBackupsPagedResponse> + LIST_BACKUPS_PAGE_STR_FACT = + new PagedListResponseFactory< + ListBackupsRequest, ListBackupsResponse, ListBackupsPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListBackupsRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_BACKUPS_PAGE_STR_DESC, request, context); + return ListBackupsPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + /** Returns the object with the settings used for calls to listInstances. */ + public PagedCallSettings + listInstancesSettings() { + return listInstancesSettings; + } + + /** Returns the object with the settings used for calls to getInstance. */ + public UnaryCallSettings getInstanceSettings() { + return getInstanceSettings; + } + + /** Returns the object with the settings used for calls to createInstance. */ + public UnaryCallSettings createInstanceSettings() { + return createInstanceSettings; + } + + /** Returns the object with the settings used for calls to createInstance. */ + public OperationCallSettings + createInstanceOperationSettings() { + return createInstanceOperationSettings; + } + + /** Returns the object with the settings used for calls to updateInstance. */ + public UnaryCallSettings updateInstanceSettings() { + return updateInstanceSettings; + } + + /** Returns the object with the settings used for calls to updateInstance. */ + public OperationCallSettings + updateInstanceOperationSettings() { + return updateInstanceOperationSettings; + } + + /** Returns the object with the settings used for calls to restoreInstance. */ + public UnaryCallSettings restoreInstanceSettings() { + return restoreInstanceSettings; + } + + /** Returns the object with the settings used for calls to restoreInstance. */ + public OperationCallSettings + restoreInstanceOperationSettings() { + return restoreInstanceOperationSettings; + } + + /** Returns the object with the settings used for calls to deleteInstance. */ + public UnaryCallSettings deleteInstanceSettings() { + return deleteInstanceSettings; + } + + /** Returns the object with the settings used for calls to deleteInstance. */ + public OperationCallSettings + deleteInstanceOperationSettings() { + return deleteInstanceOperationSettings; + } + + /** Returns the object with the settings used for calls to listBackups. */ + public PagedCallSettings + listBackupsSettings() { + return listBackupsSettings; + } + + /** Returns the object with the settings used for calls to getBackup. */ + public UnaryCallSettings getBackupSettings() { + return getBackupSettings; + } + + /** Returns the object with the settings used for calls to createBackup. */ + public UnaryCallSettings createBackupSettings() { + return createBackupSettings; + } + + /** Returns the object with the settings used for calls to createBackup. */ + public OperationCallSettings + createBackupOperationSettings() { + return createBackupOperationSettings; + } + + /** Returns the object with the settings used for calls to deleteBackup. */ + public UnaryCallSettings deleteBackupSettings() { + return deleteBackupSettings; + } + + /** Returns the object with the settings used for calls to deleteBackup. */ + public OperationCallSettings + deleteBackupOperationSettings() { + return deleteBackupOperationSettings; + } + + /** Returns the object with the settings used for calls to updateBackup. */ + public UnaryCallSettings updateBackupSettings() { + return updateBackupSettings; + } + + /** Returns the object with the settings used for calls to updateBackup. */ + public OperationCallSettings + updateBackupOperationSettings() { + return updateBackupOperationSettings; + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public CloudFilestoreManagerStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(GrpcTransportChannel.getGrpcTransportName())) { + return GrpcCloudFilestoreManagerStub.create(this); + } + throw new UnsupportedOperationException( + String.format( + "Transport not supported: %s", getTransportChannelProvider().getTransportName())); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return InstantiatingExecutorProvider.newBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return "file.googleapis.com:443"; + } + + /** Returns the default mTLS service endpoint. */ + public static String getDefaultMtlsEndpoint() { + return "file.mtls.googleapis.com:443"; + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return DEFAULT_SERVICE_SCOPES; + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return GoogleCredentialsProvider.newBuilder().setScopesToApply(DEFAULT_SERVICE_SCOPES); + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return InstantiatingGrpcChannelProvider.newBuilder() + .setMaxInboundMessageSize(Integer.MAX_VALUE); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return defaultGrpcTransportProviderBuilder().build(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken( + "gapic", GaxProperties.getLibraryVersion(CloudFilestoreManagerStubSettings.class)) + .setTransportToken( + GaxGrpcProperties.getGrpcTokenName(), GaxGrpcProperties.getGrpcVersion()); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** Returns a builder containing all the values of this settings class. */ + public Builder toBuilder() { + return new Builder(this); + } + + protected CloudFilestoreManagerStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + listInstancesSettings = settingsBuilder.listInstancesSettings().build(); + getInstanceSettings = settingsBuilder.getInstanceSettings().build(); + createInstanceSettings = settingsBuilder.createInstanceSettings().build(); + createInstanceOperationSettings = settingsBuilder.createInstanceOperationSettings().build(); + updateInstanceSettings = settingsBuilder.updateInstanceSettings().build(); + updateInstanceOperationSettings = settingsBuilder.updateInstanceOperationSettings().build(); + restoreInstanceSettings = settingsBuilder.restoreInstanceSettings().build(); + restoreInstanceOperationSettings = settingsBuilder.restoreInstanceOperationSettings().build(); + deleteInstanceSettings = settingsBuilder.deleteInstanceSettings().build(); + deleteInstanceOperationSettings = settingsBuilder.deleteInstanceOperationSettings().build(); + listBackupsSettings = settingsBuilder.listBackupsSettings().build(); + getBackupSettings = settingsBuilder.getBackupSettings().build(); + createBackupSettings = settingsBuilder.createBackupSettings().build(); + createBackupOperationSettings = settingsBuilder.createBackupOperationSettings().build(); + deleteBackupSettings = settingsBuilder.deleteBackupSettings().build(); + deleteBackupOperationSettings = settingsBuilder.deleteBackupOperationSettings().build(); + updateBackupSettings = settingsBuilder.updateBackupSettings().build(); + updateBackupOperationSettings = settingsBuilder.updateBackupOperationSettings().build(); + } + + /** Builder for CloudFilestoreManagerStubSettings. */ + public static class Builder + extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + private final PagedCallSettings.Builder< + ListInstancesRequest, ListInstancesResponse, ListInstancesPagedResponse> + listInstancesSettings; + private final UnaryCallSettings.Builder getInstanceSettings; + private final UnaryCallSettings.Builder + createInstanceSettings; + private final OperationCallSettings.Builder + createInstanceOperationSettings; + private final UnaryCallSettings.Builder + updateInstanceSettings; + private final OperationCallSettings.Builder + updateInstanceOperationSettings; + private final UnaryCallSettings.Builder + restoreInstanceSettings; + private final OperationCallSettings.Builder + restoreInstanceOperationSettings; + private final UnaryCallSettings.Builder + deleteInstanceSettings; + private final OperationCallSettings.Builder + deleteInstanceOperationSettings; + private final PagedCallSettings.Builder< + ListBackupsRequest, ListBackupsResponse, ListBackupsPagedResponse> + listBackupsSettings; + private final UnaryCallSettings.Builder getBackupSettings; + private final UnaryCallSettings.Builder createBackupSettings; + private final OperationCallSettings.Builder + createBackupOperationSettings; + private final UnaryCallSettings.Builder deleteBackupSettings; + private final OperationCallSettings.Builder + deleteBackupOperationSettings; + private final UnaryCallSettings.Builder updateBackupSettings; + private final OperationCallSettings.Builder + updateBackupOperationSettings; + private static final ImmutableMap> + RETRYABLE_CODE_DEFINITIONS; + + static { + ImmutableMap.Builder> definitions = + ImmutableMap.builder(); + definitions.put( + "retry_policy_0_codes", + ImmutableSet.copyOf(Lists.newArrayList(StatusCode.Code.UNAVAILABLE))); + definitions.put( + "no_retry_1_codes", ImmutableSet.copyOf(Lists.newArrayList())); + definitions.put( + "no_retry_2_codes", ImmutableSet.copyOf(Lists.newArrayList())); + definitions.put( + "no_retry_3_codes", ImmutableSet.copyOf(Lists.newArrayList())); + RETRYABLE_CODE_DEFINITIONS = definitions.build(); + } + + private static final ImmutableMap RETRY_PARAM_DEFINITIONS; + + static { + ImmutableMap.Builder definitions = ImmutableMap.builder(); + RetrySettings settings = null; + settings = + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(250L)) + .setRetryDelayMultiplier(1.3) + .setMaxRetryDelay(Duration.ofMillis(32000L)) + .setInitialRpcTimeout(Duration.ofMillis(60000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(60000L)) + .setTotalTimeout(Duration.ofMillis(60000L)) + .build(); + definitions.put("retry_policy_0_params", settings); + settings = + RetrySettings.newBuilder() + .setInitialRpcTimeout(Duration.ofMillis(60000000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(60000000L)) + .setTotalTimeout(Duration.ofMillis(60000000L)) + .build(); + definitions.put("no_retry_1_params", settings); + settings = + RetrySettings.newBuilder() + .setInitialRpcTimeout(Duration.ofMillis(14400000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(14400000L)) + .setTotalTimeout(Duration.ofMillis(14400000L)) + .build(); + definitions.put("no_retry_2_params", settings); + settings = + RetrySettings.newBuilder() + .setInitialRpcTimeout(Duration.ofMillis(600000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(600000L)) + .setTotalTimeout(Duration.ofMillis(600000L)) + .build(); + definitions.put("no_retry_3_params", settings); + RETRY_PARAM_DEFINITIONS = definitions.build(); + } + + protected Builder() { + this(((ClientContext) null)); + } + + protected Builder(ClientContext clientContext) { + super(clientContext); + + listInstancesSettings = PagedCallSettings.newBuilder(LIST_INSTANCES_PAGE_STR_FACT); + getInstanceSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + createInstanceSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + createInstanceOperationSettings = OperationCallSettings.newBuilder(); + updateInstanceSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + updateInstanceOperationSettings = OperationCallSettings.newBuilder(); + restoreInstanceSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + restoreInstanceOperationSettings = OperationCallSettings.newBuilder(); + deleteInstanceSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + deleteInstanceOperationSettings = OperationCallSettings.newBuilder(); + listBackupsSettings = PagedCallSettings.newBuilder(LIST_BACKUPS_PAGE_STR_FACT); + getBackupSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + createBackupSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + createBackupOperationSettings = OperationCallSettings.newBuilder(); + deleteBackupSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + deleteBackupOperationSettings = OperationCallSettings.newBuilder(); + updateBackupSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + updateBackupOperationSettings = OperationCallSettings.newBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + listInstancesSettings, + getInstanceSettings, + createInstanceSettings, + updateInstanceSettings, + restoreInstanceSettings, + deleteInstanceSettings, + listBackupsSettings, + getBackupSettings, + createBackupSettings, + deleteBackupSettings, + updateBackupSettings); + initDefaults(this); + } + + protected Builder(CloudFilestoreManagerStubSettings settings) { + super(settings); + + listInstancesSettings = settings.listInstancesSettings.toBuilder(); + getInstanceSettings = settings.getInstanceSettings.toBuilder(); + createInstanceSettings = settings.createInstanceSettings.toBuilder(); + createInstanceOperationSettings = settings.createInstanceOperationSettings.toBuilder(); + updateInstanceSettings = settings.updateInstanceSettings.toBuilder(); + updateInstanceOperationSettings = settings.updateInstanceOperationSettings.toBuilder(); + restoreInstanceSettings = settings.restoreInstanceSettings.toBuilder(); + restoreInstanceOperationSettings = settings.restoreInstanceOperationSettings.toBuilder(); + deleteInstanceSettings = settings.deleteInstanceSettings.toBuilder(); + deleteInstanceOperationSettings = settings.deleteInstanceOperationSettings.toBuilder(); + listBackupsSettings = settings.listBackupsSettings.toBuilder(); + getBackupSettings = settings.getBackupSettings.toBuilder(); + createBackupSettings = settings.createBackupSettings.toBuilder(); + createBackupOperationSettings = settings.createBackupOperationSettings.toBuilder(); + deleteBackupSettings = settings.deleteBackupSettings.toBuilder(); + deleteBackupOperationSettings = settings.deleteBackupOperationSettings.toBuilder(); + updateBackupSettings = settings.updateBackupSettings.toBuilder(); + updateBackupOperationSettings = settings.updateBackupOperationSettings.toBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + listInstancesSettings, + getInstanceSettings, + createInstanceSettings, + updateInstanceSettings, + restoreInstanceSettings, + deleteInstanceSettings, + listBackupsSettings, + getBackupSettings, + createBackupSettings, + deleteBackupSettings, + updateBackupSettings); + } + + private static Builder createDefault() { + Builder builder = new Builder(((ClientContext) null)); + + builder.setTransportChannelProvider(defaultTransportChannelProvider()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); + builder.setEndpoint(getDefaultEndpoint()); + builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); + builder.setSwitchToMtlsEndpointAllowed(true); + + return initDefaults(builder); + } + + private static Builder initDefaults(Builder builder) { + builder + .listInstancesSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .getInstanceSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .createInstanceSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")); + + builder + .updateInstanceSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_2_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_2_params")); + + builder + .restoreInstanceSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")); + + builder + .deleteInstanceSettings() + .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")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .getBackupSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .createBackupSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")); + + builder + .deleteBackupSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_3_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_3_params")); + + builder + .updateBackupSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_3_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_3_params")); + + builder + .createInstanceOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + .newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_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 + .updateInstanceOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + .newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_2_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_2_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 + .restoreInstanceOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + .newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_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( + 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(5000L)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelay(Duration.ofMillis(45000L)) + .setInitialRpcTimeout(Duration.ZERO) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ZERO) + .setTotalTimeout(Duration.ofMillis(300000L)) + .build())); + + builder + .createBackupOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + .newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create(Backup.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 + .deleteBackupOperationSettings() + .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(5000L)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelay(Duration.ofMillis(45000L)) + .setInitialRpcTimeout(Duration.ZERO) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ZERO) + .setTotalTimeout(Duration.ofMillis(300000L)) + .build())); + + builder + .updateBackupOperationSettings() + .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(Backup.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; + } + + // NEXT_MAJOR_VER: remove 'throws Exception'. + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + *

Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) throws Exception { + super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater); + return this; + } + + public ImmutableList> unaryMethodSettingsBuilders() { + return unaryMethodSettingsBuilders; + } + + /** Returns the builder for the settings used for calls to listInstances. */ + public PagedCallSettings.Builder< + ListInstancesRequest, ListInstancesResponse, ListInstancesPagedResponse> + listInstancesSettings() { + return listInstancesSettings; + } + + /** Returns the builder for the settings used for calls to getInstance. */ + public UnaryCallSettings.Builder getInstanceSettings() { + return getInstanceSettings; + } + + /** Returns the builder for the settings used for calls to createInstance. */ + public UnaryCallSettings.Builder createInstanceSettings() { + return createInstanceSettings; + } + + /** Returns the builder for the settings used for calls to createInstance. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder + createInstanceOperationSettings() { + return createInstanceOperationSettings; + } + + /** Returns the builder for the settings used for calls to updateInstance. */ + public UnaryCallSettings.Builder updateInstanceSettings() { + return updateInstanceSettings; + } + + /** Returns the builder for the settings used for calls to updateInstance. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder + updateInstanceOperationSettings() { + return updateInstanceOperationSettings; + } + + /** Returns the builder for the settings used for calls to restoreInstance. */ + public UnaryCallSettings.Builder restoreInstanceSettings() { + return restoreInstanceSettings; + } + + /** Returns the builder for the settings used for calls to restoreInstance. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder + restoreInstanceOperationSettings() { + return restoreInstanceOperationSettings; + } + + /** Returns the builder for the settings used for calls to deleteInstance. */ + public UnaryCallSettings.Builder deleteInstanceSettings() { + return deleteInstanceSettings; + } + + /** Returns the builder for the settings used for calls to deleteInstance. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder + deleteInstanceOperationSettings() { + return deleteInstanceOperationSettings; + } + + /** Returns the builder for the settings used for calls to listBackups. */ + public PagedCallSettings.Builder< + ListBackupsRequest, ListBackupsResponse, ListBackupsPagedResponse> + listBackupsSettings() { + return listBackupsSettings; + } + + /** Returns the builder for the settings used for calls to getBackup. */ + public UnaryCallSettings.Builder getBackupSettings() { + return getBackupSettings; + } + + /** Returns the builder for the settings used for calls to createBackup. */ + public UnaryCallSettings.Builder createBackupSettings() { + return createBackupSettings; + } + + /** Returns the builder for the settings used for calls to createBackup. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder + createBackupOperationSettings() { + return createBackupOperationSettings; + } + + /** Returns the builder for the settings used for calls to deleteBackup. */ + public UnaryCallSettings.Builder deleteBackupSettings() { + return deleteBackupSettings; + } + + /** Returns the builder for the settings used for calls to deleteBackup. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder + deleteBackupOperationSettings() { + return deleteBackupOperationSettings; + } + + /** Returns the builder for the settings used for calls to updateBackup. */ + public UnaryCallSettings.Builder updateBackupSettings() { + return updateBackupSettings; + } + + /** Returns the builder for the settings used for calls to updateBackup. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder + updateBackupOperationSettings() { + return updateBackupOperationSettings; + } + + @Override + public CloudFilestoreManagerStubSettings build() throws IOException { + return new CloudFilestoreManagerStubSettings(this); + } + } +} diff --git a/google-cloud-filestore/src/main/java/com/google/cloud/filestore/v1/stub/GrpcCloudFilestoreManagerCallableFactory.java b/google-cloud-filestore/src/main/java/com/google/cloud/filestore/v1/stub/GrpcCloudFilestoreManagerCallableFactory.java new file mode 100644 index 00000000..e66dcc25 --- /dev/null +++ b/google-cloud-filestore/src/main/java/com/google/cloud/filestore/v1/stub/GrpcCloudFilestoreManagerCallableFactory.java @@ -0,0 +1,113 @@ +/* + * Copyright 2021 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.v1.stub; + +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcCallableFactory; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.BidiStreamingCallable; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientStreamingCallable; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.StreamingCallSettings; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.longrunning.Operation; +import com.google.longrunning.stub.OperationsStub; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * gRPC callable factory implementation for the CloudFilestoreManager service API. + * + *

This class is for advanced usage. + */ +@Generated("by gapic-generator-java") +public class GrpcCloudFilestoreManagerCallableFactory implements GrpcStubCallableFactory { + + @Override + public UnaryCallable createUnaryCallable( + GrpcCallSettings grpcCallSettings, + UnaryCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createUnaryCallable(grpcCallSettings, callSettings, clientContext); + } + + @Override + public + UnaryCallable createPagedCallable( + GrpcCallSettings grpcCallSettings, + PagedCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createPagedCallable(grpcCallSettings, callSettings, clientContext); + } + + @Override + public UnaryCallable createBatchingCallable( + GrpcCallSettings grpcCallSettings, + BatchingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createBatchingCallable( + grpcCallSettings, callSettings, clientContext); + } + + @Override + public + OperationCallable createOperationCallable( + GrpcCallSettings grpcCallSettings, + OperationCallSettings callSettings, + ClientContext clientContext, + OperationsStub operationsStub) { + return GrpcCallableFactory.createOperationCallable( + grpcCallSettings, callSettings, clientContext, operationsStub); + } + + @Override + public + BidiStreamingCallable createBidiStreamingCallable( + GrpcCallSettings grpcCallSettings, + StreamingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createBidiStreamingCallable( + grpcCallSettings, callSettings, clientContext); + } + + @Override + public + ServerStreamingCallable createServerStreamingCallable( + GrpcCallSettings grpcCallSettings, + ServerStreamingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createServerStreamingCallable( + grpcCallSettings, callSettings, clientContext); + } + + @Override + public + ClientStreamingCallable createClientStreamingCallable( + GrpcCallSettings grpcCallSettings, + StreamingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createClientStreamingCallable( + grpcCallSettings, callSettings, clientContext); + } +} diff --git a/google-cloud-filestore/src/main/java/com/google/cloud/filestore/v1/stub/GrpcCloudFilestoreManagerStub.java b/google-cloud-filestore/src/main/java/com/google/cloud/filestore/v1/stub/GrpcCloudFilestoreManagerStub.java new file mode 100644 index 00000000..e2fa0a73 --- /dev/null +++ b/google-cloud-filestore/src/main/java/com/google/cloud/filestore/v1/stub/GrpcCloudFilestoreManagerStub.java @@ -0,0 +1,614 @@ +/* + * Copyright 2021 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.v1.stub; + +import static com.google.cloud.filestore.v1.CloudFilestoreManagerClient.ListBackupsPagedResponse; +import static com.google.cloud.filestore.v1.CloudFilestoreManagerClient.ListInstancesPagedResponse; + +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.RequestParamsExtractor; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.common.OperationMetadata; +import com.google.cloud.filestore.v1.Backup; +import com.google.cloud.filestore.v1.CreateBackupRequest; +import com.google.cloud.filestore.v1.CreateInstanceRequest; +import com.google.cloud.filestore.v1.DeleteBackupRequest; +import com.google.cloud.filestore.v1.DeleteInstanceRequest; +import com.google.cloud.filestore.v1.GetBackupRequest; +import com.google.cloud.filestore.v1.GetInstanceRequest; +import com.google.cloud.filestore.v1.Instance; +import com.google.cloud.filestore.v1.ListBackupsRequest; +import com.google.cloud.filestore.v1.ListBackupsResponse; +import com.google.cloud.filestore.v1.ListInstancesRequest; +import com.google.cloud.filestore.v1.ListInstancesResponse; +import com.google.cloud.filestore.v1.RestoreInstanceRequest; +import com.google.cloud.filestore.v1.UpdateBackupRequest; +import com.google.cloud.filestore.v1.UpdateInstanceRequest; +import com.google.common.collect.ImmutableMap; +import com.google.longrunning.Operation; +import com.google.longrunning.stub.GrpcOperationsStub; +import com.google.protobuf.Empty; +import io.grpc.MethodDescriptor; +import io.grpc.protobuf.ProtoUtils; +import java.io.IOException; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * gRPC stub implementation for the CloudFilestoreManager service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator-java") +public class GrpcCloudFilestoreManagerStub extends CloudFilestoreManagerStub { + private static final MethodDescriptor + listInstancesMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.filestore.v1.CloudFilestoreManager/ListInstances") + .setRequestMarshaller( + ProtoUtils.marshaller(ListInstancesRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListInstancesResponse.getDefaultInstance())) + .build(); + + private static final MethodDescriptor getInstanceMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.filestore.v1.CloudFilestoreManager/GetInstance") + .setRequestMarshaller(ProtoUtils.marshaller(GetInstanceRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Instance.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + createInstanceMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.filestore.v1.CloudFilestoreManager/CreateInstance") + .setRequestMarshaller( + ProtoUtils.marshaller(CreateInstanceRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + updateInstanceMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.filestore.v1.CloudFilestoreManager/UpdateInstance") + .setRequestMarshaller( + ProtoUtils.marshaller(UpdateInstanceRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + restoreInstanceMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.filestore.v1.CloudFilestoreManager/RestoreInstance") + .setRequestMarshaller( + ProtoUtils.marshaller(RestoreInstanceRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + deleteInstanceMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.filestore.v1.CloudFilestoreManager/DeleteInstance") + .setRequestMarshaller( + ProtoUtils.marshaller(DeleteInstanceRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + listBackupsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.filestore.v1.CloudFilestoreManager/ListBackups") + .setRequestMarshaller(ProtoUtils.marshaller(ListBackupsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListBackupsResponse.getDefaultInstance())) + .build(); + + private static final MethodDescriptor getBackupMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.filestore.v1.CloudFilestoreManager/GetBackup") + .setRequestMarshaller(ProtoUtils.marshaller(GetBackupRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Backup.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + createBackupMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.filestore.v1.CloudFilestoreManager/CreateBackup") + .setRequestMarshaller(ProtoUtils.marshaller(CreateBackupRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + deleteBackupMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.filestore.v1.CloudFilestoreManager/DeleteBackup") + .setRequestMarshaller(ProtoUtils.marshaller(DeleteBackupRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + updateBackupMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.filestore.v1.CloudFilestoreManager/UpdateBackup") + .setRequestMarshaller(ProtoUtils.marshaller(UpdateBackupRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + + private final UnaryCallable listInstancesCallable; + private final UnaryCallable + listInstancesPagedCallable; + private final UnaryCallable getInstanceCallable; + private final UnaryCallable createInstanceCallable; + private final OperationCallable + createInstanceOperationCallable; + private final UnaryCallable updateInstanceCallable; + private final OperationCallable + updateInstanceOperationCallable; + private final UnaryCallable restoreInstanceCallable; + private final OperationCallable + restoreInstanceOperationCallable; + private final UnaryCallable deleteInstanceCallable; + private final OperationCallable + deleteInstanceOperationCallable; + private final UnaryCallable listBackupsCallable; + private final UnaryCallable + listBackupsPagedCallable; + private final UnaryCallable getBackupCallable; + private final UnaryCallable createBackupCallable; + private final OperationCallable + createBackupOperationCallable; + private final UnaryCallable deleteBackupCallable; + private final OperationCallable + deleteBackupOperationCallable; + private final UnaryCallable updateBackupCallable; + private final OperationCallable + updateBackupOperationCallable; + + private final BackgroundResource backgroundResources; + private final GrpcOperationsStub operationsStub; + private final GrpcStubCallableFactory callableFactory; + + public static final GrpcCloudFilestoreManagerStub create( + CloudFilestoreManagerStubSettings settings) throws IOException { + return new GrpcCloudFilestoreManagerStub(settings, ClientContext.create(settings)); + } + + public static final GrpcCloudFilestoreManagerStub create(ClientContext clientContext) + throws IOException { + return new GrpcCloudFilestoreManagerStub( + CloudFilestoreManagerStubSettings.newBuilder().build(), clientContext); + } + + public static final GrpcCloudFilestoreManagerStub create( + ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { + return new GrpcCloudFilestoreManagerStub( + CloudFilestoreManagerStubSettings.newBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of GrpcCloudFilestoreManagerStub, using the given settings. This is + * protected so that it is easy to make a subclass, but otherwise, the static factory methods + * should be preferred. + */ + protected GrpcCloudFilestoreManagerStub( + CloudFilestoreManagerStubSettings settings, ClientContext clientContext) throws IOException { + this(settings, clientContext, new GrpcCloudFilestoreManagerCallableFactory()); + } + + /** + * Constructs an instance of GrpcCloudFilestoreManagerStub, using the given settings. This is + * protected so that it is easy to make a subclass, but otherwise, the static factory methods + * should be preferred. + */ + protected GrpcCloudFilestoreManagerStub( + CloudFilestoreManagerStubSettings settings, + ClientContext clientContext, + GrpcStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory); + + GrpcCallSettings listInstancesTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listInstancesMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(ListInstancesRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + } + }) + .build(); + GrpcCallSettings getInstanceTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getInstanceMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(GetInstanceRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + } + }) + .build(); + GrpcCallSettings createInstanceTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(createInstanceMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(CreateInstanceRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + } + }) + .build(); + GrpcCallSettings updateInstanceTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(updateInstanceMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(UpdateInstanceRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("instance.name", String.valueOf(request.getInstance().getName())); + return params.build(); + } + }) + .build(); + GrpcCallSettings restoreInstanceTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(restoreInstanceMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(RestoreInstanceRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + } + }) + .build(); + GrpcCallSettings deleteInstanceTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(deleteInstanceMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(DeleteInstanceRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + } + }) + .build(); + GrpcCallSettings listBackupsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listBackupsMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(ListBackupsRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + } + }) + .build(); + GrpcCallSettings getBackupTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getBackupMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(GetBackupRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + } + }) + .build(); + GrpcCallSettings createBackupTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(createBackupMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(CreateBackupRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + } + }) + .build(); + GrpcCallSettings deleteBackupTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(deleteBackupMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(DeleteBackupRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + } + }) + .build(); + GrpcCallSettings updateBackupTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(updateBackupMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(UpdateBackupRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("backup.name", String.valueOf(request.getBackup().getName())); + return params.build(); + } + }) + .build(); + + this.listInstancesCallable = + callableFactory.createUnaryCallable( + listInstancesTransportSettings, settings.listInstancesSettings(), clientContext); + this.listInstancesPagedCallable = + callableFactory.createPagedCallable( + listInstancesTransportSettings, settings.listInstancesSettings(), clientContext); + this.getInstanceCallable = + callableFactory.createUnaryCallable( + getInstanceTransportSettings, settings.getInstanceSettings(), clientContext); + this.createInstanceCallable = + callableFactory.createUnaryCallable( + createInstanceTransportSettings, settings.createInstanceSettings(), clientContext); + this.createInstanceOperationCallable = + callableFactory.createOperationCallable( + createInstanceTransportSettings, + settings.createInstanceOperationSettings(), + clientContext, + operationsStub); + this.updateInstanceCallable = + callableFactory.createUnaryCallable( + updateInstanceTransportSettings, settings.updateInstanceSettings(), clientContext); + this.updateInstanceOperationCallable = + callableFactory.createOperationCallable( + updateInstanceTransportSettings, + settings.updateInstanceOperationSettings(), + clientContext, + operationsStub); + this.restoreInstanceCallable = + callableFactory.createUnaryCallable( + restoreInstanceTransportSettings, settings.restoreInstanceSettings(), clientContext); + this.restoreInstanceOperationCallable = + callableFactory.createOperationCallable( + restoreInstanceTransportSettings, + settings.restoreInstanceOperationSettings(), + clientContext, + operationsStub); + this.deleteInstanceCallable = + callableFactory.createUnaryCallable( + deleteInstanceTransportSettings, settings.deleteInstanceSettings(), clientContext); + this.deleteInstanceOperationCallable = + callableFactory.createOperationCallable( + deleteInstanceTransportSettings, + settings.deleteInstanceOperationSettings(), + clientContext, + operationsStub); + this.listBackupsCallable = + callableFactory.createUnaryCallable( + listBackupsTransportSettings, settings.listBackupsSettings(), clientContext); + this.listBackupsPagedCallable = + callableFactory.createPagedCallable( + listBackupsTransportSettings, settings.listBackupsSettings(), clientContext); + this.getBackupCallable = + callableFactory.createUnaryCallable( + getBackupTransportSettings, settings.getBackupSettings(), clientContext); + this.createBackupCallable = + callableFactory.createUnaryCallable( + createBackupTransportSettings, settings.createBackupSettings(), clientContext); + this.createBackupOperationCallable = + callableFactory.createOperationCallable( + createBackupTransportSettings, + settings.createBackupOperationSettings(), + clientContext, + operationsStub); + this.deleteBackupCallable = + callableFactory.createUnaryCallable( + deleteBackupTransportSettings, settings.deleteBackupSettings(), clientContext); + this.deleteBackupOperationCallable = + callableFactory.createOperationCallable( + deleteBackupTransportSettings, + settings.deleteBackupOperationSettings(), + clientContext, + operationsStub); + this.updateBackupCallable = + callableFactory.createUnaryCallable( + updateBackupTransportSettings, settings.updateBackupSettings(), clientContext); + this.updateBackupOperationCallable = + callableFactory.createOperationCallable( + updateBackupTransportSettings, + settings.updateBackupOperationSettings(), + clientContext, + operationsStub); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + public GrpcOperationsStub getOperationsStub() { + return operationsStub; + } + + @Override + public UnaryCallable listInstancesCallable() { + return listInstancesCallable; + } + + @Override + public UnaryCallable + listInstancesPagedCallable() { + return listInstancesPagedCallable; + } + + @Override + public UnaryCallable getInstanceCallable() { + return getInstanceCallable; + } + + @Override + public UnaryCallable createInstanceCallable() { + return createInstanceCallable; + } + + @Override + public OperationCallable + createInstanceOperationCallable() { + return createInstanceOperationCallable; + } + + @Override + public UnaryCallable updateInstanceCallable() { + return updateInstanceCallable; + } + + @Override + public OperationCallable + updateInstanceOperationCallable() { + return updateInstanceOperationCallable; + } + + @Override + public UnaryCallable restoreInstanceCallable() { + return restoreInstanceCallable; + } + + @Override + public OperationCallable + restoreInstanceOperationCallable() { + return restoreInstanceOperationCallable; + } + + @Override + public UnaryCallable deleteInstanceCallable() { + return deleteInstanceCallable; + } + + @Override + public OperationCallable + deleteInstanceOperationCallable() { + return deleteInstanceOperationCallable; + } + + @Override + public UnaryCallable listBackupsCallable() { + return listBackupsCallable; + } + + @Override + public UnaryCallable listBackupsPagedCallable() { + return listBackupsPagedCallable; + } + + @Override + public UnaryCallable getBackupCallable() { + return getBackupCallable; + } + + @Override + public UnaryCallable createBackupCallable() { + return createBackupCallable; + } + + @Override + public OperationCallable + createBackupOperationCallable() { + return createBackupOperationCallable; + } + + @Override + public UnaryCallable deleteBackupCallable() { + return deleteBackupCallable; + } + + @Override + public OperationCallable + deleteBackupOperationCallable() { + return deleteBackupOperationCallable; + } + + @Override + public UnaryCallable updateBackupCallable() { + return updateBackupCallable; + } + + @Override + public OperationCallable + updateBackupOperationCallable() { + return updateBackupOperationCallable; + } + + @Override + public final void close() { + shutdown(); + } + + @Override + public void shutdown() { + backgroundResources.shutdown(); + } + + @Override + public boolean isShutdown() { + return backgroundResources.isShutdown(); + } + + @Override + public boolean isTerminated() { + return backgroundResources.isTerminated(); + } + + @Override + public void shutdownNow() { + backgroundResources.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return backgroundResources.awaitTermination(duration, unit); + } +} diff --git a/google-cloud-filestore/src/main/java/com/google/cloud/filestore/v1beta1/CloudFilestoreManagerClient.java b/google-cloud-filestore/src/main/java/com/google/cloud/filestore/v1beta1/CloudFilestoreManagerClient.java new file mode 100644 index 00000000..a4435299 --- /dev/null +++ b/google-cloud-filestore/src/main/java/com/google/cloud/filestore/v1beta1/CloudFilestoreManagerClient.java @@ -0,0 +1,1757 @@ +/* + * Copyright 2021 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.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.ApiFutures; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.longrunning.OperationFuture; +import com.google.api.gax.paging.AbstractFixedSizeCollection; +import com.google.api.gax.paging.AbstractPage; +import com.google.api.gax.paging.AbstractPagedListResponse; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.common.OperationMetadata; +import com.google.cloud.filestore.v1beta1.stub.CloudFilestoreManagerStub; +import com.google.cloud.filestore.v1beta1.stub.CloudFilestoreManagerStubSettings; +import com.google.common.util.concurrent.MoreExecutors; +import com.google.longrunning.Operation; +import com.google.longrunning.OperationsClient; +import com.google.protobuf.Empty; +import com.google.protobuf.FieldMask; +import java.io.IOException; +import java.util.List; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Service Description: Configures and manages Cloud Filestore resources. + * + *

Cloud Filestore Manager v1beta1. + * + *

The `file.googleapis.com` service implements the Cloud 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: + * `/projects/{project_id}/locations/{location_id}/instances/{instance_id}` backups are + * resources of the form: `/projects/{project_id}/locations/{location_id}/backup/{backup_id}` + *
+ * + *

Note that location_id can represent a GCP `zone` or `region` depending on the resource. for + * example: A zonal Filestore instance: + * + *

    + *
  • `projects/my-project/locations/us-central1-c/instances/my-basic-tier-filer` A regional + * Filestore instance: + *
  • `projects/my-project/locations/us-central1/instances/my-enterprise-filer` + *
+ * + *

This class provides the ability to make remote calls to the backing service through method + * calls that map to API methods. Sample code to get started: + * + *

{@code
+ * try (CloudFilestoreManagerClient cloudFilestoreManagerClient =
+ *     CloudFilestoreManagerClient.create()) {
+ *   InstanceName name = InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]");
+ *   Instance response = cloudFilestoreManagerClient.getInstance(name);
+ * }
+ * }
+ * + *

Note: close() needs to be called on the CloudFilestoreManagerClient object to clean up + * resources such as threads. In the example above, try-with-resources is used, which automatically + * calls close(). + * + *

The surface of this class includes several types of Java methods for each of the API's + * methods: + * + *

    + *
  1. A "flattened" method. With this type of method, the fields of the request type have been + * converted into function parameters. It may be the case that not all fields are available as + * parameters, and not every API method will have a flattened method entry point. + *
  2. A "request object" method. This type of method only takes one parameter, a request object, + * which must be constructed before the call. Not every API method will have a request object + * method. + *
  3. A "callable" method. This type of method takes no parameters and returns an immutable API + * callable object, which can be used to initiate calls to the service. + *
+ * + *

See the individual methods for example code. + * + *

Many parameters require resource names to be formatted in a particular way. To assist with + * these names, this class includes a format method for each type of name, and additionally a parse + * method to extract the individual identifiers contained within names that are returned. + * + *

This class can be customized by passing in a custom instance of CloudFilestoreManagerSettings + * to create(). For example: + * + *

To customize credentials: + * + *

{@code
+ * CloudFilestoreManagerSettings cloudFilestoreManagerSettings =
+ *     CloudFilestoreManagerSettings.newBuilder()
+ *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ *         .build();
+ * CloudFilestoreManagerClient cloudFilestoreManagerClient =
+ *     CloudFilestoreManagerClient.create(cloudFilestoreManagerSettings);
+ * }
+ * + *

To customize the endpoint: + * + *

{@code
+ * CloudFilestoreManagerSettings cloudFilestoreManagerSettings =
+ *     CloudFilestoreManagerSettings.newBuilder().setEndpoint(myEndpoint).build();
+ * CloudFilestoreManagerClient cloudFilestoreManagerClient =
+ *     CloudFilestoreManagerClient.create(cloudFilestoreManagerSettings);
+ * }
+ * + *

Please refer to the GitHub repository's samples for more quickstart code snippets. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class CloudFilestoreManagerClient implements BackgroundResource { + private final CloudFilestoreManagerSettings settings; + private final CloudFilestoreManagerStub stub; + private final OperationsClient operationsClient; + + /** Constructs an instance of CloudFilestoreManagerClient with default settings. */ + public static final CloudFilestoreManagerClient create() throws IOException { + return create(CloudFilestoreManagerSettings.newBuilder().build()); + } + + /** + * Constructs an instance of CloudFilestoreManagerClient, using the given settings. The channels + * are created based on the settings passed in, or defaults for any settings that are not set. + */ + public static final CloudFilestoreManagerClient create(CloudFilestoreManagerSettings settings) + throws IOException { + return new CloudFilestoreManagerClient(settings); + } + + /** + * Constructs an instance of CloudFilestoreManagerClient, using the given stub for making calls. + * This is for advanced usage - prefer using create(CloudFilestoreManagerSettings). + */ + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public static final CloudFilestoreManagerClient create(CloudFilestoreManagerStub stub) { + return new CloudFilestoreManagerClient(stub); + } + + /** + * Constructs an instance of CloudFilestoreManagerClient, using the given settings. This is + * protected so that it is easy to make a subclass, but otherwise, the static factory methods + * should be preferred. + */ + protected CloudFilestoreManagerClient(CloudFilestoreManagerSettings settings) throws IOException { + this.settings = settings; + this.stub = ((CloudFilestoreManagerStubSettings) settings.getStubSettings()).createStub(); + this.operationsClient = OperationsClient.create(this.stub.getOperationsStub()); + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + protected CloudFilestoreManagerClient(CloudFilestoreManagerStub stub) { + this.settings = null; + this.stub = stub; + this.operationsClient = OperationsClient.create(this.stub.getOperationsStub()); + } + + public final CloudFilestoreManagerSettings getSettings() { + return settings; + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public CloudFilestoreManagerStub getStub() { + return stub; + } + + /** + * Returns the OperationsClient that can be used to query the status of a long-running operation + * returned by another API method call. + */ + public final OperationsClient getOperationsClient() { + return operationsClient; + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists all instances in a project for either a specified location or for all locations. + * + *

Sample code: + * + *

{@code
+   * try (CloudFilestoreManagerClient cloudFilestoreManagerClient =
+   *     CloudFilestoreManagerClient.create()) {
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   for (Instance element : cloudFilestoreManagerClient.listInstances(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. The project and location for which to retrieve instance information, in + * the format projects/{project_id}/locations/{location}. In Cloud Filestore, locations map to + * GCP zones, for example **us-west1-b**. To retrieve instance information for + * all locations, use "-" for the {location} value. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListInstancesPagedResponse listInstances(LocationName parent) { + ListInstancesRequest request = + ListInstancesRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .build(); + return listInstances(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists all instances in a project for either a specified location or for all locations. + * + *

Sample code: + * + *

{@code
+   * try (CloudFilestoreManagerClient cloudFilestoreManagerClient =
+   *     CloudFilestoreManagerClient.create()) {
+   *   String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
+   *   for (Instance element : cloudFilestoreManagerClient.listInstances(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. The project and location for which to retrieve instance information, in + * the format projects/{project_id}/locations/{location}. In Cloud Filestore, locations map to + * GCP zones, for example **us-west1-b**. To retrieve instance information for + * all locations, use "-" for the {location} value. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListInstancesPagedResponse listInstances(String parent) { + ListInstancesRequest request = ListInstancesRequest.newBuilder().setParent(parent).build(); + return listInstances(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists all instances in a project for either a specified location or for all locations. + * + *

Sample code: + * + *

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

Sample code: + * + *

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

Sample code: + * + *

{@code
+   * try (CloudFilestoreManagerClient cloudFilestoreManagerClient =
+   *     CloudFilestoreManagerClient.create()) {
+   *   ListInstancesRequest request =
+   *       ListInstancesRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .setOrderBy("orderBy-1207110587")
+   *           .setFilter("filter-1274492040")
+   *           .build();
+   *   while (true) {
+   *     ListInstancesResponse response =
+   *         cloudFilestoreManagerClient.listInstancesCallable().call(request);
+   *     for (Instance element : response.getResponsesList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable listInstancesCallable() { + return stub.listInstancesCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets the details of a specific instance. + * + *

Sample code: + * + *

{@code
+   * try (CloudFilestoreManagerClient cloudFilestoreManagerClient =
+   *     CloudFilestoreManagerClient.create()) {
+   *   InstanceName name = InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]");
+   *   Instance response = cloudFilestoreManagerClient.getInstance(name);
+   * }
+   * }
+ * + * @param name Required. The instance resource name, 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 Instance getInstance(InstanceName name) { + GetInstanceRequest request = + GetInstanceRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return getInstance(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets the details of a specific instance. + * + *

Sample code: + * + *

{@code
+   * try (CloudFilestoreManagerClient cloudFilestoreManagerClient =
+   *     CloudFilestoreManagerClient.create()) {
+   *   String name = InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString();
+   *   Instance response = cloudFilestoreManagerClient.getInstance(name);
+   * }
+   * }
+ * + * @param name Required. The instance resource name, 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 Instance getInstance(String name) { + GetInstanceRequest request = GetInstanceRequest.newBuilder().setName(name).build(); + return getInstance(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets the details of a specific instance. + * + *

Sample code: + * + *

{@code
+   * try (CloudFilestoreManagerClient cloudFilestoreManagerClient =
+   *     CloudFilestoreManagerClient.create()) {
+   *   GetInstanceRequest request =
+   *       GetInstanceRequest.newBuilder()
+   *           .setName(InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString())
+   *           .build();
+   *   Instance response = cloudFilestoreManagerClient.getInstance(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 Instance getInstance(GetInstanceRequest request) { + return getInstanceCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets the details of a specific instance. + * + *

Sample code: + * + *

{@code
+   * try (CloudFilestoreManagerClient cloudFilestoreManagerClient =
+   *     CloudFilestoreManagerClient.create()) {
+   *   GetInstanceRequest request =
+   *       GetInstanceRequest.newBuilder()
+   *           .setName(InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString())
+   *           .build();
+   *   ApiFuture future =
+   *       cloudFilestoreManagerClient.getInstanceCallable().futureCall(request);
+   *   // Do something.
+   *   Instance response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable getInstanceCallable() { + return stub.getInstanceCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * 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). + * + *

Sample code: + * + *

{@code
+   * try (CloudFilestoreManagerClient cloudFilestoreManagerClient =
+   *     CloudFilestoreManagerClient.create()) {
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   Instance instance = Instance.newBuilder().build();
+   *   String instanceId = "instanceId902024336";
+   *   Instance response =
+   *       cloudFilestoreManagerClient.createInstanceAsync(parent, instance, instanceId).get();
+   * }
+   * }
+ * + * @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**. + * @param instance Required. A [instance resource] + * (/cloud-filestore/reference/rest/v1beta1/projects.locations.instances) + * @param instanceId Required. The ID of the instance to create. 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 createInstanceAsync( + LocationName parent, Instance instance, String instanceId) { + CreateInstanceRequest request = + CreateInstanceRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .setInstance(instance) + .setInstanceId(instanceId) + .build(); + return createInstanceAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * 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). + * + *

Sample code: + * + *

{@code
+   * try (CloudFilestoreManagerClient cloudFilestoreManagerClient =
+   *     CloudFilestoreManagerClient.create()) {
+   *   String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
+   *   Instance instance = Instance.newBuilder().build();
+   *   String instanceId = "instanceId902024336";
+   *   Instance response =
+   *       cloudFilestoreManagerClient.createInstanceAsync(parent, instance, instanceId).get();
+   * }
+   * }
+ * + * @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**. + * @param instance Required. A [instance resource] + * (/cloud-filestore/reference/rest/v1beta1/projects.locations.instances) + * @param instanceId Required. The ID of the instance to create. 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 createInstanceAsync( + String parent, Instance instance, String instanceId) { + CreateInstanceRequest request = + CreateInstanceRequest.newBuilder() + .setParent(parent) + .setInstance(instance) + .setInstanceId(instanceId) + .build(); + return createInstanceAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * 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). + * + *

Sample code: + * + *

{@code
+   * try (CloudFilestoreManagerClient cloudFilestoreManagerClient =
+   *     CloudFilestoreManagerClient.create()) {
+   *   CreateInstanceRequest request =
+   *       CreateInstanceRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setInstanceId("instanceId902024336")
+   *           .setInstance(Instance.newBuilder().build())
+   *           .build();
+   *   Instance response = cloudFilestoreManagerClient.createInstanceAsync(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 createInstanceAsync( + CreateInstanceRequest request) { + return createInstanceOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * 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). + * + *

Sample code: + * + *

{@code
+   * try (CloudFilestoreManagerClient cloudFilestoreManagerClient =
+   *     CloudFilestoreManagerClient.create()) {
+   *   CreateInstanceRequest request =
+   *       CreateInstanceRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setInstanceId("instanceId902024336")
+   *           .setInstance(Instance.newBuilder().build())
+   *           .build();
+   *   OperationFuture future =
+   *       cloudFilestoreManagerClient.createInstanceOperationCallable().futureCall(request);
+   *   // Do something.
+   *   Instance response = future.get();
+   * }
+   * }
+ */ + public final OperationCallable + createInstanceOperationCallable() { + return stub.createInstanceOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * 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). + * + *

Sample code: + * + *

{@code
+   * try (CloudFilestoreManagerClient cloudFilestoreManagerClient =
+   *     CloudFilestoreManagerClient.create()) {
+   *   CreateInstanceRequest request =
+   *       CreateInstanceRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setInstanceId("instanceId902024336")
+   *           .setInstance(Instance.newBuilder().build())
+   *           .build();
+   *   ApiFuture future =
+   *       cloudFilestoreManagerClient.createInstanceCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable createInstanceCallable() { + return stub.createInstanceCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates the settings of a specific instance. + * + *

Sample code: + * + *

{@code
+   * try (CloudFilestoreManagerClient cloudFilestoreManagerClient =
+   *     CloudFilestoreManagerClient.create()) {
+   *   Instance instance = Instance.newBuilder().build();
+   *   FieldMask updateMask = FieldMask.newBuilder().build();
+   *   Instance response =
+   *       cloudFilestoreManagerClient.updateInstanceAsync(instance, updateMask).get();
+   * }
+   * }
+ * + * @param instance Required. 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" + *
  • "file_shares" + *
  • "labels" + *
+ * + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture updateInstanceAsync( + Instance instance, FieldMask updateMask) { + UpdateInstanceRequest request = + UpdateInstanceRequest.newBuilder().setInstance(instance).setUpdateMask(updateMask).build(); + return updateInstanceAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates the settings of a specific instance. + * + *

Sample code: + * + *

{@code
+   * try (CloudFilestoreManagerClient cloudFilestoreManagerClient =
+   *     CloudFilestoreManagerClient.create()) {
+   *   UpdateInstanceRequest request =
+   *       UpdateInstanceRequest.newBuilder()
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .setInstance(Instance.newBuilder().build())
+   *           .build();
+   *   Instance response = cloudFilestoreManagerClient.updateInstanceAsync(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 updateInstanceAsync( + UpdateInstanceRequest request) { + return updateInstanceOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates the settings of a specific instance. + * + *

Sample code: + * + *

{@code
+   * try (CloudFilestoreManagerClient cloudFilestoreManagerClient =
+   *     CloudFilestoreManagerClient.create()) {
+   *   UpdateInstanceRequest request =
+   *       UpdateInstanceRequest.newBuilder()
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .setInstance(Instance.newBuilder().build())
+   *           .build();
+   *   OperationFuture future =
+   *       cloudFilestoreManagerClient.updateInstanceOperationCallable().futureCall(request);
+   *   // Do something.
+   *   Instance response = future.get();
+   * }
+   * }
+ */ + public final OperationCallable + updateInstanceOperationCallable() { + return stub.updateInstanceOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates the settings of a specific instance. + * + *

Sample code: + * + *

{@code
+   * try (CloudFilestoreManagerClient cloudFilestoreManagerClient =
+   *     CloudFilestoreManagerClient.create()) {
+   *   UpdateInstanceRequest request =
+   *       UpdateInstanceRequest.newBuilder()
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .setInstance(Instance.newBuilder().build())
+   *           .build();
+   *   ApiFuture future =
+   *       cloudFilestoreManagerClient.updateInstanceCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable updateInstanceCallable() { + return stub.updateInstanceCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * 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). + * + *

Sample code: + * + *

{@code
+   * try (CloudFilestoreManagerClient cloudFilestoreManagerClient =
+   *     CloudFilestoreManagerClient.create()) {
+   *   RestoreInstanceRequest request =
+   *       RestoreInstanceRequest.newBuilder()
+   *           .setName(InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString())
+   *           .setFileShare("fileShare-1327728701")
+   *           .build();
+   *   Instance response = cloudFilestoreManagerClient.restoreInstanceAsync(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 restoreInstanceAsync( + RestoreInstanceRequest request) { + return restoreInstanceOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * 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). + * + *

Sample code: + * + *

{@code
+   * try (CloudFilestoreManagerClient cloudFilestoreManagerClient =
+   *     CloudFilestoreManagerClient.create()) {
+   *   RestoreInstanceRequest request =
+   *       RestoreInstanceRequest.newBuilder()
+   *           .setName(InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString())
+   *           .setFileShare("fileShare-1327728701")
+   *           .build();
+   *   OperationFuture future =
+   *       cloudFilestoreManagerClient.restoreInstanceOperationCallable().futureCall(request);
+   *   // Do something.
+   *   Instance response = future.get();
+   * }
+   * }
+ */ + public final OperationCallable + restoreInstanceOperationCallable() { + return stub.restoreInstanceOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * 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). + * + *

Sample code: + * + *

{@code
+   * try (CloudFilestoreManagerClient cloudFilestoreManagerClient =
+   *     CloudFilestoreManagerClient.create()) {
+   *   RestoreInstanceRequest request =
+   *       RestoreInstanceRequest.newBuilder()
+   *           .setName(InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString())
+   *           .setFileShare("fileShare-1327728701")
+   *           .build();
+   *   ApiFuture future =
+   *       cloudFilestoreManagerClient.restoreInstanceCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable restoreInstanceCallable() { + return stub.restoreInstanceCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes an instance. + * + *

Sample code: + * + *

{@code
+   * try (CloudFilestoreManagerClient cloudFilestoreManagerClient =
+   *     CloudFilestoreManagerClient.create()) {
+   *   InstanceName name = InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]");
+   *   cloudFilestoreManagerClient.deleteInstanceAsync(name).get();
+   * }
+   * }
+ * + * @param name Required. The instance resource name, 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 OperationFuture deleteInstanceAsync(InstanceName name) { + DeleteInstanceRequest request = + DeleteInstanceRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return deleteInstanceAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes an instance. + * + *

Sample code: + * + *

{@code
+   * try (CloudFilestoreManagerClient cloudFilestoreManagerClient =
+   *     CloudFilestoreManagerClient.create()) {
+   *   String name = InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString();
+   *   cloudFilestoreManagerClient.deleteInstanceAsync(name).get();
+   * }
+   * }
+ * + * @param name Required. The instance resource name, 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 OperationFuture deleteInstanceAsync(String name) { + DeleteInstanceRequest request = DeleteInstanceRequest.newBuilder().setName(name).build(); + return deleteInstanceAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes an instance. + * + *

Sample code: + * + *

{@code
+   * try (CloudFilestoreManagerClient cloudFilestoreManagerClient =
+   *     CloudFilestoreManagerClient.create()) {
+   *   DeleteInstanceRequest request =
+   *       DeleteInstanceRequest.newBuilder()
+   *           .setName(InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString())
+   *           .build();
+   *   cloudFilestoreManagerClient.deleteInstanceAsync(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 deleteInstanceAsync( + DeleteInstanceRequest request) { + return deleteInstanceOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes an instance. + * + *

Sample code: + * + *

{@code
+   * try (CloudFilestoreManagerClient cloudFilestoreManagerClient =
+   *     CloudFilestoreManagerClient.create()) {
+   *   DeleteInstanceRequest request =
+   *       DeleteInstanceRequest.newBuilder()
+   *           .setName(InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString())
+   *           .build();
+   *   OperationFuture future =
+   *       cloudFilestoreManagerClient.deleteInstanceOperationCallable().futureCall(request);
+   *   // Do something.
+   *   future.get();
+   * }
+   * }
+ */ + public final OperationCallable + deleteInstanceOperationCallable() { + return stub.deleteInstanceOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes an instance. + * + *

Sample code: + * + *

{@code
+   * try (CloudFilestoreManagerClient cloudFilestoreManagerClient =
+   *     CloudFilestoreManagerClient.create()) {
+   *   DeleteInstanceRequest request =
+   *       DeleteInstanceRequest.newBuilder()
+   *           .setName(InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString())
+   *           .build();
+   *   ApiFuture future =
+   *       cloudFilestoreManagerClient.deleteInstanceCallable().futureCall(request);
+   *   // Do something.
+   *   future.get();
+   * }
+   * }
+ */ + public final UnaryCallable deleteInstanceCallable() { + return stub.deleteInstanceCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists all backups in a project for either a specified location or for all locations. + * + *

Sample code: + * + *

{@code
+   * 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 Cloud 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
+   * 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 Cloud 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
+   * 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
+   * 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
+   * 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.getResponsesList()) {
+   *       // 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
+   * 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
+   * 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
+   * 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
+   * 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
+   * 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 Cloud Filestore, backup locations map to GCP + * regions, for example **us-west1**. + * @param backup Required. A [backup resource] + * (/cloud-filestore/reference/rest/v1beta1/projects.locations.backups) + * @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
+   * 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 Cloud Filestore, backup locations map to GCP + * regions, for example **us-west1**. + * @param backup Required. A [backup resource] + * (/cloud-filestore/reference/rest/v1beta1/projects.locations.backups) + * @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
+   * 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
+   * 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
+   * 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
+   * 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
+   * 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
+   * 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
+   * 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
+   * 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
+   * 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] + * (/cloud-filestore/reference/rest/v1beta1/projects.locations.backups) + * @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 updateBackupAsync( + Backup backup, FieldMask updateMask) { + UpdateBackupRequest request = + UpdateBackupRequest.newBuilder().setBackup(backup).setUpdateMask(updateMask).build(); + return updateBackupAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates the settings of a specific backup. + * + *

Sample code: + * + *

{@code
+   * 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
+   * 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
+   * 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(); + } + + @Override + public final void close() { + stub.close(); + } + + @Override + public void shutdown() { + stub.shutdown(); + } + + @Override + public boolean isShutdown() { + return stub.isShutdown(); + } + + @Override + public boolean isTerminated() { + return stub.isTerminated(); + } + + @Override + public void shutdownNow() { + stub.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return stub.awaitTermination(duration, unit); + } + + public static class ListInstancesPagedResponse + extends AbstractPagedListResponse< + ListInstancesRequest, + ListInstancesResponse, + Instance, + ListInstancesPage, + ListInstancesFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListInstancesPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + new ApiFunction() { + @Override + public ListInstancesPagedResponse apply(ListInstancesPage input) { + return new ListInstancesPagedResponse(input); + } + }, + MoreExecutors.directExecutor()); + } + + private ListInstancesPagedResponse(ListInstancesPage page) { + super(page, ListInstancesFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListInstancesPage + extends AbstractPage< + ListInstancesRequest, ListInstancesResponse, Instance, ListInstancesPage> { + + private ListInstancesPage( + PageContext context, + ListInstancesResponse response) { + super(context, response); + } + + private static ListInstancesPage createEmptyPage() { + return new ListInstancesPage(null, null); + } + + @Override + protected ListInstancesPage createPage( + PageContext context, + ListInstancesResponse response) { + return new ListInstancesPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListInstancesFixedSizeCollection + extends AbstractFixedSizeCollection< + ListInstancesRequest, + ListInstancesResponse, + Instance, + ListInstancesPage, + ListInstancesFixedSizeCollection> { + + private ListInstancesFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListInstancesFixedSizeCollection createEmptyCollection() { + return new ListInstancesFixedSizeCollection(null, 0); + } + + @Override + protected ListInstancesFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListInstancesFixedSizeCollection(pages, collectionSize); + } + } + + public static class ListBackupsPagedResponse + extends AbstractPagedListResponse< + ListBackupsRequest, + ListBackupsResponse, + Backup, + ListBackupsPage, + ListBackupsFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListBackupsPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + new ApiFunction() { + @Override + public ListBackupsPagedResponse apply(ListBackupsPage input) { + return new ListBackupsPagedResponse(input); + } + }, + MoreExecutors.directExecutor()); + } + + private ListBackupsPagedResponse(ListBackupsPage page) { + super(page, ListBackupsFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListBackupsPage + extends AbstractPage { + + private ListBackupsPage( + PageContext context, + ListBackupsResponse response) { + super(context, response); + } + + private static ListBackupsPage createEmptyPage() { + return new ListBackupsPage(null, null); + } + + @Override + protected ListBackupsPage createPage( + PageContext context, + ListBackupsResponse response) { + return new ListBackupsPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListBackupsFixedSizeCollection + extends AbstractFixedSizeCollection< + ListBackupsRequest, + ListBackupsResponse, + Backup, + ListBackupsPage, + ListBackupsFixedSizeCollection> { + + private ListBackupsFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListBackupsFixedSizeCollection createEmptyCollection() { + return new ListBackupsFixedSizeCollection(null, 0); + } + + @Override + protected ListBackupsFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListBackupsFixedSizeCollection(pages, collectionSize); + } + } +} diff --git a/google-cloud-filestore/src/main/java/com/google/cloud/filestore/v1beta1/CloudFilestoreManagerSettings.java b/google-cloud-filestore/src/main/java/com/google/cloud/filestore/v1beta1/CloudFilestoreManagerSettings.java new file mode 100644 index 00000000..852d90b7 --- /dev/null +++ b/google-cloud-filestore/src/main/java/com/google/cloud/filestore/v1beta1/CloudFilestoreManagerSettings.java @@ -0,0 +1,387 @@ +/* + * Copyright 2021 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 static com.google.cloud.filestore.v1beta1.CloudFilestoreManagerClient.ListBackupsPagedResponse; +import static com.google.cloud.filestore.v1beta1.CloudFilestoreManagerClient.ListInstancesPagedResponse; + +import com.google.api.core.ApiFunction; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientSettings; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.cloud.common.OperationMetadata; +import com.google.cloud.filestore.v1beta1.stub.CloudFilestoreManagerStubSettings; +import com.google.longrunning.Operation; +import com.google.protobuf.Empty; +import java.io.IOException; +import java.util.List; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Settings class to configure an instance of {@link CloudFilestoreManagerClient}. + * + *

The default instance has everything set to sensible defaults: + * + *

    + *
  • The default service address (file.googleapis.com) and default port (443) are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
+ * + *

The builder of this class is recursive, so contained classes are themselves builders. When + * build() is called, the tree of builders is called to create the complete settings object. + * + *

For example, to set the total timeout of getInstance to 30 seconds: + * + *

{@code
+ * CloudFilestoreManagerSettings.Builder cloudFilestoreManagerSettingsBuilder =
+ *     CloudFilestoreManagerSettings.newBuilder();
+ * cloudFilestoreManagerSettingsBuilder
+ *     .getInstanceSettings()
+ *     .setRetrySettings(
+ *         cloudFilestoreManagerSettingsBuilder
+ *             .getInstanceSettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
+ *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .build());
+ * CloudFilestoreManagerSettings cloudFilestoreManagerSettings =
+ *     cloudFilestoreManagerSettingsBuilder.build();
+ * }
+ */ +@BetaApi +@Generated("by gapic-generator-java") +public class CloudFilestoreManagerSettings extends ClientSettings { + + /** Returns the object with the settings used for calls to listInstances. */ + public PagedCallSettings + listInstancesSettings() { + return ((CloudFilestoreManagerStubSettings) getStubSettings()).listInstancesSettings(); + } + + /** Returns the object with the settings used for calls to getInstance. */ + public UnaryCallSettings getInstanceSettings() { + return ((CloudFilestoreManagerStubSettings) getStubSettings()).getInstanceSettings(); + } + + /** Returns the object with the settings used for calls to createInstance. */ + public UnaryCallSettings createInstanceSettings() { + return ((CloudFilestoreManagerStubSettings) getStubSettings()).createInstanceSettings(); + } + + /** Returns the object with the settings used for calls to createInstance. */ + public OperationCallSettings + createInstanceOperationSettings() { + return ((CloudFilestoreManagerStubSettings) getStubSettings()) + .createInstanceOperationSettings(); + } + + /** Returns the object with the settings used for calls to updateInstance. */ + public UnaryCallSettings updateInstanceSettings() { + return ((CloudFilestoreManagerStubSettings) getStubSettings()).updateInstanceSettings(); + } + + /** Returns the object with the settings used for calls to updateInstance. */ + public OperationCallSettings + updateInstanceOperationSettings() { + return ((CloudFilestoreManagerStubSettings) getStubSettings()) + .updateInstanceOperationSettings(); + } + + /** Returns the object with the settings used for calls to restoreInstance. */ + public UnaryCallSettings restoreInstanceSettings() { + return ((CloudFilestoreManagerStubSettings) getStubSettings()).restoreInstanceSettings(); + } + + /** Returns the object with the settings used for calls to restoreInstance. */ + public OperationCallSettings + restoreInstanceOperationSettings() { + return ((CloudFilestoreManagerStubSettings) getStubSettings()) + .restoreInstanceOperationSettings(); + } + + /** Returns the object with the settings used for calls to deleteInstance. */ + public UnaryCallSettings deleteInstanceSettings() { + return ((CloudFilestoreManagerStubSettings) getStubSettings()).deleteInstanceSettings(); + } + + /** Returns the object with the settings used for calls to deleteInstance. */ + public OperationCallSettings + deleteInstanceOperationSettings() { + return ((CloudFilestoreManagerStubSettings) getStubSettings()) + .deleteInstanceOperationSettings(); + } + + /** Returns the object with the settings used for calls to listBackups. */ + public PagedCallSettings + listBackupsSettings() { + return ((CloudFilestoreManagerStubSettings) getStubSettings()).listBackupsSettings(); + } + + /** Returns the object with the settings used for calls to getBackup. */ + public UnaryCallSettings getBackupSettings() { + return ((CloudFilestoreManagerStubSettings) getStubSettings()).getBackupSettings(); + } + + /** Returns the object with the settings used for calls to createBackup. */ + public UnaryCallSettings createBackupSettings() { + return ((CloudFilestoreManagerStubSettings) getStubSettings()).createBackupSettings(); + } + + /** Returns the object with the settings used for calls to createBackup. */ + public OperationCallSettings + createBackupOperationSettings() { + return ((CloudFilestoreManagerStubSettings) getStubSettings()).createBackupOperationSettings(); + } + + /** Returns the object with the settings used for calls to deleteBackup. */ + public UnaryCallSettings deleteBackupSettings() { + return ((CloudFilestoreManagerStubSettings) getStubSettings()).deleteBackupSettings(); + } + + /** Returns the object with the settings used for calls to deleteBackup. */ + public OperationCallSettings + deleteBackupOperationSettings() { + return ((CloudFilestoreManagerStubSettings) getStubSettings()).deleteBackupOperationSettings(); + } + + /** Returns the object with the settings used for calls to updateBackup. */ + public UnaryCallSettings updateBackupSettings() { + return ((CloudFilestoreManagerStubSettings) getStubSettings()).updateBackupSettings(); + } + + /** Returns the object with the settings used for calls to updateBackup. */ + public OperationCallSettings + updateBackupOperationSettings() { + return ((CloudFilestoreManagerStubSettings) getStubSettings()).updateBackupOperationSettings(); + } + + public static final CloudFilestoreManagerSettings create(CloudFilestoreManagerStubSettings stub) + throws IOException { + return new CloudFilestoreManagerSettings.Builder(stub.toBuilder()).build(); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return CloudFilestoreManagerStubSettings.defaultExecutorProviderBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return CloudFilestoreManagerStubSettings.getDefaultEndpoint(); + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return CloudFilestoreManagerStubSettings.getDefaultServiceScopes(); + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return CloudFilestoreManagerStubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return CloudFilestoreManagerStubSettings.defaultGrpcTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return CloudFilestoreManagerStubSettings.defaultTransportChannelProvider(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return CloudFilestoreManagerStubSettings.defaultApiClientHeaderProviderBuilder(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** Returns a builder containing all the values of this settings class. */ + public Builder toBuilder() { + return new Builder(this); + } + + protected CloudFilestoreManagerSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** Builder for CloudFilestoreManagerSettings. */ + public static class Builder + extends ClientSettings.Builder { + + protected Builder() throws IOException { + this(((ClientContext) null)); + } + + protected Builder(ClientContext clientContext) { + super(CloudFilestoreManagerStubSettings.newBuilder(clientContext)); + } + + protected Builder(CloudFilestoreManagerSettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(CloudFilestoreManagerStubSettings.Builder stubSettings) { + super(stubSettings); + } + + private static Builder createDefault() { + return new Builder(CloudFilestoreManagerStubSettings.newBuilder()); + } + + public CloudFilestoreManagerStubSettings.Builder getStubSettingsBuilder() { + return ((CloudFilestoreManagerStubSettings.Builder) getStubSettings()); + } + + // NEXT_MAJOR_VER: remove 'throws Exception'. + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + *

Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) throws Exception { + super.applyToAllUnaryMethods( + getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); + return this; + } + + /** Returns the builder for the settings used for calls to listInstances. */ + public PagedCallSettings.Builder< + ListInstancesRequest, ListInstancesResponse, ListInstancesPagedResponse> + listInstancesSettings() { + return getStubSettingsBuilder().listInstancesSettings(); + } + + /** Returns the builder for the settings used for calls to getInstance. */ + public UnaryCallSettings.Builder getInstanceSettings() { + return getStubSettingsBuilder().getInstanceSettings(); + } + + /** Returns the builder for the settings used for calls to createInstance. */ + public UnaryCallSettings.Builder createInstanceSettings() { + return getStubSettingsBuilder().createInstanceSettings(); + } + + /** Returns the builder for the settings used for calls to createInstance. */ + public OperationCallSettings.Builder + createInstanceOperationSettings() { + return getStubSettingsBuilder().createInstanceOperationSettings(); + } + + /** Returns the builder for the settings used for calls to updateInstance. */ + public UnaryCallSettings.Builder updateInstanceSettings() { + return getStubSettingsBuilder().updateInstanceSettings(); + } + + /** Returns the builder for the settings used for calls to updateInstance. */ + public OperationCallSettings.Builder + updateInstanceOperationSettings() { + return getStubSettingsBuilder().updateInstanceOperationSettings(); + } + + /** Returns the builder for the settings used for calls to restoreInstance. */ + public UnaryCallSettings.Builder restoreInstanceSettings() { + return getStubSettingsBuilder().restoreInstanceSettings(); + } + + /** Returns the builder for the settings used for calls to restoreInstance. */ + public OperationCallSettings.Builder + restoreInstanceOperationSettings() { + return getStubSettingsBuilder().restoreInstanceOperationSettings(); + } + + /** Returns the builder for the settings used for calls to deleteInstance. */ + public UnaryCallSettings.Builder deleteInstanceSettings() { + return getStubSettingsBuilder().deleteInstanceSettings(); + } + + /** Returns the builder for the settings used for calls to deleteInstance. */ + public OperationCallSettings.Builder + deleteInstanceOperationSettings() { + return getStubSettingsBuilder().deleteInstanceOperationSettings(); + } + + /** Returns the builder for the settings used for calls to listBackups. */ + public PagedCallSettings.Builder< + ListBackupsRequest, ListBackupsResponse, ListBackupsPagedResponse> + listBackupsSettings() { + return getStubSettingsBuilder().listBackupsSettings(); + } + + /** Returns the builder for the settings used for calls to getBackup. */ + public UnaryCallSettings.Builder getBackupSettings() { + return getStubSettingsBuilder().getBackupSettings(); + } + + /** Returns the builder for the settings used for calls to createBackup. */ + public UnaryCallSettings.Builder createBackupSettings() { + return getStubSettingsBuilder().createBackupSettings(); + } + + /** Returns the builder for the settings used for calls to createBackup. */ + public OperationCallSettings.Builder + createBackupOperationSettings() { + return getStubSettingsBuilder().createBackupOperationSettings(); + } + + /** Returns the builder for the settings used for calls to deleteBackup. */ + public UnaryCallSettings.Builder deleteBackupSettings() { + return getStubSettingsBuilder().deleteBackupSettings(); + } + + /** Returns the builder for the settings used for calls to deleteBackup. */ + public OperationCallSettings.Builder + deleteBackupOperationSettings() { + return getStubSettingsBuilder().deleteBackupOperationSettings(); + } + + /** Returns the builder for the settings used for calls to updateBackup. */ + public UnaryCallSettings.Builder updateBackupSettings() { + return getStubSettingsBuilder().updateBackupSettings(); + } + + /** Returns the builder for the settings used for calls to updateBackup. */ + public OperationCallSettings.Builder + updateBackupOperationSettings() { + return getStubSettingsBuilder().updateBackupOperationSettings(); + } + + @Override + public CloudFilestoreManagerSettings build() throws IOException { + return new CloudFilestoreManagerSettings(this); + } + } +} diff --git a/google-cloud-filestore/src/main/java/com/google/cloud/filestore/v1beta1/gapic_metadata.json b/google-cloud-filestore/src/main/java/com/google/cloud/filestore/v1beta1/gapic_metadata.json new file mode 100644 index 00000000..6cac3777 --- /dev/null +++ b/google-cloud-filestore/src/main/java/com/google/cloud/filestore/v1beta1/gapic_metadata.json @@ -0,0 +1,51 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "java", + "protoPackage": "google.cloud.filestore.v1beta1", + "libraryPackage": "com.google.cloud.filestore.v1beta1", + "services": { + "CloudFilestoreManager": { + "clients": { + "grpc": { + "libraryClient": "CloudFilestoreManagerClient", + "rpcs": { + "CreateBackup": { + "methods": ["createBackupAsync", "createBackupAsync", "createBackupAsync", "createBackupOperationCallable", "createBackupCallable"] + }, + "CreateInstance": { + "methods": ["createInstanceAsync", "createInstanceAsync", "createInstanceAsync", "createInstanceOperationCallable", "createInstanceCallable"] + }, + "DeleteBackup": { + "methods": ["deleteBackupAsync", "deleteBackupAsync", "deleteBackupAsync", "deleteBackupOperationCallable", "deleteBackupCallable"] + }, + "DeleteInstance": { + "methods": ["deleteInstanceAsync", "deleteInstanceAsync", "deleteInstanceAsync", "deleteInstanceOperationCallable", "deleteInstanceCallable"] + }, + "GetBackup": { + "methods": ["getBackup", "getBackup", "getBackup", "getBackupCallable"] + }, + "GetInstance": { + "methods": ["getInstance", "getInstance", "getInstance", "getInstanceCallable"] + }, + "ListBackups": { + "methods": ["listBackups", "listBackups", "listBackups", "listBackupsPagedCallable", "listBackupsCallable"] + }, + "ListInstances": { + "methods": ["listInstances", "listInstances", "listInstances", "listInstancesPagedCallable", "listInstancesCallable"] + }, + "RestoreInstance": { + "methods": ["restoreInstanceAsync", "restoreInstanceOperationCallable", "restoreInstanceCallable"] + }, + "UpdateBackup": { + "methods": ["updateBackupAsync", "updateBackupAsync", "updateBackupOperationCallable", "updateBackupCallable"] + }, + "UpdateInstance": { + "methods": ["updateInstanceAsync", "updateInstanceAsync", "updateInstanceOperationCallable", "updateInstanceCallable"] + } + } + } + } + } + } +} \ No newline at end of file diff --git a/google-cloud-filestore/src/main/java/com/google/cloud/filestore/v1beta1/package-info.java b/google-cloud-filestore/src/main/java/com/google/cloud/filestore/v1beta1/package-info.java new file mode 100644 index 00000000..29d49f2b --- /dev/null +++ b/google-cloud-filestore/src/main/java/com/google/cloud/filestore/v1beta1/package-info.java @@ -0,0 +1,61 @@ +/* + * Copyright 2021 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. + */ + +/** + * The interfaces provided are listed below, along with usage samples. + * + *

======================= CloudFilestoreManagerClient ======================= + * + *

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

Cloud Filestore Manager v1beta1. + * + *

The `file.googleapis.com` service implements the Cloud 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: + * `/projects/{project_id}/locations/{location_id}/instances/{instance_id}` backups are + * resources of the form: `/projects/{project_id}/locations/{location_id}/backup/{backup_id}` + *
+ * + *

Note that location_id can represent a GCP `zone` or `region` depending on the resource. for + * example: A zonal Filestore instance: + * + *

    + *
  • `projects/my-project/locations/us-central1-c/instances/my-basic-tier-filer` A regional + * Filestore instance: + *
  • `projects/my-project/locations/us-central1/instances/my-enterprise-filer` + *
+ * + *

Sample for CloudFilestoreManagerClient: + * + *

{@code
+ * try (CloudFilestoreManagerClient cloudFilestoreManagerClient =
+ *     CloudFilestoreManagerClient.create()) {
+ *   InstanceName name = InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]");
+ *   Instance response = cloudFilestoreManagerClient.getInstance(name);
+ * }
+ * }
+ */ +@Generated("by gapic-generator-java") +package com.google.cloud.filestore.v1beta1; + +import javax.annotation.Generated; diff --git a/google-cloud-filestore/src/main/java/com/google/cloud/filestore/v1beta1/stub/CloudFilestoreManagerStub.java b/google-cloud-filestore/src/main/java/com/google/cloud/filestore/v1beta1/stub/CloudFilestoreManagerStub.java new file mode 100644 index 00000000..bd8519c5 --- /dev/null +++ b/google-cloud-filestore/src/main/java/com/google/cloud/filestore/v1beta1/stub/CloudFilestoreManagerStub.java @@ -0,0 +1,151 @@ +/* + * Copyright 2021 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.stub; + +import static com.google.cloud.filestore.v1beta1.CloudFilestoreManagerClient.ListBackupsPagedResponse; +import static com.google.cloud.filestore.v1beta1.CloudFilestoreManagerClient.ListInstancesPagedResponse; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.common.OperationMetadata; +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.DeleteBackupRequest; +import com.google.cloud.filestore.v1beta1.DeleteInstanceRequest; +import com.google.cloud.filestore.v1beta1.GetBackupRequest; +import com.google.cloud.filestore.v1beta1.GetInstanceRequest; +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.RestoreInstanceRequest; +import com.google.cloud.filestore.v1beta1.UpdateBackupRequest; +import com.google.cloud.filestore.v1beta1.UpdateInstanceRequest; +import com.google.longrunning.Operation; +import com.google.longrunning.stub.OperationsStub; +import com.google.protobuf.Empty; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Base stub class for the CloudFilestoreManager service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@BetaApi +@Generated("by gapic-generator-java") +public abstract class CloudFilestoreManagerStub implements BackgroundResource { + + public OperationsStub getOperationsStub() { + throw new UnsupportedOperationException("Not implemented: getOperationsStub()"); + } + + public UnaryCallable + listInstancesPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listInstancesPagedCallable()"); + } + + public UnaryCallable listInstancesCallable() { + throw new UnsupportedOperationException("Not implemented: listInstancesCallable()"); + } + + public UnaryCallable getInstanceCallable() { + throw new UnsupportedOperationException("Not implemented: getInstanceCallable()"); + } + + public OperationCallable + createInstanceOperationCallable() { + throw new UnsupportedOperationException("Not implemented: createInstanceOperationCallable()"); + } + + public UnaryCallable createInstanceCallable() { + throw new UnsupportedOperationException("Not implemented: createInstanceCallable()"); + } + + public OperationCallable + updateInstanceOperationCallable() { + throw new UnsupportedOperationException("Not implemented: updateInstanceOperationCallable()"); + } + + public UnaryCallable updateInstanceCallable() { + throw new UnsupportedOperationException("Not implemented: updateInstanceCallable()"); + } + + public OperationCallable + restoreInstanceOperationCallable() { + throw new UnsupportedOperationException("Not implemented: restoreInstanceOperationCallable()"); + } + + public UnaryCallable restoreInstanceCallable() { + throw new UnsupportedOperationException("Not implemented: restoreInstanceCallable()"); + } + + public OperationCallable + deleteInstanceOperationCallable() { + throw new UnsupportedOperationException("Not implemented: deleteInstanceOperationCallable()"); + } + + public UnaryCallable deleteInstanceCallable() { + throw new UnsupportedOperationException("Not implemented: deleteInstanceCallable()"); + } + + public UnaryCallable listBackupsPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listBackupsPagedCallable()"); + } + + public UnaryCallable listBackupsCallable() { + throw new UnsupportedOperationException("Not implemented: listBackupsCallable()"); + } + + public UnaryCallable getBackupCallable() { + throw new UnsupportedOperationException("Not implemented: getBackupCallable()"); + } + + public OperationCallable + createBackupOperationCallable() { + throw new UnsupportedOperationException("Not implemented: createBackupOperationCallable()"); + } + + public UnaryCallable createBackupCallable() { + throw new UnsupportedOperationException("Not implemented: createBackupCallable()"); + } + + public OperationCallable + deleteBackupOperationCallable() { + throw new UnsupportedOperationException("Not implemented: deleteBackupOperationCallable()"); + } + + public UnaryCallable deleteBackupCallable() { + throw new UnsupportedOperationException("Not implemented: deleteBackupCallable()"); + } + + public OperationCallable + updateBackupOperationCallable() { + throw new UnsupportedOperationException("Not implemented: updateBackupOperationCallable()"); + } + + public UnaryCallable updateBackupCallable() { + throw new UnsupportedOperationException("Not implemented: updateBackupCallable()"); + } + + @Override + public abstract void close(); +} diff --git a/google-cloud-filestore/src/main/java/com/google/cloud/filestore/v1beta1/stub/CloudFilestoreManagerStubSettings.java b/google-cloud-filestore/src/main/java/com/google/cloud/filestore/v1beta1/stub/CloudFilestoreManagerStubSettings.java new file mode 100644 index 00000000..1585176e --- /dev/null +++ b/google-cloud-filestore/src/main/java/com/google/cloud/filestore/v1beta1/stub/CloudFilestoreManagerStubSettings.java @@ -0,0 +1,997 @@ +/* + * Copyright 2021 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.stub; + +import static com.google.cloud.filestore.v1beta1.CloudFilestoreManagerClient.ListBackupsPagedResponse; +import static com.google.cloud.filestore.v1beta1.CloudFilestoreManagerClient.ListInstancesPagedResponse; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.GaxProperties; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.grpc.GaxGrpcProperties; +import com.google.api.gax.grpc.GrpcTransportChannel; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.grpc.ProtoOperationTransformers; +import com.google.api.gax.longrunning.OperationSnapshot; +import com.google.api.gax.longrunning.OperationTimedPollAlgorithm; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.ApiCallContext; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.PagedListDescriptor; +import com.google.api.gax.rpc.PagedListResponseFactory; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.StubSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.common.OperationMetadata; +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.DeleteBackupRequest; +import com.google.cloud.filestore.v1beta1.DeleteInstanceRequest; +import com.google.cloud.filestore.v1beta1.GetBackupRequest; +import com.google.cloud.filestore.v1beta1.GetInstanceRequest; +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.RestoreInstanceRequest; +import com.google.cloud.filestore.v1beta1.UpdateBackupRequest; +import com.google.cloud.filestore.v1beta1.UpdateInstanceRequest; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Lists; +import com.google.longrunning.Operation; +import com.google.protobuf.Empty; +import java.io.IOException; +import java.util.List; +import javax.annotation.Generated; +import org.threeten.bp.Duration; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Settings class to configure an instance of {@link CloudFilestoreManagerStub}. + * + *

The default instance has everything set to sensible defaults: + * + *

    + *
  • The default service address (file.googleapis.com) and default port (443) are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
+ * + *

The builder of this class is recursive, so contained classes are themselves builders. When + * build() is called, the tree of builders is called to create the complete settings object. + * + *

For example, to set the total timeout of getInstance to 30 seconds: + * + *

{@code
+ * CloudFilestoreManagerStubSettings.Builder cloudFilestoreManagerSettingsBuilder =
+ *     CloudFilestoreManagerStubSettings.newBuilder();
+ * cloudFilestoreManagerSettingsBuilder
+ *     .getInstanceSettings()
+ *     .setRetrySettings(
+ *         cloudFilestoreManagerSettingsBuilder
+ *             .getInstanceSettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
+ *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .build());
+ * CloudFilestoreManagerStubSettings cloudFilestoreManagerSettings =
+ *     cloudFilestoreManagerSettingsBuilder.build();
+ * }
+ */ +@BetaApi +@Generated("by gapic-generator-java") +public class CloudFilestoreManagerStubSettings + extends StubSettings { + /** The default scopes of the service. */ + private static final ImmutableList DEFAULT_SERVICE_SCOPES = + ImmutableList.builder().add("https://www.googleapis.com/auth/cloud-platform").build(); + + private final PagedCallSettings< + ListInstancesRequest, ListInstancesResponse, ListInstancesPagedResponse> + listInstancesSettings; + private final UnaryCallSettings getInstanceSettings; + private final UnaryCallSettings createInstanceSettings; + private final OperationCallSettings + createInstanceOperationSettings; + private final UnaryCallSettings updateInstanceSettings; + private final OperationCallSettings + updateInstanceOperationSettings; + private final UnaryCallSettings restoreInstanceSettings; + private final OperationCallSettings + restoreInstanceOperationSettings; + private final UnaryCallSettings deleteInstanceSettings; + private final OperationCallSettings + deleteInstanceOperationSettings; + private final PagedCallSettings + listBackupsSettings; + private final UnaryCallSettings getBackupSettings; + private final UnaryCallSettings createBackupSettings; + private final OperationCallSettings + createBackupOperationSettings; + private final UnaryCallSettings deleteBackupSettings; + private final OperationCallSettings + deleteBackupOperationSettings; + private final UnaryCallSettings updateBackupSettings; + private final OperationCallSettings + updateBackupOperationSettings; + + private static final PagedListDescriptor + LIST_INSTANCES_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListInstancesRequest injectToken(ListInstancesRequest payload, String token) { + return ListInstancesRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListInstancesRequest injectPageSize(ListInstancesRequest payload, int pageSize) { + return ListInstancesRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListInstancesRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListInstancesResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListInstancesResponse payload) { + return payload.getInstancesList() == null + ? ImmutableList.of() + : payload.getInstancesList(); + } + }; + + private static final PagedListDescriptor + LIST_BACKUPS_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListBackupsRequest injectToken(ListBackupsRequest payload, String token) { + return ListBackupsRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListBackupsRequest injectPageSize(ListBackupsRequest payload, int pageSize) { + return ListBackupsRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListBackupsRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListBackupsResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListBackupsResponse payload) { + return payload.getBackupsList() == null + ? ImmutableList.of() + : payload.getBackupsList(); + } + }; + + private static final PagedListResponseFactory< + ListInstancesRequest, ListInstancesResponse, ListInstancesPagedResponse> + LIST_INSTANCES_PAGE_STR_FACT = + new PagedListResponseFactory< + ListInstancesRequest, ListInstancesResponse, ListInstancesPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListInstancesRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_INSTANCES_PAGE_STR_DESC, request, context); + return ListInstancesPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + private static final PagedListResponseFactory< + ListBackupsRequest, ListBackupsResponse, ListBackupsPagedResponse> + LIST_BACKUPS_PAGE_STR_FACT = + new PagedListResponseFactory< + ListBackupsRequest, ListBackupsResponse, ListBackupsPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListBackupsRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_BACKUPS_PAGE_STR_DESC, request, context); + return ListBackupsPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + /** Returns the object with the settings used for calls to listInstances. */ + public PagedCallSettings + listInstancesSettings() { + return listInstancesSettings; + } + + /** Returns the object with the settings used for calls to getInstance. */ + public UnaryCallSettings getInstanceSettings() { + return getInstanceSettings; + } + + /** Returns the object with the settings used for calls to createInstance. */ + public UnaryCallSettings createInstanceSettings() { + return createInstanceSettings; + } + + /** Returns the object with the settings used for calls to createInstance. */ + public OperationCallSettings + createInstanceOperationSettings() { + return createInstanceOperationSettings; + } + + /** Returns the object with the settings used for calls to updateInstance. */ + public UnaryCallSettings updateInstanceSettings() { + return updateInstanceSettings; + } + + /** Returns the object with the settings used for calls to updateInstance. */ + public OperationCallSettings + updateInstanceOperationSettings() { + return updateInstanceOperationSettings; + } + + /** Returns the object with the settings used for calls to restoreInstance. */ + public UnaryCallSettings restoreInstanceSettings() { + return restoreInstanceSettings; + } + + /** Returns the object with the settings used for calls to restoreInstance. */ + public OperationCallSettings + restoreInstanceOperationSettings() { + return restoreInstanceOperationSettings; + } + + /** Returns the object with the settings used for calls to deleteInstance. */ + public UnaryCallSettings deleteInstanceSettings() { + return deleteInstanceSettings; + } + + /** Returns the object with the settings used for calls to deleteInstance. */ + public OperationCallSettings + deleteInstanceOperationSettings() { + return deleteInstanceOperationSettings; + } + + /** Returns the object with the settings used for calls to listBackups. */ + public PagedCallSettings + listBackupsSettings() { + return listBackupsSettings; + } + + /** Returns the object with the settings used for calls to getBackup. */ + public UnaryCallSettings getBackupSettings() { + return getBackupSettings; + } + + /** Returns the object with the settings used for calls to createBackup. */ + public UnaryCallSettings createBackupSettings() { + return createBackupSettings; + } + + /** Returns the object with the settings used for calls to createBackup. */ + public OperationCallSettings + createBackupOperationSettings() { + return createBackupOperationSettings; + } + + /** Returns the object with the settings used for calls to deleteBackup. */ + public UnaryCallSettings deleteBackupSettings() { + return deleteBackupSettings; + } + + /** Returns the object with the settings used for calls to deleteBackup. */ + public OperationCallSettings + deleteBackupOperationSettings() { + return deleteBackupOperationSettings; + } + + /** Returns the object with the settings used for calls to updateBackup. */ + public UnaryCallSettings updateBackupSettings() { + return updateBackupSettings; + } + + /** Returns the object with the settings used for calls to updateBackup. */ + public OperationCallSettings + updateBackupOperationSettings() { + return updateBackupOperationSettings; + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public CloudFilestoreManagerStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(GrpcTransportChannel.getGrpcTransportName())) { + return GrpcCloudFilestoreManagerStub.create(this); + } + throw new UnsupportedOperationException( + String.format( + "Transport not supported: %s", getTransportChannelProvider().getTransportName())); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return InstantiatingExecutorProvider.newBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return "file.googleapis.com:443"; + } + + /** Returns the default mTLS service endpoint. */ + public static String getDefaultMtlsEndpoint() { + return "file.mtls.googleapis.com:443"; + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return DEFAULT_SERVICE_SCOPES; + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return GoogleCredentialsProvider.newBuilder().setScopesToApply(DEFAULT_SERVICE_SCOPES); + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return InstantiatingGrpcChannelProvider.newBuilder() + .setMaxInboundMessageSize(Integer.MAX_VALUE); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return defaultGrpcTransportProviderBuilder().build(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken( + "gapic", GaxProperties.getLibraryVersion(CloudFilestoreManagerStubSettings.class)) + .setTransportToken( + GaxGrpcProperties.getGrpcTokenName(), GaxGrpcProperties.getGrpcVersion()); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** Returns a builder containing all the values of this settings class. */ + public Builder toBuilder() { + return new Builder(this); + } + + protected CloudFilestoreManagerStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + listInstancesSettings = settingsBuilder.listInstancesSettings().build(); + getInstanceSettings = settingsBuilder.getInstanceSettings().build(); + createInstanceSettings = settingsBuilder.createInstanceSettings().build(); + createInstanceOperationSettings = settingsBuilder.createInstanceOperationSettings().build(); + updateInstanceSettings = settingsBuilder.updateInstanceSettings().build(); + updateInstanceOperationSettings = settingsBuilder.updateInstanceOperationSettings().build(); + restoreInstanceSettings = settingsBuilder.restoreInstanceSettings().build(); + restoreInstanceOperationSettings = settingsBuilder.restoreInstanceOperationSettings().build(); + deleteInstanceSettings = settingsBuilder.deleteInstanceSettings().build(); + deleteInstanceOperationSettings = settingsBuilder.deleteInstanceOperationSettings().build(); + listBackupsSettings = settingsBuilder.listBackupsSettings().build(); + getBackupSettings = settingsBuilder.getBackupSettings().build(); + createBackupSettings = settingsBuilder.createBackupSettings().build(); + createBackupOperationSettings = settingsBuilder.createBackupOperationSettings().build(); + deleteBackupSettings = settingsBuilder.deleteBackupSettings().build(); + deleteBackupOperationSettings = settingsBuilder.deleteBackupOperationSettings().build(); + updateBackupSettings = settingsBuilder.updateBackupSettings().build(); + updateBackupOperationSettings = settingsBuilder.updateBackupOperationSettings().build(); + } + + /** Builder for CloudFilestoreManagerStubSettings. */ + public static class Builder + extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + private final PagedCallSettings.Builder< + ListInstancesRequest, ListInstancesResponse, ListInstancesPagedResponse> + listInstancesSettings; + private final UnaryCallSettings.Builder getInstanceSettings; + private final UnaryCallSettings.Builder + createInstanceSettings; + private final OperationCallSettings.Builder + createInstanceOperationSettings; + private final UnaryCallSettings.Builder + updateInstanceSettings; + private final OperationCallSettings.Builder + updateInstanceOperationSettings; + private final UnaryCallSettings.Builder + restoreInstanceSettings; + private final OperationCallSettings.Builder + restoreInstanceOperationSettings; + private final UnaryCallSettings.Builder + deleteInstanceSettings; + private final OperationCallSettings.Builder + deleteInstanceOperationSettings; + private final PagedCallSettings.Builder< + ListBackupsRequest, ListBackupsResponse, ListBackupsPagedResponse> + listBackupsSettings; + private final UnaryCallSettings.Builder getBackupSettings; + private final UnaryCallSettings.Builder createBackupSettings; + private final OperationCallSettings.Builder + createBackupOperationSettings; + private final UnaryCallSettings.Builder deleteBackupSettings; + private final OperationCallSettings.Builder + deleteBackupOperationSettings; + private final UnaryCallSettings.Builder updateBackupSettings; + private final OperationCallSettings.Builder + updateBackupOperationSettings; + private static final ImmutableMap> + RETRYABLE_CODE_DEFINITIONS; + + static { + ImmutableMap.Builder> definitions = + ImmutableMap.builder(); + definitions.put( + "retry_policy_0_codes", + ImmutableSet.copyOf(Lists.newArrayList(StatusCode.Code.UNAVAILABLE))); + definitions.put( + "no_retry_1_codes", ImmutableSet.copyOf(Lists.newArrayList())); + definitions.put( + "no_retry_2_codes", ImmutableSet.copyOf(Lists.newArrayList())); + definitions.put( + "no_retry_3_codes", ImmutableSet.copyOf(Lists.newArrayList())); + RETRYABLE_CODE_DEFINITIONS = definitions.build(); + } + + private static final ImmutableMap RETRY_PARAM_DEFINITIONS; + + static { + ImmutableMap.Builder definitions = ImmutableMap.builder(); + RetrySettings settings = null; + settings = + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(250L)) + .setRetryDelayMultiplier(1.3) + .setMaxRetryDelay(Duration.ofMillis(32000L)) + .setInitialRpcTimeout(Duration.ofMillis(60000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(60000L)) + .setTotalTimeout(Duration.ofMillis(60000L)) + .build(); + definitions.put("retry_policy_0_params", settings); + settings = + RetrySettings.newBuilder() + .setInitialRpcTimeout(Duration.ofMillis(60000000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(60000000L)) + .setTotalTimeout(Duration.ofMillis(60000000L)) + .build(); + definitions.put("no_retry_1_params", settings); + settings = + RetrySettings.newBuilder() + .setInitialRpcTimeout(Duration.ofMillis(14400000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(14400000L)) + .setTotalTimeout(Duration.ofMillis(14400000L)) + .build(); + definitions.put("no_retry_2_params", settings); + settings = + RetrySettings.newBuilder() + .setInitialRpcTimeout(Duration.ofMillis(600000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(600000L)) + .setTotalTimeout(Duration.ofMillis(600000L)) + .build(); + definitions.put("no_retry_3_params", settings); + RETRY_PARAM_DEFINITIONS = definitions.build(); + } + + protected Builder() { + this(((ClientContext) null)); + } + + protected Builder(ClientContext clientContext) { + super(clientContext); + + listInstancesSettings = PagedCallSettings.newBuilder(LIST_INSTANCES_PAGE_STR_FACT); + getInstanceSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + createInstanceSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + createInstanceOperationSettings = OperationCallSettings.newBuilder(); + updateInstanceSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + updateInstanceOperationSettings = OperationCallSettings.newBuilder(); + restoreInstanceSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + restoreInstanceOperationSettings = OperationCallSettings.newBuilder(); + deleteInstanceSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + deleteInstanceOperationSettings = OperationCallSettings.newBuilder(); + listBackupsSettings = PagedCallSettings.newBuilder(LIST_BACKUPS_PAGE_STR_FACT); + getBackupSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + createBackupSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + createBackupOperationSettings = OperationCallSettings.newBuilder(); + deleteBackupSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + deleteBackupOperationSettings = OperationCallSettings.newBuilder(); + updateBackupSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + updateBackupOperationSettings = OperationCallSettings.newBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + listInstancesSettings, + getInstanceSettings, + createInstanceSettings, + updateInstanceSettings, + restoreInstanceSettings, + deleteInstanceSettings, + listBackupsSettings, + getBackupSettings, + createBackupSettings, + deleteBackupSettings, + updateBackupSettings); + initDefaults(this); + } + + protected Builder(CloudFilestoreManagerStubSettings settings) { + super(settings); + + listInstancesSettings = settings.listInstancesSettings.toBuilder(); + getInstanceSettings = settings.getInstanceSettings.toBuilder(); + createInstanceSettings = settings.createInstanceSettings.toBuilder(); + createInstanceOperationSettings = settings.createInstanceOperationSettings.toBuilder(); + updateInstanceSettings = settings.updateInstanceSettings.toBuilder(); + updateInstanceOperationSettings = settings.updateInstanceOperationSettings.toBuilder(); + restoreInstanceSettings = settings.restoreInstanceSettings.toBuilder(); + restoreInstanceOperationSettings = settings.restoreInstanceOperationSettings.toBuilder(); + deleteInstanceSettings = settings.deleteInstanceSettings.toBuilder(); + deleteInstanceOperationSettings = settings.deleteInstanceOperationSettings.toBuilder(); + listBackupsSettings = settings.listBackupsSettings.toBuilder(); + getBackupSettings = settings.getBackupSettings.toBuilder(); + createBackupSettings = settings.createBackupSettings.toBuilder(); + createBackupOperationSettings = settings.createBackupOperationSettings.toBuilder(); + deleteBackupSettings = settings.deleteBackupSettings.toBuilder(); + deleteBackupOperationSettings = settings.deleteBackupOperationSettings.toBuilder(); + updateBackupSettings = settings.updateBackupSettings.toBuilder(); + updateBackupOperationSettings = settings.updateBackupOperationSettings.toBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + listInstancesSettings, + getInstanceSettings, + createInstanceSettings, + updateInstanceSettings, + restoreInstanceSettings, + deleteInstanceSettings, + listBackupsSettings, + getBackupSettings, + createBackupSettings, + deleteBackupSettings, + updateBackupSettings); + } + + private static Builder createDefault() { + Builder builder = new Builder(((ClientContext) null)); + + builder.setTransportChannelProvider(defaultTransportChannelProvider()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); + builder.setEndpoint(getDefaultEndpoint()); + builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); + builder.setSwitchToMtlsEndpointAllowed(true); + + return initDefaults(builder); + } + + private static Builder initDefaults(Builder builder) { + builder + .listInstancesSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .getInstanceSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .createInstanceSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")); + + builder + .updateInstanceSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_2_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_2_params")); + + builder + .restoreInstanceSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")); + + builder + .deleteInstanceSettings() + .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")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .getBackupSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .createBackupSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")); + + builder + .deleteBackupSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_3_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_3_params")); + + builder + .updateBackupSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_3_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_3_params")); + + builder + .createInstanceOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + .newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_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 + .updateInstanceOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + .newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_2_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_2_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 + .restoreInstanceOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + .newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_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( + 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(5000L)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelay(Duration.ofMillis(45000L)) + .setInitialRpcTimeout(Duration.ZERO) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ZERO) + .setTotalTimeout(Duration.ofMillis(300000L)) + .build())); + + builder + .createBackupOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + .newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create(Backup.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 + .deleteBackupOperationSettings() + .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(5000L)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelay(Duration.ofMillis(45000L)) + .setInitialRpcTimeout(Duration.ZERO) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ZERO) + .setTotalTimeout(Duration.ofMillis(300000L)) + .build())); + + builder + .updateBackupOperationSettings() + .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(Backup.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; + } + + // NEXT_MAJOR_VER: remove 'throws Exception'. + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + *

Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) throws Exception { + super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater); + return this; + } + + public ImmutableList> unaryMethodSettingsBuilders() { + return unaryMethodSettingsBuilders; + } + + /** Returns the builder for the settings used for calls to listInstances. */ + public PagedCallSettings.Builder< + ListInstancesRequest, ListInstancesResponse, ListInstancesPagedResponse> + listInstancesSettings() { + return listInstancesSettings; + } + + /** Returns the builder for the settings used for calls to getInstance. */ + public UnaryCallSettings.Builder getInstanceSettings() { + return getInstanceSettings; + } + + /** Returns the builder for the settings used for calls to createInstance. */ + public UnaryCallSettings.Builder createInstanceSettings() { + return createInstanceSettings; + } + + /** Returns the builder for the settings used for calls to createInstance. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder + createInstanceOperationSettings() { + return createInstanceOperationSettings; + } + + /** Returns the builder for the settings used for calls to updateInstance. */ + public UnaryCallSettings.Builder updateInstanceSettings() { + return updateInstanceSettings; + } + + /** Returns the builder for the settings used for calls to updateInstance. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder + updateInstanceOperationSettings() { + return updateInstanceOperationSettings; + } + + /** Returns the builder for the settings used for calls to restoreInstance. */ + public UnaryCallSettings.Builder restoreInstanceSettings() { + return restoreInstanceSettings; + } + + /** Returns the builder for the settings used for calls to restoreInstance. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder + restoreInstanceOperationSettings() { + return restoreInstanceOperationSettings; + } + + /** Returns the builder for the settings used for calls to deleteInstance. */ + public UnaryCallSettings.Builder deleteInstanceSettings() { + return deleteInstanceSettings; + } + + /** Returns the builder for the settings used for calls to deleteInstance. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder + deleteInstanceOperationSettings() { + return deleteInstanceOperationSettings; + } + + /** Returns the builder for the settings used for calls to listBackups. */ + public PagedCallSettings.Builder< + ListBackupsRequest, ListBackupsResponse, ListBackupsPagedResponse> + listBackupsSettings() { + return listBackupsSettings; + } + + /** Returns the builder for the settings used for calls to getBackup. */ + public UnaryCallSettings.Builder getBackupSettings() { + return getBackupSettings; + } + + /** Returns the builder for the settings used for calls to createBackup. */ + public UnaryCallSettings.Builder createBackupSettings() { + return createBackupSettings; + } + + /** Returns the builder for the settings used for calls to createBackup. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder + createBackupOperationSettings() { + return createBackupOperationSettings; + } + + /** Returns the builder for the settings used for calls to deleteBackup. */ + public UnaryCallSettings.Builder deleteBackupSettings() { + return deleteBackupSettings; + } + + /** Returns the builder for the settings used for calls to deleteBackup. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder + deleteBackupOperationSettings() { + return deleteBackupOperationSettings; + } + + /** Returns the builder for the settings used for calls to updateBackup. */ + public UnaryCallSettings.Builder updateBackupSettings() { + return updateBackupSettings; + } + + /** Returns the builder for the settings used for calls to updateBackup. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder + updateBackupOperationSettings() { + return updateBackupOperationSettings; + } + + @Override + public CloudFilestoreManagerStubSettings build() throws IOException { + return new CloudFilestoreManagerStubSettings(this); + } + } +} diff --git a/google-cloud-filestore/src/main/java/com/google/cloud/filestore/v1beta1/stub/GrpcCloudFilestoreManagerCallableFactory.java b/google-cloud-filestore/src/main/java/com/google/cloud/filestore/v1beta1/stub/GrpcCloudFilestoreManagerCallableFactory.java new file mode 100644 index 00000000..6221bcd0 --- /dev/null +++ b/google-cloud-filestore/src/main/java/com/google/cloud/filestore/v1beta1/stub/GrpcCloudFilestoreManagerCallableFactory.java @@ -0,0 +1,115 @@ +/* + * Copyright 2021 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.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcCallableFactory; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.BidiStreamingCallable; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientStreamingCallable; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.StreamingCallSettings; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.longrunning.Operation; +import com.google.longrunning.stub.OperationsStub; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * gRPC callable factory implementation for the CloudFilestoreManager service API. + * + *

This class is for advanced usage. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class GrpcCloudFilestoreManagerCallableFactory implements GrpcStubCallableFactory { + + @Override + public UnaryCallable createUnaryCallable( + GrpcCallSettings grpcCallSettings, + UnaryCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createUnaryCallable(grpcCallSettings, callSettings, clientContext); + } + + @Override + public + UnaryCallable createPagedCallable( + GrpcCallSettings grpcCallSettings, + PagedCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createPagedCallable(grpcCallSettings, callSettings, clientContext); + } + + @Override + public UnaryCallable createBatchingCallable( + GrpcCallSettings grpcCallSettings, + BatchingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createBatchingCallable( + grpcCallSettings, callSettings, clientContext); + } + + @Override + public + OperationCallable createOperationCallable( + GrpcCallSettings grpcCallSettings, + OperationCallSettings callSettings, + ClientContext clientContext, + OperationsStub operationsStub) { + return GrpcCallableFactory.createOperationCallable( + grpcCallSettings, callSettings, clientContext, operationsStub); + } + + @Override + public + BidiStreamingCallable createBidiStreamingCallable( + GrpcCallSettings grpcCallSettings, + StreamingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createBidiStreamingCallable( + grpcCallSettings, callSettings, clientContext); + } + + @Override + public + ServerStreamingCallable createServerStreamingCallable( + GrpcCallSettings grpcCallSettings, + ServerStreamingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createServerStreamingCallable( + grpcCallSettings, callSettings, clientContext); + } + + @Override + public + ClientStreamingCallable createClientStreamingCallable( + GrpcCallSettings grpcCallSettings, + StreamingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createClientStreamingCallable( + grpcCallSettings, callSettings, clientContext); + } +} diff --git a/google-cloud-filestore/src/main/java/com/google/cloud/filestore/v1beta1/stub/GrpcCloudFilestoreManagerStub.java b/google-cloud-filestore/src/main/java/com/google/cloud/filestore/v1beta1/stub/GrpcCloudFilestoreManagerStub.java new file mode 100644 index 00000000..dd7597dd --- /dev/null +++ b/google-cloud-filestore/src/main/java/com/google/cloud/filestore/v1beta1/stub/GrpcCloudFilestoreManagerStub.java @@ -0,0 +1,624 @@ +/* + * Copyright 2021 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.stub; + +import static com.google.cloud.filestore.v1beta1.CloudFilestoreManagerClient.ListBackupsPagedResponse; +import static com.google.cloud.filestore.v1beta1.CloudFilestoreManagerClient.ListInstancesPagedResponse; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.RequestParamsExtractor; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.common.OperationMetadata; +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.DeleteBackupRequest; +import com.google.cloud.filestore.v1beta1.DeleteInstanceRequest; +import com.google.cloud.filestore.v1beta1.GetBackupRequest; +import com.google.cloud.filestore.v1beta1.GetInstanceRequest; +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.RestoreInstanceRequest; +import com.google.cloud.filestore.v1beta1.UpdateBackupRequest; +import com.google.cloud.filestore.v1beta1.UpdateInstanceRequest; +import com.google.common.collect.ImmutableMap; +import com.google.longrunning.Operation; +import com.google.longrunning.stub.GrpcOperationsStub; +import com.google.protobuf.Empty; +import io.grpc.MethodDescriptor; +import io.grpc.protobuf.ProtoUtils; +import java.io.IOException; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * gRPC stub implementation for the CloudFilestoreManager service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class GrpcCloudFilestoreManagerStub extends CloudFilestoreManagerStub { + private static final MethodDescriptor + listInstancesMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.filestore.v1beta1.CloudFilestoreManager/ListInstances") + .setRequestMarshaller( + ProtoUtils.marshaller(ListInstancesRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListInstancesResponse.getDefaultInstance())) + .build(); + + private static final MethodDescriptor getInstanceMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.filestore.v1beta1.CloudFilestoreManager/GetInstance") + .setRequestMarshaller(ProtoUtils.marshaller(GetInstanceRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Instance.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + createInstanceMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.filestore.v1beta1.CloudFilestoreManager/CreateInstance") + .setRequestMarshaller( + ProtoUtils.marshaller(CreateInstanceRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + updateInstanceMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.filestore.v1beta1.CloudFilestoreManager/UpdateInstance") + .setRequestMarshaller( + ProtoUtils.marshaller(UpdateInstanceRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + restoreInstanceMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.filestore.v1beta1.CloudFilestoreManager/RestoreInstance") + .setRequestMarshaller( + ProtoUtils.marshaller(RestoreInstanceRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + deleteInstanceMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.filestore.v1beta1.CloudFilestoreManager/DeleteInstance") + .setRequestMarshaller( + ProtoUtils.marshaller(DeleteInstanceRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + listBackupsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.filestore.v1beta1.CloudFilestoreManager/ListBackups") + .setRequestMarshaller(ProtoUtils.marshaller(ListBackupsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListBackupsResponse.getDefaultInstance())) + .build(); + + private static final MethodDescriptor getBackupMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.filestore.v1beta1.CloudFilestoreManager/GetBackup") + .setRequestMarshaller(ProtoUtils.marshaller(GetBackupRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Backup.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + createBackupMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.filestore.v1beta1.CloudFilestoreManager/CreateBackup") + .setRequestMarshaller(ProtoUtils.marshaller(CreateBackupRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + deleteBackupMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.filestore.v1beta1.CloudFilestoreManager/DeleteBackup") + .setRequestMarshaller(ProtoUtils.marshaller(DeleteBackupRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + updateBackupMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.filestore.v1beta1.CloudFilestoreManager/UpdateBackup") + .setRequestMarshaller(ProtoUtils.marshaller(UpdateBackupRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + + private final UnaryCallable listInstancesCallable; + private final UnaryCallable + listInstancesPagedCallable; + private final UnaryCallable getInstanceCallable; + private final UnaryCallable createInstanceCallable; + private final OperationCallable + createInstanceOperationCallable; + private final UnaryCallable updateInstanceCallable; + private final OperationCallable + updateInstanceOperationCallable; + private final UnaryCallable restoreInstanceCallable; + private final OperationCallable + restoreInstanceOperationCallable; + private final UnaryCallable deleteInstanceCallable; + private final OperationCallable + deleteInstanceOperationCallable; + private final UnaryCallable listBackupsCallable; + private final UnaryCallable + listBackupsPagedCallable; + private final UnaryCallable getBackupCallable; + private final UnaryCallable createBackupCallable; + private final OperationCallable + createBackupOperationCallable; + private final UnaryCallable deleteBackupCallable; + private final OperationCallable + deleteBackupOperationCallable; + private final UnaryCallable updateBackupCallable; + private final OperationCallable + updateBackupOperationCallable; + + private final BackgroundResource backgroundResources; + private final GrpcOperationsStub operationsStub; + private final GrpcStubCallableFactory callableFactory; + + public static final GrpcCloudFilestoreManagerStub create( + CloudFilestoreManagerStubSettings settings) throws IOException { + return new GrpcCloudFilestoreManagerStub(settings, ClientContext.create(settings)); + } + + public static final GrpcCloudFilestoreManagerStub create(ClientContext clientContext) + throws IOException { + return new GrpcCloudFilestoreManagerStub( + CloudFilestoreManagerStubSettings.newBuilder().build(), clientContext); + } + + public static final GrpcCloudFilestoreManagerStub create( + ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { + return new GrpcCloudFilestoreManagerStub( + CloudFilestoreManagerStubSettings.newBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of GrpcCloudFilestoreManagerStub, using the given settings. This is + * protected so that it is easy to make a subclass, but otherwise, the static factory methods + * should be preferred. + */ + protected GrpcCloudFilestoreManagerStub( + CloudFilestoreManagerStubSettings settings, ClientContext clientContext) throws IOException { + this(settings, clientContext, new GrpcCloudFilestoreManagerCallableFactory()); + } + + /** + * Constructs an instance of GrpcCloudFilestoreManagerStub, using the given settings. This is + * protected so that it is easy to make a subclass, but otherwise, the static factory methods + * should be preferred. + */ + protected GrpcCloudFilestoreManagerStub( + CloudFilestoreManagerStubSettings settings, + ClientContext clientContext, + GrpcStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory); + + GrpcCallSettings listInstancesTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listInstancesMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(ListInstancesRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + } + }) + .build(); + GrpcCallSettings getInstanceTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getInstanceMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(GetInstanceRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + } + }) + .build(); + GrpcCallSettings createInstanceTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(createInstanceMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(CreateInstanceRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + } + }) + .build(); + GrpcCallSettings updateInstanceTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(updateInstanceMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(UpdateInstanceRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("instance.name", String.valueOf(request.getInstance().getName())); + return params.build(); + } + }) + .build(); + GrpcCallSettings restoreInstanceTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(restoreInstanceMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(RestoreInstanceRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + } + }) + .build(); + GrpcCallSettings deleteInstanceTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(deleteInstanceMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(DeleteInstanceRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + } + }) + .build(); + GrpcCallSettings listBackupsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listBackupsMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(ListBackupsRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + } + }) + .build(); + GrpcCallSettings getBackupTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getBackupMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(GetBackupRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + } + }) + .build(); + GrpcCallSettings createBackupTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(createBackupMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(CreateBackupRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + } + }) + .build(); + GrpcCallSettings deleteBackupTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(deleteBackupMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(DeleteBackupRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + } + }) + .build(); + GrpcCallSettings updateBackupTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(updateBackupMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(UpdateBackupRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("backup.name", String.valueOf(request.getBackup().getName())); + return params.build(); + } + }) + .build(); + + this.listInstancesCallable = + callableFactory.createUnaryCallable( + listInstancesTransportSettings, settings.listInstancesSettings(), clientContext); + this.listInstancesPagedCallable = + callableFactory.createPagedCallable( + listInstancesTransportSettings, settings.listInstancesSettings(), clientContext); + this.getInstanceCallable = + callableFactory.createUnaryCallable( + getInstanceTransportSettings, settings.getInstanceSettings(), clientContext); + this.createInstanceCallable = + callableFactory.createUnaryCallable( + createInstanceTransportSettings, settings.createInstanceSettings(), clientContext); + this.createInstanceOperationCallable = + callableFactory.createOperationCallable( + createInstanceTransportSettings, + settings.createInstanceOperationSettings(), + clientContext, + operationsStub); + this.updateInstanceCallable = + callableFactory.createUnaryCallable( + updateInstanceTransportSettings, settings.updateInstanceSettings(), clientContext); + this.updateInstanceOperationCallable = + callableFactory.createOperationCallable( + updateInstanceTransportSettings, + settings.updateInstanceOperationSettings(), + clientContext, + operationsStub); + this.restoreInstanceCallable = + callableFactory.createUnaryCallable( + restoreInstanceTransportSettings, settings.restoreInstanceSettings(), clientContext); + this.restoreInstanceOperationCallable = + callableFactory.createOperationCallable( + restoreInstanceTransportSettings, + settings.restoreInstanceOperationSettings(), + clientContext, + operationsStub); + this.deleteInstanceCallable = + callableFactory.createUnaryCallable( + deleteInstanceTransportSettings, settings.deleteInstanceSettings(), clientContext); + this.deleteInstanceOperationCallable = + callableFactory.createOperationCallable( + deleteInstanceTransportSettings, + settings.deleteInstanceOperationSettings(), + clientContext, + operationsStub); + this.listBackupsCallable = + callableFactory.createUnaryCallable( + listBackupsTransportSettings, settings.listBackupsSettings(), clientContext); + this.listBackupsPagedCallable = + callableFactory.createPagedCallable( + listBackupsTransportSettings, settings.listBackupsSettings(), clientContext); + this.getBackupCallable = + callableFactory.createUnaryCallable( + getBackupTransportSettings, settings.getBackupSettings(), clientContext); + this.createBackupCallable = + callableFactory.createUnaryCallable( + createBackupTransportSettings, settings.createBackupSettings(), clientContext); + this.createBackupOperationCallable = + callableFactory.createOperationCallable( + createBackupTransportSettings, + settings.createBackupOperationSettings(), + clientContext, + operationsStub); + this.deleteBackupCallable = + callableFactory.createUnaryCallable( + deleteBackupTransportSettings, settings.deleteBackupSettings(), clientContext); + this.deleteBackupOperationCallable = + callableFactory.createOperationCallable( + deleteBackupTransportSettings, + settings.deleteBackupOperationSettings(), + clientContext, + operationsStub); + this.updateBackupCallable = + callableFactory.createUnaryCallable( + updateBackupTransportSettings, settings.updateBackupSettings(), clientContext); + this.updateBackupOperationCallable = + callableFactory.createOperationCallable( + updateBackupTransportSettings, + settings.updateBackupOperationSettings(), + clientContext, + operationsStub); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + public GrpcOperationsStub getOperationsStub() { + return operationsStub; + } + + @Override + public UnaryCallable listInstancesCallable() { + return listInstancesCallable; + } + + @Override + public UnaryCallable + listInstancesPagedCallable() { + return listInstancesPagedCallable; + } + + @Override + public UnaryCallable getInstanceCallable() { + return getInstanceCallable; + } + + @Override + public UnaryCallable createInstanceCallable() { + return createInstanceCallable; + } + + @Override + public OperationCallable + createInstanceOperationCallable() { + return createInstanceOperationCallable; + } + + @Override + public UnaryCallable updateInstanceCallable() { + return updateInstanceCallable; + } + + @Override + public OperationCallable + updateInstanceOperationCallable() { + return updateInstanceOperationCallable; + } + + @Override + public UnaryCallable restoreInstanceCallable() { + return restoreInstanceCallable; + } + + @Override + public OperationCallable + restoreInstanceOperationCallable() { + return restoreInstanceOperationCallable; + } + + @Override + public UnaryCallable deleteInstanceCallable() { + return deleteInstanceCallable; + } + + @Override + public OperationCallable + deleteInstanceOperationCallable() { + return deleteInstanceOperationCallable; + } + + @Override + public UnaryCallable listBackupsCallable() { + return listBackupsCallable; + } + + @Override + public UnaryCallable listBackupsPagedCallable() { + return listBackupsPagedCallable; + } + + @Override + public UnaryCallable getBackupCallable() { + return getBackupCallable; + } + + @Override + public UnaryCallable createBackupCallable() { + return createBackupCallable; + } + + @Override + public OperationCallable + createBackupOperationCallable() { + return createBackupOperationCallable; + } + + @Override + public UnaryCallable deleteBackupCallable() { + return deleteBackupCallable; + } + + @Override + public OperationCallable + deleteBackupOperationCallable() { + return deleteBackupOperationCallable; + } + + @Override + public UnaryCallable updateBackupCallable() { + return updateBackupCallable; + } + + @Override + public OperationCallable + updateBackupOperationCallable() { + return updateBackupOperationCallable; + } + + @Override + public final void close() { + shutdown(); + } + + @Override + public void shutdown() { + backgroundResources.shutdown(); + } + + @Override + public boolean isShutdown() { + return backgroundResources.isShutdown(); + } + + @Override + public boolean isTerminated() { + return backgroundResources.isTerminated(); + } + + @Override + public void shutdownNow() { + backgroundResources.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return backgroundResources.awaitTermination(duration, unit); + } +} diff --git a/google-cloud-filestore/src/test/java/com/google/cloud/filestore/v1/CloudFilestoreManagerClientTest.java b/google-cloud-filestore/src/test/java/com/google/cloud/filestore/v1/CloudFilestoreManagerClientTest.java new file mode 100644 index 00000000..19a11e1e --- /dev/null +++ b/google-cloud-filestore/src/test/java/com/google/cloud/filestore/v1/CloudFilestoreManagerClientTest.java @@ -0,0 +1,1043 @@ +/* + * Copyright 2021 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.v1; + +import static com.google.cloud.filestore.v1.CloudFilestoreManagerClient.ListBackupsPagedResponse; +import static com.google.cloud.filestore.v1.CloudFilestoreManagerClient.ListInstancesPagedResponse; + +import com.google.api.gax.core.NoCredentialsProvider; +import com.google.api.gax.grpc.GaxGrpcProperties; +import com.google.api.gax.grpc.testing.LocalChannelProvider; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.api.gax.grpc.testing.MockServiceHelper; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.api.gax.rpc.StatusCode; +import com.google.common.collect.Lists; +import com.google.longrunning.Operation; +import com.google.protobuf.AbstractMessage; +import com.google.protobuf.Any; +import com.google.protobuf.BoolValue; +import com.google.protobuf.Empty; +import com.google.protobuf.FieldMask; +import com.google.protobuf.Timestamp; +import io.grpc.StatusRuntimeException; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.UUID; +import java.util.concurrent.ExecutionException; +import javax.annotation.Generated; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +@Generated("by gapic-generator-java") +public class CloudFilestoreManagerClientTest { + private static MockCloudFilestoreManager mockCloudFilestoreManager; + private static MockServiceHelper mockServiceHelper; + private LocalChannelProvider channelProvider; + private CloudFilestoreManagerClient client; + + @BeforeClass + public static void startStaticServer() { + mockCloudFilestoreManager = new MockCloudFilestoreManager(); + mockServiceHelper = + new MockServiceHelper( + UUID.randomUUID().toString(), + Arrays.asList(mockCloudFilestoreManager)); + mockServiceHelper.start(); + } + + @AfterClass + public static void stopServer() { + mockServiceHelper.stop(); + } + + @Before + public void setUp() throws IOException { + mockServiceHelper.reset(); + channelProvider = mockServiceHelper.createChannelProvider(); + CloudFilestoreManagerSettings settings = + CloudFilestoreManagerSettings.newBuilder() + .setTransportChannelProvider(channelProvider) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = CloudFilestoreManagerClient.create(settings); + } + + @After + public void tearDown() throws Exception { + client.close(); + } + + @Test + public void listInstancesTest() throws Exception { + Instance responsesElement = Instance.newBuilder().build(); + ListInstancesResponse expectedResponse = + ListInstancesResponse.newBuilder() + .setNextPageToken("") + .addAllInstances(Arrays.asList(responsesElement)) + .build(); + mockCloudFilestoreManager.addResponse(expectedResponse); + + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + + ListInstancesPagedResponse pagedListResponse = client.listInstances(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getInstancesList().get(0), resources.get(0)); + + List actualRequests = mockCloudFilestoreManager.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListInstancesRequest actualRequest = ((ListInstancesRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listInstancesExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockCloudFilestoreManager.addException(exception); + + try { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + client.listInstances(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listInstancesTest2() throws Exception { + Instance responsesElement = Instance.newBuilder().build(); + ListInstancesResponse expectedResponse = + ListInstancesResponse.newBuilder() + .setNextPageToken("") + .addAllInstances(Arrays.asList(responsesElement)) + .build(); + mockCloudFilestoreManager.addResponse(expectedResponse); + + String parent = "parent-995424086"; + + ListInstancesPagedResponse pagedListResponse = client.listInstances(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getInstancesList().get(0), resources.get(0)); + + List actualRequests = mockCloudFilestoreManager.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListInstancesRequest actualRequest = ((ListInstancesRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listInstancesExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockCloudFilestoreManager.addException(exception); + + try { + String parent = "parent-995424086"; + client.listInstances(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getInstanceTest() 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()) + .build(); + mockCloudFilestoreManager.addResponse(expectedResponse); + + InstanceName name = InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]"); + + Instance actualResponse = client.getInstance(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockCloudFilestoreManager.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetInstanceRequest actualRequest = ((GetInstanceRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getInstanceExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockCloudFilestoreManager.addException(exception); + + try { + InstanceName name = InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]"); + client.getInstance(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getInstanceTest2() 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()) + .build(); + mockCloudFilestoreManager.addResponse(expectedResponse); + + String name = "name3373707"; + + Instance actualResponse = client.getInstance(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockCloudFilestoreManager.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetInstanceRequest actualRequest = ((GetInstanceRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getInstanceExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockCloudFilestoreManager.addException(exception); + + try { + String name = "name3373707"; + client.getInstance(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createInstanceTest() 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()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("createInstanceTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockCloudFilestoreManager.addResponse(resultOperation); + + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + Instance instance = Instance.newBuilder().build(); + String instanceId = "instanceId902024336"; + + Instance actualResponse = client.createInstanceAsync(parent, instance, instanceId).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockCloudFilestoreManager.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateInstanceRequest actualRequest = ((CreateInstanceRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertEquals(instance, actualRequest.getInstance()); + Assert.assertEquals(instanceId, actualRequest.getInstanceId()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createInstanceExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockCloudFilestoreManager.addException(exception); + + try { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + Instance instance = Instance.newBuilder().build(); + String instanceId = "instanceId902024336"; + client.createInstanceAsync(parent, instance, instanceId).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 createInstanceTest2() 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()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("createInstanceTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockCloudFilestoreManager.addResponse(resultOperation); + + String parent = "parent-995424086"; + Instance instance = Instance.newBuilder().build(); + String instanceId = "instanceId902024336"; + + Instance actualResponse = client.createInstanceAsync(parent, instance, instanceId).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockCloudFilestoreManager.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateInstanceRequest actualRequest = ((CreateInstanceRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertEquals(instance, actualRequest.getInstance()); + Assert.assertEquals(instanceId, actualRequest.getInstanceId()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createInstanceExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockCloudFilestoreManager.addException(exception); + + try { + String parent = "parent-995424086"; + Instance instance = Instance.newBuilder().build(); + String instanceId = "instanceId902024336"; + client.createInstanceAsync(parent, instance, instanceId).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 updateInstanceTest() 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()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("updateInstanceTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockCloudFilestoreManager.addResponse(resultOperation); + + Instance instance = Instance.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + + Instance actualResponse = client.updateInstanceAsync(instance, updateMask).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockCloudFilestoreManager.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + UpdateInstanceRequest actualRequest = ((UpdateInstanceRequest) actualRequests.get(0)); + + Assert.assertEquals(instance, actualRequest.getInstance()); + Assert.assertEquals(updateMask, actualRequest.getUpdateMask()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void updateInstanceExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockCloudFilestoreManager.addException(exception); + + try { + Instance instance = Instance.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + client.updateInstanceAsync(instance, 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 restoreInstanceTest() 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()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("restoreInstanceTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockCloudFilestoreManager.addResponse(resultOperation); + + RestoreInstanceRequest request = + RestoreInstanceRequest.newBuilder() + .setName(InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString()) + .setFileShare("fileShare-1327728701") + .build(); + + Instance actualResponse = client.restoreInstanceAsync(request).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockCloudFilestoreManager.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + RestoreInstanceRequest actualRequest = ((RestoreInstanceRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getName(), actualRequest.getName()); + Assert.assertEquals(request.getFileShare(), actualRequest.getFileShare()); + Assert.assertEquals(request.getSourceBackup(), actualRequest.getSourceBackup()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void restoreInstanceExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockCloudFilestoreManager.addException(exception); + + try { + RestoreInstanceRequest request = + RestoreInstanceRequest.newBuilder() + .setName(InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString()) + .setFileShare("fileShare-1327728701") + .build(); + client.restoreInstanceAsync(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(); + Operation resultOperation = + Operation.newBuilder() + .setName("deleteInstanceTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockCloudFilestoreManager.addResponse(resultOperation); + + InstanceName name = InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]"); + + client.deleteInstanceAsync(name).get(); + + List actualRequests = mockCloudFilestoreManager.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteInstanceRequest actualRequest = ((DeleteInstanceRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteInstanceExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockCloudFilestoreManager.addException(exception); + + try { + InstanceName name = InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]"); + client.deleteInstanceAsync(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 deleteInstanceTest2() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + Operation resultOperation = + Operation.newBuilder() + .setName("deleteInstanceTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockCloudFilestoreManager.addResponse(resultOperation); + + String name = "name3373707"; + + client.deleteInstanceAsync(name).get(); + + List actualRequests = mockCloudFilestoreManager.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteInstanceRequest actualRequest = ((DeleteInstanceRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteInstanceExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockCloudFilestoreManager.addException(exception); + + try { + String name = "name3373707"; + client.deleteInstanceAsync(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 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()) + .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()) + .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()) + .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()) + .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()) + .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()); + } + } +} diff --git a/google-cloud-filestore/src/test/java/com/google/cloud/filestore/v1/MockCloudFilestoreManager.java b/google-cloud-filestore/src/test/java/com/google/cloud/filestore/v1/MockCloudFilestoreManager.java new file mode 100644 index 00000000..7156253e --- /dev/null +++ b/google-cloud-filestore/src/test/java/com/google/cloud/filestore/v1/MockCloudFilestoreManager.java @@ -0,0 +1,59 @@ +/* + * Copyright 2021 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.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.protobuf.AbstractMessage; +import io.grpc.ServerServiceDefinition; +import java.util.List; +import javax.annotation.Generated; + +@BetaApi +@Generated("by gapic-generator-java") +public class MockCloudFilestoreManager implements MockGrpcService { + private final MockCloudFilestoreManagerImpl serviceImpl; + + public MockCloudFilestoreManager() { + serviceImpl = new MockCloudFilestoreManagerImpl(); + } + + @Override + public List getRequests() { + return serviceImpl.getRequests(); + } + + @Override + public void addResponse(AbstractMessage response) { + serviceImpl.addResponse(response); + } + + @Override + public void addException(Exception exception) { + serviceImpl.addException(exception); + } + + @Override + public ServerServiceDefinition getServiceDefinition() { + return serviceImpl.bindService(); + } + + @Override + public void reset() { + serviceImpl.reset(); + } +} diff --git a/google-cloud-filestore/src/test/java/com/google/cloud/filestore/v1/MockCloudFilestoreManagerImpl.java b/google-cloud-filestore/src/test/java/com/google/cloud/filestore/v1/MockCloudFilestoreManagerImpl.java new file mode 100644 index 00000000..56402f85 --- /dev/null +++ b/google-cloud-filestore/src/test/java/com/google/cloud/filestore/v1/MockCloudFilestoreManagerImpl.java @@ -0,0 +1,290 @@ +/* + * Copyright 2021 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.v1; + +import com.google.api.core.BetaApi; +import com.google.cloud.filestore.v1.CloudFilestoreManagerGrpc.CloudFilestoreManagerImplBase; +import com.google.longrunning.Operation; +import com.google.protobuf.AbstractMessage; +import io.grpc.stub.StreamObserver; +import java.util.ArrayList; +import java.util.LinkedList; +import java.util.List; +import java.util.Queue; +import javax.annotation.Generated; + +@BetaApi +@Generated("by gapic-generator-java") +public class MockCloudFilestoreManagerImpl extends CloudFilestoreManagerImplBase { + private List requests; + private Queue responses; + + public MockCloudFilestoreManagerImpl() { + requests = new ArrayList<>(); + responses = new LinkedList<>(); + } + + public List getRequests() { + return requests; + } + + public void addResponse(AbstractMessage response) { + responses.add(response); + } + + public void setResponses(List responses) { + this.responses = new LinkedList(responses); + } + + public void addException(Exception exception) { + responses.add(exception); + } + + public void reset() { + requests = new ArrayList<>(); + responses = new LinkedList<>(); + } + + @Override + public void listInstances( + ListInstancesRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof ListInstancesResponse) { + requests.add(request); + responseObserver.onNext(((ListInstancesResponse) 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 ListInstances, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + ListInstancesResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void getInstance(GetInstanceRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Instance) { + requests.add(request); + responseObserver.onNext(((Instance) 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 GetInstance, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Instance.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void createInstance( + CreateInstanceRequest 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 CreateInstance, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void updateInstance( + UpdateInstanceRequest 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 UpdateInstance, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void restoreInstance( + RestoreInstanceRequest 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 RestoreInstance, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void deleteInstance( + DeleteInstanceRequest 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 DeleteInstance, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void listBackups( + ListBackupsRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof ListBackupsResponse) { + requests.add(request); + responseObserver.onNext(((ListBackupsResponse) 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 ListBackups, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + ListBackupsResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void getBackup(GetBackupRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Backup) { + requests.add(request); + responseObserver.onNext(((Backup) 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 GetBackup, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Backup.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void createBackup( + CreateBackupRequest 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 CreateBackup, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void deleteBackup( + DeleteBackupRequest 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 DeleteBackup, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void updateBackup( + UpdateBackupRequest 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 UpdateBackup, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } +} diff --git a/google-cloud-filestore/src/test/java/com/google/cloud/filestore/v1beta1/CloudFilestoreManagerClientTest.java b/google-cloud-filestore/src/test/java/com/google/cloud/filestore/v1beta1/CloudFilestoreManagerClientTest.java new file mode 100644 index 00000000..cf1e67df --- /dev/null +++ b/google-cloud-filestore/src/test/java/com/google/cloud/filestore/v1beta1/CloudFilestoreManagerClientTest.java @@ -0,0 +1,1044 @@ +/* + * Copyright 2021 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 static com.google.cloud.filestore.v1beta1.CloudFilestoreManagerClient.ListBackupsPagedResponse; +import static com.google.cloud.filestore.v1beta1.CloudFilestoreManagerClient.ListInstancesPagedResponse; + +import com.google.api.gax.core.NoCredentialsProvider; +import com.google.api.gax.grpc.GaxGrpcProperties; +import com.google.api.gax.grpc.testing.LocalChannelProvider; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.api.gax.grpc.testing.MockServiceHelper; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.api.gax.rpc.StatusCode; +import com.google.common.collect.Lists; +import com.google.longrunning.Operation; +import com.google.protobuf.AbstractMessage; +import com.google.protobuf.Any; +import com.google.protobuf.BoolValue; +import com.google.protobuf.Empty; +import com.google.protobuf.FieldMask; +import com.google.protobuf.Timestamp; +import io.grpc.StatusRuntimeException; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.UUID; +import java.util.concurrent.ExecutionException; +import javax.annotation.Generated; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +@Generated("by gapic-generator-java") +public class CloudFilestoreManagerClientTest { + private static MockCloudFilestoreManager mockCloudFilestoreManager; + private static MockServiceHelper mockServiceHelper; + private LocalChannelProvider channelProvider; + private CloudFilestoreManagerClient client; + + @BeforeClass + public static void startStaticServer() { + mockCloudFilestoreManager = new MockCloudFilestoreManager(); + mockServiceHelper = + new MockServiceHelper( + UUID.randomUUID().toString(), + Arrays.asList(mockCloudFilestoreManager)); + mockServiceHelper.start(); + } + + @AfterClass + public static void stopServer() { + mockServiceHelper.stop(); + } + + @Before + public void setUp() throws IOException { + mockServiceHelper.reset(); + channelProvider = mockServiceHelper.createChannelProvider(); + CloudFilestoreManagerSettings settings = + CloudFilestoreManagerSettings.newBuilder() + .setTransportChannelProvider(channelProvider) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = CloudFilestoreManagerClient.create(settings); + } + + @After + public void tearDown() throws Exception { + client.close(); + } + + @Test + public void listInstancesTest() throws Exception { + Instance responsesElement = Instance.newBuilder().build(); + ListInstancesResponse expectedResponse = + ListInstancesResponse.newBuilder() + .setNextPageToken("") + .addAllInstances(Arrays.asList(responsesElement)) + .build(); + mockCloudFilestoreManager.addResponse(expectedResponse); + + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + + ListInstancesPagedResponse pagedListResponse = client.listInstances(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getInstancesList().get(0), resources.get(0)); + + List actualRequests = mockCloudFilestoreManager.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListInstancesRequest actualRequest = ((ListInstancesRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listInstancesExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockCloudFilestoreManager.addException(exception); + + try { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + client.listInstances(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listInstancesTest2() throws Exception { + Instance responsesElement = Instance.newBuilder().build(); + ListInstancesResponse expectedResponse = + ListInstancesResponse.newBuilder() + .setNextPageToken("") + .addAllInstances(Arrays.asList(responsesElement)) + .build(); + mockCloudFilestoreManager.addResponse(expectedResponse); + + String parent = "parent-995424086"; + + ListInstancesPagedResponse pagedListResponse = client.listInstances(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getInstancesList().get(0), resources.get(0)); + + List actualRequests = mockCloudFilestoreManager.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListInstancesRequest actualRequest = ((ListInstancesRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listInstancesExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockCloudFilestoreManager.addException(exception); + + try { + String parent = "parent-995424086"; + client.listInstances(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getInstanceTest() 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()) + .build(); + mockCloudFilestoreManager.addResponse(expectedResponse); + + InstanceName name = InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]"); + + Instance actualResponse = client.getInstance(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockCloudFilestoreManager.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetInstanceRequest actualRequest = ((GetInstanceRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getInstanceExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockCloudFilestoreManager.addException(exception); + + try { + InstanceName name = InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]"); + client.getInstance(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getInstanceTest2() 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()) + .build(); + mockCloudFilestoreManager.addResponse(expectedResponse); + + String name = "name3373707"; + + Instance actualResponse = client.getInstance(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockCloudFilestoreManager.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetInstanceRequest actualRequest = ((GetInstanceRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getInstanceExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockCloudFilestoreManager.addException(exception); + + try { + String name = "name3373707"; + client.getInstance(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createInstanceTest() 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()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("createInstanceTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockCloudFilestoreManager.addResponse(resultOperation); + + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + Instance instance = Instance.newBuilder().build(); + String instanceId = "instanceId902024336"; + + Instance actualResponse = client.createInstanceAsync(parent, instance, instanceId).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockCloudFilestoreManager.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateInstanceRequest actualRequest = ((CreateInstanceRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertEquals(instance, actualRequest.getInstance()); + Assert.assertEquals(instanceId, actualRequest.getInstanceId()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createInstanceExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockCloudFilestoreManager.addException(exception); + + try { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + Instance instance = Instance.newBuilder().build(); + String instanceId = "instanceId902024336"; + client.createInstanceAsync(parent, instance, instanceId).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 createInstanceTest2() 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()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("createInstanceTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockCloudFilestoreManager.addResponse(resultOperation); + + String parent = "parent-995424086"; + Instance instance = Instance.newBuilder().build(); + String instanceId = "instanceId902024336"; + + Instance actualResponse = client.createInstanceAsync(parent, instance, instanceId).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockCloudFilestoreManager.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateInstanceRequest actualRequest = ((CreateInstanceRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertEquals(instance, actualRequest.getInstance()); + Assert.assertEquals(instanceId, actualRequest.getInstanceId()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createInstanceExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockCloudFilestoreManager.addException(exception); + + try { + String parent = "parent-995424086"; + Instance instance = Instance.newBuilder().build(); + String instanceId = "instanceId902024336"; + client.createInstanceAsync(parent, instance, instanceId).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 updateInstanceTest() 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()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("updateInstanceTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockCloudFilestoreManager.addResponse(resultOperation); + + Instance instance = Instance.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + + Instance actualResponse = client.updateInstanceAsync(instance, updateMask).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockCloudFilestoreManager.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + UpdateInstanceRequest actualRequest = ((UpdateInstanceRequest) actualRequests.get(0)); + + Assert.assertEquals(instance, actualRequest.getInstance()); + Assert.assertEquals(updateMask, actualRequest.getUpdateMask()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void updateInstanceExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockCloudFilestoreManager.addException(exception); + + try { + Instance instance = Instance.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + client.updateInstanceAsync(instance, 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 restoreInstanceTest() 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()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("restoreInstanceTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockCloudFilestoreManager.addResponse(resultOperation); + + RestoreInstanceRequest request = + RestoreInstanceRequest.newBuilder() + .setName(InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString()) + .setFileShare("fileShare-1327728701") + .build(); + + Instance actualResponse = client.restoreInstanceAsync(request).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockCloudFilestoreManager.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + RestoreInstanceRequest actualRequest = ((RestoreInstanceRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getName(), actualRequest.getName()); + Assert.assertEquals(request.getFileShare(), actualRequest.getFileShare()); + Assert.assertEquals(request.getSourceSnapshot(), actualRequest.getSourceSnapshot()); + Assert.assertEquals(request.getSourceBackup(), actualRequest.getSourceBackup()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void restoreInstanceExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockCloudFilestoreManager.addException(exception); + + try { + RestoreInstanceRequest request = + RestoreInstanceRequest.newBuilder() + .setName(InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString()) + .setFileShare("fileShare-1327728701") + .build(); + client.restoreInstanceAsync(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(); + Operation resultOperation = + Operation.newBuilder() + .setName("deleteInstanceTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockCloudFilestoreManager.addResponse(resultOperation); + + InstanceName name = InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]"); + + client.deleteInstanceAsync(name).get(); + + List actualRequests = mockCloudFilestoreManager.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteInstanceRequest actualRequest = ((DeleteInstanceRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteInstanceExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockCloudFilestoreManager.addException(exception); + + try { + InstanceName name = InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]"); + client.deleteInstanceAsync(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 deleteInstanceTest2() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + Operation resultOperation = + Operation.newBuilder() + .setName("deleteInstanceTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockCloudFilestoreManager.addResponse(resultOperation); + + String name = "name3373707"; + + client.deleteInstanceAsync(name).get(); + + List actualRequests = mockCloudFilestoreManager.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteInstanceRequest actualRequest = ((DeleteInstanceRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteInstanceExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockCloudFilestoreManager.addException(exception); + + try { + String name = "name3373707"; + client.deleteInstanceAsync(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 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()) + .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()) + .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()) + .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()) + .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()) + .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()); + } + } +} diff --git a/google-cloud-filestore/src/test/java/com/google/cloud/filestore/v1beta1/MockCloudFilestoreManager.java b/google-cloud-filestore/src/test/java/com/google/cloud/filestore/v1beta1/MockCloudFilestoreManager.java new file mode 100644 index 00000000..8d0038af --- /dev/null +++ b/google-cloud-filestore/src/test/java/com/google/cloud/filestore/v1beta1/MockCloudFilestoreManager.java @@ -0,0 +1,59 @@ +/* + * Copyright 2021 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.core.BetaApi; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.protobuf.AbstractMessage; +import io.grpc.ServerServiceDefinition; +import java.util.List; +import javax.annotation.Generated; + +@BetaApi +@Generated("by gapic-generator-java") +public class MockCloudFilestoreManager implements MockGrpcService { + private final MockCloudFilestoreManagerImpl serviceImpl; + + public MockCloudFilestoreManager() { + serviceImpl = new MockCloudFilestoreManagerImpl(); + } + + @Override + public List getRequests() { + return serviceImpl.getRequests(); + } + + @Override + public void addResponse(AbstractMessage response) { + serviceImpl.addResponse(response); + } + + @Override + public void addException(Exception exception) { + serviceImpl.addException(exception); + } + + @Override + public ServerServiceDefinition getServiceDefinition() { + return serviceImpl.bindService(); + } + + @Override + public void reset() { + serviceImpl.reset(); + } +} diff --git a/google-cloud-filestore/src/test/java/com/google/cloud/filestore/v1beta1/MockCloudFilestoreManagerImpl.java b/google-cloud-filestore/src/test/java/com/google/cloud/filestore/v1beta1/MockCloudFilestoreManagerImpl.java new file mode 100644 index 00000000..83214c18 --- /dev/null +++ b/google-cloud-filestore/src/test/java/com/google/cloud/filestore/v1beta1/MockCloudFilestoreManagerImpl.java @@ -0,0 +1,290 @@ +/* + * Copyright 2021 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.core.BetaApi; +import com.google.cloud.filestore.v1beta1.CloudFilestoreManagerGrpc.CloudFilestoreManagerImplBase; +import com.google.longrunning.Operation; +import com.google.protobuf.AbstractMessage; +import io.grpc.stub.StreamObserver; +import java.util.ArrayList; +import java.util.LinkedList; +import java.util.List; +import java.util.Queue; +import javax.annotation.Generated; + +@BetaApi +@Generated("by gapic-generator-java") +public class MockCloudFilestoreManagerImpl extends CloudFilestoreManagerImplBase { + private List requests; + private Queue responses; + + public MockCloudFilestoreManagerImpl() { + requests = new ArrayList<>(); + responses = new LinkedList<>(); + } + + public List getRequests() { + return requests; + } + + public void addResponse(AbstractMessage response) { + responses.add(response); + } + + public void setResponses(List responses) { + this.responses = new LinkedList(responses); + } + + public void addException(Exception exception) { + responses.add(exception); + } + + public void reset() { + requests = new ArrayList<>(); + responses = new LinkedList<>(); + } + + @Override + public void listInstances( + ListInstancesRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof ListInstancesResponse) { + requests.add(request); + responseObserver.onNext(((ListInstancesResponse) 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 ListInstances, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + ListInstancesResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void getInstance(GetInstanceRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Instance) { + requests.add(request); + responseObserver.onNext(((Instance) 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 GetInstance, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Instance.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void createInstance( + CreateInstanceRequest 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 CreateInstance, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void updateInstance( + UpdateInstanceRequest 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 UpdateInstance, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void restoreInstance( + RestoreInstanceRequest 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 RestoreInstance, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void deleteInstance( + DeleteInstanceRequest 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 DeleteInstance, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void listBackups( + ListBackupsRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof ListBackupsResponse) { + requests.add(request); + responseObserver.onNext(((ListBackupsResponse) 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 ListBackups, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + ListBackupsResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void getBackup(GetBackupRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Backup) { + requests.add(request); + responseObserver.onNext(((Backup) 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 GetBackup, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Backup.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void createBackup( + CreateBackupRequest 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 CreateBackup, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void deleteBackup( + DeleteBackupRequest 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 DeleteBackup, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void updateBackup( + UpdateBackupRequest 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 UpdateBackup, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } +} diff --git a/grpc-google-cloud-filestore-v1/pom.xml b/grpc-google-cloud-filestore-v1/pom.xml new file mode 100644 index 00000000..6a4fb4bb --- /dev/null +++ b/grpc-google-cloud-filestore-v1/pom.xml @@ -0,0 +1,69 @@ + + 4.0.0 + com.google.api.grpc + grpc-google-cloud-filestore-v1 + 0.0.1-SNAPSHOT + grpc-google-cloud-filestore-v1 + GRPC library for google-cloud-filestore + + com.google.cloud + google-cloud-filestore-parent + 0.0.1-SNAPSHOT + + + + io.grpc + grpc-api + + + io.grpc + grpc-stub + + + io.grpc + grpc-protobuf + + + com.google.protobuf + protobuf-java + + + com.google.api.grpc + proto-google-common-protos + + + com.google.api.grpc + proto-google-cloud-filestore-v1 + + + com.google.guava + guava + + + + + + java9 + + [9,) + + + + javax.annotation + javax.annotation-api + + + + + + + + + org.codehaus.mojo + flatten-maven-plugin + + + + \ No newline at end of file diff --git a/grpc-google-cloud-filestore-v1/src/main/java/com/google/cloud/filestore/v1/CloudFilestoreManagerGrpc.java b/grpc-google-cloud-filestore-v1/src/main/java/com/google/cloud/filestore/v1/CloudFilestoreManagerGrpc.java new file mode 100644 index 00000000..8633144b --- /dev/null +++ b/grpc-google-cloud-filestore-v1/src/main/java/com/google/cloud/filestore/v1/CloudFilestoreManagerGrpc.java @@ -0,0 +1,1601 @@ +/* + * 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. + */ +package com.google.cloud.filestore.v1; + +import static io.grpc.MethodDescriptor.generateFullMethodName; + +/** + * + * + *
+ * Configures and manages Cloud Filestore resources.
+ * Cloud Filestore Manager v1.
+ * The `file.googleapis.com` service implements the Cloud Filestore API and
+ * defines the following resource model for managing instances:
+ * * 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:
+ *   `/projects/{project_number}/locations/{location_id}/instances/{instance_id}`
+ *   and backups are resources of the form:
+ *   `/projects/{project_number}/locations/{location_id}/backup/{backup_id}`
+ * Note that location_id must be a GCP `zone` for instances and but to a GCP
+ * `region` for backups; for example:
+ * * `projects/12345/locations/us-central1-c/instances/my-filestore`
+ * * `projects/12345/locations/us-central1/backups/my-backup`
+ * 
+ */ +@javax.annotation.Generated( + value = "by gRPC proto compiler", + comments = "Source: google/cloud/filestore/v1/cloud_filestore_service.proto") +public final class CloudFilestoreManagerGrpc { + + private CloudFilestoreManagerGrpc() {} + + public static final String SERVICE_NAME = "google.cloud.filestore.v1.CloudFilestoreManager"; + + // Static method descriptors that strictly reflect the proto. + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.filestore.v1.ListInstancesRequest, + com.google.cloud.filestore.v1.ListInstancesResponse> + getListInstancesMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ListInstances", + requestType = com.google.cloud.filestore.v1.ListInstancesRequest.class, + responseType = com.google.cloud.filestore.v1.ListInstancesResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.filestore.v1.ListInstancesRequest, + com.google.cloud.filestore.v1.ListInstancesResponse> + getListInstancesMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.filestore.v1.ListInstancesRequest, + com.google.cloud.filestore.v1.ListInstancesResponse> + getListInstancesMethod; + if ((getListInstancesMethod = CloudFilestoreManagerGrpc.getListInstancesMethod) == null) { + synchronized (CloudFilestoreManagerGrpc.class) { + if ((getListInstancesMethod = CloudFilestoreManagerGrpc.getListInstancesMethod) == null) { + CloudFilestoreManagerGrpc.getListInstancesMethod = + getListInstancesMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ListInstances")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.filestore.v1.ListInstancesRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.filestore.v1.ListInstancesResponse + .getDefaultInstance())) + .setSchemaDescriptor( + new CloudFilestoreManagerMethodDescriptorSupplier("ListInstances")) + .build(); + } + } + } + return getListInstancesMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.filestore.v1.GetInstanceRequest, com.google.cloud.filestore.v1.Instance> + getGetInstanceMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetInstance", + requestType = com.google.cloud.filestore.v1.GetInstanceRequest.class, + responseType = com.google.cloud.filestore.v1.Instance.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.filestore.v1.GetInstanceRequest, com.google.cloud.filestore.v1.Instance> + getGetInstanceMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.filestore.v1.GetInstanceRequest, + com.google.cloud.filestore.v1.Instance> + getGetInstanceMethod; + if ((getGetInstanceMethod = CloudFilestoreManagerGrpc.getGetInstanceMethod) == null) { + synchronized (CloudFilestoreManagerGrpc.class) { + if ((getGetInstanceMethod = CloudFilestoreManagerGrpc.getGetInstanceMethod) == null) { + CloudFilestoreManagerGrpc.getGetInstanceMethod = + getGetInstanceMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetInstance")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.filestore.v1.GetInstanceRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.filestore.v1.Instance.getDefaultInstance())) + .setSchemaDescriptor( + new CloudFilestoreManagerMethodDescriptorSupplier("GetInstance")) + .build(); + } + } + } + return getGetInstanceMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.filestore.v1.CreateInstanceRequest, com.google.longrunning.Operation> + getCreateInstanceMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "CreateInstance", + requestType = com.google.cloud.filestore.v1.CreateInstanceRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.filestore.v1.CreateInstanceRequest, com.google.longrunning.Operation> + getCreateInstanceMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.filestore.v1.CreateInstanceRequest, com.google.longrunning.Operation> + getCreateInstanceMethod; + if ((getCreateInstanceMethod = CloudFilestoreManagerGrpc.getCreateInstanceMethod) == null) { + synchronized (CloudFilestoreManagerGrpc.class) { + if ((getCreateInstanceMethod = CloudFilestoreManagerGrpc.getCreateInstanceMethod) == null) { + CloudFilestoreManagerGrpc.getCreateInstanceMethod = + getCreateInstanceMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "CreateInstance")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.filestore.v1.CreateInstanceRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new CloudFilestoreManagerMethodDescriptorSupplier("CreateInstance")) + .build(); + } + } + } + return getCreateInstanceMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.filestore.v1.UpdateInstanceRequest, com.google.longrunning.Operation> + getUpdateInstanceMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "UpdateInstance", + requestType = com.google.cloud.filestore.v1.UpdateInstanceRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.filestore.v1.UpdateInstanceRequest, com.google.longrunning.Operation> + getUpdateInstanceMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.filestore.v1.UpdateInstanceRequest, com.google.longrunning.Operation> + getUpdateInstanceMethod; + if ((getUpdateInstanceMethod = CloudFilestoreManagerGrpc.getUpdateInstanceMethod) == null) { + synchronized (CloudFilestoreManagerGrpc.class) { + if ((getUpdateInstanceMethod = CloudFilestoreManagerGrpc.getUpdateInstanceMethod) == null) { + CloudFilestoreManagerGrpc.getUpdateInstanceMethod = + getUpdateInstanceMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "UpdateInstance")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.filestore.v1.UpdateInstanceRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new CloudFilestoreManagerMethodDescriptorSupplier("UpdateInstance")) + .build(); + } + } + } + return getUpdateInstanceMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.filestore.v1.RestoreInstanceRequest, com.google.longrunning.Operation> + getRestoreInstanceMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "RestoreInstance", + requestType = com.google.cloud.filestore.v1.RestoreInstanceRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.filestore.v1.RestoreInstanceRequest, com.google.longrunning.Operation> + getRestoreInstanceMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.filestore.v1.RestoreInstanceRequest, com.google.longrunning.Operation> + getRestoreInstanceMethod; + if ((getRestoreInstanceMethod = CloudFilestoreManagerGrpc.getRestoreInstanceMethod) == null) { + synchronized (CloudFilestoreManagerGrpc.class) { + if ((getRestoreInstanceMethod = CloudFilestoreManagerGrpc.getRestoreInstanceMethod) + == null) { + CloudFilestoreManagerGrpc.getRestoreInstanceMethod = + getRestoreInstanceMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "RestoreInstance")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.filestore.v1.RestoreInstanceRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new CloudFilestoreManagerMethodDescriptorSupplier("RestoreInstance")) + .build(); + } + } + } + return getRestoreInstanceMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.filestore.v1.DeleteInstanceRequest, com.google.longrunning.Operation> + getDeleteInstanceMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "DeleteInstance", + requestType = com.google.cloud.filestore.v1.DeleteInstanceRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.filestore.v1.DeleteInstanceRequest, com.google.longrunning.Operation> + getDeleteInstanceMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.filestore.v1.DeleteInstanceRequest, com.google.longrunning.Operation> + getDeleteInstanceMethod; + if ((getDeleteInstanceMethod = CloudFilestoreManagerGrpc.getDeleteInstanceMethod) == null) { + synchronized (CloudFilestoreManagerGrpc.class) { + if ((getDeleteInstanceMethod = CloudFilestoreManagerGrpc.getDeleteInstanceMethod) == null) { + CloudFilestoreManagerGrpc.getDeleteInstanceMethod = + getDeleteInstanceMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "DeleteInstance")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.filestore.v1.DeleteInstanceRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new CloudFilestoreManagerMethodDescriptorSupplier("DeleteInstance")) + .build(); + } + } + } + return getDeleteInstanceMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.filestore.v1.ListBackupsRequest, + com.google.cloud.filestore.v1.ListBackupsResponse> + getListBackupsMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ListBackups", + requestType = com.google.cloud.filestore.v1.ListBackupsRequest.class, + responseType = com.google.cloud.filestore.v1.ListBackupsResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.filestore.v1.ListBackupsRequest, + com.google.cloud.filestore.v1.ListBackupsResponse> + getListBackupsMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.filestore.v1.ListBackupsRequest, + com.google.cloud.filestore.v1.ListBackupsResponse> + getListBackupsMethod; + if ((getListBackupsMethod = CloudFilestoreManagerGrpc.getListBackupsMethod) == null) { + synchronized (CloudFilestoreManagerGrpc.class) { + if ((getListBackupsMethod = CloudFilestoreManagerGrpc.getListBackupsMethod) == null) { + CloudFilestoreManagerGrpc.getListBackupsMethod = + getListBackupsMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ListBackups")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.filestore.v1.ListBackupsRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.filestore.v1.ListBackupsResponse + .getDefaultInstance())) + .setSchemaDescriptor( + new CloudFilestoreManagerMethodDescriptorSupplier("ListBackups")) + .build(); + } + } + } + return getListBackupsMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.filestore.v1.GetBackupRequest, com.google.cloud.filestore.v1.Backup> + getGetBackupMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetBackup", + requestType = com.google.cloud.filestore.v1.GetBackupRequest.class, + responseType = com.google.cloud.filestore.v1.Backup.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.filestore.v1.GetBackupRequest, com.google.cloud.filestore.v1.Backup> + getGetBackupMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.filestore.v1.GetBackupRequest, com.google.cloud.filestore.v1.Backup> + getGetBackupMethod; + if ((getGetBackupMethod = CloudFilestoreManagerGrpc.getGetBackupMethod) == null) { + synchronized (CloudFilestoreManagerGrpc.class) { + if ((getGetBackupMethod = CloudFilestoreManagerGrpc.getGetBackupMethod) == null) { + CloudFilestoreManagerGrpc.getGetBackupMethod = + getGetBackupMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetBackup")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.filestore.v1.GetBackupRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.filestore.v1.Backup.getDefaultInstance())) + .setSchemaDescriptor( + new CloudFilestoreManagerMethodDescriptorSupplier("GetBackup")) + .build(); + } + } + } + return getGetBackupMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.filestore.v1.CreateBackupRequest, com.google.longrunning.Operation> + getCreateBackupMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "CreateBackup", + requestType = com.google.cloud.filestore.v1.CreateBackupRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.filestore.v1.CreateBackupRequest, com.google.longrunning.Operation> + getCreateBackupMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.filestore.v1.CreateBackupRequest, com.google.longrunning.Operation> + getCreateBackupMethod; + if ((getCreateBackupMethod = CloudFilestoreManagerGrpc.getCreateBackupMethod) == null) { + synchronized (CloudFilestoreManagerGrpc.class) { + if ((getCreateBackupMethod = CloudFilestoreManagerGrpc.getCreateBackupMethod) == null) { + CloudFilestoreManagerGrpc.getCreateBackupMethod = + getCreateBackupMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "CreateBackup")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.filestore.v1.CreateBackupRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new CloudFilestoreManagerMethodDescriptorSupplier("CreateBackup")) + .build(); + } + } + } + return getCreateBackupMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.filestore.v1.DeleteBackupRequest, com.google.longrunning.Operation> + getDeleteBackupMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "DeleteBackup", + requestType = com.google.cloud.filestore.v1.DeleteBackupRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.filestore.v1.DeleteBackupRequest, com.google.longrunning.Operation> + getDeleteBackupMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.filestore.v1.DeleteBackupRequest, com.google.longrunning.Operation> + getDeleteBackupMethod; + if ((getDeleteBackupMethod = CloudFilestoreManagerGrpc.getDeleteBackupMethod) == null) { + synchronized (CloudFilestoreManagerGrpc.class) { + if ((getDeleteBackupMethod = CloudFilestoreManagerGrpc.getDeleteBackupMethod) == null) { + CloudFilestoreManagerGrpc.getDeleteBackupMethod = + getDeleteBackupMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "DeleteBackup")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.filestore.v1.DeleteBackupRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new CloudFilestoreManagerMethodDescriptorSupplier("DeleteBackup")) + .build(); + } + } + } + return getDeleteBackupMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.filestore.v1.UpdateBackupRequest, com.google.longrunning.Operation> + getUpdateBackupMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "UpdateBackup", + requestType = com.google.cloud.filestore.v1.UpdateBackupRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.filestore.v1.UpdateBackupRequest, com.google.longrunning.Operation> + getUpdateBackupMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.filestore.v1.UpdateBackupRequest, com.google.longrunning.Operation> + getUpdateBackupMethod; + if ((getUpdateBackupMethod = CloudFilestoreManagerGrpc.getUpdateBackupMethod) == null) { + synchronized (CloudFilestoreManagerGrpc.class) { + if ((getUpdateBackupMethod = CloudFilestoreManagerGrpc.getUpdateBackupMethod) == null) { + CloudFilestoreManagerGrpc.getUpdateBackupMethod = + getUpdateBackupMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "UpdateBackup")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.filestore.v1.UpdateBackupRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new CloudFilestoreManagerMethodDescriptorSupplier("UpdateBackup")) + .build(); + } + } + } + return getUpdateBackupMethod; + } + + /** 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 = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public CloudFilestoreManagerStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new CloudFilestoreManagerStub(channel, callOptions); + } + }; + return CloudFilestoreManagerStub.newStub(factory, channel); + } + + /** + * Creates a new blocking-style stub that supports unary and streaming output calls on the service + */ + public static CloudFilestoreManagerBlockingStub newBlockingStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public CloudFilestoreManagerBlockingStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new CloudFilestoreManagerBlockingStub(channel, callOptions); + } + }; + return CloudFilestoreManagerBlockingStub.newStub(factory, channel); + } + + /** Creates a new ListenableFuture-style stub that supports unary calls on the service */ + public static CloudFilestoreManagerFutureStub newFutureStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public CloudFilestoreManagerFutureStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new CloudFilestoreManagerFutureStub(channel, callOptions); + } + }; + return CloudFilestoreManagerFutureStub.newStub(factory, channel); + } + + /** + * + * + *
+   * Configures and manages Cloud Filestore resources.
+   * Cloud Filestore Manager v1.
+   * The `file.googleapis.com` service implements the Cloud Filestore API and
+   * defines the following resource model for managing instances:
+   * * 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:
+   *   `/projects/{project_number}/locations/{location_id}/instances/{instance_id}`
+   *   and backups are resources of the form:
+   *   `/projects/{project_number}/locations/{location_id}/backup/{backup_id}`
+   * Note that location_id must be a GCP `zone` for instances and but to a GCP
+   * `region` for backups; for example:
+   * * `projects/12345/locations/us-central1-c/instances/my-filestore`
+   * * `projects/12345/locations/us-central1/backups/my-backup`
+   * 
+ */ + public abstract static class CloudFilestoreManagerImplBase implements io.grpc.BindableService { + + /** + * + * + *
+     * Lists all instances in a project for either a specified location
+     * or for all locations.
+     * 
+ */ + public void listInstances( + com.google.cloud.filestore.v1.ListInstancesRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getListInstancesMethod(), responseObserver); + } + + /** + * + * + *
+     * Gets the details of a specific instance.
+     * 
+ */ + public void getInstance( + com.google.cloud.filestore.v1.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.v1.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.v1.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.v1.RestoreInstanceRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getRestoreInstanceMethod(), responseObserver); + } + + /** + * + * + *
+     * Deletes an instance.
+     * 
+ */ + public void deleteInstance( + com.google.cloud.filestore.v1.DeleteInstanceRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getDeleteInstanceMethod(), responseObserver); + } + + /** + * + * + *
+     * Lists all backups in a project for either a specified location or for all
+     * locations.
+     * 
+ */ + public void listBackups( + com.google.cloud.filestore.v1.ListBackupsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getListBackupsMethod(), responseObserver); + } + + /** + * + * + *
+     * Gets the details of a specific backup.
+     * 
+ */ + public void getBackup( + com.google.cloud.filestore.v1.GetBackupRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getGetBackupMethod(), responseObserver); + } + + /** + * + * + *
+     * Creates a backup.
+     * 
+ */ + public void createBackup( + com.google.cloud.filestore.v1.CreateBackupRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getCreateBackupMethod(), responseObserver); + } + + /** + * + * + *
+     * Deletes a backup.
+     * 
+ */ + public void deleteBackup( + com.google.cloud.filestore.v1.DeleteBackupRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getDeleteBackupMethod(), responseObserver); + } + + /** + * + * + *
+     * Updates the settings of a specific backup.
+     * 
+ */ + public void updateBackup( + com.google.cloud.filestore.v1.UpdateBackupRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getUpdateBackupMethod(), responseObserver); + } + + @java.lang.Override + public final io.grpc.ServerServiceDefinition bindService() { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + getListInstancesMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.filestore.v1.ListInstancesRequest, + com.google.cloud.filestore.v1.ListInstancesResponse>( + this, METHODID_LIST_INSTANCES))) + .addMethod( + getGetInstanceMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.filestore.v1.GetInstanceRequest, + com.google.cloud.filestore.v1.Instance>(this, METHODID_GET_INSTANCE))) + .addMethod( + getCreateInstanceMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.filestore.v1.CreateInstanceRequest, + com.google.longrunning.Operation>(this, METHODID_CREATE_INSTANCE))) + .addMethod( + getUpdateInstanceMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.filestore.v1.UpdateInstanceRequest, + com.google.longrunning.Operation>(this, METHODID_UPDATE_INSTANCE))) + .addMethod( + getRestoreInstanceMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.filestore.v1.RestoreInstanceRequest, + com.google.longrunning.Operation>(this, METHODID_RESTORE_INSTANCE))) + .addMethod( + getDeleteInstanceMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.filestore.v1.DeleteInstanceRequest, + com.google.longrunning.Operation>(this, METHODID_DELETE_INSTANCE))) + .addMethod( + getListBackupsMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.filestore.v1.ListBackupsRequest, + com.google.cloud.filestore.v1.ListBackupsResponse>( + this, METHODID_LIST_BACKUPS))) + .addMethod( + getGetBackupMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.filestore.v1.GetBackupRequest, + com.google.cloud.filestore.v1.Backup>(this, METHODID_GET_BACKUP))) + .addMethod( + getCreateBackupMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.filestore.v1.CreateBackupRequest, + com.google.longrunning.Operation>(this, METHODID_CREATE_BACKUP))) + .addMethod( + getDeleteBackupMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.filestore.v1.DeleteBackupRequest, + com.google.longrunning.Operation>(this, METHODID_DELETE_BACKUP))) + .addMethod( + getUpdateBackupMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.filestore.v1.UpdateBackupRequest, + com.google.longrunning.Operation>(this, METHODID_UPDATE_BACKUP))) + .build(); + } + } + + /** + * + * + *
+   * Configures and manages Cloud Filestore resources.
+   * Cloud Filestore Manager v1.
+   * The `file.googleapis.com` service implements the Cloud Filestore API and
+   * defines the following resource model for managing instances:
+   * * 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:
+   *   `/projects/{project_number}/locations/{location_id}/instances/{instance_id}`
+   *   and backups are resources of the form:
+   *   `/projects/{project_number}/locations/{location_id}/backup/{backup_id}`
+   * Note that location_id must be a GCP `zone` for instances and but to a GCP
+   * `region` for backups; for example:
+   * * `projects/12345/locations/us-central1-c/instances/my-filestore`
+   * * `projects/12345/locations/us-central1/backups/my-backup`
+   * 
+ */ + public static final class CloudFilestoreManagerStub + extends io.grpc.stub.AbstractAsyncStub { + private CloudFilestoreManagerStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected CloudFilestoreManagerStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new CloudFilestoreManagerStub(channel, callOptions); + } + + /** + * + * + *
+     * Lists all instances in a project for either a specified location
+     * or for all locations.
+     * 
+ */ + public void listInstances( + com.google.cloud.filestore.v1.ListInstancesRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getListInstancesMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Gets the details of a specific instance.
+     * 
+ */ + public void getInstance( + com.google.cloud.filestore.v1.GetInstanceRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetInstanceMethod(), getCallOptions()), + request, + 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.v1.CreateInstanceRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getCreateInstanceMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Updates the settings of a specific instance.
+     * 
+ */ + public void updateInstance( + com.google.cloud.filestore.v1.UpdateInstanceRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getUpdateInstanceMethod(), getCallOptions()), + request, + 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.v1.RestoreInstanceRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getRestoreInstanceMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Deletes an instance.
+     * 
+ */ + public void deleteInstance( + com.google.cloud.filestore.v1.DeleteInstanceRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getDeleteInstanceMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Lists all backups in a project for either a specified location or for all
+     * locations.
+     * 
+ */ + public void listBackups( + com.google.cloud.filestore.v1.ListBackupsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getListBackupsMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Gets the details of a specific backup.
+     * 
+ */ + public void getBackup( + com.google.cloud.filestore.v1.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.v1.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.v1.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.v1.UpdateBackupRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getUpdateBackupMethod(), getCallOptions()), + request, + responseObserver); + } + } + + /** + * + * + *
+   * Configures and manages Cloud Filestore resources.
+   * Cloud Filestore Manager v1.
+   * The `file.googleapis.com` service implements the Cloud Filestore API and
+   * defines the following resource model for managing instances:
+   * * 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:
+   *   `/projects/{project_number}/locations/{location_id}/instances/{instance_id}`
+   *   and backups are resources of the form:
+   *   `/projects/{project_number}/locations/{location_id}/backup/{backup_id}`
+   * Note that location_id must be a GCP `zone` for instances and but to a GCP
+   * `region` for backups; for example:
+   * * `projects/12345/locations/us-central1-c/instances/my-filestore`
+   * * `projects/12345/locations/us-central1/backups/my-backup`
+   * 
+ */ + public static final class CloudFilestoreManagerBlockingStub + extends io.grpc.stub.AbstractBlockingStub { + private CloudFilestoreManagerBlockingStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected CloudFilestoreManagerBlockingStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new CloudFilestoreManagerBlockingStub(channel, callOptions); + } + + /** + * + * + *
+     * Lists all instances in a project for either a specified location
+     * or for all locations.
+     * 
+ */ + public com.google.cloud.filestore.v1.ListInstancesResponse listInstances( + com.google.cloud.filestore.v1.ListInstancesRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getListInstancesMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Gets the details of a specific instance.
+     * 
+ */ + public com.google.cloud.filestore.v1.Instance getInstance( + com.google.cloud.filestore.v1.GetInstanceRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetInstanceMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * 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 com.google.longrunning.Operation createInstance( + com.google.cloud.filestore.v1.CreateInstanceRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getCreateInstanceMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Updates the settings of a specific instance.
+     * 
+ */ + public com.google.longrunning.Operation updateInstance( + com.google.cloud.filestore.v1.UpdateInstanceRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getUpdateInstanceMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * 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 com.google.longrunning.Operation restoreInstance( + com.google.cloud.filestore.v1.RestoreInstanceRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getRestoreInstanceMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Deletes an instance.
+     * 
+ */ + public com.google.longrunning.Operation deleteInstance( + com.google.cloud.filestore.v1.DeleteInstanceRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getDeleteInstanceMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Lists all backups in a project for either a specified location or for all
+     * locations.
+     * 
+ */ + public com.google.cloud.filestore.v1.ListBackupsResponse listBackups( + com.google.cloud.filestore.v1.ListBackupsRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getListBackupsMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Gets the details of a specific backup.
+     * 
+ */ + public com.google.cloud.filestore.v1.Backup getBackup( + com.google.cloud.filestore.v1.GetBackupRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetBackupMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Creates a backup.
+     * 
+ */ + public com.google.longrunning.Operation createBackup( + com.google.cloud.filestore.v1.CreateBackupRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getCreateBackupMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Deletes a backup.
+     * 
+ */ + public com.google.longrunning.Operation deleteBackup( + com.google.cloud.filestore.v1.DeleteBackupRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getDeleteBackupMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Updates the settings of a specific backup.
+     * 
+ */ + public com.google.longrunning.Operation updateBackup( + com.google.cloud.filestore.v1.UpdateBackupRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getUpdateBackupMethod(), getCallOptions(), request); + } + } + + /** + * + * + *
+   * Configures and manages Cloud Filestore resources.
+   * Cloud Filestore Manager v1.
+   * The `file.googleapis.com` service implements the Cloud Filestore API and
+   * defines the following resource model for managing instances:
+   * * 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:
+   *   `/projects/{project_number}/locations/{location_id}/instances/{instance_id}`
+   *   and backups are resources of the form:
+   *   `/projects/{project_number}/locations/{location_id}/backup/{backup_id}`
+   * Note that location_id must be a GCP `zone` for instances and but to a GCP
+   * `region` for backups; for example:
+   * * `projects/12345/locations/us-central1-c/instances/my-filestore`
+   * * `projects/12345/locations/us-central1/backups/my-backup`
+   * 
+ */ + public static final class CloudFilestoreManagerFutureStub + extends io.grpc.stub.AbstractFutureStub { + private CloudFilestoreManagerFutureStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected CloudFilestoreManagerFutureStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new CloudFilestoreManagerFutureStub(channel, callOptions); + } + + /** + * + * + *
+     * Lists all instances in a project for either a specified location
+     * or for all locations.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.filestore.v1.ListInstancesResponse> + listInstances(com.google.cloud.filestore.v1.ListInstancesRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getListInstancesMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Gets the details of a specific instance.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.filestore.v1.Instance> + getInstance(com.google.cloud.filestore.v1.GetInstanceRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetInstanceMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * 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 com.google.common.util.concurrent.ListenableFuture + createInstance(com.google.cloud.filestore.v1.CreateInstanceRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getCreateInstanceMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Updates the settings of a specific instance.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + updateInstance(com.google.cloud.filestore.v1.UpdateInstanceRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getUpdateInstanceMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * 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 com.google.common.util.concurrent.ListenableFuture + restoreInstance(com.google.cloud.filestore.v1.RestoreInstanceRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getRestoreInstanceMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Deletes an instance.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + deleteInstance(com.google.cloud.filestore.v1.DeleteInstanceRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getDeleteInstanceMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Lists all backups in a project for either a specified location or for all
+     * locations.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.filestore.v1.ListBackupsResponse> + listBackups(com.google.cloud.filestore.v1.ListBackupsRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getListBackupsMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Gets the details of a specific backup.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + getBackup(com.google.cloud.filestore.v1.GetBackupRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetBackupMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Creates a backup.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + createBackup(com.google.cloud.filestore.v1.CreateBackupRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getCreateBackupMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Deletes a backup.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + deleteBackup(com.google.cloud.filestore.v1.DeleteBackupRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getDeleteBackupMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Updates the settings of a specific backup.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + updateBackup(com.google.cloud.filestore.v1.UpdateBackupRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getUpdateBackupMethod(), getCallOptions()), request); + } + } + + private static final int METHODID_LIST_INSTANCES = 0; + private static final int METHODID_GET_INSTANCE = 1; + 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 class MethodHandlers + implements io.grpc.stub.ServerCalls.UnaryMethod, + io.grpc.stub.ServerCalls.ServerStreamingMethod, + io.grpc.stub.ServerCalls.ClientStreamingMethod, + io.grpc.stub.ServerCalls.BidiStreamingMethod { + private final CloudFilestoreManagerImplBase serviceImpl; + private final int methodId; + + MethodHandlers(CloudFilestoreManagerImplBase serviceImpl, int methodId) { + this.serviceImpl = serviceImpl; + this.methodId = methodId; + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public void invoke(Req request, io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + case METHODID_LIST_INSTANCES: + serviceImpl.listInstances( + (com.google.cloud.filestore.v1.ListInstancesRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_GET_INSTANCE: + serviceImpl.getInstance( + (com.google.cloud.filestore.v1.GetInstanceRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_CREATE_INSTANCE: + serviceImpl.createInstance( + (com.google.cloud.filestore.v1.CreateInstanceRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_UPDATE_INSTANCE: + serviceImpl.updateInstance( + (com.google.cloud.filestore.v1.UpdateInstanceRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_RESTORE_INSTANCE: + serviceImpl.restoreInstance( + (com.google.cloud.filestore.v1.RestoreInstanceRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_DELETE_INSTANCE: + serviceImpl.deleteInstance( + (com.google.cloud.filestore.v1.DeleteInstanceRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_LIST_BACKUPS: + serviceImpl.listBackups( + (com.google.cloud.filestore.v1.ListBackupsRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_GET_BACKUP: + serviceImpl.getBackup( + (com.google.cloud.filestore.v1.GetBackupRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_CREATE_BACKUP: + serviceImpl.createBackup( + (com.google.cloud.filestore.v1.CreateBackupRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_DELETE_BACKUP: + serviceImpl.deleteBackup( + (com.google.cloud.filestore.v1.DeleteBackupRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_UPDATE_BACKUP: + serviceImpl.updateBackup( + (com.google.cloud.filestore.v1.UpdateBackupRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + default: + throw new AssertionError(); + } + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public io.grpc.stub.StreamObserver invoke( + io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + default: + throw new AssertionError(); + } + } + } + + private abstract static class CloudFilestoreManagerBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoFileDescriptorSupplier, + io.grpc.protobuf.ProtoServiceDescriptorSupplier { + CloudFilestoreManagerBaseDescriptorSupplier() {} + + @java.lang.Override + public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { + return com.google.cloud.filestore.v1.CloudFilestoreServiceProto.getDescriptor(); + } + + @java.lang.Override + public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { + return getFileDescriptor().findServiceByName("CloudFilestoreManager"); + } + } + + private static final class CloudFilestoreManagerFileDescriptorSupplier + extends CloudFilestoreManagerBaseDescriptorSupplier { + CloudFilestoreManagerFileDescriptorSupplier() {} + } + + private static final class CloudFilestoreManagerMethodDescriptorSupplier + extends CloudFilestoreManagerBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { + private final String methodName; + + CloudFilestoreManagerMethodDescriptorSupplier(String methodName) { + this.methodName = methodName; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.MethodDescriptor getMethodDescriptor() { + return getServiceDescriptor().findMethodByName(methodName); + } + } + + private static volatile io.grpc.ServiceDescriptor serviceDescriptor; + + public static io.grpc.ServiceDescriptor getServiceDescriptor() { + io.grpc.ServiceDescriptor result = serviceDescriptor; + if (result == null) { + synchronized (CloudFilestoreManagerGrpc.class) { + result = serviceDescriptor; + if (result == null) { + serviceDescriptor = + result = + io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) + .setSchemaDescriptor(new CloudFilestoreManagerFileDescriptorSupplier()) + .addMethod(getListInstancesMethod()) + .addMethod(getGetInstanceMethod()) + .addMethod(getCreateInstanceMethod()) + .addMethod(getUpdateInstanceMethod()) + .addMethod(getRestoreInstanceMethod()) + .addMethod(getDeleteInstanceMethod()) + .addMethod(getListBackupsMethod()) + .addMethod(getGetBackupMethod()) + .addMethod(getCreateBackupMethod()) + .addMethod(getDeleteBackupMethod()) + .addMethod(getUpdateBackupMethod()) + .build(); + } + } + } + return result; + } +} diff --git a/grpc-google-cloud-filestore-v1beta1/pom.xml b/grpc-google-cloud-filestore-v1beta1/pom.xml new file mode 100644 index 00000000..fb370568 --- /dev/null +++ b/grpc-google-cloud-filestore-v1beta1/pom.xml @@ -0,0 +1,69 @@ + + 4.0.0 + com.google.api.grpc + grpc-google-cloud-filestore-v1beta1 + 0.0.1-SNAPSHOT + grpc-google-cloud-filestore-v1beta1 + GRPC library for google-cloud-filestore + + com.google.cloud + google-cloud-filestore-parent + 0.0.1-SNAPSHOT + + + + io.grpc + grpc-api + + + io.grpc + grpc-stub + + + io.grpc + grpc-protobuf + + + com.google.protobuf + protobuf-java + + + com.google.api.grpc + proto-google-common-protos + + + com.google.api.grpc + proto-google-cloud-filestore-v1beta1 + + + com.google.guava + guava + + + + + + java9 + + [9,) + + + + javax.annotation + javax.annotation-api + + + + + + + + + org.codehaus.mojo + flatten-maven-plugin + + + + \ No newline at end of file diff --git a/grpc-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/CloudFilestoreManagerGrpc.java b/grpc-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/CloudFilestoreManagerGrpc.java new file mode 100644 index 00000000..5d2af986 --- /dev/null +++ b/grpc-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/CloudFilestoreManagerGrpc.java @@ -0,0 +1,1640 @@ +/* + * 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. + */ +package com.google.cloud.filestore.v1beta1; + +import static io.grpc.MethodDescriptor.generateFullMethodName; + +/** + * + * + *
+ * Configures and manages Cloud Filestore resources.
+ * Cloud Filestore Manager v1beta1.
+ * The `file.googleapis.com` service implements the Cloud 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:
+ *   `/projects/{project_id}/locations/{location_id}/instances/{instance_id}`
+ *   backups are resources of the form:
+ *   `/projects/{project_id}/locations/{location_id}/backup/{backup_id}`
+ * Note that location_id can represent a GCP `zone` or `region` depending on the
+ * resource.
+ * for example:
+ * A zonal Filestore instance:
+ * * `projects/my-project/locations/us-central1-c/instances/my-basic-tier-filer`
+ * A regional Filestore instance:
+ * * `projects/my-project/locations/us-central1/instances/my-enterprise-filer`
+ * 
+ */ +@javax.annotation.Generated( + value = "by gRPC proto compiler", + comments = "Source: google/cloud/filestore/v1beta1/cloud_filestore_service.proto") +public final class CloudFilestoreManagerGrpc { + + private CloudFilestoreManagerGrpc() {} + + public static final String SERVICE_NAME = "google.cloud.filestore.v1beta1.CloudFilestoreManager"; + + // Static method descriptors that strictly reflect the proto. + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.filestore.v1beta1.ListInstancesRequest, + com.google.cloud.filestore.v1beta1.ListInstancesResponse> + getListInstancesMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ListInstances", + requestType = com.google.cloud.filestore.v1beta1.ListInstancesRequest.class, + responseType = com.google.cloud.filestore.v1beta1.ListInstancesResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.filestore.v1beta1.ListInstancesRequest, + com.google.cloud.filestore.v1beta1.ListInstancesResponse> + getListInstancesMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.filestore.v1beta1.ListInstancesRequest, + com.google.cloud.filestore.v1beta1.ListInstancesResponse> + getListInstancesMethod; + if ((getListInstancesMethod = CloudFilestoreManagerGrpc.getListInstancesMethod) == null) { + synchronized (CloudFilestoreManagerGrpc.class) { + if ((getListInstancesMethod = CloudFilestoreManagerGrpc.getListInstancesMethod) == null) { + CloudFilestoreManagerGrpc.getListInstancesMethod = + getListInstancesMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ListInstances")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.filestore.v1beta1.ListInstancesRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.filestore.v1beta1.ListInstancesResponse + .getDefaultInstance())) + .setSchemaDescriptor( + new CloudFilestoreManagerMethodDescriptorSupplier("ListInstances")) + .build(); + } + } + } + return getListInstancesMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.filestore.v1beta1.GetInstanceRequest, + com.google.cloud.filestore.v1beta1.Instance> + getGetInstanceMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetInstance", + requestType = com.google.cloud.filestore.v1beta1.GetInstanceRequest.class, + responseType = com.google.cloud.filestore.v1beta1.Instance.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.filestore.v1beta1.GetInstanceRequest, + com.google.cloud.filestore.v1beta1.Instance> + getGetInstanceMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.filestore.v1beta1.GetInstanceRequest, + com.google.cloud.filestore.v1beta1.Instance> + getGetInstanceMethod; + if ((getGetInstanceMethod = CloudFilestoreManagerGrpc.getGetInstanceMethod) == null) { + synchronized (CloudFilestoreManagerGrpc.class) { + if ((getGetInstanceMethod = CloudFilestoreManagerGrpc.getGetInstanceMethod) == null) { + CloudFilestoreManagerGrpc.getGetInstanceMethod = + getGetInstanceMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetInstance")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.filestore.v1beta1.GetInstanceRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.filestore.v1beta1.Instance.getDefaultInstance())) + .setSchemaDescriptor( + new CloudFilestoreManagerMethodDescriptorSupplier("GetInstance")) + .build(); + } + } + } + return getGetInstanceMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.filestore.v1beta1.CreateInstanceRequest, + com.google.longrunning.Operation> + getCreateInstanceMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "CreateInstance", + requestType = com.google.cloud.filestore.v1beta1.CreateInstanceRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.filestore.v1beta1.CreateInstanceRequest, + com.google.longrunning.Operation> + getCreateInstanceMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.filestore.v1beta1.CreateInstanceRequest, + com.google.longrunning.Operation> + getCreateInstanceMethod; + if ((getCreateInstanceMethod = CloudFilestoreManagerGrpc.getCreateInstanceMethod) == null) { + synchronized (CloudFilestoreManagerGrpc.class) { + if ((getCreateInstanceMethod = CloudFilestoreManagerGrpc.getCreateInstanceMethod) == null) { + CloudFilestoreManagerGrpc.getCreateInstanceMethod = + getCreateInstanceMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "CreateInstance")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.filestore.v1beta1.CreateInstanceRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new CloudFilestoreManagerMethodDescriptorSupplier("CreateInstance")) + .build(); + } + } + } + return getCreateInstanceMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.filestore.v1beta1.UpdateInstanceRequest, + com.google.longrunning.Operation> + getUpdateInstanceMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "UpdateInstance", + requestType = com.google.cloud.filestore.v1beta1.UpdateInstanceRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.filestore.v1beta1.UpdateInstanceRequest, + com.google.longrunning.Operation> + getUpdateInstanceMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.filestore.v1beta1.UpdateInstanceRequest, + com.google.longrunning.Operation> + getUpdateInstanceMethod; + if ((getUpdateInstanceMethod = CloudFilestoreManagerGrpc.getUpdateInstanceMethod) == null) { + synchronized (CloudFilestoreManagerGrpc.class) { + if ((getUpdateInstanceMethod = CloudFilestoreManagerGrpc.getUpdateInstanceMethod) == null) { + CloudFilestoreManagerGrpc.getUpdateInstanceMethod = + getUpdateInstanceMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "UpdateInstance")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.filestore.v1beta1.UpdateInstanceRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new CloudFilestoreManagerMethodDescriptorSupplier("UpdateInstance")) + .build(); + } + } + } + return getUpdateInstanceMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.filestore.v1beta1.RestoreInstanceRequest, + com.google.longrunning.Operation> + getRestoreInstanceMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "RestoreInstance", + requestType = com.google.cloud.filestore.v1beta1.RestoreInstanceRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.filestore.v1beta1.RestoreInstanceRequest, + com.google.longrunning.Operation> + getRestoreInstanceMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.filestore.v1beta1.RestoreInstanceRequest, + com.google.longrunning.Operation> + getRestoreInstanceMethod; + if ((getRestoreInstanceMethod = CloudFilestoreManagerGrpc.getRestoreInstanceMethod) == null) { + synchronized (CloudFilestoreManagerGrpc.class) { + if ((getRestoreInstanceMethod = CloudFilestoreManagerGrpc.getRestoreInstanceMethod) + == null) { + CloudFilestoreManagerGrpc.getRestoreInstanceMethod = + getRestoreInstanceMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "RestoreInstance")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.filestore.v1beta1.RestoreInstanceRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new CloudFilestoreManagerMethodDescriptorSupplier("RestoreInstance")) + .build(); + } + } + } + return getRestoreInstanceMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.filestore.v1beta1.DeleteInstanceRequest, + com.google.longrunning.Operation> + getDeleteInstanceMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "DeleteInstance", + requestType = com.google.cloud.filestore.v1beta1.DeleteInstanceRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.filestore.v1beta1.DeleteInstanceRequest, + com.google.longrunning.Operation> + getDeleteInstanceMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.filestore.v1beta1.DeleteInstanceRequest, + com.google.longrunning.Operation> + getDeleteInstanceMethod; + if ((getDeleteInstanceMethod = CloudFilestoreManagerGrpc.getDeleteInstanceMethod) == null) { + synchronized (CloudFilestoreManagerGrpc.class) { + if ((getDeleteInstanceMethod = CloudFilestoreManagerGrpc.getDeleteInstanceMethod) == null) { + CloudFilestoreManagerGrpc.getDeleteInstanceMethod = + getDeleteInstanceMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "DeleteInstance")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.filestore.v1beta1.DeleteInstanceRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new CloudFilestoreManagerMethodDescriptorSupplier("DeleteInstance")) + .build(); + } + } + } + return getDeleteInstanceMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.filestore.v1beta1.ListBackupsRequest, + com.google.cloud.filestore.v1beta1.ListBackupsResponse> + getListBackupsMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ListBackups", + requestType = com.google.cloud.filestore.v1beta1.ListBackupsRequest.class, + responseType = com.google.cloud.filestore.v1beta1.ListBackupsResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.filestore.v1beta1.ListBackupsRequest, + com.google.cloud.filestore.v1beta1.ListBackupsResponse> + getListBackupsMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.filestore.v1beta1.ListBackupsRequest, + com.google.cloud.filestore.v1beta1.ListBackupsResponse> + getListBackupsMethod; + if ((getListBackupsMethod = CloudFilestoreManagerGrpc.getListBackupsMethod) == null) { + synchronized (CloudFilestoreManagerGrpc.class) { + if ((getListBackupsMethod = CloudFilestoreManagerGrpc.getListBackupsMethod) == null) { + CloudFilestoreManagerGrpc.getListBackupsMethod = + getListBackupsMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ListBackups")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.filestore.v1beta1.ListBackupsRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.filestore.v1beta1.ListBackupsResponse + .getDefaultInstance())) + .setSchemaDescriptor( + new CloudFilestoreManagerMethodDescriptorSupplier("ListBackups")) + .build(); + } + } + } + return getListBackupsMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.filestore.v1beta1.GetBackupRequest, + com.google.cloud.filestore.v1beta1.Backup> + getGetBackupMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetBackup", + requestType = com.google.cloud.filestore.v1beta1.GetBackupRequest.class, + responseType = com.google.cloud.filestore.v1beta1.Backup.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.filestore.v1beta1.GetBackupRequest, + com.google.cloud.filestore.v1beta1.Backup> + getGetBackupMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.filestore.v1beta1.GetBackupRequest, + com.google.cloud.filestore.v1beta1.Backup> + getGetBackupMethod; + if ((getGetBackupMethod = CloudFilestoreManagerGrpc.getGetBackupMethod) == null) { + synchronized (CloudFilestoreManagerGrpc.class) { + if ((getGetBackupMethod = CloudFilestoreManagerGrpc.getGetBackupMethod) == null) { + CloudFilestoreManagerGrpc.getGetBackupMethod = + getGetBackupMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetBackup")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.filestore.v1beta1.GetBackupRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.filestore.v1beta1.Backup.getDefaultInstance())) + .setSchemaDescriptor( + new CloudFilestoreManagerMethodDescriptorSupplier("GetBackup")) + .build(); + } + } + } + return getGetBackupMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.filestore.v1beta1.CreateBackupRequest, com.google.longrunning.Operation> + getCreateBackupMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "CreateBackup", + requestType = com.google.cloud.filestore.v1beta1.CreateBackupRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.filestore.v1beta1.CreateBackupRequest, com.google.longrunning.Operation> + getCreateBackupMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.filestore.v1beta1.CreateBackupRequest, + com.google.longrunning.Operation> + getCreateBackupMethod; + if ((getCreateBackupMethod = CloudFilestoreManagerGrpc.getCreateBackupMethod) == null) { + synchronized (CloudFilestoreManagerGrpc.class) { + if ((getCreateBackupMethod = CloudFilestoreManagerGrpc.getCreateBackupMethod) == null) { + CloudFilestoreManagerGrpc.getCreateBackupMethod = + getCreateBackupMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "CreateBackup")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.filestore.v1beta1.CreateBackupRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new CloudFilestoreManagerMethodDescriptorSupplier("CreateBackup")) + .build(); + } + } + } + return getCreateBackupMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.filestore.v1beta1.DeleteBackupRequest, com.google.longrunning.Operation> + getDeleteBackupMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "DeleteBackup", + requestType = com.google.cloud.filestore.v1beta1.DeleteBackupRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.filestore.v1beta1.DeleteBackupRequest, com.google.longrunning.Operation> + getDeleteBackupMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.filestore.v1beta1.DeleteBackupRequest, + com.google.longrunning.Operation> + getDeleteBackupMethod; + if ((getDeleteBackupMethod = CloudFilestoreManagerGrpc.getDeleteBackupMethod) == null) { + synchronized (CloudFilestoreManagerGrpc.class) { + if ((getDeleteBackupMethod = CloudFilestoreManagerGrpc.getDeleteBackupMethod) == null) { + CloudFilestoreManagerGrpc.getDeleteBackupMethod = + getDeleteBackupMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "DeleteBackup")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.filestore.v1beta1.DeleteBackupRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new CloudFilestoreManagerMethodDescriptorSupplier("DeleteBackup")) + .build(); + } + } + } + return getDeleteBackupMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.filestore.v1beta1.UpdateBackupRequest, com.google.longrunning.Operation> + getUpdateBackupMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "UpdateBackup", + requestType = com.google.cloud.filestore.v1beta1.UpdateBackupRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.filestore.v1beta1.UpdateBackupRequest, com.google.longrunning.Operation> + getUpdateBackupMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.filestore.v1beta1.UpdateBackupRequest, + com.google.longrunning.Operation> + getUpdateBackupMethod; + if ((getUpdateBackupMethod = CloudFilestoreManagerGrpc.getUpdateBackupMethod) == null) { + synchronized (CloudFilestoreManagerGrpc.class) { + if ((getUpdateBackupMethod = CloudFilestoreManagerGrpc.getUpdateBackupMethod) == null) { + CloudFilestoreManagerGrpc.getUpdateBackupMethod = + getUpdateBackupMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "UpdateBackup")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.filestore.v1beta1.UpdateBackupRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new CloudFilestoreManagerMethodDescriptorSupplier("UpdateBackup")) + .build(); + } + } + } + return getUpdateBackupMethod; + } + + /** 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 = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public CloudFilestoreManagerStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new CloudFilestoreManagerStub(channel, callOptions); + } + }; + return CloudFilestoreManagerStub.newStub(factory, channel); + } + + /** + * Creates a new blocking-style stub that supports unary and streaming output calls on the service + */ + public static CloudFilestoreManagerBlockingStub newBlockingStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public CloudFilestoreManagerBlockingStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new CloudFilestoreManagerBlockingStub(channel, callOptions); + } + }; + return CloudFilestoreManagerBlockingStub.newStub(factory, channel); + } + + /** Creates a new ListenableFuture-style stub that supports unary calls on the service */ + public static CloudFilestoreManagerFutureStub newFutureStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public CloudFilestoreManagerFutureStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new CloudFilestoreManagerFutureStub(channel, callOptions); + } + }; + return CloudFilestoreManagerFutureStub.newStub(factory, channel); + } + + /** + * + * + *
+   * Configures and manages Cloud Filestore resources.
+   * Cloud Filestore Manager v1beta1.
+   * The `file.googleapis.com` service implements the Cloud 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:
+   *   `/projects/{project_id}/locations/{location_id}/instances/{instance_id}`
+   *   backups are resources of the form:
+   *   `/projects/{project_id}/locations/{location_id}/backup/{backup_id}`
+   * Note that location_id can represent a GCP `zone` or `region` depending on the
+   * resource.
+   * for example:
+   * A zonal Filestore instance:
+   * * `projects/my-project/locations/us-central1-c/instances/my-basic-tier-filer`
+   * A regional Filestore instance:
+   * * `projects/my-project/locations/us-central1/instances/my-enterprise-filer`
+   * 
+ */ + public abstract static class CloudFilestoreManagerImplBase implements io.grpc.BindableService { + + /** + * + * + *
+     * Lists all instances in a project for either a specified location
+     * or for all locations.
+     * 
+ */ + public void listInstances( + com.google.cloud.filestore.v1beta1.ListInstancesRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getListInstancesMethod(), responseObserver); + } + + /** + * + * + *
+     * 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); + } + + /** + * + * + *
+     * 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 backups in a project for either a specified location or for all
+     * locations.
+     * 
+ */ + public void listBackups( + com.google.cloud.filestore.v1beta1.ListBackupsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getListBackupsMethod(), 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.ServerCalls.asyncUnimplementedUnaryCall(getGetBackupMethod(), responseObserver); + } + + /** + * + * + *
+     * Creates a backup.
+     * 
+ */ + public void createBackup( + com.google.cloud.filestore.v1beta1.CreateBackupRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getCreateBackupMethod(), responseObserver); + } + + /** + * + * + *
+     * Deletes a backup.
+     * 
+ */ + public void deleteBackup( + com.google.cloud.filestore.v1beta1.DeleteBackupRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getDeleteBackupMethod(), 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.ServerCalls.asyncUnimplementedUnaryCall( + getUpdateBackupMethod(), responseObserver); + } + + @java.lang.Override + public final io.grpc.ServerServiceDefinition bindService() { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + getListInstancesMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.filestore.v1beta1.ListInstancesRequest, + com.google.cloud.filestore.v1beta1.ListInstancesResponse>( + this, METHODID_LIST_INSTANCES))) + .addMethod( + getGetInstanceMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.filestore.v1beta1.GetInstanceRequest, + com.google.cloud.filestore.v1beta1.Instance>(this, METHODID_GET_INSTANCE))) + .addMethod( + getCreateInstanceMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.filestore.v1beta1.CreateInstanceRequest, + com.google.longrunning.Operation>(this, METHODID_CREATE_INSTANCE))) + .addMethod( + getUpdateInstanceMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.filestore.v1beta1.UpdateInstanceRequest, + com.google.longrunning.Operation>(this, METHODID_UPDATE_INSTANCE))) + .addMethod( + getRestoreInstanceMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.filestore.v1beta1.RestoreInstanceRequest, + com.google.longrunning.Operation>(this, METHODID_RESTORE_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( + getListBackupsMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.filestore.v1beta1.ListBackupsRequest, + com.google.cloud.filestore.v1beta1.ListBackupsResponse>( + this, METHODID_LIST_BACKUPS))) + .addMethod( + getGetBackupMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.filestore.v1beta1.GetBackupRequest, + com.google.cloud.filestore.v1beta1.Backup>(this, METHODID_GET_BACKUP))) + .addMethod( + getCreateBackupMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.filestore.v1beta1.CreateBackupRequest, + com.google.longrunning.Operation>(this, METHODID_CREATE_BACKUP))) + .addMethod( + getDeleteBackupMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.filestore.v1beta1.DeleteBackupRequest, + com.google.longrunning.Operation>(this, METHODID_DELETE_BACKUP))) + .addMethod( + getUpdateBackupMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.filestore.v1beta1.UpdateBackupRequest, + com.google.longrunning.Operation>(this, METHODID_UPDATE_BACKUP))) + .build(); + } + } + + /** + * + * + *
+   * Configures and manages Cloud Filestore resources.
+   * Cloud Filestore Manager v1beta1.
+   * The `file.googleapis.com` service implements the Cloud 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:
+   *   `/projects/{project_id}/locations/{location_id}/instances/{instance_id}`
+   *   backups are resources of the form:
+   *   `/projects/{project_id}/locations/{location_id}/backup/{backup_id}`
+   * Note that location_id can represent a GCP `zone` or `region` depending on the
+   * resource.
+   * for example:
+   * A zonal Filestore instance:
+   * * `projects/my-project/locations/us-central1-c/instances/my-basic-tier-filer`
+   * A regional Filestore instance:
+   * * `projects/my-project/locations/us-central1/instances/my-enterprise-filer`
+   * 
+ */ + public static final class CloudFilestoreManagerStub + extends io.grpc.stub.AbstractAsyncStub { + private CloudFilestoreManagerStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected CloudFilestoreManagerStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new CloudFilestoreManagerStub(channel, callOptions); + } + + /** + * + * + *
+     * Lists all instances in a project for either a specified location
+     * or for all locations.
+     * 
+ */ + public void listInstances( + com.google.cloud.filestore.v1beta1.ListInstancesRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getListInstancesMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * 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.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetInstanceMethod(), getCallOptions()), + request, + 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.ClientCalls.asyncUnaryCall( + getChannel().newCall(getCreateInstanceMethod(), getCallOptions()), + request, + 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.ClientCalls.asyncUnaryCall( + getChannel().newCall(getUpdateInstanceMethod(), getCallOptions()), + request, + 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.ClientCalls.asyncUnaryCall( + getChannel().newCall(getRestoreInstanceMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Deletes an instance.
+     * 
+ */ + public void deleteInstance( + com.google.cloud.filestore.v1beta1.DeleteInstanceRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getDeleteInstanceMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Lists all backups in a project for either a specified location or for all
+     * locations.
+     * 
+ */ + public void listBackups( + com.google.cloud.filestore.v1beta1.ListBackupsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + 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); + } + } + + /** + * + * + *
+   * Configures and manages Cloud Filestore resources.
+   * Cloud Filestore Manager v1beta1.
+   * The `file.googleapis.com` service implements the Cloud 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:
+   *   `/projects/{project_id}/locations/{location_id}/instances/{instance_id}`
+   *   backups are resources of the form:
+   *   `/projects/{project_id}/locations/{location_id}/backup/{backup_id}`
+   * Note that location_id can represent a GCP `zone` or `region` depending on the
+   * resource.
+   * for example:
+   * A zonal Filestore instance:
+   * * `projects/my-project/locations/us-central1-c/instances/my-basic-tier-filer`
+   * A regional Filestore instance:
+   * * `projects/my-project/locations/us-central1/instances/my-enterprise-filer`
+   * 
+ */ + public static final class CloudFilestoreManagerBlockingStub + extends io.grpc.stub.AbstractBlockingStub { + private CloudFilestoreManagerBlockingStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected CloudFilestoreManagerBlockingStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new CloudFilestoreManagerBlockingStub(channel, callOptions); + } + + /** + * + * + *
+     * Lists all instances in a project for either a specified location
+     * or for all locations.
+     * 
+ */ + public com.google.cloud.filestore.v1beta1.ListInstancesResponse listInstances( + com.google.cloud.filestore.v1beta1.ListInstancesRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getListInstancesMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Gets the details of a specific instance.
+     * 
+ */ + public com.google.cloud.filestore.v1beta1.Instance getInstance( + com.google.cloud.filestore.v1beta1.GetInstanceRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetInstanceMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * 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 com.google.longrunning.Operation createInstance( + com.google.cloud.filestore.v1beta1.CreateInstanceRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getCreateInstanceMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Updates the settings of a specific instance.
+     * 
+ */ + public com.google.longrunning.Operation updateInstance( + com.google.cloud.filestore.v1beta1.UpdateInstanceRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getUpdateInstanceMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * 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 com.google.longrunning.Operation restoreInstance( + com.google.cloud.filestore.v1beta1.RestoreInstanceRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getRestoreInstanceMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Deletes an instance.
+     * 
+ */ + public com.google.longrunning.Operation deleteInstance( + com.google.cloud.filestore.v1beta1.DeleteInstanceRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getDeleteInstanceMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Lists all backups in a project for either a specified location or for all
+     * locations.
+     * 
+ */ + public com.google.cloud.filestore.v1beta1.ListBackupsResponse listBackups( + com.google.cloud.filestore.v1beta1.ListBackupsRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getListBackupsMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Gets the details of a specific backup.
+     * 
+ */ + public com.google.cloud.filestore.v1beta1.Backup getBackup( + com.google.cloud.filestore.v1beta1.GetBackupRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetBackupMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Creates a backup.
+     * 
+ */ + public com.google.longrunning.Operation createBackup( + com.google.cloud.filestore.v1beta1.CreateBackupRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getCreateBackupMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Deletes a backup.
+     * 
+ */ + public com.google.longrunning.Operation deleteBackup( + com.google.cloud.filestore.v1beta1.DeleteBackupRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getDeleteBackupMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Updates the settings of a specific backup.
+     * 
+ */ + public com.google.longrunning.Operation updateBackup( + com.google.cloud.filestore.v1beta1.UpdateBackupRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getUpdateBackupMethod(), getCallOptions(), request); + } + } + + /** + * + * + *
+   * Configures and manages Cloud Filestore resources.
+   * Cloud Filestore Manager v1beta1.
+   * The `file.googleapis.com` service implements the Cloud 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:
+   *   `/projects/{project_id}/locations/{location_id}/instances/{instance_id}`
+   *   backups are resources of the form:
+   *   `/projects/{project_id}/locations/{location_id}/backup/{backup_id}`
+   * Note that location_id can represent a GCP `zone` or `region` depending on the
+   * resource.
+   * for example:
+   * A zonal Filestore instance:
+   * * `projects/my-project/locations/us-central1-c/instances/my-basic-tier-filer`
+   * A regional Filestore instance:
+   * * `projects/my-project/locations/us-central1/instances/my-enterprise-filer`
+   * 
+ */ + public static final class CloudFilestoreManagerFutureStub + extends io.grpc.stub.AbstractFutureStub { + private CloudFilestoreManagerFutureStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected CloudFilestoreManagerFutureStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new CloudFilestoreManagerFutureStub(channel, callOptions); + } + + /** + * + * + *
+     * Lists all instances in a project for either a specified location
+     * or for all locations.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.filestore.v1beta1.ListInstancesResponse> + listInstances(com.google.cloud.filestore.v1beta1.ListInstancesRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getListInstancesMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Gets the details of a specific instance.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.filestore.v1beta1.Instance> + getInstance(com.google.cloud.filestore.v1beta1.GetInstanceRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetInstanceMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * 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 com.google.common.util.concurrent.ListenableFuture + createInstance(com.google.cloud.filestore.v1beta1.CreateInstanceRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getCreateInstanceMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Updates the settings of a specific instance.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + updateInstance(com.google.cloud.filestore.v1beta1.UpdateInstanceRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getUpdateInstanceMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * 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 com.google.common.util.concurrent.ListenableFuture + restoreInstance(com.google.cloud.filestore.v1beta1.RestoreInstanceRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getRestoreInstanceMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Deletes an instance.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + deleteInstance(com.google.cloud.filestore.v1beta1.DeleteInstanceRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getDeleteInstanceMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Lists all backups in a project for either a specified location or for all
+     * locations.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.filestore.v1beta1.ListBackupsResponse> + listBackups(com.google.cloud.filestore.v1beta1.ListBackupsRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getListBackupsMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Gets the details of a specific backup.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.filestore.v1beta1.Backup> + getBackup(com.google.cloud.filestore.v1beta1.GetBackupRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetBackupMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Creates a backup.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + createBackup(com.google.cloud.filestore.v1beta1.CreateBackupRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getCreateBackupMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Deletes a backup.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + deleteBackup(com.google.cloud.filestore.v1beta1.DeleteBackupRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getDeleteBackupMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Updates the settings of a specific backup.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + updateBackup(com.google.cloud.filestore.v1beta1.UpdateBackupRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getUpdateBackupMethod(), getCallOptions()), request); + } + } + + private static final int METHODID_LIST_INSTANCES = 0; + private static final int METHODID_GET_INSTANCE = 1; + 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 class MethodHandlers + implements io.grpc.stub.ServerCalls.UnaryMethod, + io.grpc.stub.ServerCalls.ServerStreamingMethod, + io.grpc.stub.ServerCalls.ClientStreamingMethod, + io.grpc.stub.ServerCalls.BidiStreamingMethod { + private final CloudFilestoreManagerImplBase serviceImpl; + private final int methodId; + + MethodHandlers(CloudFilestoreManagerImplBase serviceImpl, int methodId) { + this.serviceImpl = serviceImpl; + this.methodId = methodId; + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public void invoke(Req request, io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + case METHODID_LIST_INSTANCES: + serviceImpl.listInstances( + (com.google.cloud.filestore.v1beta1.ListInstancesRequest) request, + (io.grpc.stub.StreamObserver< + com.google.cloud.filestore.v1beta1.ListInstancesResponse>) + responseObserver); + break; + case METHODID_GET_INSTANCE: + serviceImpl.getInstance( + (com.google.cloud.filestore.v1beta1.GetInstanceRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_CREATE_INSTANCE: + serviceImpl.createInstance( + (com.google.cloud.filestore.v1beta1.CreateInstanceRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_UPDATE_INSTANCE: + serviceImpl.updateInstance( + (com.google.cloud.filestore.v1beta1.UpdateInstanceRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_RESTORE_INSTANCE: + serviceImpl.restoreInstance( + (com.google.cloud.filestore.v1beta1.RestoreInstanceRequest) 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_BACKUPS: + serviceImpl.listBackups( + (com.google.cloud.filestore.v1beta1.ListBackupsRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_GET_BACKUP: + serviceImpl.getBackup( + (com.google.cloud.filestore.v1beta1.GetBackupRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_CREATE_BACKUP: + serviceImpl.createBackup( + (com.google.cloud.filestore.v1beta1.CreateBackupRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_DELETE_BACKUP: + serviceImpl.deleteBackup( + (com.google.cloud.filestore.v1beta1.DeleteBackupRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_UPDATE_BACKUP: + serviceImpl.updateBackup( + (com.google.cloud.filestore.v1beta1.UpdateBackupRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + default: + throw new AssertionError(); + } + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public io.grpc.stub.StreamObserver invoke( + io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + default: + throw new AssertionError(); + } + } + } + + private abstract static class CloudFilestoreManagerBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoFileDescriptorSupplier, + io.grpc.protobuf.ProtoServiceDescriptorSupplier { + CloudFilestoreManagerBaseDescriptorSupplier() {} + + @java.lang.Override + public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { + return com.google.cloud.filestore.v1beta1.CloudFilestoreServiceProto.getDescriptor(); + } + + @java.lang.Override + public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { + return getFileDescriptor().findServiceByName("CloudFilestoreManager"); + } + } + + private static final class CloudFilestoreManagerFileDescriptorSupplier + extends CloudFilestoreManagerBaseDescriptorSupplier { + CloudFilestoreManagerFileDescriptorSupplier() {} + } + + private static final class CloudFilestoreManagerMethodDescriptorSupplier + extends CloudFilestoreManagerBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { + private final String methodName; + + CloudFilestoreManagerMethodDescriptorSupplier(String methodName) { + this.methodName = methodName; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.MethodDescriptor getMethodDescriptor() { + return getServiceDescriptor().findMethodByName(methodName); + } + } + + private static volatile io.grpc.ServiceDescriptor serviceDescriptor; + + public static io.grpc.ServiceDescriptor getServiceDescriptor() { + io.grpc.ServiceDescriptor result = serviceDescriptor; + if (result == null) { + synchronized (CloudFilestoreManagerGrpc.class) { + result = serviceDescriptor; + if (result == null) { + serviceDescriptor = + result = + io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) + .setSchemaDescriptor(new CloudFilestoreManagerFileDescriptorSupplier()) + .addMethod(getListInstancesMethod()) + .addMethod(getGetInstanceMethod()) + .addMethod(getCreateInstanceMethod()) + .addMethod(getUpdateInstanceMethod()) + .addMethod(getRestoreInstanceMethod()) + .addMethod(getDeleteInstanceMethod()) + .addMethod(getListBackupsMethod()) + .addMethod(getGetBackupMethod()) + .addMethod(getCreateBackupMethod()) + .addMethod(getDeleteBackupMethod()) + .addMethod(getUpdateBackupMethod()) + .build(); + } + } + } + return result; + } +} diff --git a/java.header b/java.header new file mode 100644 index 00000000..3a9b503a --- /dev/null +++ b/java.header @@ -0,0 +1,15 @@ +^/\*$ +^ \* Copyright \d\d\d\d,? Google (Inc\.|LLC)( All [rR]ights [rR]eserved\.)?$ +^ \*$ +^ \* 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\.$ +^ \*/$ diff --git a/license-checks.xml b/license-checks.xml new file mode 100644 index 00000000..6597fced --- /dev/null +++ b/license-checks.xml @@ -0,0 +1,10 @@ + + + + + + + + diff --git a/owlbot.py b/owlbot.py new file mode 100644 index 00000000..77243461 --- /dev/null +++ b/owlbot.py @@ -0,0 +1,24 @@ +# Copyright 2021 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. + +import synthtool as s +from synthtool.languages import java + + +for library in s.get_staging_dirs(): + # put any special-case replacements here + s.move(library) + +s.remove_staging_dirs() +java.common_templates() \ No newline at end of file diff --git a/pom.xml b/pom.xml new file mode 100644 index 00000000..7a93c95e --- /dev/null +++ b/pom.xml @@ -0,0 +1,200 @@ + + + 4.0.0 + com.google.cloud + google-cloud-filestore-parent + pom + 0.0.1-SNAPSHOT + Google Cloud Filestore API Parent + https://github.com/googleapis/java-filestore + + Java idiomatic client for Google Cloud Platform services. + + + + com.google.cloud + google-cloud-shared-config + 0.12.0 + + + + + chingor + Jeff Ching + chingor@google.com + Google + + Developer + + + + neenushaji + Neenu Shaji + neenushaji@google.com + Google + + Developer + + + + + Google LLC + + + scm:git:git@github.com:googleapis/java-filestore.git + scm:git:git@github.com:googleapis/java-filestore.git + https://github.com/googleapis/java-filestore + HEAD + + + https://github.com/googleapis/java-filestore/issues + GitHub Issues + + + + Apache-2.0 + https://www.apache.org/licenses/LICENSE-2.0.txt + + + + + UTF-8 + UTF-8 + github + google-cloud-filestore-parent + + + + + + com.google.cloud + google-cloud-filestore + 0.0.1-SNAPSHOT + + + com.google.api.grpc + grpc-google-cloud-filestore-v1beta1 + 0.0.1-SNAPSHOT + + + com.google.api.grpc + grpc-google-cloud-filestore-v1 + 0.0.1-SNAPSHOT + + + com.google.api.grpc + proto-google-cloud-filestore-v1 + 0.0.1-SNAPSHOT + + + com.google.api.grpc + proto-google-cloud-filestore-v1beta1 + 0.0.1-SNAPSHOT + + + + com.google.cloud + google-cloud-shared-dependencies + 1.3.0 + pom + import + + + + + + + + + org.apache.maven.plugins + maven-dependency-plugin + + + org.objenesis:objenesis + javax.annotation:javax.annotation-api + + + + + + + + + google-cloud-filestore + grpc-google-cloud-filestore-v1beta1 + grpc-google-cloud-filestore-v1 + proto-google-cloud-filestore-v1 + proto-google-cloud-filestore-v1beta1 + google-cloud-filestore-bom + + + + + + org.apache.maven.plugins + maven-project-info-reports-plugin + 3.1.1 + + + + index + dependency-info + team + ci-management + issue-management + licenses + scm + dependency-management + distribution-management + summary + modules + + + + + true + ${site.installationModule} + jar + + + + org.apache.maven.plugins + maven-javadoc-plugin + 3.2.0 + + + html + + aggregate + javadoc + + + + + none + protected + true + ${project.build.directory}/javadoc + + + Test helpers packages + com.google.cloud.testing + + + SPI packages + com.google.cloud.spi* + + + + + https://grpc.io/grpc-java/javadoc/ + https://developers.google.com/protocol-buffers/docs/reference/java/ + https://googleapis.dev/java/google-auth-library/latest/ + https://googleapis.dev/java/gax/latest/ + https://googleapis.github.io/api-common-java/${google.api-common.version}/apidocs/ + + + + + + diff --git a/proto-google-cloud-filestore-v1/clirr-ignored-differences.xml b/proto-google-cloud-filestore-v1/clirr-ignored-differences.xml new file mode 100644 index 00000000..0d76ddf6 --- /dev/null +++ b/proto-google-cloud-filestore-v1/clirr-ignored-differences.xml @@ -0,0 +1,33 @@ + + + + + 7012 + com/google/cloud/common/*OrBuilder + * get*(*) + + + 7012 + com/google/cloud/common/*OrBuilder + boolean contains*(*) + + + 7012 + com/google/cloud/common/*OrBuilder + boolean has*(*) + + 7012 + com/google/cloud/filestore/v1/*OrBuilder + * get*(*) + + + 7012 + com/google/cloud/filestore/v1/*OrBuilder + boolean contains*(*) + + + 7012 + com/google/cloud/filestore/v1/*OrBuilder + boolean has*(*) + + diff --git a/proto-google-cloud-filestore-v1/pom.xml b/proto-google-cloud-filestore-v1/pom.xml new file mode 100644 index 00000000..ef2a9ca8 --- /dev/null +++ b/proto-google-cloud-filestore-v1/pom.xml @@ -0,0 +1,46 @@ + + 4.0.0 + com.google.api.grpc + proto-google-cloud-filestore-v1 + 0.0.1-SNAPSHOT + proto-google-cloud-filestore-v1 + Proto library for google-cloud-filestore + + com.google.cloud + google-cloud-filestore-parent + 0.0.1-SNAPSHOT + + + + com.google.protobuf + protobuf-java + + + com.google.api.grpc + proto-google-common-protos + + + com.google.api.grpc + proto-google-iam-v1 + + + com.google.api + api-common + + + com.google.guava + guava + + + + + + + org.codehaus.mojo + flatten-maven-plugin + + + + diff --git a/proto-google-cloud-filestore-v1/src/main/java/com/google/cloud/common/OperationMetadata.java b/proto-google-cloud-filestore-v1/src/main/java/com/google/cloud/common/OperationMetadata.java new file mode 100644 index 00000000..965742be --- /dev/null +++ b/proto-google-cloud-filestore-v1/src/main/java/com/google/cloud/common/OperationMetadata.java @@ -0,0 +1,1846 @@ +/* + * 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/common/operation_metadata.proto + +package com.google.cloud.common; + +/** + * + * + *
+ * Represents the metadata of the long-running operation.
+ * 
+ * + * Protobuf type {@code google.cloud.common.OperationMetadata} + */ +public final class OperationMetadata extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.common.OperationMetadata) + OperationMetadataOrBuilder { + private static final long serialVersionUID = 0L; + // Use OperationMetadata.newBuilder() to construct. + private OperationMetadata(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private OperationMetadata() { + target_ = ""; + verb_ = ""; + statusDetail_ = ""; + apiVersion_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new OperationMetadata(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private OperationMetadata( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (createTime_ != null) { + subBuilder = createTime_.toBuilder(); + } + createTime_ = + input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(createTime_); + createTime_ = subBuilder.buildPartial(); + } + + break; + } + case 18: + { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (endTime_ != null) { + subBuilder = endTime_.toBuilder(); + } + endTime_ = + input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(endTime_); + endTime_ = subBuilder.buildPartial(); + } + + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + + target_ = s; + break; + } + case 34: + { + java.lang.String s = input.readStringRequireUtf8(); + + verb_ = s; + break; + } + case 42: + { + java.lang.String s = input.readStringRequireUtf8(); + + statusDetail_ = s; + break; + } + case 48: + { + cancelRequested_ = input.readBool(); + break; + } + case 58: + { + java.lang.String s = input.readStringRequireUtf8(); + + apiVersion_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.common.OperationMetadataOuterClass + .internal_static_google_cloud_common_OperationMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.common.OperationMetadataOuterClass + .internal_static_google_cloud_common_OperationMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.common.OperationMetadata.class, + com.google.cloud.common.OperationMetadata.Builder.class); + } + + public static final int CREATE_TIME_FIELD_NUMBER = 1; + private com.google.protobuf.Timestamp createTime_; + /** + * + * + *
+   * Output only. The time the operation was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 1 [(.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 the operation was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 1 [(.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 the operation was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { + return getCreateTime(); + } + + public static final int END_TIME_FIELD_NUMBER = 2; + private com.google.protobuf.Timestamp endTime_; + /** + * + * + *
+   * Output only. The time the operation finished running.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the endTime field is set. + */ + @java.lang.Override + public boolean hasEndTime() { + return endTime_ != null; + } + /** + * + * + *
+   * Output only. The time the operation finished running.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The endTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getEndTime() { + return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; + } + /** + * + * + *
+   * Output only. The time the operation finished running.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder() { + return getEndTime(); + } + + public static final int TARGET_FIELD_NUMBER = 3; + private volatile java.lang.Object target_; + /** + * + * + *
+   * Output only. Server-defined resource path for the target of the operation.
+   * 
+ * + * string target = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The target. + */ + @java.lang.Override + public java.lang.String getTarget() { + java.lang.Object ref = target_; + 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(); + target_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. Server-defined resource path for the target of the operation.
+   * 
+ * + * string target = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for target. + */ + @java.lang.Override + public com.google.protobuf.ByteString getTargetBytes() { + java.lang.Object ref = target_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + target_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int VERB_FIELD_NUMBER = 4; + private volatile java.lang.Object verb_; + /** + * + * + *
+   * Output only. Name of the verb executed by the operation.
+   * 
+ * + * string verb = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The verb. + */ + @java.lang.Override + public java.lang.String getVerb() { + java.lang.Object ref = verb_; + 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(); + verb_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. Name of the verb executed by the operation.
+   * 
+ * + * string verb = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for verb. + */ + @java.lang.Override + public com.google.protobuf.ByteString getVerbBytes() { + java.lang.Object ref = verb_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + verb_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int STATUS_DETAIL_FIELD_NUMBER = 5; + private volatile java.lang.Object statusDetail_; + /** + * + * + *
+   * Output only. Human-readable status of the operation, if any.
+   * 
+ * + * string status_detail = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The statusDetail. + */ + @java.lang.Override + public java.lang.String getStatusDetail() { + java.lang.Object ref = statusDetail_; + 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(); + statusDetail_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. Human-readable status of the operation, if any.
+   * 
+ * + * string status_detail = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for statusDetail. + */ + @java.lang.Override + public com.google.protobuf.ByteString getStatusDetailBytes() { + java.lang.Object ref = statusDetail_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + statusDetail_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CANCEL_REQUESTED_FIELD_NUMBER = 6; + private boolean cancelRequested_; + /** + * + * + *
+   * Output only. Identifies whether the user has requested cancellation
+   * of the operation. Operations that have successfully been cancelled
+   * have [Operation.error][] value with a [google.rpc.Status.code][] of 1,
+   * corresponding to `Code.CANCELLED`.
+   * 
+ * + * bool cancel_requested = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The cancelRequested. + */ + @java.lang.Override + public boolean getCancelRequested() { + return cancelRequested_; + } + + public static final int API_VERSION_FIELD_NUMBER = 7; + private volatile java.lang.Object apiVersion_; + /** + * + * + *
+   * Output only. API version used to start the operation.
+   * 
+ * + * string api_version = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The apiVersion. + */ + @java.lang.Override + public java.lang.String getApiVersion() { + java.lang.Object ref = apiVersion_; + 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(); + apiVersion_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. API version used to start the operation.
+   * 
+ * + * string api_version = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for apiVersion. + */ + @java.lang.Override + public com.google.protobuf.ByteString getApiVersionBytes() { + java.lang.Object ref = apiVersion_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + apiVersion_ = 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 (createTime_ != null) { + output.writeMessage(1, getCreateTime()); + } + if (endTime_ != null) { + output.writeMessage(2, getEndTime()); + } + if (!getTargetBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, target_); + } + if (!getVerbBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, verb_); + } + if (!getStatusDetailBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, statusDetail_); + } + if (cancelRequested_ != false) { + output.writeBool(6, cancelRequested_); + } + if (!getApiVersionBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 7, apiVersion_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (createTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getCreateTime()); + } + if (endTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getEndTime()); + } + if (!getTargetBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, target_); + } + if (!getVerbBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, verb_); + } + if (!getStatusDetailBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, statusDetail_); + } + if (cancelRequested_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(6, cancelRequested_); + } + if (!getApiVersionBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(7, apiVersion_); + } + size += unknownFields.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.common.OperationMetadata)) { + return super.equals(obj); + } + com.google.cloud.common.OperationMetadata other = + (com.google.cloud.common.OperationMetadata) obj; + + if (hasCreateTime() != other.hasCreateTime()) return false; + if (hasCreateTime()) { + if (!getCreateTime().equals(other.getCreateTime())) return false; + } + if (hasEndTime() != other.hasEndTime()) return false; + if (hasEndTime()) { + if (!getEndTime().equals(other.getEndTime())) return false; + } + if (!getTarget().equals(other.getTarget())) return false; + if (!getVerb().equals(other.getVerb())) return false; + if (!getStatusDetail().equals(other.getStatusDetail())) return false; + if (getCancelRequested() != other.getCancelRequested()) return false; + if (!getApiVersion().equals(other.getApiVersion())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasCreateTime()) { + hash = (37 * hash) + CREATE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getCreateTime().hashCode(); + } + if (hasEndTime()) { + hash = (37 * hash) + END_TIME_FIELD_NUMBER; + hash = (53 * hash) + getEndTime().hashCode(); + } + hash = (37 * hash) + TARGET_FIELD_NUMBER; + hash = (53 * hash) + getTarget().hashCode(); + hash = (37 * hash) + VERB_FIELD_NUMBER; + hash = (53 * hash) + getVerb().hashCode(); + hash = (37 * hash) + STATUS_DETAIL_FIELD_NUMBER; + hash = (53 * hash) + getStatusDetail().hashCode(); + hash = (37 * hash) + CANCEL_REQUESTED_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getCancelRequested()); + hash = (37 * hash) + API_VERSION_FIELD_NUMBER; + hash = (53 * hash) + getApiVersion().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.common.OperationMetadata parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.common.OperationMetadata 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.common.OperationMetadata parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.common.OperationMetadata 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.common.OperationMetadata parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.common.OperationMetadata parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.common.OperationMetadata parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.common.OperationMetadata 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.common.OperationMetadata parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.common.OperationMetadata 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.common.OperationMetadata parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.common.OperationMetadata 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.common.OperationMetadata 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; + } + /** + * + * + *
+   * Represents the metadata of the long-running operation.
+   * 
+ * + * Protobuf type {@code google.cloud.common.OperationMetadata} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.common.OperationMetadata) + com.google.cloud.common.OperationMetadataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.common.OperationMetadataOuterClass + .internal_static_google_cloud_common_OperationMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.common.OperationMetadataOuterClass + .internal_static_google_cloud_common_OperationMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.common.OperationMetadata.class, + com.google.cloud.common.OperationMetadata.Builder.class); + } + + // Construct using com.google.cloud.common.OperationMetadata.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (createTimeBuilder_ == null) { + createTime_ = null; + } else { + createTime_ = null; + createTimeBuilder_ = null; + } + if (endTimeBuilder_ == null) { + endTime_ = null; + } else { + endTime_ = null; + endTimeBuilder_ = null; + } + target_ = ""; + + verb_ = ""; + + statusDetail_ = ""; + + cancelRequested_ = false; + + apiVersion_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.common.OperationMetadataOuterClass + .internal_static_google_cloud_common_OperationMetadata_descriptor; + } + + @java.lang.Override + public com.google.cloud.common.OperationMetadata getDefaultInstanceForType() { + return com.google.cloud.common.OperationMetadata.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.common.OperationMetadata build() { + com.google.cloud.common.OperationMetadata result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.common.OperationMetadata buildPartial() { + com.google.cloud.common.OperationMetadata result = + new com.google.cloud.common.OperationMetadata(this); + if (createTimeBuilder_ == null) { + result.createTime_ = createTime_; + } else { + result.createTime_ = createTimeBuilder_.build(); + } + if (endTimeBuilder_ == null) { + result.endTime_ = endTime_; + } else { + result.endTime_ = endTimeBuilder_.build(); + } + result.target_ = target_; + result.verb_ = verb_; + result.statusDetail_ = statusDetail_; + result.cancelRequested_ = cancelRequested_; + result.apiVersion_ = apiVersion_; + 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.common.OperationMetadata) { + return mergeFrom((com.google.cloud.common.OperationMetadata) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.common.OperationMetadata other) { + if (other == com.google.cloud.common.OperationMetadata.getDefaultInstance()) return this; + if (other.hasCreateTime()) { + mergeCreateTime(other.getCreateTime()); + } + if (other.hasEndTime()) { + mergeEndTime(other.getEndTime()); + } + if (!other.getTarget().isEmpty()) { + target_ = other.target_; + onChanged(); + } + if (!other.getVerb().isEmpty()) { + verb_ = other.verb_; + onChanged(); + } + if (!other.getStatusDetail().isEmpty()) { + statusDetail_ = other.statusDetail_; + onChanged(); + } + if (other.getCancelRequested() != false) { + setCancelRequested(other.getCancelRequested()); + } + if (!other.getApiVersion().isEmpty()) { + apiVersion_ = other.apiVersion_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + 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 { + com.google.cloud.common.OperationMetadata parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.common.OperationMetadata) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + 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 the operation was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 1 [(.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 the operation was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 1 [(.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 the operation was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 1 [(.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 the operation was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 1 [(.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 the operation was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 1 [(.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 the operation was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 1 [(.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 the operation was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getCreateTimeBuilder() { + + onChanged(); + return getCreateTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. The time the operation was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 1 [(.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 the operation was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 1 [(.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.Timestamp endTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + endTimeBuilder_; + /** + * + * + *
+     * Output only. The time the operation finished running.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the endTime field is set. + */ + public boolean hasEndTime() { + return endTimeBuilder_ != null || endTime_ != null; + } + /** + * + * + *
+     * Output only. The time the operation finished running.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The endTime. + */ + public com.google.protobuf.Timestamp getEndTime() { + if (endTimeBuilder_ == null) { + return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; + } else { + return endTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Output only. The time the operation finished running.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setEndTime(com.google.protobuf.Timestamp value) { + if (endTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + endTime_ = value; + onChanged(); + } else { + endTimeBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Output only. The time the operation finished running.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setEndTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (endTimeBuilder_ == null) { + endTime_ = builderForValue.build(); + onChanged(); + } else { + endTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Output only. The time the operation finished running.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeEndTime(com.google.protobuf.Timestamp value) { + if (endTimeBuilder_ == null) { + if (endTime_ != null) { + endTime_ = + com.google.protobuf.Timestamp.newBuilder(endTime_).mergeFrom(value).buildPartial(); + } else { + endTime_ = value; + } + onChanged(); + } else { + endTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Output only. The time the operation finished running.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearEndTime() { + if (endTimeBuilder_ == null) { + endTime_ = null; + onChanged(); + } else { + endTime_ = null; + endTimeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Output only. The time the operation finished running.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getEndTimeBuilder() { + + onChanged(); + return getEndTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. The time the operation finished running.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder() { + if (endTimeBuilder_ != null) { + return endTimeBuilder_.getMessageOrBuilder(); + } else { + return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; + } + } + /** + * + * + *
+     * Output only. The time the operation finished running.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getEndTimeFieldBuilder() { + if (endTimeBuilder_ == null) { + endTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getEndTime(), getParentForChildren(), isClean()); + endTime_ = null; + } + return endTimeBuilder_; + } + + private java.lang.Object target_ = ""; + /** + * + * + *
+     * Output only. Server-defined resource path for the target of the operation.
+     * 
+ * + * string target = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The target. + */ + public java.lang.String getTarget() { + java.lang.Object ref = target_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + target_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. Server-defined resource path for the target of the operation.
+     * 
+ * + * string target = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for target. + */ + public com.google.protobuf.ByteString getTargetBytes() { + java.lang.Object ref = target_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + target_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. Server-defined resource path for the target of the operation.
+     * 
+ * + * string target = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The target to set. + * @return This builder for chaining. + */ + public Builder setTarget(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + target_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Server-defined resource path for the target of the operation.
+     * 
+ * + * string target = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearTarget() { + + target_ = getDefaultInstance().getTarget(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Server-defined resource path for the target of the operation.
+     * 
+ * + * string target = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for target to set. + * @return This builder for chaining. + */ + public Builder setTargetBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + target_ = value; + onChanged(); + return this; + } + + private java.lang.Object verb_ = ""; + /** + * + * + *
+     * Output only. Name of the verb executed by the operation.
+     * 
+ * + * string verb = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The verb. + */ + public java.lang.String getVerb() { + java.lang.Object ref = verb_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + verb_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. Name of the verb executed by the operation.
+     * 
+ * + * string verb = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for verb. + */ + public com.google.protobuf.ByteString getVerbBytes() { + java.lang.Object ref = verb_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + verb_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. Name of the verb executed by the operation.
+     * 
+ * + * string verb = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The verb to set. + * @return This builder for chaining. + */ + public Builder setVerb(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + verb_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Name of the verb executed by the operation.
+     * 
+ * + * string verb = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearVerb() { + + verb_ = getDefaultInstance().getVerb(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Name of the verb executed by the operation.
+     * 
+ * + * string verb = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for verb to set. + * @return This builder for chaining. + */ + public Builder setVerbBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + verb_ = value; + onChanged(); + return this; + } + + private java.lang.Object statusDetail_ = ""; + /** + * + * + *
+     * Output only. Human-readable status of the operation, if any.
+     * 
+ * + * string status_detail = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The statusDetail. + */ + public java.lang.String getStatusDetail() { + java.lang.Object ref = statusDetail_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + statusDetail_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. Human-readable status of the operation, if any.
+     * 
+ * + * string status_detail = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for statusDetail. + */ + public com.google.protobuf.ByteString getStatusDetailBytes() { + java.lang.Object ref = statusDetail_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + statusDetail_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. Human-readable status of the operation, if any.
+     * 
+ * + * string status_detail = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The statusDetail to set. + * @return This builder for chaining. + */ + public Builder setStatusDetail(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + statusDetail_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Human-readable status of the operation, if any.
+     * 
+ * + * string status_detail = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearStatusDetail() { + + statusDetail_ = getDefaultInstance().getStatusDetail(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Human-readable status of the operation, if any.
+     * 
+ * + * string status_detail = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for statusDetail to set. + * @return This builder for chaining. + */ + public Builder setStatusDetailBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + statusDetail_ = value; + onChanged(); + return this; + } + + private boolean cancelRequested_; + /** + * + * + *
+     * Output only. Identifies whether the user has requested cancellation
+     * of the operation. Operations that have successfully been cancelled
+     * have [Operation.error][] value with a [google.rpc.Status.code][] of 1,
+     * corresponding to `Code.CANCELLED`.
+     * 
+ * + * bool cancel_requested = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The cancelRequested. + */ + @java.lang.Override + public boolean getCancelRequested() { + return cancelRequested_; + } + /** + * + * + *
+     * Output only. Identifies whether the user has requested cancellation
+     * of the operation. Operations that have successfully been cancelled
+     * have [Operation.error][] value with a [google.rpc.Status.code][] of 1,
+     * corresponding to `Code.CANCELLED`.
+     * 
+ * + * bool cancel_requested = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The cancelRequested to set. + * @return This builder for chaining. + */ + public Builder setCancelRequested(boolean value) { + + cancelRequested_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Identifies whether the user has requested cancellation
+     * of the operation. Operations that have successfully been cancelled
+     * have [Operation.error][] value with a [google.rpc.Status.code][] of 1,
+     * corresponding to `Code.CANCELLED`.
+     * 
+ * + * bool cancel_requested = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearCancelRequested() { + + cancelRequested_ = false; + onChanged(); + return this; + } + + private java.lang.Object apiVersion_ = ""; + /** + * + * + *
+     * Output only. API version used to start the operation.
+     * 
+ * + * string api_version = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The apiVersion. + */ + public java.lang.String getApiVersion() { + java.lang.Object ref = apiVersion_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + apiVersion_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. API version used to start the operation.
+     * 
+ * + * string api_version = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for apiVersion. + */ + public com.google.protobuf.ByteString getApiVersionBytes() { + java.lang.Object ref = apiVersion_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + apiVersion_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. API version used to start the operation.
+     * 
+ * + * string api_version = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The apiVersion to set. + * @return This builder for chaining. + */ + public Builder setApiVersion(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + apiVersion_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. API version used to start the operation.
+     * 
+ * + * string api_version = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearApiVersion() { + + apiVersion_ = getDefaultInstance().getApiVersion(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. API version used to start the operation.
+     * 
+ * + * string api_version = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for apiVersion to set. + * @return This builder for chaining. + */ + public Builder setApiVersionBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + apiVersion_ = 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.common.OperationMetadata) + } + + // @@protoc_insertion_point(class_scope:google.cloud.common.OperationMetadata) + private static final com.google.cloud.common.OperationMetadata DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.common.OperationMetadata(); + } + + public static com.google.cloud.common.OperationMetadata getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public OperationMetadata parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new OperationMetadata(input, extensionRegistry); + } + }; + + 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.common.OperationMetadata getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-filestore-v1/src/main/java/com/google/cloud/common/OperationMetadataOrBuilder.java b/proto-google-cloud-filestore-v1/src/main/java/com/google/cloud/common/OperationMetadataOrBuilder.java new file mode 100644 index 00000000..9d77fb3b --- /dev/null +++ b/proto-google-cloud-filestore-v1/src/main/java/com/google/cloud/common/OperationMetadataOrBuilder.java @@ -0,0 +1,217 @@ +/* + * 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/common/operation_metadata.proto + +package com.google.cloud.common; + +public interface OperationMetadataOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.common.OperationMetadata) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Output only. The time the operation was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + boolean hasCreateTime(); + /** + * + * + *
+   * Output only. The time the operation was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The createTime. + */ + com.google.protobuf.Timestamp getCreateTime(); + /** + * + * + *
+   * Output only. The time the operation was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder(); + + /** + * + * + *
+   * Output only. The time the operation finished running.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the endTime field is set. + */ + boolean hasEndTime(); + /** + * + * + *
+   * Output only. The time the operation finished running.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The endTime. + */ + com.google.protobuf.Timestamp getEndTime(); + /** + * + * + *
+   * Output only. The time the operation finished running.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder(); + + /** + * + * + *
+   * Output only. Server-defined resource path for the target of the operation.
+   * 
+ * + * string target = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The target. + */ + java.lang.String getTarget(); + /** + * + * + *
+   * Output only. Server-defined resource path for the target of the operation.
+   * 
+ * + * string target = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for target. + */ + com.google.protobuf.ByteString getTargetBytes(); + + /** + * + * + *
+   * Output only. Name of the verb executed by the operation.
+   * 
+ * + * string verb = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The verb. + */ + java.lang.String getVerb(); + /** + * + * + *
+   * Output only. Name of the verb executed by the operation.
+   * 
+ * + * string verb = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for verb. + */ + com.google.protobuf.ByteString getVerbBytes(); + + /** + * + * + *
+   * Output only. Human-readable status of the operation, if any.
+   * 
+ * + * string status_detail = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The statusDetail. + */ + java.lang.String getStatusDetail(); + /** + * + * + *
+   * Output only. Human-readable status of the operation, if any.
+   * 
+ * + * string status_detail = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for statusDetail. + */ + com.google.protobuf.ByteString getStatusDetailBytes(); + + /** + * + * + *
+   * Output only. Identifies whether the user has requested cancellation
+   * of the operation. Operations that have successfully been cancelled
+   * have [Operation.error][] value with a [google.rpc.Status.code][] of 1,
+   * corresponding to `Code.CANCELLED`.
+   * 
+ * + * bool cancel_requested = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The cancelRequested. + */ + boolean getCancelRequested(); + + /** + * + * + *
+   * Output only. API version used to start the operation.
+   * 
+ * + * string api_version = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The apiVersion. + */ + java.lang.String getApiVersion(); + /** + * + * + *
+   * Output only. API version used to start the operation.
+   * 
+ * + * string api_version = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for apiVersion. + */ + com.google.protobuf.ByteString getApiVersionBytes(); +} diff --git a/proto-google-cloud-filestore-v1/src/main/java/com/google/cloud/common/OperationMetadataOuterClass.java b/proto-google-cloud-filestore-v1/src/main/java/com/google/cloud/common/OperationMetadataOuterClass.java new file mode 100644 index 00000000..7ed9837c --- /dev/null +++ b/proto-google-cloud-filestore-v1/src/main/java/com/google/cloud/common/OperationMetadataOuterClass.java @@ -0,0 +1,88 @@ +/* + * 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/common/operation_metadata.proto + +package com.google.cloud.common; + +public final class OperationMetadataOuterClass { + private OperationMetadataOuterClass() {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions((com.google.protobuf.ExtensionRegistryLite) registry); + } + + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_common_OperationMetadata_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_common_OperationMetadata_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\n,google/cloud/common/operation_metadata" + + ".proto\022\023google.cloud.common\032\037google/api/" + + "field_behavior.proto\032\037google/protobuf/ti" + + "mestamp.proto\"\371\001\n\021OperationMetadata\0224\n\013c" + + "reate_time\030\001 \001(\0132\032.google.protobuf.Times" + + "tampB\003\340A\003\0221\n\010end_time\030\002 \001(\0132\032.google.pro" + + "tobuf.TimestampB\003\340A\003\022\023\n\006target\030\003 \001(\tB\003\340A" + + "\003\022\021\n\004verb\030\004 \001(\tB\003\340A\003\022\032\n\rstatus_detail\030\005 " + + "\001(\tB\003\340A\003\022\035\n\020cancel_requested\030\006 \001(\010B\003\340A\003\022" + + "\030\n\013api_version\030\007 \001(\tB\003\340A\003BV\n\027com.google." + + "cloud.commonP\001Z9google.golang.org/genpro" + + "to/googleapis/cloud/common;commonb\006proto" + + "3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.api.FieldBehaviorProto.getDescriptor(), + com.google.protobuf.TimestampProto.getDescriptor(), + }); + internal_static_google_cloud_common_OperationMetadata_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_common_OperationMetadata_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_common_OperationMetadata_descriptor, + new java.lang.String[] { + "CreateTime", + "EndTime", + "Target", + "Verb", + "StatusDetail", + "CancelRequested", + "ApiVersion", + }); + com.google.protobuf.ExtensionRegistry registry = + com.google.protobuf.ExtensionRegistry.newInstance(); + registry.add(com.google.api.FieldBehaviorProto.fieldBehavior); + com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( + descriptor, registry); + com.google.api.FieldBehaviorProto.getDescriptor(); + com.google.protobuf.TimestampProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/proto-google-cloud-filestore-v1/src/main/java/com/google/cloud/filestore/v1/Backup.java b/proto-google-cloud-filestore-v1/src/main/java/com/google/cloud/filestore/v1/Backup.java new file mode 100644 index 00000000..b810e847 --- /dev/null +++ b/proto-google-cloud-filestore-v1/src/main/java/com/google/cloud/filestore/v1/Backup.java @@ -0,0 +1,2942 @@ +/* + * 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/v1/cloud_filestore_service.proto + +package com.google.cloud.filestore.v1; + +/** + * + * + *
+ * A Cloud Filestore backup.
+ * 
+ * + * Protobuf type {@code google.cloud.filestore.v1.Backup} + */ +public final class Backup extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.filestore.v1.Backup) + BackupOrBuilder { + private static final long serialVersionUID = 0L; + // Use Backup.newBuilder() to construct. + private Backup(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Backup() { + name_ = ""; + description_ = ""; + state_ = 0; + sourceInstance_ = ""; + sourceFileShare_ = ""; + sourceInstanceTier_ = 0; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Backup(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private Backup( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + description_ = s; + break; + } + case 24: + { + int rawValue = input.readEnum(); + + state_ = rawValue; + break; + } + case 34: + { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (createTime_ != null) { + subBuilder = createTime_.toBuilder(); + } + createTime_ = + input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(createTime_); + createTime_ = subBuilder.buildPartial(); + } + + break; + } + case 42: + { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + labels_ = + com.google.protobuf.MapField.newMapField(LabelsDefaultEntryHolder.defaultEntry); + mutable_bitField0_ |= 0x00000001; + } + com.google.protobuf.MapEntry labels__ = + input.readMessage( + LabelsDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); + labels_.getMutableMap().put(labels__.getKey(), labels__.getValue()); + break; + } + case 48: + { + capacityGb_ = input.readInt64(); + break; + } + case 56: + { + storageBytes_ = input.readInt64(); + break; + } + case 66: + { + java.lang.String s = input.readStringRequireUtf8(); + + sourceInstance_ = s; + break; + } + case 74: + { + java.lang.String s = input.readStringRequireUtf8(); + + sourceFileShare_ = s; + break; + } + case 80: + { + int rawValue = input.readEnum(); + + sourceInstanceTier_ = rawValue; + break; + } + case 88: + { + downloadBytes_ = input.readInt64(); + break; + } + case 98: + { + com.google.protobuf.BoolValue.Builder subBuilder = null; + if (satisfiesPzs_ != null) { + subBuilder = satisfiesPzs_.toBuilder(); + } + satisfiesPzs_ = + input.readMessage(com.google.protobuf.BoolValue.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(satisfiesPzs_); + satisfiesPzs_ = subBuilder.buildPartial(); + } + + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.filestore.v1.CloudFilestoreServiceProto + .internal_static_google_cloud_filestore_v1_Backup_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 5: + 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.v1.CloudFilestoreServiceProto + .internal_static_google_cloud_filestore_v1_Backup_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.filestore.v1.Backup.class, + com.google.cloud.filestore.v1.Backup.Builder.class); + } + + /** + * + * + *
+   * The backup state.
+   * 
+ * + * Protobuf enum {@code google.cloud.filestore.v1.Backup.State} + */ + public enum State implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * State not set.
+     * 
+ * + * STATE_UNSPECIFIED = 0; + */ + STATE_UNSPECIFIED(0), + /** + * + * + *
+     * Backup is being created.
+     * 
+ * + * CREATING = 1; + */ + CREATING(1), + /** + * + * + *
+     * Backup has been taken and the operation is being finalized. At this
+     * point, changes to the file share will not be reflected in the backup.
+     * 
+ * + * FINALIZING = 2; + */ + FINALIZING(2), + /** + * + * + *
+     * Backup is available for use.
+     * 
+ * + * READY = 3; + */ + READY(3), + /** + * + * + *
+     * Backup is being deleted.
+     * 
+ * + * DELETING = 4; + */ + DELETING(4), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * State not set.
+     * 
+ * + * STATE_UNSPECIFIED = 0; + */ + public static final int STATE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * Backup is being created.
+     * 
+ * + * CREATING = 1; + */ + public static final int CREATING_VALUE = 1; + /** + * + * + *
+     * Backup has been taken and the operation is being finalized. At this
+     * point, changes to the file share will not be reflected in the backup.
+     * 
+ * + * FINALIZING = 2; + */ + public static final int FINALIZING_VALUE = 2; + /** + * + * + *
+     * Backup is available for use.
+     * 
+ * + * READY = 3; + */ + public static final int READY_VALUE = 3; + /** + * + * + *
+     * Backup 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 2: + return FINALIZING; + 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.v1.Backup.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.v1.Backup.State) + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Output only. The resource name of the backup, in the format
+   * projects/{project_number}/locations/{location_id}/backups/{backup_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 backup, in the format
+   * projects/{project_number}/locations/{location_id}/backups/{backup_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 DESCRIPTION_FIELD_NUMBER = 2; + private volatile java.lang.Object description_; + /** + * + * + *
+   * A description of the backup with 2048 characters or less.
+   * Requests with longer descriptions will be rejected.
+   * 
+ * + * string description = 2; + * + * @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 backup with 2048 characters or less.
+   * Requests with longer descriptions will be rejected.
+   * 
+ * + * string description = 2; + * + * @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 STATE_FIELD_NUMBER = 3; + private int state_; + /** + * + * + *
+   * Output only. The backup state.
+   * 
+ * + * + * .google.cloud.filestore.v1.Backup.State state = 3 [(.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 backup state.
+   * 
+ * + * + * .google.cloud.filestore.v1.Backup.State state = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The state. + */ + @java.lang.Override + public com.google.cloud.filestore.v1.Backup.State getState() { + @SuppressWarnings("deprecation") + com.google.cloud.filestore.v1.Backup.State result = + com.google.cloud.filestore.v1.Backup.State.valueOf(state_); + return result == null ? com.google.cloud.filestore.v1.Backup.State.UNRECOGNIZED : result; + } + + public static final int CREATE_TIME_FIELD_NUMBER = 4; + private com.google.protobuf.Timestamp createTime_; + /** + * + * + *
+   * Output only. The time when the backup was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 4 [(.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 backup was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 4 [(.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 backup was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { + return getCreateTime(); + } + + public static final int LABELS_FIELD_NUMBER = 5; + + private static final class LabelsDefaultEntryHolder { + static final com.google.protobuf.MapEntry defaultEntry = + com.google.protobuf.MapEntry.newDefaultInstance( + com.google.cloud.filestore.v1.CloudFilestoreServiceProto + .internal_static_google_cloud_filestore_v1_Backup_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 = 5; + */ + @java.lang.Override + public boolean containsLabels(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + 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 = 5; + */ + @java.lang.Override + public java.util.Map getLabelsMap() { + return internalGetLabels().getMap(); + } + /** + * + * + *
+   * Resource labels to represent user provided metadata.
+   * 
+ * + * map<string, string> labels = 5; + */ + @java.lang.Override + public java.lang.String getLabelsOrDefault(java.lang.String key, java.lang.String defaultValue) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + 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 = 5; + */ + @java.lang.Override + public java.lang.String getLabelsOrThrow(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = internalGetLabels().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public static final int CAPACITY_GB_FIELD_NUMBER = 6; + private long capacityGb_; + /** + * + * + *
+   * Output only. Capacity of the source file share when the backup was created.
+   * 
+ * + * int64 capacity_gb = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The capacityGb. + */ + @java.lang.Override + public long getCapacityGb() { + return capacityGb_; + } + + public static final int STORAGE_BYTES_FIELD_NUMBER = 7; + private long storageBytes_; + /** + * + * + *
+   * Output only. The size of the storage used by the backup. As backups share storage,
+   * this number is expected to change with backup creation/deletion.
+   * 
+ * + * int64 storage_bytes = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The storageBytes. + */ + @java.lang.Override + public long getStorageBytes() { + return storageBytes_; + } + + public static final int SOURCE_INSTANCE_FIELD_NUMBER = 8; + private volatile java.lang.Object sourceInstance_; + /** + * + * + *
+   * The resource name of the source Cloud Filestore instance, in the format
+   * projects/{project_number}/locations/{location_id}/instances/{instance_id},
+   * used to create this backup.
+   * 
+ * + * string source_instance = 8 [(.google.api.resource_reference) = { ... } + * + * @return The sourceInstance. + */ + @java.lang.Override + public java.lang.String getSourceInstance() { + java.lang.Object ref = sourceInstance_; + 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(); + sourceInstance_ = s; + return s; + } + } + /** + * + * + *
+   * The resource name of the source Cloud Filestore instance, in the format
+   * projects/{project_number}/locations/{location_id}/instances/{instance_id},
+   * used to create this backup.
+   * 
+ * + * string source_instance = 8 [(.google.api.resource_reference) = { ... } + * + * @return The bytes for sourceInstance. + */ + @java.lang.Override + public com.google.protobuf.ByteString getSourceInstanceBytes() { + java.lang.Object ref = sourceInstance_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + sourceInstance_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SOURCE_FILE_SHARE_FIELD_NUMBER = 9; + private volatile java.lang.Object sourceFileShare_; + /** + * + * + *
+   * Name of the file share in the source Cloud Filestore instance that the
+   * backup is created from.
+   * 
+ * + * string source_file_share = 9; + * + * @return The sourceFileShare. + */ + @java.lang.Override + public java.lang.String getSourceFileShare() { + java.lang.Object ref = sourceFileShare_; + 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(); + sourceFileShare_ = s; + return s; + } + } + /** + * + * + *
+   * Name of the file share in the source Cloud Filestore instance that the
+   * backup is created from.
+   * 
+ * + * string source_file_share = 9; + * + * @return The bytes for sourceFileShare. + */ + @java.lang.Override + public com.google.protobuf.ByteString getSourceFileShareBytes() { + java.lang.Object ref = sourceFileShare_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + sourceFileShare_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SOURCE_INSTANCE_TIER_FIELD_NUMBER = 10; + private int sourceInstanceTier_; + /** + * + * + *
+   * Output only. The service tier of the source Cloud Filestore instance that this backup
+   * is created from.
+   * 
+ * + * + * .google.cloud.filestore.v1.Instance.Tier source_instance_tier = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for sourceInstanceTier. + */ + @java.lang.Override + public int getSourceInstanceTierValue() { + return sourceInstanceTier_; + } + /** + * + * + *
+   * Output only. The service tier of the source Cloud Filestore instance that this backup
+   * is created from.
+   * 
+ * + * + * .google.cloud.filestore.v1.Instance.Tier source_instance_tier = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The sourceInstanceTier. + */ + @java.lang.Override + public com.google.cloud.filestore.v1.Instance.Tier getSourceInstanceTier() { + @SuppressWarnings("deprecation") + com.google.cloud.filestore.v1.Instance.Tier result = + com.google.cloud.filestore.v1.Instance.Tier.valueOf(sourceInstanceTier_); + return result == null ? com.google.cloud.filestore.v1.Instance.Tier.UNRECOGNIZED : result; + } + + public static final int DOWNLOAD_BYTES_FIELD_NUMBER = 11; + private long downloadBytes_; + /** + * + * + *
+   * Output only. Amount of bytes that will be downloaded if the backup is restored. This
+   * may be different than storage bytes, since sequential backups of the same
+   * disk will share storage.
+   * 
+ * + * int64 download_bytes = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The downloadBytes. + */ + @java.lang.Override + public long getDownloadBytes() { + return downloadBytes_; + } + + public static final int SATISFIES_PZS_FIELD_NUMBER = 12; + private com.google.protobuf.BoolValue satisfiesPzs_; + /** + * + * + *
+   * Output only. Reserved for future use.
+   * 
+ * + * + * .google.protobuf.BoolValue satisfies_pzs = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the satisfiesPzs field is set. + */ + @java.lang.Override + public boolean hasSatisfiesPzs() { + return satisfiesPzs_ != null; + } + /** + * + * + *
+   * Output only. Reserved for future use.
+   * 
+ * + * + * .google.protobuf.BoolValue satisfies_pzs = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The satisfiesPzs. + */ + @java.lang.Override + public com.google.protobuf.BoolValue getSatisfiesPzs() { + return satisfiesPzs_ == null + ? com.google.protobuf.BoolValue.getDefaultInstance() + : satisfiesPzs_; + } + /** + * + * + *
+   * Output only. Reserved for future use.
+   * 
+ * + * + * .google.protobuf.BoolValue satisfies_pzs = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.BoolValueOrBuilder getSatisfiesPzsOrBuilder() { + return getSatisfiesPzs(); + } + + 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 (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (!getDescriptionBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, description_); + } + if (state_ != com.google.cloud.filestore.v1.Backup.State.STATE_UNSPECIFIED.getNumber()) { + output.writeEnum(3, state_); + } + if (createTime_ != null) { + output.writeMessage(4, getCreateTime()); + } + com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( + output, internalGetLabels(), LabelsDefaultEntryHolder.defaultEntry, 5); + if (capacityGb_ != 0L) { + output.writeInt64(6, capacityGb_); + } + if (storageBytes_ != 0L) { + output.writeInt64(7, storageBytes_); + } + if (!getSourceInstanceBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 8, sourceInstance_); + } + if (!getSourceFileShareBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 9, sourceFileShare_); + } + if (sourceInstanceTier_ + != com.google.cloud.filestore.v1.Instance.Tier.TIER_UNSPECIFIED.getNumber()) { + output.writeEnum(10, sourceInstanceTier_); + } + if (downloadBytes_ != 0L) { + output.writeInt64(11, downloadBytes_); + } + if (satisfiesPzs_ != null) { + output.writeMessage(12, getSatisfiesPzs()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (!getDescriptionBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, description_); + } + if (state_ != com.google.cloud.filestore.v1.Backup.State.STATE_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(3, state_); + } + if (createTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, 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(5, labels__); + } + if (capacityGb_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(6, capacityGb_); + } + if (storageBytes_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(7, storageBytes_); + } + if (!getSourceInstanceBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(8, sourceInstance_); + } + if (!getSourceFileShareBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(9, sourceFileShare_); + } + if (sourceInstanceTier_ + != com.google.cloud.filestore.v1.Instance.Tier.TIER_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(10, sourceInstanceTier_); + } + if (downloadBytes_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(11, downloadBytes_); + } + if (satisfiesPzs_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(12, getSatisfiesPzs()); + } + size += unknownFields.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.v1.Backup)) { + return super.equals(obj); + } + com.google.cloud.filestore.v1.Backup other = (com.google.cloud.filestore.v1.Backup) obj; + + if (!getName().equals(other.getName())) return false; + if (!getDescription().equals(other.getDescription())) 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 (getCapacityGb() != other.getCapacityGb()) return false; + if (getStorageBytes() != other.getStorageBytes()) return false; + if (!getSourceInstance().equals(other.getSourceInstance())) return false; + if (!getSourceFileShare().equals(other.getSourceFileShare())) return false; + if (sourceInstanceTier_ != other.sourceInstanceTier_) return false; + if (getDownloadBytes() != other.getDownloadBytes()) return false; + if (hasSatisfiesPzs() != other.hasSatisfiesPzs()) return false; + if (hasSatisfiesPzs()) { + if (!getSatisfiesPzs().equals(other.getSatisfiesPzs())) return false; + } + if (!unknownFields.equals(other.unknownFields)) 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) + DESCRIPTION_FIELD_NUMBER; + hash = (53 * hash) + getDescription().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 = (37 * hash) + CAPACITY_GB_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getCapacityGb()); + hash = (37 * hash) + STORAGE_BYTES_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getStorageBytes()); + hash = (37 * hash) + SOURCE_INSTANCE_FIELD_NUMBER; + hash = (53 * hash) + getSourceInstance().hashCode(); + hash = (37 * hash) + SOURCE_FILE_SHARE_FIELD_NUMBER; + hash = (53 * hash) + getSourceFileShare().hashCode(); + hash = (37 * hash) + SOURCE_INSTANCE_TIER_FIELD_NUMBER; + hash = (53 * hash) + sourceInstanceTier_; + hash = (37 * hash) + DOWNLOAD_BYTES_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getDownloadBytes()); + if (hasSatisfiesPzs()) { + hash = (37 * hash) + SATISFIES_PZS_FIELD_NUMBER; + hash = (53 * hash) + getSatisfiesPzs().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.filestore.v1.Backup parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.filestore.v1.Backup 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.v1.Backup parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.filestore.v1.Backup 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.v1.Backup parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.filestore.v1.Backup parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.filestore.v1.Backup parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.filestore.v1.Backup 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.v1.Backup parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.filestore.v1.Backup 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.v1.Backup parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.filestore.v1.Backup 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.v1.Backup 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 Cloud Filestore backup.
+   * 
+ * + * Protobuf type {@code google.cloud.filestore.v1.Backup} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.filestore.v1.Backup) + com.google.cloud.filestore.v1.BackupOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.filestore.v1.CloudFilestoreServiceProto + .internal_static_google_cloud_filestore_v1_Backup_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 5: + return internalGetLabels(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMutableMapField(int number) { + switch (number) { + case 5: + 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.v1.CloudFilestoreServiceProto + .internal_static_google_cloud_filestore_v1_Backup_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.filestore.v1.Backup.class, + com.google.cloud.filestore.v1.Backup.Builder.class); + } + + // Construct using com.google.cloud.filestore.v1.Backup.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + description_ = ""; + + state_ = 0; + + if (createTimeBuilder_ == null) { + createTime_ = null; + } else { + createTime_ = null; + createTimeBuilder_ = null; + } + internalGetMutableLabels().clear(); + capacityGb_ = 0L; + + storageBytes_ = 0L; + + sourceInstance_ = ""; + + sourceFileShare_ = ""; + + sourceInstanceTier_ = 0; + + downloadBytes_ = 0L; + + if (satisfiesPzsBuilder_ == null) { + satisfiesPzs_ = null; + } else { + satisfiesPzs_ = null; + satisfiesPzsBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.filestore.v1.CloudFilestoreServiceProto + .internal_static_google_cloud_filestore_v1_Backup_descriptor; + } + + @java.lang.Override + public com.google.cloud.filestore.v1.Backup getDefaultInstanceForType() { + return com.google.cloud.filestore.v1.Backup.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.filestore.v1.Backup build() { + com.google.cloud.filestore.v1.Backup result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.filestore.v1.Backup buildPartial() { + com.google.cloud.filestore.v1.Backup result = new com.google.cloud.filestore.v1.Backup(this); + int from_bitField0_ = bitField0_; + result.name_ = name_; + result.description_ = description_; + result.state_ = state_; + if (createTimeBuilder_ == null) { + result.createTime_ = createTime_; + } else { + result.createTime_ = createTimeBuilder_.build(); + } + result.labels_ = internalGetLabels(); + result.labels_.makeImmutable(); + result.capacityGb_ = capacityGb_; + result.storageBytes_ = storageBytes_; + result.sourceInstance_ = sourceInstance_; + result.sourceFileShare_ = sourceFileShare_; + result.sourceInstanceTier_ = sourceInstanceTier_; + result.downloadBytes_ = downloadBytes_; + if (satisfiesPzsBuilder_ == null) { + result.satisfiesPzs_ = satisfiesPzs_; + } else { + result.satisfiesPzs_ = satisfiesPzsBuilder_.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.v1.Backup) { + return mergeFrom((com.google.cloud.filestore.v1.Backup) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.filestore.v1.Backup other) { + if (other == com.google.cloud.filestore.v1.Backup.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (!other.getDescription().isEmpty()) { + description_ = other.description_; + onChanged(); + } + if (other.state_ != 0) { + setStateValue(other.getStateValue()); + } + if (other.hasCreateTime()) { + mergeCreateTime(other.getCreateTime()); + } + internalGetMutableLabels().mergeFrom(other.internalGetLabels()); + if (other.getCapacityGb() != 0L) { + setCapacityGb(other.getCapacityGb()); + } + if (other.getStorageBytes() != 0L) { + setStorageBytes(other.getStorageBytes()); + } + if (!other.getSourceInstance().isEmpty()) { + sourceInstance_ = other.sourceInstance_; + onChanged(); + } + if (!other.getSourceFileShare().isEmpty()) { + sourceFileShare_ = other.sourceFileShare_; + onChanged(); + } + if (other.sourceInstanceTier_ != 0) { + setSourceInstanceTierValue(other.getSourceInstanceTierValue()); + } + if (other.getDownloadBytes() != 0L) { + setDownloadBytes(other.getDownloadBytes()); + } + if (other.hasSatisfiesPzs()) { + mergeSatisfiesPzs(other.getSatisfiesPzs()); + } + this.mergeUnknownFields(other.unknownFields); + 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 { + com.google.cloud.filestore.v1.Backup parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.filestore.v1.Backup) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Output only. The resource name of the backup, in the format
+     * projects/{project_number}/locations/{location_id}/backups/{backup_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 backup, in the format
+     * projects/{project_number}/locations/{location_id}/backups/{backup_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 backup, in the format
+     * projects/{project_number}/locations/{location_id}/backups/{backup_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 backup, in the format
+     * projects/{project_number}/locations/{location_id}/backups/{backup_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 backup, in the format
+     * projects/{project_number}/locations/{location_id}/backups/{backup_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 description_ = ""; + /** + * + * + *
+     * A description of the backup with 2048 characters or less.
+     * Requests with longer descriptions will be rejected.
+     * 
+ * + * string description = 2; + * + * @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 backup with 2048 characters or less.
+     * Requests with longer descriptions will be rejected.
+     * 
+ * + * string description = 2; + * + * @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 backup with 2048 characters or less.
+     * Requests with longer descriptions will be rejected.
+     * 
+ * + * string description = 2; + * + * @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 backup with 2048 characters or less.
+     * Requests with longer descriptions will be rejected.
+     * 
+ * + * string description = 2; + * + * @return This builder for chaining. + */ + public Builder clearDescription() { + + description_ = getDefaultInstance().getDescription(); + onChanged(); + return this; + } + /** + * + * + *
+     * A description of the backup with 2048 characters or less.
+     * Requests with longer descriptions will be rejected.
+     * 
+ * + * string description = 2; + * + * @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 int state_ = 0; + /** + * + * + *
+     * Output only. The backup state.
+     * 
+ * + * + * .google.cloud.filestore.v1.Backup.State state = 3 [(.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 backup state.
+     * 
+ * + * + * .google.cloud.filestore.v1.Backup.State state = 3 [(.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 backup state.
+     * 
+ * + * + * .google.cloud.filestore.v1.Backup.State state = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The state. + */ + @java.lang.Override + public com.google.cloud.filestore.v1.Backup.State getState() { + @SuppressWarnings("deprecation") + com.google.cloud.filestore.v1.Backup.State result = + com.google.cloud.filestore.v1.Backup.State.valueOf(state_); + return result == null ? com.google.cloud.filestore.v1.Backup.State.UNRECOGNIZED : result; + } + /** + * + * + *
+     * Output only. The backup state.
+     * 
+ * + * + * .google.cloud.filestore.v1.Backup.State state = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The state to set. + * @return This builder for chaining. + */ + public Builder setState(com.google.cloud.filestore.v1.Backup.State value) { + if (value == null) { + throw new NullPointerException(); + } + + state_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The backup state.
+     * 
+ * + * + * .google.cloud.filestore.v1.Backup.State state = 3 [(.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 backup was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 4 [(.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 backup was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 4 [(.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 backup was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 4 [(.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 backup was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 4 [(.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 backup was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 4 [(.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 backup was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 4 [(.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 backup was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getCreateTimeBuilder() { + + onChanged(); + return getCreateTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. The time when the backup was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 4 [(.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 backup was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 4 [(.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 = 5; + */ + @java.lang.Override + public boolean containsLabels(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + 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 = 5; + */ + @java.lang.Override + public java.util.Map getLabelsMap() { + return internalGetLabels().getMap(); + } + /** + * + * + *
+     * Resource labels to represent user provided metadata.
+     * 
+ * + * map<string, string> labels = 5; + */ + @java.lang.Override + public java.lang.String getLabelsOrDefault( + java.lang.String key, java.lang.String defaultValue) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + 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 = 5; + */ + @java.lang.Override + public java.lang.String getLabelsOrThrow(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + 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 = 5; + */ + public Builder removeLabels(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + 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 = 5; + */ + public Builder putLabels(java.lang.String key, java.lang.String value) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + if (value == null) { + throw new java.lang.NullPointerException(); + } + internalGetMutableLabels().getMutableMap().put(key, value); + return this; + } + /** + * + * + *
+     * Resource labels to represent user provided metadata.
+     * 
+ * + * map<string, string> labels = 5; + */ + public Builder putAllLabels(java.util.Map values) { + internalGetMutableLabels().getMutableMap().putAll(values); + return this; + } + + private long capacityGb_; + /** + * + * + *
+     * Output only. Capacity of the source file share when the backup was created.
+     * 
+ * + * int64 capacity_gb = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The capacityGb. + */ + @java.lang.Override + public long getCapacityGb() { + return capacityGb_; + } + /** + * + * + *
+     * Output only. Capacity of the source file share when the backup was created.
+     * 
+ * + * int64 capacity_gb = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The capacityGb to set. + * @return This builder for chaining. + */ + public Builder setCapacityGb(long value) { + + capacityGb_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Capacity of the source file share when the backup was created.
+     * 
+ * + * int64 capacity_gb = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearCapacityGb() { + + capacityGb_ = 0L; + onChanged(); + return this; + } + + private long storageBytes_; + /** + * + * + *
+     * Output only. The size of the storage used by the backup. As backups share storage,
+     * this number is expected to change with backup creation/deletion.
+     * 
+ * + * int64 storage_bytes = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The storageBytes. + */ + @java.lang.Override + public long getStorageBytes() { + return storageBytes_; + } + /** + * + * + *
+     * Output only. The size of the storage used by the backup. As backups share storage,
+     * this number is expected to change with backup creation/deletion.
+     * 
+ * + * int64 storage_bytes = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The storageBytes to set. + * @return This builder for chaining. + */ + public Builder setStorageBytes(long value) { + + storageBytes_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The size of the storage used by the backup. As backups share storage,
+     * this number is expected to change with backup creation/deletion.
+     * 
+ * + * int64 storage_bytes = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearStorageBytes() { + + storageBytes_ = 0L; + onChanged(); + return this; + } + + private java.lang.Object sourceInstance_ = ""; + /** + * + * + *
+     * The resource name of the source Cloud Filestore instance, in the format
+     * projects/{project_number}/locations/{location_id}/instances/{instance_id},
+     * used to create this backup.
+     * 
+ * + * string source_instance = 8 [(.google.api.resource_reference) = { ... } + * + * @return The sourceInstance. + */ + public java.lang.String getSourceInstance() { + java.lang.Object ref = sourceInstance_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + sourceInstance_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The resource name of the source Cloud Filestore instance, in the format
+     * projects/{project_number}/locations/{location_id}/instances/{instance_id},
+     * used to create this backup.
+     * 
+ * + * string source_instance = 8 [(.google.api.resource_reference) = { ... } + * + * @return The bytes for sourceInstance. + */ + public com.google.protobuf.ByteString getSourceInstanceBytes() { + java.lang.Object ref = sourceInstance_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + sourceInstance_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The resource name of the source Cloud Filestore instance, in the format
+     * projects/{project_number}/locations/{location_id}/instances/{instance_id},
+     * used to create this backup.
+     * 
+ * + * string source_instance = 8 [(.google.api.resource_reference) = { ... } + * + * @param value The sourceInstance to set. + * @return This builder for chaining. + */ + public Builder setSourceInstance(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + sourceInstance_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The resource name of the source Cloud Filestore instance, in the format
+     * projects/{project_number}/locations/{location_id}/instances/{instance_id},
+     * used to create this backup.
+     * 
+ * + * string source_instance = 8 [(.google.api.resource_reference) = { ... } + * + * @return This builder for chaining. + */ + public Builder clearSourceInstance() { + + sourceInstance_ = getDefaultInstance().getSourceInstance(); + onChanged(); + return this; + } + /** + * + * + *
+     * The resource name of the source Cloud Filestore instance, in the format
+     * projects/{project_number}/locations/{location_id}/instances/{instance_id},
+     * used to create this backup.
+     * 
+ * + * string source_instance = 8 [(.google.api.resource_reference) = { ... } + * + * @param value The bytes for sourceInstance to set. + * @return This builder for chaining. + */ + public Builder setSourceInstanceBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + sourceInstance_ = value; + onChanged(); + return this; + } + + private java.lang.Object sourceFileShare_ = ""; + /** + * + * + *
+     * Name of the file share in the source Cloud Filestore instance that the
+     * backup is created from.
+     * 
+ * + * string source_file_share = 9; + * + * @return The sourceFileShare. + */ + public java.lang.String getSourceFileShare() { + java.lang.Object ref = sourceFileShare_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + sourceFileShare_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Name of the file share in the source Cloud Filestore instance that the
+     * backup is created from.
+     * 
+ * + * string source_file_share = 9; + * + * @return The bytes for sourceFileShare. + */ + public com.google.protobuf.ByteString getSourceFileShareBytes() { + java.lang.Object ref = sourceFileShare_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + sourceFileShare_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Name of the file share in the source Cloud Filestore instance that the
+     * backup is created from.
+     * 
+ * + * string source_file_share = 9; + * + * @param value The sourceFileShare to set. + * @return This builder for chaining. + */ + public Builder setSourceFileShare(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + sourceFileShare_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Name of the file share in the source Cloud Filestore instance that the
+     * backup is created from.
+     * 
+ * + * string source_file_share = 9; + * + * @return This builder for chaining. + */ + public Builder clearSourceFileShare() { + + sourceFileShare_ = getDefaultInstance().getSourceFileShare(); + onChanged(); + return this; + } + /** + * + * + *
+     * Name of the file share in the source Cloud Filestore instance that the
+     * backup is created from.
+     * 
+ * + * string source_file_share = 9; + * + * @param value The bytes for sourceFileShare to set. + * @return This builder for chaining. + */ + public Builder setSourceFileShareBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + sourceFileShare_ = value; + onChanged(); + return this; + } + + private int sourceInstanceTier_ = 0; + /** + * + * + *
+     * Output only. The service tier of the source Cloud Filestore instance that this backup
+     * is created from.
+     * 
+ * + * + * .google.cloud.filestore.v1.Instance.Tier source_instance_tier = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for sourceInstanceTier. + */ + @java.lang.Override + public int getSourceInstanceTierValue() { + return sourceInstanceTier_; + } + /** + * + * + *
+     * Output only. The service tier of the source Cloud Filestore instance that this backup
+     * is created from.
+     * 
+ * + * + * .google.cloud.filestore.v1.Instance.Tier source_instance_tier = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The enum numeric value on the wire for sourceInstanceTier to set. + * @return This builder for chaining. + */ + public Builder setSourceInstanceTierValue(int value) { + + sourceInstanceTier_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The service tier of the source Cloud Filestore instance that this backup
+     * is created from.
+     * 
+ * + * + * .google.cloud.filestore.v1.Instance.Tier source_instance_tier = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The sourceInstanceTier. + */ + @java.lang.Override + public com.google.cloud.filestore.v1.Instance.Tier getSourceInstanceTier() { + @SuppressWarnings("deprecation") + com.google.cloud.filestore.v1.Instance.Tier result = + com.google.cloud.filestore.v1.Instance.Tier.valueOf(sourceInstanceTier_); + return result == null ? com.google.cloud.filestore.v1.Instance.Tier.UNRECOGNIZED : result; + } + /** + * + * + *
+     * Output only. The service tier of the source Cloud Filestore instance that this backup
+     * is created from.
+     * 
+ * + * + * .google.cloud.filestore.v1.Instance.Tier source_instance_tier = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The sourceInstanceTier to set. + * @return This builder for chaining. + */ + public Builder setSourceInstanceTier(com.google.cloud.filestore.v1.Instance.Tier value) { + if (value == null) { + throw new NullPointerException(); + } + + sourceInstanceTier_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The service tier of the source Cloud Filestore instance that this backup
+     * is created from.
+     * 
+ * + * + * .google.cloud.filestore.v1.Instance.Tier source_instance_tier = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return This builder for chaining. + */ + public Builder clearSourceInstanceTier() { + + sourceInstanceTier_ = 0; + onChanged(); + return this; + } + + private long downloadBytes_; + /** + * + * + *
+     * Output only. Amount of bytes that will be downloaded if the backup is restored. This
+     * may be different than storage bytes, since sequential backups of the same
+     * disk will share storage.
+     * 
+ * + * int64 download_bytes = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The downloadBytes. + */ + @java.lang.Override + public long getDownloadBytes() { + return downloadBytes_; + } + /** + * + * + *
+     * Output only. Amount of bytes that will be downloaded if the backup is restored. This
+     * may be different than storage bytes, since sequential backups of the same
+     * disk will share storage.
+     * 
+ * + * int64 download_bytes = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The downloadBytes to set. + * @return This builder for chaining. + */ + public Builder setDownloadBytes(long value) { + + downloadBytes_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Amount of bytes that will be downloaded if the backup is restored. This
+     * may be different than storage bytes, since sequential backups of the same
+     * disk will share storage.
+     * 
+ * + * int64 download_bytes = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearDownloadBytes() { + + downloadBytes_ = 0L; + onChanged(); + return this; + } + + private com.google.protobuf.BoolValue satisfiesPzs_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder> + satisfiesPzsBuilder_; + /** + * + * + *
+     * Output only. Reserved for future use.
+     * 
+ * + * + * .google.protobuf.BoolValue satisfies_pzs = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the satisfiesPzs field is set. + */ + public boolean hasSatisfiesPzs() { + return satisfiesPzsBuilder_ != null || satisfiesPzs_ != null; + } + /** + * + * + *
+     * Output only. Reserved for future use.
+     * 
+ * + * + * .google.protobuf.BoolValue satisfies_pzs = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The satisfiesPzs. + */ + public com.google.protobuf.BoolValue getSatisfiesPzs() { + if (satisfiesPzsBuilder_ == null) { + return satisfiesPzs_ == null + ? com.google.protobuf.BoolValue.getDefaultInstance() + : satisfiesPzs_; + } else { + return satisfiesPzsBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Output only. Reserved for future use.
+     * 
+ * + * + * .google.protobuf.BoolValue satisfies_pzs = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setSatisfiesPzs(com.google.protobuf.BoolValue value) { + if (satisfiesPzsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + satisfiesPzs_ = value; + onChanged(); + } else { + satisfiesPzsBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Output only. Reserved for future use.
+     * 
+ * + * + * .google.protobuf.BoolValue satisfies_pzs = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setSatisfiesPzs(com.google.protobuf.BoolValue.Builder builderForValue) { + if (satisfiesPzsBuilder_ == null) { + satisfiesPzs_ = builderForValue.build(); + onChanged(); + } else { + satisfiesPzsBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Output only. Reserved for future use.
+     * 
+ * + * + * .google.protobuf.BoolValue satisfies_pzs = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeSatisfiesPzs(com.google.protobuf.BoolValue value) { + if (satisfiesPzsBuilder_ == null) { + if (satisfiesPzs_ != null) { + satisfiesPzs_ = + com.google.protobuf.BoolValue.newBuilder(satisfiesPzs_) + .mergeFrom(value) + .buildPartial(); + } else { + satisfiesPzs_ = value; + } + onChanged(); + } else { + satisfiesPzsBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Output only. Reserved for future use.
+     * 
+ * + * + * .google.protobuf.BoolValue satisfies_pzs = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearSatisfiesPzs() { + if (satisfiesPzsBuilder_ == null) { + satisfiesPzs_ = null; + onChanged(); + } else { + satisfiesPzs_ = null; + satisfiesPzsBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Output only. Reserved for future use.
+     * 
+ * + * + * .google.protobuf.BoolValue satisfies_pzs = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.BoolValue.Builder getSatisfiesPzsBuilder() { + + onChanged(); + return getSatisfiesPzsFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. Reserved for future use.
+     * 
+ * + * + * .google.protobuf.BoolValue satisfies_pzs = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.BoolValueOrBuilder getSatisfiesPzsOrBuilder() { + if (satisfiesPzsBuilder_ != null) { + return satisfiesPzsBuilder_.getMessageOrBuilder(); + } else { + return satisfiesPzs_ == null + ? com.google.protobuf.BoolValue.getDefaultInstance() + : satisfiesPzs_; + } + } + /** + * + * + *
+     * Output only. Reserved for future use.
+     * 
+ * + * + * .google.protobuf.BoolValue satisfies_pzs = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder> + getSatisfiesPzsFieldBuilder() { + if (satisfiesPzsBuilder_ == null) { + satisfiesPzsBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder>( + getSatisfiesPzs(), getParentForChildren(), isClean()); + satisfiesPzs_ = null; + } + return satisfiesPzsBuilder_; + } + + @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.v1.Backup) + } + + // @@protoc_insertion_point(class_scope:google.cloud.filestore.v1.Backup) + private static final com.google.cloud.filestore.v1.Backup DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.filestore.v1.Backup(); + } + + public static com.google.cloud.filestore.v1.Backup getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Backup parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Backup(input, extensionRegistry); + } + }; + + 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.v1.Backup getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-filestore-v1/src/main/java/com/google/cloud/filestore/v1/BackupName.java b/proto-google-cloud-filestore-v1/src/main/java/com/google/cloud/filestore/v1/BackupName.java new file mode 100644 index 00000000..962707aa --- /dev/null +++ b/proto-google-cloud-filestore-v1/src/main/java/com/google/cloud/filestore/v1/BackupName.java @@ -0,0 +1,223 @@ +/* + * Copyright 2021 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.v1; + +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 BackupName implements ResourceName { + private static final PathTemplate PROJECT_LOCATION_BACKUP = + PathTemplate.createWithoutUrlEncoding( + "projects/{project}/locations/{location}/backups/{backup}"); + private volatile Map fieldValuesMap; + private final String project; + private final String location; + private final String backup; + + @Deprecated + protected BackupName() { + project = null; + location = null; + backup = null; + } + + private BackupName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + location = Preconditions.checkNotNull(builder.getLocation()); + backup = Preconditions.checkNotNull(builder.getBackup()); + } + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getBackup() { + return backup; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static BackupName of(String project, String location, String backup) { + return newBuilder().setProject(project).setLocation(location).setBackup(backup).build(); + } + + public static String format(String project, String location, String backup) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setBackup(backup) + .build() + .toString(); + } + + public static BackupName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PROJECT_LOCATION_BACKUP.validatedMatch( + formattedString, "BackupName.parse: formattedString not in valid format"); + return of(matchMap.get("project"), matchMap.get("location"), matchMap.get("backup")); + } + + 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 (BackupName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PROJECT_LOCATION_BACKUP.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 (backup != null) { + fieldMapBuilder.put("backup", backup); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return PROJECT_LOCATION_BACKUP.instantiate( + "project", project, "location", location, "backup", backup); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null || getClass() == o.getClass()) { + BackupName that = ((BackupName) o); + return Objects.equals(this.project, that.project) + && Objects.equals(this.location, that.location) + && Objects.equals(this.backup, that.backup); + } + 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(backup); + return h; + } + + /** Builder for projects/{project}/locations/{location}/backups/{backup}. */ + public static class Builder { + private String project; + private String location; + private String backup; + + protected Builder() {} + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getBackup() { + return backup; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setLocation(String location) { + this.location = location; + return this; + } + + public Builder setBackup(String backup) { + this.backup = backup; + return this; + } + + private Builder(BackupName backupName) { + this.project = backupName.project; + this.location = backupName.location; + this.backup = backupName.backup; + } + + public BackupName build() { + return new BackupName(this); + } + } +} diff --git a/proto-google-cloud-filestore-v1/src/main/java/com/google/cloud/filestore/v1/BackupOrBuilder.java b/proto-google-cloud-filestore-v1/src/main/java/com/google/cloud/filestore/v1/BackupOrBuilder.java new file mode 100644 index 00000000..609ae7e4 --- /dev/null +++ b/proto-google-cloud-filestore-v1/src/main/java/com/google/cloud/filestore/v1/BackupOrBuilder.java @@ -0,0 +1,370 @@ +/* + * 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/v1/cloud_filestore_service.proto + +package com.google.cloud.filestore.v1; + +public interface BackupOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.filestore.v1.Backup) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Output only. The resource name of the backup, in the format
+   * projects/{project_number}/locations/{location_id}/backups/{backup_id}.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Output only. The resource name of the backup, in the format
+   * projects/{project_number}/locations/{location_id}/backups/{backup_id}.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * A description of the backup with 2048 characters or less.
+   * Requests with longer descriptions will be rejected.
+   * 
+ * + * string description = 2; + * + * @return The description. + */ + java.lang.String getDescription(); + /** + * + * + *
+   * A description of the backup with 2048 characters or less.
+   * Requests with longer descriptions will be rejected.
+   * 
+ * + * string description = 2; + * + * @return The bytes for description. + */ + com.google.protobuf.ByteString getDescriptionBytes(); + + /** + * + * + *
+   * Output only. The backup state.
+   * 
+ * + * + * .google.cloud.filestore.v1.Backup.State state = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for state. + */ + int getStateValue(); + /** + * + * + *
+   * Output only. The backup state.
+   * 
+ * + * + * .google.cloud.filestore.v1.Backup.State state = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The state. + */ + com.google.cloud.filestore.v1.Backup.State getState(); + + /** + * + * + *
+   * Output only. The time when the backup was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + boolean hasCreateTime(); + /** + * + * + *
+   * Output only. The time when the backup was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The createTime. + */ + com.google.protobuf.Timestamp getCreateTime(); + /** + * + * + *
+   * Output only. The time when the backup was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder(); + + /** + * + * + *
+   * Resource labels to represent user provided metadata.
+   * 
+ * + * map<string, string> labels = 5; + */ + int getLabelsCount(); + /** + * + * + *
+   * Resource labels to represent user provided metadata.
+   * 
+ * + * map<string, string> labels = 5; + */ + 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 = 5; + */ + java.util.Map getLabelsMap(); + /** + * + * + *
+   * Resource labels to represent user provided metadata.
+   * 
+ * + * map<string, string> labels = 5; + */ + java.lang.String getLabelsOrDefault(java.lang.String key, java.lang.String defaultValue); + /** + * + * + *
+   * Resource labels to represent user provided metadata.
+   * 
+ * + * map<string, string> labels = 5; + */ + java.lang.String getLabelsOrThrow(java.lang.String key); + + /** + * + * + *
+   * Output only. Capacity of the source file share when the backup was created.
+   * 
+ * + * int64 capacity_gb = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The capacityGb. + */ + long getCapacityGb(); + + /** + * + * + *
+   * Output only. The size of the storage used by the backup. As backups share storage,
+   * this number is expected to change with backup creation/deletion.
+   * 
+ * + * int64 storage_bytes = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The storageBytes. + */ + long getStorageBytes(); + + /** + * + * + *
+   * The resource name of the source Cloud Filestore instance, in the format
+   * projects/{project_number}/locations/{location_id}/instances/{instance_id},
+   * used to create this backup.
+   * 
+ * + * string source_instance = 8 [(.google.api.resource_reference) = { ... } + * + * @return The sourceInstance. + */ + java.lang.String getSourceInstance(); + /** + * + * + *
+   * The resource name of the source Cloud Filestore instance, in the format
+   * projects/{project_number}/locations/{location_id}/instances/{instance_id},
+   * used to create this backup.
+   * 
+ * + * string source_instance = 8 [(.google.api.resource_reference) = { ... } + * + * @return The bytes for sourceInstance. + */ + com.google.protobuf.ByteString getSourceInstanceBytes(); + + /** + * + * + *
+   * Name of the file share in the source Cloud Filestore instance that the
+   * backup is created from.
+   * 
+ * + * string source_file_share = 9; + * + * @return The sourceFileShare. + */ + java.lang.String getSourceFileShare(); + /** + * + * + *
+   * Name of the file share in the source Cloud Filestore instance that the
+   * backup is created from.
+   * 
+ * + * string source_file_share = 9; + * + * @return The bytes for sourceFileShare. + */ + com.google.protobuf.ByteString getSourceFileShareBytes(); + + /** + * + * + *
+   * Output only. The service tier of the source Cloud Filestore instance that this backup
+   * is created from.
+   * 
+ * + * + * .google.cloud.filestore.v1.Instance.Tier source_instance_tier = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for sourceInstanceTier. + */ + int getSourceInstanceTierValue(); + /** + * + * + *
+   * Output only. The service tier of the source Cloud Filestore instance that this backup
+   * is created from.
+   * 
+ * + * + * .google.cloud.filestore.v1.Instance.Tier source_instance_tier = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The sourceInstanceTier. + */ + com.google.cloud.filestore.v1.Instance.Tier getSourceInstanceTier(); + + /** + * + * + *
+   * Output only. Amount of bytes that will be downloaded if the backup is restored. This
+   * may be different than storage bytes, since sequential backups of the same
+   * disk will share storage.
+   * 
+ * + * int64 download_bytes = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The downloadBytes. + */ + long getDownloadBytes(); + + /** + * + * + *
+   * Output only. Reserved for future use.
+   * 
+ * + * + * .google.protobuf.BoolValue satisfies_pzs = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the satisfiesPzs field is set. + */ + boolean hasSatisfiesPzs(); + /** + * + * + *
+   * Output only. Reserved for future use.
+   * 
+ * + * + * .google.protobuf.BoolValue satisfies_pzs = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The satisfiesPzs. + */ + com.google.protobuf.BoolValue getSatisfiesPzs(); + /** + * + * + *
+   * Output only. Reserved for future use.
+   * 
+ * + * + * .google.protobuf.BoolValue satisfies_pzs = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.BoolValueOrBuilder getSatisfiesPzsOrBuilder(); +} diff --git a/proto-google-cloud-filestore-v1/src/main/java/com/google/cloud/filestore/v1/CloudFilestoreServiceProto.java b/proto-google-cloud-filestore-v1/src/main/java/com/google/cloud/filestore/v1/CloudFilestoreServiceProto.java new file mode 100644 index 00000000..8ad23d1e --- /dev/null +++ b/proto-google-cloud-filestore-v1/src/main/java/com/google/cloud/filestore/v1/CloudFilestoreServiceProto.java @@ -0,0 +1,512 @@ +/* + * 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/v1/cloud_filestore_service.proto + +package com.google.cloud.filestore.v1; + +public final class CloudFilestoreServiceProto { + private CloudFilestoreServiceProto() {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions((com.google.protobuf.ExtensionRegistryLite) registry); + } + + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_filestore_v1_NetworkConfig_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_filestore_v1_NetworkConfig_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_filestore_v1_FileShareConfig_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_filestore_v1_FileShareConfig_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_filestore_v1_NfsExportOptions_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_filestore_v1_NfsExportOptions_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_filestore_v1_Instance_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_filestore_v1_Instance_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_filestore_v1_Instance_LabelsEntry_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_filestore_v1_Instance_LabelsEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_filestore_v1_CreateInstanceRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_filestore_v1_CreateInstanceRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_filestore_v1_GetInstanceRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_filestore_v1_GetInstanceRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_filestore_v1_UpdateInstanceRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_filestore_v1_UpdateInstanceRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_filestore_v1_RestoreInstanceRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_filestore_v1_RestoreInstanceRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_filestore_v1_DeleteInstanceRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_filestore_v1_DeleteInstanceRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_filestore_v1_ListInstancesRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_filestore_v1_ListInstancesRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_filestore_v1_ListInstancesResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_filestore_v1_ListInstancesResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_filestore_v1_Backup_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_filestore_v1_Backup_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_filestore_v1_Backup_LabelsEntry_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_filestore_v1_Backup_LabelsEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_filestore_v1_CreateBackupRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_filestore_v1_CreateBackupRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_filestore_v1_DeleteBackupRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_filestore_v1_DeleteBackupRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_filestore_v1_UpdateBackupRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_filestore_v1_UpdateBackupRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_filestore_v1_GetBackupRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_filestore_v1_GetBackupRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_filestore_v1_ListBackupsRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_filestore_v1_ListBackupsRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_filestore_v1_ListBackupsResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_filestore_v1_ListBackupsResponse_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\n7google/cloud/filestore/v1/cloud_filest" + + "ore_service.proto\022\031google.cloud.filestor" + + "e.v1\032\034google/api/annotations.proto\032\027goog" + + "le/api/client.proto\032\037google/api/field_be" + + "havior.proto\032\031google/api/resource.proto\032" + + "#google/longrunning/operations.proto\032 go" + + "ogle/protobuf/field_mask.proto\032\037google/p" + + "rotobuf/timestamp.proto\032\036google/protobuf" + + "/wrappers.proto\"\327\001\n\rNetworkConfig\022\017\n\007net" + + "work\030\001 \001(\t\022C\n\005modes\030\003 \003(\01624.google.cloud" + + ".filestore.v1.NetworkConfig.AddressMode\022" + + "\031\n\021reserved_ip_range\030\004 \001(\t\022\031\n\014ip_address" + + "es\030\005 \003(\tB\003\340A\003\":\n\013AddressMode\022\034\n\030ADDRESS_" + + "MODE_UNSPECIFIED\020\000\022\r\n\tMODE_IPV4\020\001\"\301\001\n\017Fi" + + "leShareConfig\022\014\n\004name\030\001 \001(\t\022\023\n\013capacity_" + + "gb\030\002 \001(\003\0228\n\rsource_backup\030\010 \001(\tB\037\372A\034\n\032fi" + + "le.googleapis.com/BackupH\000\022G\n\022nfs_export" + + "_options\030\007 \003(\0132+.google.cloud.filestore." + + "v1.NfsExportOptionsB\010\n\006source\"\375\002\n\020NfsExp" + + "ortOptions\022\021\n\tip_ranges\030\001 \003(\t\022K\n\013access_" + + "mode\030\002 \001(\01626.google.cloud.filestore.v1.N" + + "fsExportOptions.AccessMode\022K\n\013squash_mod" + + "e\030\003 \001(\01626.google.cloud.filestore.v1.NfsE" + + "xportOptions.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\027ACC" + + "ESS_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_MO" + + "DE_UNSPECIFIED\020\000\022\022\n\016NO_ROOT_SQUASH\020\001\022\017\n\013" + + "ROOT_SQUASH\020\002\"\353\006\n\010Instance\022\021\n\004name\030\001 \001(\t" + + "B\003\340A\003\022\023\n\013description\030\002 \001(\t\022=\n\005state\030\005 \001(" + + "\0162).google.cloud.filestore.v1.Instance.S" + + "tateB\003\340A\003\022\033\n\016status_message\030\006 \001(\tB\003\340A\003\0224" + + "\n\013create_time\030\007 \001(\0132\032.google.protobuf.Ti" + + "mestampB\003\340A\003\0226\n\004tier\030\010 \001(\0162(.google.clou" + + "d.filestore.v1.Instance.Tier\022?\n\006labels\030\t" + + " \003(\0132/.google.cloud.filestore.v1.Instanc" + + "e.LabelsEntry\022?\n\013file_shares\030\n \003(\0132*.goo" + + "gle.cloud.filestore.v1.FileShareConfig\022:" + + "\n\010networks\030\013 \003(\0132(.google.cloud.filestor" + + "e.v1.NetworkConfig\022\014\n\004etag\030\014 \001(\t\0226\n\rsati" + + "sfies_pzs\030\r \001(\0132\032.google.protobuf.BoolVa" + + "lueB\003\340A\003\032-\n\013LabelsEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005" + + "value\030\002 \001(\t:\0028\001\"n\n\005State\022\025\n\021STATE_UNSPEC" + + "IFIED\020\000\022\014\n\010CREATING\020\001\022\t\n\005READY\020\002\022\r\n\tREPA" + + "IRING\020\003\022\014\n\010DELETING\020\004\022\t\n\005ERROR\020\006\022\r\n\tREST" + + "ORING\020\007\"i\n\004Tier\022\024\n\020TIER_UNSPECIFIED\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_SCALE_SSD\020\005:_\352A\\\n" + + "\034file.googleapis.com/Instance\022\202\323\344\223\002/\022-/v1/{parent=proj" + + "ects/*/locations/*}/instances\332A\006parent\022\237" + + "\001\n\013GetInstance\022-.google.cloud.filestore." + + "v1.GetInstanceRequest\032#.google.cloud.fil" + + "estore.v1.Instance\"<\202\323\344\223\002/\022-/v1/{name=pr" + + "ojects/*/locations/*/instances/*}\332A\004name" + + "\022\365\001\n\016CreateInstance\0220.google.cloud.files" + + "tore.v1.CreateInstanceRequest\032\035.google.l" + + "ongrunning.Operation\"\221\001\202\323\344\223\0029\"-/v1/{pare" + + "nt=projects/*/locations/*}/instances:\010in" + + "stance\332A\033parent,instance,instance_id\312A1\n" + + "\010Instance\022%google.cloud.common.Operation" + + "Metadata\022\367\001\n\016UpdateInstance\0220.google.clo" + + "ud.filestore.v1.UpdateInstanceRequest\032\035." + + "google.longrunning.Operation\"\223\001\202\323\344\223\002B26/" + + "v1/{instance.name=projects/*/locations/*" + + "/instances/*}:\010instance\332A\024instance,updat" + + "e_mask\312A1\n\010Instance\022%google.cloud.common" + + ".OperationMetadata\022\331\001\n\017RestoreInstance\0221" + + ".google.cloud.filestore.v1.RestoreInstan" + + "ceRequest\032\035.google.longrunning.Operation" + + "\"t\202\323\344\223\002:\"5/v1/{name=projects/*/locations" + + "/*/instances/*}:restore:\001*\312A1\n\010Instance\022" + + "%google.cloud.common.OperationMetadata\022\340" + + "\001\n\016DeleteInstance\0220.google.cloud.filesto" + + "re.v1.DeleteInstanceRequest\032\035.google.lon" + + "grunning.Operation\"}\202\323\344\223\002/*-/v1/{name=pr" + + "ojects/*/locations/*/instances/*}\332A\004name" + + "\312A>\n\025google.protobuf.Empty\022%google.cloud" + + ".common.OperationMetadata\022\252\001\n\013ListBackup" + + "s\022-.google.cloud.filestore.v1.ListBackup" + + "sRequest\032..google.cloud.filestore.v1.Lis" + + "tBackupsResponse\"<\202\323\344\223\002-\022+/v1/{parent=pr" + + "ojects/*/locations/*}/backups\332A\006parent\022\227" + + "\001\n\tGetBackup\022+.google.cloud.filestore.v1" + + ".GetBackupRequest\032!.google.cloud.filesto" + + "re.v1.Backup\":\202\323\344\223\002-\022+/v1/{name=projects" + + "/*/locations/*/backups/*}\332A\004name\022\347\001\n\014Cre" + + "ateBackup\022..google.cloud.filestore.v1.Cr" + + "eateBackupRequest\032\035.google.longrunning.O" + + "peration\"\207\001\202\323\344\223\0025\"+/v1/{parent=projects/" + + "*/locations/*}/backups:\006backup\332A\027parent," + + "backup,backup_id\312A/\n\006Backup\022%google.clou" + + "d.common.OperationMetadata\022\332\001\n\014DeleteBac" + + "kup\022..google.cloud.filestore.v1.DeleteBa" + + "ckupRequest\032\035.google.longrunning.Operati" + + "on\"{\202\323\344\223\002-*+/v1/{name=projects/*/locatio" + + "ns/*/backups/*}\332A\004name\312A>\n\025google.protob" + + "uf.Empty\022%google.cloud.common.OperationM" + + "etadata\022\351\001\n\014UpdateBackup\022..google.cloud." + + "filestore.v1.UpdateBackupRequest\032\035.googl" + + "e.longrunning.Operation\"\211\001\202\323\344\223\002<22/v1/{b" + + "ackup.name=projects/*/locations/*/backup" + + "s/*}:\006backup\332A\022backup,update_mask\312A/\n\006Ba" + + "ckup\022%google.cloud.common.OperationMetad" + + "ata\032G\312A\023file.googleapis.com\322A.https://ww" + + "w.googleapis.com/auth/cloud-platformB\271\001\n" + + "\035com.google.cloud.filestore.v1B\032CloudFil" + + "estoreServiceProtoP\001ZBgoogle.golang.org/" + + "genproto/googleapis/cloud/filestore/v1;f" + + "ilestore\252\002\031Google.Cloud.Filestore.V1\312\002\031G" + + "oogle\\Cloud\\Filestore\\V1b\006proto3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.api.AnnotationsProto.getDescriptor(), + com.google.api.ClientProto.getDescriptor(), + com.google.api.FieldBehaviorProto.getDescriptor(), + com.google.api.ResourceProto.getDescriptor(), + com.google.longrunning.OperationsProto.getDescriptor(), + com.google.protobuf.FieldMaskProto.getDescriptor(), + com.google.protobuf.TimestampProto.getDescriptor(), + com.google.protobuf.WrappersProto.getDescriptor(), + }); + internal_static_google_cloud_filestore_v1_NetworkConfig_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_filestore_v1_NetworkConfig_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_filestore_v1_NetworkConfig_descriptor, + new java.lang.String[] { + "Network", "Modes", "ReservedIpRange", "IpAddresses", + }); + internal_static_google_cloud_filestore_v1_FileShareConfig_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_cloud_filestore_v1_FileShareConfig_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_filestore_v1_FileShareConfig_descriptor, + new java.lang.String[] { + "Name", "CapacityGb", "SourceBackup", "NfsExportOptions", "Source", + }); + internal_static_google_cloud_filestore_v1_NfsExportOptions_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_google_cloud_filestore_v1_NfsExportOptions_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_filestore_v1_NfsExportOptions_descriptor, + new java.lang.String[] { + "IpRanges", "AccessMode", "SquashMode", "AnonUid", "AnonGid", + }); + internal_static_google_cloud_filestore_v1_Instance_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_google_cloud_filestore_v1_Instance_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_filestore_v1_Instance_descriptor, + new java.lang.String[] { + "Name", + "Description", + "State", + "StatusMessage", + "CreateTime", + "Tier", + "Labels", + "FileShares", + "Networks", + "Etag", + "SatisfiesPzs", + }); + internal_static_google_cloud_filestore_v1_Instance_LabelsEntry_descriptor = + internal_static_google_cloud_filestore_v1_Instance_descriptor.getNestedTypes().get(0); + internal_static_google_cloud_filestore_v1_Instance_LabelsEntry_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_filestore_v1_Instance_LabelsEntry_descriptor, + new java.lang.String[] { + "Key", "Value", + }); + internal_static_google_cloud_filestore_v1_CreateInstanceRequest_descriptor = + getDescriptor().getMessageTypes().get(4); + internal_static_google_cloud_filestore_v1_CreateInstanceRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_filestore_v1_CreateInstanceRequest_descriptor, + new java.lang.String[] { + "Parent", "InstanceId", "Instance", + }); + internal_static_google_cloud_filestore_v1_GetInstanceRequest_descriptor = + getDescriptor().getMessageTypes().get(5); + internal_static_google_cloud_filestore_v1_GetInstanceRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_filestore_v1_GetInstanceRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_cloud_filestore_v1_UpdateInstanceRequest_descriptor = + getDescriptor().getMessageTypes().get(6); + internal_static_google_cloud_filestore_v1_UpdateInstanceRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_filestore_v1_UpdateInstanceRequest_descriptor, + new java.lang.String[] { + "UpdateMask", "Instance", + }); + internal_static_google_cloud_filestore_v1_RestoreInstanceRequest_descriptor = + getDescriptor().getMessageTypes().get(7); + internal_static_google_cloud_filestore_v1_RestoreInstanceRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_filestore_v1_RestoreInstanceRequest_descriptor, + new java.lang.String[] { + "Name", "FileShare", "SourceBackup", "Source", + }); + internal_static_google_cloud_filestore_v1_DeleteInstanceRequest_descriptor = + getDescriptor().getMessageTypes().get(8); + internal_static_google_cloud_filestore_v1_DeleteInstanceRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_filestore_v1_DeleteInstanceRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_cloud_filestore_v1_ListInstancesRequest_descriptor = + getDescriptor().getMessageTypes().get(9); + internal_static_google_cloud_filestore_v1_ListInstancesRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_filestore_v1_ListInstancesRequest_descriptor, + new java.lang.String[] { + "Parent", "PageSize", "PageToken", "OrderBy", "Filter", + }); + internal_static_google_cloud_filestore_v1_ListInstancesResponse_descriptor = + getDescriptor().getMessageTypes().get(10); + internal_static_google_cloud_filestore_v1_ListInstancesResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_filestore_v1_ListInstancesResponse_descriptor, + new java.lang.String[] { + "Instances", "NextPageToken", "Unreachable", + }); + internal_static_google_cloud_filestore_v1_Backup_descriptor = + getDescriptor().getMessageTypes().get(11); + internal_static_google_cloud_filestore_v1_Backup_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_filestore_v1_Backup_descriptor, + new java.lang.String[] { + "Name", + "Description", + "State", + "CreateTime", + "Labels", + "CapacityGb", + "StorageBytes", + "SourceInstance", + "SourceFileShare", + "SourceInstanceTier", + "DownloadBytes", + "SatisfiesPzs", + }); + internal_static_google_cloud_filestore_v1_Backup_LabelsEntry_descriptor = + internal_static_google_cloud_filestore_v1_Backup_descriptor.getNestedTypes().get(0); + internal_static_google_cloud_filestore_v1_Backup_LabelsEntry_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_filestore_v1_Backup_LabelsEntry_descriptor, + new java.lang.String[] { + "Key", "Value", + }); + internal_static_google_cloud_filestore_v1_CreateBackupRequest_descriptor = + getDescriptor().getMessageTypes().get(12); + internal_static_google_cloud_filestore_v1_CreateBackupRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_filestore_v1_CreateBackupRequest_descriptor, + new java.lang.String[] { + "Parent", "Backup", "BackupId", + }); + internal_static_google_cloud_filestore_v1_DeleteBackupRequest_descriptor = + getDescriptor().getMessageTypes().get(13); + internal_static_google_cloud_filestore_v1_DeleteBackupRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_filestore_v1_DeleteBackupRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_cloud_filestore_v1_UpdateBackupRequest_descriptor = + getDescriptor().getMessageTypes().get(14); + internal_static_google_cloud_filestore_v1_UpdateBackupRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_filestore_v1_UpdateBackupRequest_descriptor, + new java.lang.String[] { + "Backup", "UpdateMask", + }); + internal_static_google_cloud_filestore_v1_GetBackupRequest_descriptor = + getDescriptor().getMessageTypes().get(15); + internal_static_google_cloud_filestore_v1_GetBackupRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_filestore_v1_GetBackupRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_cloud_filestore_v1_ListBackupsRequest_descriptor = + getDescriptor().getMessageTypes().get(16); + internal_static_google_cloud_filestore_v1_ListBackupsRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_filestore_v1_ListBackupsRequest_descriptor, + new java.lang.String[] { + "Parent", "PageSize", "PageToken", "OrderBy", "Filter", + }); + internal_static_google_cloud_filestore_v1_ListBackupsResponse_descriptor = + getDescriptor().getMessageTypes().get(17); + internal_static_google_cloud_filestore_v1_ListBackupsResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_filestore_v1_ListBackupsResponse_descriptor, + new java.lang.String[] { + "Backups", "NextPageToken", "Unreachable", + }); + com.google.protobuf.ExtensionRegistry registry = + com.google.protobuf.ExtensionRegistry.newInstance(); + registry.add(com.google.api.ClientProto.defaultHost); + registry.add(com.google.api.FieldBehaviorProto.fieldBehavior); + registry.add(com.google.api.AnnotationsProto.http); + registry.add(com.google.api.ClientProto.methodSignature); + registry.add(com.google.api.ClientProto.oauthScopes); + registry.add(com.google.api.ResourceProto.resource); + registry.add(com.google.api.ResourceProto.resourceReference); + registry.add(com.google.longrunning.OperationsProto.operationInfo); + com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( + descriptor, registry); + com.google.api.AnnotationsProto.getDescriptor(); + com.google.api.ClientProto.getDescriptor(); + com.google.api.FieldBehaviorProto.getDescriptor(); + com.google.api.ResourceProto.getDescriptor(); + com.google.longrunning.OperationsProto.getDescriptor(); + com.google.protobuf.FieldMaskProto.getDescriptor(); + com.google.protobuf.TimestampProto.getDescriptor(); + com.google.protobuf.WrappersProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/proto-google-cloud-filestore-v1/src/main/java/com/google/cloud/filestore/v1/CreateBackupRequest.java b/proto-google-cloud-filestore-v1/src/main/java/com/google/cloud/filestore/v1/CreateBackupRequest.java new file mode 100644 index 00000000..682de17f --- /dev/null +++ b/proto-google-cloud-filestore-v1/src/main/java/com/google/cloud/filestore/v1/CreateBackupRequest.java @@ -0,0 +1,1177 @@ +/* + * 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/v1/cloud_filestore_service.proto + +package com.google.cloud.filestore.v1; + +/** + * + * + *
+ * CreateBackupRequest creates a backup.
+ * 
+ * + * Protobuf type {@code google.cloud.filestore.v1.CreateBackupRequest} + */ +public final class CreateBackupRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.filestore.v1.CreateBackupRequest) + CreateBackupRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use CreateBackupRequest.newBuilder() to construct. + private CreateBackupRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CreateBackupRequest() { + parent_ = ""; + backupId_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new CreateBackupRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private CreateBackupRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + parent_ = s; + break; + } + case 18: + { + com.google.cloud.filestore.v1.Backup.Builder subBuilder = null; + if (backup_ != null) { + subBuilder = backup_.toBuilder(); + } + backup_ = + input.readMessage( + com.google.cloud.filestore.v1.Backup.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(backup_); + backup_ = subBuilder.buildPartial(); + } + + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + + backupId_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.filestore.v1.CloudFilestoreServiceProto + .internal_static_google_cloud_filestore_v1_CreateBackupRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.filestore.v1.CloudFilestoreServiceProto + .internal_static_google_cloud_filestore_v1_CreateBackupRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.filestore.v1.CreateBackupRequest.class, + com.google.cloud.filestore.v1.CreateBackupRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + * + * + *
+   * Required. The backup's project and location, in the format
+   * projects/{project_number}/locations/{location}. In Cloud Filestore,
+   * backup locations map to GCP regions, for example **us-west1**.
+   * 
+ * + * + * 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 backup's project and location, in the format
+   * projects/{project_number}/locations/{location}. In Cloud Filestore,
+   * backup locations map to GCP regions, for example **us-west1**.
+   * 
+ * + * + * 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 BACKUP_FIELD_NUMBER = 2; + private com.google.cloud.filestore.v1.Backup backup_; + /** + * + * + *
+   * Required. A [backup resource]
+   * (/cloud-filestore/reference/rest/v1/projects.locations.backups)
+   * 
+ * + * .google.cloud.filestore.v1.Backup backup = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the backup field is set. + */ + @java.lang.Override + public boolean hasBackup() { + return backup_ != null; + } + /** + * + * + *
+   * Required. A [backup resource]
+   * (/cloud-filestore/reference/rest/v1/projects.locations.backups)
+   * 
+ * + * .google.cloud.filestore.v1.Backup backup = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The backup. + */ + @java.lang.Override + public com.google.cloud.filestore.v1.Backup getBackup() { + return backup_ == null ? com.google.cloud.filestore.v1.Backup.getDefaultInstance() : backup_; + } + /** + * + * + *
+   * Required. A [backup resource]
+   * (/cloud-filestore/reference/rest/v1/projects.locations.backups)
+   * 
+ * + * .google.cloud.filestore.v1.Backup backup = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.filestore.v1.BackupOrBuilder getBackupOrBuilder() { + return getBackup(); + } + + public static final int BACKUP_ID_FIELD_NUMBER = 3; + private volatile java.lang.Object 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.
+   * Values that do not match this pattern will trigger an INVALID_ARGUMENT
+   * error.
+   * 
+ * + * string backup_id = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The backupId. + */ + @java.lang.Override + public java.lang.String getBackupId() { + java.lang.Object ref = backupId_; + 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(); + backupId_ = s; + return s; + } + } + /** + * + * + *
+   * 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.
+   * Values that do not match this pattern will trigger an INVALID_ARGUMENT
+   * error.
+   * 
+ * + * string backup_id = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for backupId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getBackupIdBytes() { + java.lang.Object ref = backupId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + backupId_ = 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 (!getParentBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (backup_ != null) { + output.writeMessage(2, getBackup()); + } + if (!getBackupIdBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, backupId_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getParentBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (backup_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getBackup()); + } + if (!getBackupIdBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, backupId_); + } + size += unknownFields.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.v1.CreateBackupRequest)) { + return super.equals(obj); + } + com.google.cloud.filestore.v1.CreateBackupRequest other = + (com.google.cloud.filestore.v1.CreateBackupRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (hasBackup() != other.hasBackup()) return false; + if (hasBackup()) { + if (!getBackup().equals(other.getBackup())) return false; + } + if (!getBackupId().equals(other.getBackupId())) return false; + if (!unknownFields.equals(other.unknownFields)) 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(); + if (hasBackup()) { + hash = (37 * hash) + BACKUP_FIELD_NUMBER; + hash = (53 * hash) + getBackup().hashCode(); + } + hash = (37 * hash) + BACKUP_ID_FIELD_NUMBER; + hash = (53 * hash) + getBackupId().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.filestore.v1.CreateBackupRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.filestore.v1.CreateBackupRequest 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.v1.CreateBackupRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.filestore.v1.CreateBackupRequest 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.v1.CreateBackupRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.filestore.v1.CreateBackupRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.filestore.v1.CreateBackupRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.filestore.v1.CreateBackupRequest 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.v1.CreateBackupRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.filestore.v1.CreateBackupRequest 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.v1.CreateBackupRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.filestore.v1.CreateBackupRequest 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.v1.CreateBackupRequest 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; + } + /** + * + * + *
+   * CreateBackupRequest creates a backup.
+   * 
+ * + * Protobuf type {@code google.cloud.filestore.v1.CreateBackupRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.filestore.v1.CreateBackupRequest) + com.google.cloud.filestore.v1.CreateBackupRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.filestore.v1.CloudFilestoreServiceProto + .internal_static_google_cloud_filestore_v1_CreateBackupRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.filestore.v1.CloudFilestoreServiceProto + .internal_static_google_cloud_filestore_v1_CreateBackupRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.filestore.v1.CreateBackupRequest.class, + com.google.cloud.filestore.v1.CreateBackupRequest.Builder.class); + } + + // Construct using com.google.cloud.filestore.v1.CreateBackupRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + parent_ = ""; + + if (backupBuilder_ == null) { + backup_ = null; + } else { + backup_ = null; + backupBuilder_ = null; + } + backupId_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.filestore.v1.CloudFilestoreServiceProto + .internal_static_google_cloud_filestore_v1_CreateBackupRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.filestore.v1.CreateBackupRequest getDefaultInstanceForType() { + return com.google.cloud.filestore.v1.CreateBackupRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.filestore.v1.CreateBackupRequest build() { + com.google.cloud.filestore.v1.CreateBackupRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.filestore.v1.CreateBackupRequest buildPartial() { + com.google.cloud.filestore.v1.CreateBackupRequest result = + new com.google.cloud.filestore.v1.CreateBackupRequest(this); + result.parent_ = parent_; + if (backupBuilder_ == null) { + result.backup_ = backup_; + } else { + result.backup_ = backupBuilder_.build(); + } + result.backupId_ = backupId_; + 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.v1.CreateBackupRequest) { + return mergeFrom((com.google.cloud.filestore.v1.CreateBackupRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.filestore.v1.CreateBackupRequest other) { + if (other == com.google.cloud.filestore.v1.CreateBackupRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + onChanged(); + } + if (other.hasBackup()) { + mergeBackup(other.getBackup()); + } + if (!other.getBackupId().isEmpty()) { + backupId_ = other.backupId_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + 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 { + com.google.cloud.filestore.v1.CreateBackupRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.filestore.v1.CreateBackupRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. The backup's project and location, in the format
+     * projects/{project_number}/locations/{location}. In Cloud Filestore,
+     * backup locations map to GCP regions, for example **us-west1**.
+     * 
+ * + * + * 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 backup's project and location, in the format
+     * projects/{project_number}/locations/{location}. In Cloud Filestore,
+     * backup locations map to GCP regions, for example **us-west1**.
+     * 
+ * + * + * 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 backup's project and location, in the format
+     * projects/{project_number}/locations/{location}. In Cloud Filestore,
+     * backup locations map to GCP regions, for example **us-west1**.
+     * 
+ * + * + * 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 backup's project and location, in the format
+     * projects/{project_number}/locations/{location}. In Cloud Filestore,
+     * backup locations map to GCP regions, for example **us-west1**.
+     * 
+ * + * + * 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 backup's project and location, in the format
+     * projects/{project_number}/locations/{location}. In Cloud Filestore,
+     * backup locations map to GCP regions, for example **us-west1**.
+     * 
+ * + * + * 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 com.google.cloud.filestore.v1.Backup backup_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.filestore.v1.Backup, + com.google.cloud.filestore.v1.Backup.Builder, + com.google.cloud.filestore.v1.BackupOrBuilder> + backupBuilder_; + /** + * + * + *
+     * Required. A [backup resource]
+     * (/cloud-filestore/reference/rest/v1/projects.locations.backups)
+     * 
+ * + * .google.cloud.filestore.v1.Backup backup = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the backup field is set. + */ + public boolean hasBackup() { + return backupBuilder_ != null || backup_ != null; + } + /** + * + * + *
+     * Required. A [backup resource]
+     * (/cloud-filestore/reference/rest/v1/projects.locations.backups)
+     * 
+ * + * .google.cloud.filestore.v1.Backup backup = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The backup. + */ + public com.google.cloud.filestore.v1.Backup getBackup() { + if (backupBuilder_ == null) { + return backup_ == null + ? com.google.cloud.filestore.v1.Backup.getDefaultInstance() + : backup_; + } else { + return backupBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. A [backup resource]
+     * (/cloud-filestore/reference/rest/v1/projects.locations.backups)
+     * 
+ * + * .google.cloud.filestore.v1.Backup backup = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setBackup(com.google.cloud.filestore.v1.Backup value) { + if (backupBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + backup_ = value; + onChanged(); + } else { + backupBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Required. A [backup resource]
+     * (/cloud-filestore/reference/rest/v1/projects.locations.backups)
+     * 
+ * + * .google.cloud.filestore.v1.Backup backup = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setBackup(com.google.cloud.filestore.v1.Backup.Builder builderForValue) { + if (backupBuilder_ == null) { + backup_ = builderForValue.build(); + onChanged(); + } else { + backupBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Required. A [backup resource]
+     * (/cloud-filestore/reference/rest/v1/projects.locations.backups)
+     * 
+ * + * .google.cloud.filestore.v1.Backup backup = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeBackup(com.google.cloud.filestore.v1.Backup value) { + if (backupBuilder_ == null) { + if (backup_ != null) { + backup_ = + com.google.cloud.filestore.v1.Backup.newBuilder(backup_) + .mergeFrom(value) + .buildPartial(); + } else { + backup_ = value; + } + onChanged(); + } else { + backupBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Required. A [backup resource]
+     * (/cloud-filestore/reference/rest/v1/projects.locations.backups)
+     * 
+ * + * .google.cloud.filestore.v1.Backup backup = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearBackup() { + if (backupBuilder_ == null) { + backup_ = null; + onChanged(); + } else { + backup_ = null; + backupBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Required. A [backup resource]
+     * (/cloud-filestore/reference/rest/v1/projects.locations.backups)
+     * 
+ * + * .google.cloud.filestore.v1.Backup backup = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.filestore.v1.Backup.Builder getBackupBuilder() { + + onChanged(); + return getBackupFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. A [backup resource]
+     * (/cloud-filestore/reference/rest/v1/projects.locations.backups)
+     * 
+ * + * .google.cloud.filestore.v1.Backup backup = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.filestore.v1.BackupOrBuilder getBackupOrBuilder() { + if (backupBuilder_ != null) { + return backupBuilder_.getMessageOrBuilder(); + } else { + return backup_ == null + ? com.google.cloud.filestore.v1.Backup.getDefaultInstance() + : backup_; + } + } + /** + * + * + *
+     * Required. A [backup resource]
+     * (/cloud-filestore/reference/rest/v1/projects.locations.backups)
+     * 
+ * + * .google.cloud.filestore.v1.Backup backup = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.filestore.v1.Backup, + com.google.cloud.filestore.v1.Backup.Builder, + com.google.cloud.filestore.v1.BackupOrBuilder> + getBackupFieldBuilder() { + if (backupBuilder_ == null) { + backupBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.filestore.v1.Backup, + com.google.cloud.filestore.v1.Backup.Builder, + com.google.cloud.filestore.v1.BackupOrBuilder>( + getBackup(), getParentForChildren(), isClean()); + backup_ = null; + } + return backupBuilder_; + } + + private java.lang.Object 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.
+     * Values that do not match this pattern will trigger an INVALID_ARGUMENT
+     * error.
+     * 
+ * + * string backup_id = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The backupId. + */ + public java.lang.String getBackupId() { + java.lang.Object ref = backupId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + backupId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * 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.
+     * Values that do not match this pattern will trigger an INVALID_ARGUMENT
+     * error.
+     * 
+ * + * string backup_id = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for backupId. + */ + public com.google.protobuf.ByteString getBackupIdBytes() { + java.lang.Object ref = backupId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + backupId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * 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.
+     * Values that do not match this pattern will trigger an INVALID_ARGUMENT
+     * error.
+     * 
+ * + * string backup_id = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The backupId to set. + * @return This builder for chaining. + */ + public Builder setBackupId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + backupId_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * 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.
+     * Values that do not match this pattern will trigger an INVALID_ARGUMENT
+     * error.
+     * 
+ * + * string backup_id = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearBackupId() { + + backupId_ = getDefaultInstance().getBackupId(); + onChanged(); + return this; + } + /** + * + * + *
+     * 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.
+     * Values that do not match this pattern will trigger an INVALID_ARGUMENT
+     * error.
+     * 
+ * + * string backup_id = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for backupId to set. + * @return This builder for chaining. + */ + public Builder setBackupIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + backupId_ = 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.v1.CreateBackupRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.filestore.v1.CreateBackupRequest) + private static final com.google.cloud.filestore.v1.CreateBackupRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.filestore.v1.CreateBackupRequest(); + } + + public static com.google.cloud.filestore.v1.CreateBackupRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CreateBackupRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new CreateBackupRequest(input, extensionRegistry); + } + }; + + 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.v1.CreateBackupRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-filestore-v1/src/main/java/com/google/cloud/filestore/v1/CreateBackupRequestOrBuilder.java b/proto-google-cloud-filestore-v1/src/main/java/com/google/cloud/filestore/v1/CreateBackupRequestOrBuilder.java new file mode 100644 index 00000000..d4ffb2ab --- /dev/null +++ b/proto-google-cloud-filestore-v1/src/main/java/com/google/cloud/filestore/v1/CreateBackupRequestOrBuilder.java @@ -0,0 +1,134 @@ +/* + * 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/v1/cloud_filestore_service.proto + +package com.google.cloud.filestore.v1; + +public interface CreateBackupRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.filestore.v1.CreateBackupRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The backup's project and location, in the format
+   * projects/{project_number}/locations/{location}. In Cloud Filestore,
+   * backup locations map to GCP regions, for example **us-west1**.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. The backup's project and location, in the format
+   * projects/{project_number}/locations/{location}. In Cloud Filestore,
+   * backup locations map to GCP regions, for example **us-west1**.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Required. A [backup resource]
+   * (/cloud-filestore/reference/rest/v1/projects.locations.backups)
+   * 
+ * + * .google.cloud.filestore.v1.Backup backup = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the backup field is set. + */ + boolean hasBackup(); + /** + * + * + *
+   * Required. A [backup resource]
+   * (/cloud-filestore/reference/rest/v1/projects.locations.backups)
+   * 
+ * + * .google.cloud.filestore.v1.Backup backup = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The backup. + */ + com.google.cloud.filestore.v1.Backup getBackup(); + /** + * + * + *
+   * Required. A [backup resource]
+   * (/cloud-filestore/reference/rest/v1/projects.locations.backups)
+   * 
+ * + * .google.cloud.filestore.v1.Backup backup = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.filestore.v1.BackupOrBuilder getBackupOrBuilder(); + + /** + * + * + *
+   * 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.
+   * Values that do not match this pattern will trigger an INVALID_ARGUMENT
+   * error.
+   * 
+ * + * string backup_id = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The backupId. + */ + java.lang.String getBackupId(); + /** + * + * + *
+   * 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.
+   * Values that do not match this pattern will trigger an INVALID_ARGUMENT
+   * error.
+   * 
+ * + * string backup_id = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for backupId. + */ + com.google.protobuf.ByteString getBackupIdBytes(); +} diff --git a/proto-google-cloud-filestore-v1/src/main/java/com/google/cloud/filestore/v1/CreateInstanceRequest.java b/proto-google-cloud-filestore-v1/src/main/java/com/google/cloud/filestore/v1/CreateInstanceRequest.java new file mode 100644 index 00000000..7cfb19cb --- /dev/null +++ b/proto-google-cloud-filestore-v1/src/main/java/com/google/cloud/filestore/v1/CreateInstanceRequest.java @@ -0,0 +1,1163 @@ +/* + * 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/v1/cloud_filestore_service.proto + +package com.google.cloud.filestore.v1; + +/** + * + * + *
+ * CreateInstanceRequest creates an instance.
+ * 
+ * + * Protobuf type {@code google.cloud.filestore.v1.CreateInstanceRequest} + */ +public final class CreateInstanceRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.filestore.v1.CreateInstanceRequest) + CreateInstanceRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use CreateInstanceRequest.newBuilder() to construct. + private CreateInstanceRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CreateInstanceRequest() { + parent_ = ""; + instanceId_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new CreateInstanceRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private CreateInstanceRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + parent_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + instanceId_ = s; + break; + } + case 26: + { + com.google.cloud.filestore.v1.Instance.Builder subBuilder = null; + if (instance_ != null) { + subBuilder = instance_.toBuilder(); + } + instance_ = + input.readMessage( + com.google.cloud.filestore.v1.Instance.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(instance_); + instance_ = subBuilder.buildPartial(); + } + + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.filestore.v1.CloudFilestoreServiceProto + .internal_static_google_cloud_filestore_v1_CreateInstanceRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.filestore.v1.CloudFilestoreServiceProto + .internal_static_google_cloud_filestore_v1_CreateInstanceRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.filestore.v1.CreateInstanceRequest.class, + com.google.cloud.filestore.v1.CreateInstanceRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object 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**.
+   * 
+ * + * + * 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'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**.
+   * 
+ * + * + * 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 INSTANCE_ID_FIELD_NUMBER = 2; + private volatile java.lang.Object instanceId_; + /** + * + * + *
+   * Required. The name of the instance to create.
+   * The name must be unique for the specified project and location.
+   * 
+ * + * string instance_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The instanceId. + */ + @java.lang.Override + public java.lang.String getInstanceId() { + java.lang.Object ref = instanceId_; + 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(); + instanceId_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The name of the instance to create.
+   * The name must be unique for the specified project and location.
+   * 
+ * + * string instance_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for instanceId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getInstanceIdBytes() { + java.lang.Object ref = instanceId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instanceId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int INSTANCE_FIELD_NUMBER = 3; + private com.google.cloud.filestore.v1.Instance instance_; + /** + * + * + *
+   * Required. A [instance resource]
+   * (/cloud-filestore/reference/rest/v1/projects.locations.instances)
+   * 
+ * + * + * .google.cloud.filestore.v1.Instance instance = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the instance field is set. + */ + @java.lang.Override + public boolean hasInstance() { + return instance_ != null; + } + /** + * + * + *
+   * Required. A [instance resource]
+   * (/cloud-filestore/reference/rest/v1/projects.locations.instances)
+   * 
+ * + * + * .google.cloud.filestore.v1.Instance instance = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The instance. + */ + @java.lang.Override + public com.google.cloud.filestore.v1.Instance getInstance() { + return instance_ == null + ? com.google.cloud.filestore.v1.Instance.getDefaultInstance() + : instance_; + } + /** + * + * + *
+   * Required. A [instance resource]
+   * (/cloud-filestore/reference/rest/v1/projects.locations.instances)
+   * 
+ * + * + * .google.cloud.filestore.v1.Instance instance = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.filestore.v1.InstanceOrBuilder getInstanceOrBuilder() { + return getInstance(); + } + + 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 (!getParentBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (!getInstanceIdBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, instanceId_); + } + if (instance_ != null) { + output.writeMessage(3, getInstance()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getParentBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (!getInstanceIdBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, instanceId_); + } + if (instance_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getInstance()); + } + size += unknownFields.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.v1.CreateInstanceRequest)) { + return super.equals(obj); + } + com.google.cloud.filestore.v1.CreateInstanceRequest other = + (com.google.cloud.filestore.v1.CreateInstanceRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (!getInstanceId().equals(other.getInstanceId())) return false; + if (hasInstance() != other.hasInstance()) return false; + if (hasInstance()) { + if (!getInstance().equals(other.getInstance())) return false; + } + if (!unknownFields.equals(other.unknownFields)) 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) + INSTANCE_ID_FIELD_NUMBER; + hash = (53 * hash) + getInstanceId().hashCode(); + if (hasInstance()) { + hash = (37 * hash) + INSTANCE_FIELD_NUMBER; + hash = (53 * hash) + getInstance().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.filestore.v1.CreateInstanceRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.filestore.v1.CreateInstanceRequest 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.v1.CreateInstanceRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.filestore.v1.CreateInstanceRequest 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.v1.CreateInstanceRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.filestore.v1.CreateInstanceRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.filestore.v1.CreateInstanceRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.filestore.v1.CreateInstanceRequest 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.v1.CreateInstanceRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.filestore.v1.CreateInstanceRequest 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.v1.CreateInstanceRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.filestore.v1.CreateInstanceRequest 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.v1.CreateInstanceRequest 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; + } + /** + * + * + *
+   * CreateInstanceRequest creates an instance.
+   * 
+ * + * Protobuf type {@code google.cloud.filestore.v1.CreateInstanceRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.filestore.v1.CreateInstanceRequest) + com.google.cloud.filestore.v1.CreateInstanceRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.filestore.v1.CloudFilestoreServiceProto + .internal_static_google_cloud_filestore_v1_CreateInstanceRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.filestore.v1.CloudFilestoreServiceProto + .internal_static_google_cloud_filestore_v1_CreateInstanceRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.filestore.v1.CreateInstanceRequest.class, + com.google.cloud.filestore.v1.CreateInstanceRequest.Builder.class); + } + + // Construct using com.google.cloud.filestore.v1.CreateInstanceRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + parent_ = ""; + + instanceId_ = ""; + + if (instanceBuilder_ == null) { + instance_ = null; + } else { + instance_ = null; + instanceBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.filestore.v1.CloudFilestoreServiceProto + .internal_static_google_cloud_filestore_v1_CreateInstanceRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.filestore.v1.CreateInstanceRequest getDefaultInstanceForType() { + return com.google.cloud.filestore.v1.CreateInstanceRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.filestore.v1.CreateInstanceRequest build() { + com.google.cloud.filestore.v1.CreateInstanceRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.filestore.v1.CreateInstanceRequest buildPartial() { + com.google.cloud.filestore.v1.CreateInstanceRequest result = + new com.google.cloud.filestore.v1.CreateInstanceRequest(this); + result.parent_ = parent_; + result.instanceId_ = instanceId_; + if (instanceBuilder_ == null) { + result.instance_ = instance_; + } else { + result.instance_ = instanceBuilder_.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.v1.CreateInstanceRequest) { + return mergeFrom((com.google.cloud.filestore.v1.CreateInstanceRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.filestore.v1.CreateInstanceRequest other) { + if (other == com.google.cloud.filestore.v1.CreateInstanceRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + onChanged(); + } + if (!other.getInstanceId().isEmpty()) { + instanceId_ = other.instanceId_; + onChanged(); + } + if (other.hasInstance()) { + mergeInstance(other.getInstance()); + } + this.mergeUnknownFields(other.unknownFields); + 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 { + com.google.cloud.filestore.v1.CreateInstanceRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.filestore.v1.CreateInstanceRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object 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**.
+     * 
+ * + * + * 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'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**.
+     * 
+ * + * + * 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'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**.
+     * 
+ * + * + * 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'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**.
+     * 
+ * + * + * 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'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**.
+     * 
+ * + * + * 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 instanceId_ = ""; + /** + * + * + *
+     * Required. The name of the instance to create.
+     * The name must be unique for the specified project and location.
+     * 
+ * + * string instance_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The instanceId. + */ + public java.lang.String getInstanceId() { + java.lang.Object ref = instanceId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instanceId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The name of the instance to create.
+     * The name must be unique for the specified project and location.
+     * 
+ * + * string instance_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for instanceId. + */ + public com.google.protobuf.ByteString getInstanceIdBytes() { + java.lang.Object ref = instanceId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instanceId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The name of the instance to create.
+     * The name must be unique for the specified project and location.
+     * 
+ * + * string instance_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The instanceId to set. + * @return This builder for chaining. + */ + public Builder setInstanceId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + instanceId_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the instance to create.
+     * The name must be unique for the specified project and location.
+     * 
+ * + * string instance_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearInstanceId() { + + instanceId_ = getDefaultInstance().getInstanceId(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the instance to create.
+     * The name must be unique for the specified project and location.
+     * 
+ * + * string instance_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for instanceId to set. + * @return This builder for chaining. + */ + public Builder setInstanceIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + instanceId_ = value; + onChanged(); + return this; + } + + private com.google.cloud.filestore.v1.Instance instance_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.filestore.v1.Instance, + com.google.cloud.filestore.v1.Instance.Builder, + com.google.cloud.filestore.v1.InstanceOrBuilder> + instanceBuilder_; + /** + * + * + *
+     * Required. A [instance resource]
+     * (/cloud-filestore/reference/rest/v1/projects.locations.instances)
+     * 
+ * + * + * .google.cloud.filestore.v1.Instance instance = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the instance field is set. + */ + public boolean hasInstance() { + return instanceBuilder_ != null || instance_ != null; + } + /** + * + * + *
+     * Required. A [instance resource]
+     * (/cloud-filestore/reference/rest/v1/projects.locations.instances)
+     * 
+ * + * + * .google.cloud.filestore.v1.Instance instance = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The instance. + */ + public com.google.cloud.filestore.v1.Instance getInstance() { + if (instanceBuilder_ == null) { + return instance_ == null + ? com.google.cloud.filestore.v1.Instance.getDefaultInstance() + : instance_; + } else { + return instanceBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. A [instance resource]
+     * (/cloud-filestore/reference/rest/v1/projects.locations.instances)
+     * 
+ * + * + * .google.cloud.filestore.v1.Instance instance = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setInstance(com.google.cloud.filestore.v1.Instance value) { + if (instanceBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + instance_ = value; + onChanged(); + } else { + instanceBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Required. A [instance resource]
+     * (/cloud-filestore/reference/rest/v1/projects.locations.instances)
+     * 
+ * + * + * .google.cloud.filestore.v1.Instance instance = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setInstance(com.google.cloud.filestore.v1.Instance.Builder builderForValue) { + if (instanceBuilder_ == null) { + instance_ = builderForValue.build(); + onChanged(); + } else { + instanceBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Required. A [instance resource]
+     * (/cloud-filestore/reference/rest/v1/projects.locations.instances)
+     * 
+ * + * + * .google.cloud.filestore.v1.Instance instance = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeInstance(com.google.cloud.filestore.v1.Instance value) { + if (instanceBuilder_ == null) { + if (instance_ != null) { + instance_ = + com.google.cloud.filestore.v1.Instance.newBuilder(instance_) + .mergeFrom(value) + .buildPartial(); + } else { + instance_ = value; + } + onChanged(); + } else { + instanceBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Required. A [instance resource]
+     * (/cloud-filestore/reference/rest/v1/projects.locations.instances)
+     * 
+ * + * + * .google.cloud.filestore.v1.Instance instance = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearInstance() { + if (instanceBuilder_ == null) { + instance_ = null; + onChanged(); + } else { + instance_ = null; + instanceBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Required. A [instance resource]
+     * (/cloud-filestore/reference/rest/v1/projects.locations.instances)
+     * 
+ * + * + * .google.cloud.filestore.v1.Instance instance = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.filestore.v1.Instance.Builder getInstanceBuilder() { + + onChanged(); + return getInstanceFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. A [instance resource]
+     * (/cloud-filestore/reference/rest/v1/projects.locations.instances)
+     * 
+ * + * + * .google.cloud.filestore.v1.Instance instance = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.filestore.v1.InstanceOrBuilder getInstanceOrBuilder() { + if (instanceBuilder_ != null) { + return instanceBuilder_.getMessageOrBuilder(); + } else { + return instance_ == null + ? com.google.cloud.filestore.v1.Instance.getDefaultInstance() + : instance_; + } + } + /** + * + * + *
+     * Required. A [instance resource]
+     * (/cloud-filestore/reference/rest/v1/projects.locations.instances)
+     * 
+ * + * + * .google.cloud.filestore.v1.Instance instance = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.filestore.v1.Instance, + com.google.cloud.filestore.v1.Instance.Builder, + com.google.cloud.filestore.v1.InstanceOrBuilder> + getInstanceFieldBuilder() { + if (instanceBuilder_ == null) { + instanceBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.filestore.v1.Instance, + com.google.cloud.filestore.v1.Instance.Builder, + com.google.cloud.filestore.v1.InstanceOrBuilder>( + getInstance(), getParentForChildren(), isClean()); + instance_ = null; + } + return instanceBuilder_; + } + + @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.v1.CreateInstanceRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.filestore.v1.CreateInstanceRequest) + private static final com.google.cloud.filestore.v1.CreateInstanceRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.filestore.v1.CreateInstanceRequest(); + } + + public static com.google.cloud.filestore.v1.CreateInstanceRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CreateInstanceRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new CreateInstanceRequest(input, extensionRegistry); + } + }; + + 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.v1.CreateInstanceRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-filestore-v1/src/main/java/com/google/cloud/filestore/v1/CreateInstanceRequestOrBuilder.java b/proto-google-cloud-filestore-v1/src/main/java/com/google/cloud/filestore/v1/CreateInstanceRequestOrBuilder.java new file mode 100644 index 00000000..021b05a9 --- /dev/null +++ b/proto-google-cloud-filestore-v1/src/main/java/com/google/cloud/filestore/v1/CreateInstanceRequestOrBuilder.java @@ -0,0 +1,129 @@ +/* + * 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/v1/cloud_filestore_service.proto + +package com.google.cloud.filestore.v1; + +public interface CreateInstanceRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.filestore.v1.CreateInstanceRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * 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**.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * 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**.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Required. The name of the instance to create.
+   * The name must be unique for the specified project and location.
+   * 
+ * + * string instance_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The instanceId. + */ + java.lang.String getInstanceId(); + /** + * + * + *
+   * Required. The name of the instance to create.
+   * The name must be unique for the specified project and location.
+   * 
+ * + * string instance_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for instanceId. + */ + com.google.protobuf.ByteString getInstanceIdBytes(); + + /** + * + * + *
+   * Required. A [instance resource]
+   * (/cloud-filestore/reference/rest/v1/projects.locations.instances)
+   * 
+ * + * + * .google.cloud.filestore.v1.Instance instance = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the instance field is set. + */ + boolean hasInstance(); + /** + * + * + *
+   * Required. A [instance resource]
+   * (/cloud-filestore/reference/rest/v1/projects.locations.instances)
+   * 
+ * + * + * .google.cloud.filestore.v1.Instance instance = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The instance. + */ + com.google.cloud.filestore.v1.Instance getInstance(); + /** + * + * + *
+   * Required. A [instance resource]
+   * (/cloud-filestore/reference/rest/v1/projects.locations.instances)
+   * 
+ * + * + * .google.cloud.filestore.v1.Instance instance = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.filestore.v1.InstanceOrBuilder getInstanceOrBuilder(); +} diff --git a/proto-google-cloud-filestore-v1/src/main/java/com/google/cloud/filestore/v1/DeleteBackupRequest.java b/proto-google-cloud-filestore-v1/src/main/java/com/google/cloud/filestore/v1/DeleteBackupRequest.java new file mode 100644 index 00000000..c5d0c5e6 --- /dev/null +++ b/proto-google-cloud-filestore-v1/src/main/java/com/google/cloud/filestore/v1/DeleteBackupRequest.java @@ -0,0 +1,657 @@ +/* + * 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/v1/cloud_filestore_service.proto + +package com.google.cloud.filestore.v1; + +/** + * + * + *
+ * DeleteBackupRequest deletes a backup.
+ * 
+ * + * Protobuf type {@code google.cloud.filestore.v1.DeleteBackupRequest} + */ +public final class DeleteBackupRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.filestore.v1.DeleteBackupRequest) + DeleteBackupRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use DeleteBackupRequest.newBuilder() to construct. + private DeleteBackupRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private DeleteBackupRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new DeleteBackupRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private DeleteBackupRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.filestore.v1.CloudFilestoreServiceProto + .internal_static_google_cloud_filestore_v1_DeleteBackupRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.filestore.v1.CloudFilestoreServiceProto + .internal_static_google_cloud_filestore_v1_DeleteBackupRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.filestore.v1.DeleteBackupRequest.class, + com.google.cloud.filestore.v1.DeleteBackupRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Required. The backup resource name, in the format
+   * projects/{project_number}/locations/{location}/backups/{backup_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 backup resource name, in the format
+   * projects/{project_number}/locations/{location}/backups/{backup_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 (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + size += unknownFields.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.v1.DeleteBackupRequest)) { + return super.equals(obj); + } + com.google.cloud.filestore.v1.DeleteBackupRequest other = + (com.google.cloud.filestore.v1.DeleteBackupRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!unknownFields.equals(other.unknownFields)) 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) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.filestore.v1.DeleteBackupRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.filestore.v1.DeleteBackupRequest 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.v1.DeleteBackupRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.filestore.v1.DeleteBackupRequest 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.v1.DeleteBackupRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.filestore.v1.DeleteBackupRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.filestore.v1.DeleteBackupRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.filestore.v1.DeleteBackupRequest 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.v1.DeleteBackupRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.filestore.v1.DeleteBackupRequest 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.v1.DeleteBackupRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.filestore.v1.DeleteBackupRequest 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.v1.DeleteBackupRequest 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; + } + /** + * + * + *
+   * DeleteBackupRequest deletes a backup.
+   * 
+ * + * Protobuf type {@code google.cloud.filestore.v1.DeleteBackupRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.filestore.v1.DeleteBackupRequest) + com.google.cloud.filestore.v1.DeleteBackupRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.filestore.v1.CloudFilestoreServiceProto + .internal_static_google_cloud_filestore_v1_DeleteBackupRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.filestore.v1.CloudFilestoreServiceProto + .internal_static_google_cloud_filestore_v1_DeleteBackupRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.filestore.v1.DeleteBackupRequest.class, + com.google.cloud.filestore.v1.DeleteBackupRequest.Builder.class); + } + + // Construct using com.google.cloud.filestore.v1.DeleteBackupRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @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.v1.CloudFilestoreServiceProto + .internal_static_google_cloud_filestore_v1_DeleteBackupRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.filestore.v1.DeleteBackupRequest getDefaultInstanceForType() { + return com.google.cloud.filestore.v1.DeleteBackupRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.filestore.v1.DeleteBackupRequest build() { + com.google.cloud.filestore.v1.DeleteBackupRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.filestore.v1.DeleteBackupRequest buildPartial() { + com.google.cloud.filestore.v1.DeleteBackupRequest result = + new com.google.cloud.filestore.v1.DeleteBackupRequest(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.v1.DeleteBackupRequest) { + return mergeFrom((com.google.cloud.filestore.v1.DeleteBackupRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.filestore.v1.DeleteBackupRequest other) { + if (other == com.google.cloud.filestore.v1.DeleteBackupRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + 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 { + com.google.cloud.filestore.v1.DeleteBackupRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.filestore.v1.DeleteBackupRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. The backup resource name, in the format
+     * projects/{project_number}/locations/{location}/backups/{backup_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 backup resource name, in the format
+     * projects/{project_number}/locations/{location}/backups/{backup_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 backup resource name, in the format
+     * projects/{project_number}/locations/{location}/backups/{backup_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 backup resource name, in the format
+     * projects/{project_number}/locations/{location}/backups/{backup_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 backup resource name, in the format
+     * projects/{project_number}/locations/{location}/backups/{backup_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.v1.DeleteBackupRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.filestore.v1.DeleteBackupRequest) + private static final com.google.cloud.filestore.v1.DeleteBackupRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.filestore.v1.DeleteBackupRequest(); + } + + public static com.google.cloud.filestore.v1.DeleteBackupRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DeleteBackupRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new DeleteBackupRequest(input, extensionRegistry); + } + }; + + 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.v1.DeleteBackupRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-filestore-v1/src/main/java/com/google/cloud/filestore/v1/DeleteBackupRequestOrBuilder.java b/proto-google-cloud-filestore-v1/src/main/java/com/google/cloud/filestore/v1/DeleteBackupRequestOrBuilder.java new file mode 100644 index 00000000..9752dcb9 --- /dev/null +++ b/proto-google-cloud-filestore-v1/src/main/java/com/google/cloud/filestore/v1/DeleteBackupRequestOrBuilder.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/v1/cloud_filestore_service.proto + +package com.google.cloud.filestore.v1; + +public interface DeleteBackupRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.filestore.v1.DeleteBackupRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The backup resource name, in the format
+   * projects/{project_number}/locations/{location}/backups/{backup_id}
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. The backup resource name, in the format
+   * projects/{project_number}/locations/{location}/backups/{backup_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/proto-google-cloud-filestore-v1/src/main/java/com/google/cloud/filestore/v1/DeleteInstanceRequest.java b/proto-google-cloud-filestore-v1/src/main/java/com/google/cloud/filestore/v1/DeleteInstanceRequest.java new file mode 100644 index 00000000..7009d217 --- /dev/null +++ b/proto-google-cloud-filestore-v1/src/main/java/com/google/cloud/filestore/v1/DeleteInstanceRequest.java @@ -0,0 +1,657 @@ +/* + * 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/v1/cloud_filestore_service.proto + +package com.google.cloud.filestore.v1; + +/** + * + * + *
+ * DeleteInstanceRequest deletes an instance.
+ * 
+ * + * Protobuf type {@code google.cloud.filestore.v1.DeleteInstanceRequest} + */ +public final class DeleteInstanceRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.filestore.v1.DeleteInstanceRequest) + DeleteInstanceRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use DeleteInstanceRequest.newBuilder() to construct. + private DeleteInstanceRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private DeleteInstanceRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new DeleteInstanceRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private DeleteInstanceRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.filestore.v1.CloudFilestoreServiceProto + .internal_static_google_cloud_filestore_v1_DeleteInstanceRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.filestore.v1.CloudFilestoreServiceProto + .internal_static_google_cloud_filestore_v1_DeleteInstanceRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.filestore.v1.DeleteInstanceRequest.class, + com.google.cloud.filestore.v1.DeleteInstanceRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Required. The instance resource name, in the format
+   * projects/{project_id}/locations/{location}/instances/{instance_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 instance resource name, in the format
+   * projects/{project_id}/locations/{location}/instances/{instance_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 (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + size += unknownFields.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.v1.DeleteInstanceRequest)) { + return super.equals(obj); + } + com.google.cloud.filestore.v1.DeleteInstanceRequest other = + (com.google.cloud.filestore.v1.DeleteInstanceRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!unknownFields.equals(other.unknownFields)) 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) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.filestore.v1.DeleteInstanceRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.filestore.v1.DeleteInstanceRequest 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.v1.DeleteInstanceRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.filestore.v1.DeleteInstanceRequest 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.v1.DeleteInstanceRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.filestore.v1.DeleteInstanceRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.filestore.v1.DeleteInstanceRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.filestore.v1.DeleteInstanceRequest 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.v1.DeleteInstanceRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.filestore.v1.DeleteInstanceRequest 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.v1.DeleteInstanceRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.filestore.v1.DeleteInstanceRequest 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.v1.DeleteInstanceRequest 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; + } + /** + * + * + *
+   * DeleteInstanceRequest deletes an instance.
+   * 
+ * + * Protobuf type {@code google.cloud.filestore.v1.DeleteInstanceRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.filestore.v1.DeleteInstanceRequest) + com.google.cloud.filestore.v1.DeleteInstanceRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.filestore.v1.CloudFilestoreServiceProto + .internal_static_google_cloud_filestore_v1_DeleteInstanceRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.filestore.v1.CloudFilestoreServiceProto + .internal_static_google_cloud_filestore_v1_DeleteInstanceRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.filestore.v1.DeleteInstanceRequest.class, + com.google.cloud.filestore.v1.DeleteInstanceRequest.Builder.class); + } + + // Construct using com.google.cloud.filestore.v1.DeleteInstanceRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @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.v1.CloudFilestoreServiceProto + .internal_static_google_cloud_filestore_v1_DeleteInstanceRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.filestore.v1.DeleteInstanceRequest getDefaultInstanceForType() { + return com.google.cloud.filestore.v1.DeleteInstanceRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.filestore.v1.DeleteInstanceRequest build() { + com.google.cloud.filestore.v1.DeleteInstanceRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.filestore.v1.DeleteInstanceRequest buildPartial() { + com.google.cloud.filestore.v1.DeleteInstanceRequest result = + new com.google.cloud.filestore.v1.DeleteInstanceRequest(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.v1.DeleteInstanceRequest) { + return mergeFrom((com.google.cloud.filestore.v1.DeleteInstanceRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.filestore.v1.DeleteInstanceRequest other) { + if (other == com.google.cloud.filestore.v1.DeleteInstanceRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + 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 { + com.google.cloud.filestore.v1.DeleteInstanceRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.filestore.v1.DeleteInstanceRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. The instance resource name, in the format
+     * projects/{project_id}/locations/{location}/instances/{instance_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 instance resource name, in the format
+     * projects/{project_id}/locations/{location}/instances/{instance_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 instance resource name, in the format
+     * projects/{project_id}/locations/{location}/instances/{instance_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 instance resource name, in the format
+     * projects/{project_id}/locations/{location}/instances/{instance_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 instance resource name, in the format
+     * projects/{project_id}/locations/{location}/instances/{instance_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.v1.DeleteInstanceRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.filestore.v1.DeleteInstanceRequest) + private static final com.google.cloud.filestore.v1.DeleteInstanceRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.filestore.v1.DeleteInstanceRequest(); + } + + public static com.google.cloud.filestore.v1.DeleteInstanceRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DeleteInstanceRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new DeleteInstanceRequest(input, extensionRegistry); + } + }; + + 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.v1.DeleteInstanceRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-filestore-v1/src/main/java/com/google/cloud/filestore/v1/DeleteInstanceRequestOrBuilder.java b/proto-google-cloud-filestore-v1/src/main/java/com/google/cloud/filestore/v1/DeleteInstanceRequestOrBuilder.java new file mode 100644 index 00000000..71b2eee6 --- /dev/null +++ b/proto-google-cloud-filestore-v1/src/main/java/com/google/cloud/filestore/v1/DeleteInstanceRequestOrBuilder.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/v1/cloud_filestore_service.proto + +package com.google.cloud.filestore.v1; + +public interface DeleteInstanceRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.filestore.v1.DeleteInstanceRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The instance resource name, in the format
+   * projects/{project_id}/locations/{location}/instances/{instance_id}
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. The instance resource name, in the format
+   * projects/{project_id}/locations/{location}/instances/{instance_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/proto-google-cloud-filestore-v1/src/main/java/com/google/cloud/filestore/v1/FileShareConfig.java b/proto-google-cloud-filestore-v1/src/main/java/com/google/cloud/filestore/v1/FileShareConfig.java new file mode 100644 index 00000000..66369f81 --- /dev/null +++ b/proto-google-cloud-filestore-v1/src/main/java/com/google/cloud/filestore/v1/FileShareConfig.java @@ -0,0 +1,1585 @@ +/* + * 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/v1/cloud_filestore_service.proto + +package com.google.cloud.filestore.v1; + +/** + * + * + *
+ * File share configuration for the instance.
+ * 
+ * + * Protobuf type {@code google.cloud.filestore.v1.FileShareConfig} + */ +public final class FileShareConfig extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.filestore.v1.FileShareConfig) + FileShareConfigOrBuilder { + private static final long serialVersionUID = 0L; + // Use FileShareConfig.newBuilder() to construct. + private FileShareConfig(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private FileShareConfig() { + name_ = ""; + nfsExportOptions_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new FileShareConfig(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private FileShareConfig( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + case 16: + { + capacityGb_ = input.readInt64(); + break; + } + case 58: + { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + nfsExportOptions_ = + new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + nfsExportOptions_.add( + input.readMessage( + com.google.cloud.filestore.v1.NfsExportOptions.parser(), extensionRegistry)); + break; + } + case 66: + { + java.lang.String s = input.readStringRequireUtf8(); + sourceCase_ = 8; + source_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + nfsExportOptions_ = java.util.Collections.unmodifiableList(nfsExportOptions_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.filestore.v1.CloudFilestoreServiceProto + .internal_static_google_cloud_filestore_v1_FileShareConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.filestore.v1.CloudFilestoreServiceProto + .internal_static_google_cloud_filestore_v1_FileShareConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.filestore.v1.FileShareConfig.class, + com.google.cloud.filestore.v1.FileShareConfig.Builder.class); + } + + private int sourceCase_ = 0; + private java.lang.Object source_; + + public enum SourceCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + SOURCE_BACKUP(8), + SOURCE_NOT_SET(0); + private final int value; + + private SourceCase(int value) { + this.value = value; + } + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static SourceCase valueOf(int value) { + return forNumber(value); + } + + public static SourceCase forNumber(int value) { + switch (value) { + case 8: + return SOURCE_BACKUP; + case 0: + return SOURCE_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public SourceCase getSourceCase() { + return SourceCase.forNumber(sourceCase_); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * The name of the file share (must be 16 characters or less).
+   * 
+ * + * string name = 1; + * + * @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; + } + } + /** + * + * + *
+   * The name of the file share (must be 16 characters or less).
+   * 
+ * + * string name = 1; + * + * @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 CAPACITY_GB_FIELD_NUMBER = 2; + private long capacityGb_; + /** + * + * + *
+   * File share capacity in gigabytes (GB).
+   * Cloud Filestore defines 1 GB as 1024^3 bytes.
+   * 
+ * + * int64 capacity_gb = 2; + * + * @return The capacityGb. + */ + @java.lang.Override + public long getCapacityGb() { + return capacityGb_; + } + + public static final int SOURCE_BACKUP_FIELD_NUMBER = 8; + /** + * + * + *
+   * The resource name of the backup, in the format
+   * projects/{project_number}/locations/{location_id}/backups/{backup_id},
+   * that this file share has been restored from.
+   * 
+ * + * string source_backup = 8 [(.google.api.resource_reference) = { ... } + * + * @return Whether the sourceBackup field is set. + */ + public boolean hasSourceBackup() { + return sourceCase_ == 8; + } + /** + * + * + *
+   * The resource name of the backup, in the format
+   * projects/{project_number}/locations/{location_id}/backups/{backup_id},
+   * that this file share has been restored from.
+   * 
+ * + * string source_backup = 8 [(.google.api.resource_reference) = { ... } + * + * @return The sourceBackup. + */ + public java.lang.String getSourceBackup() { + java.lang.Object ref = ""; + if (sourceCase_ == 8) { + ref = source_; + } + 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(); + if (sourceCase_ == 8) { + source_ = s; + } + return s; + } + } + /** + * + * + *
+   * The resource name of the backup, in the format
+   * projects/{project_number}/locations/{location_id}/backups/{backup_id},
+   * that this file share has been restored from.
+   * 
+ * + * string source_backup = 8 [(.google.api.resource_reference) = { ... } + * + * @return The bytes for sourceBackup. + */ + public com.google.protobuf.ByteString getSourceBackupBytes() { + java.lang.Object ref = ""; + if (sourceCase_ == 8) { + ref = source_; + } + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + if (sourceCase_ == 8) { + source_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int NFS_EXPORT_OPTIONS_FIELD_NUMBER = 7; + private java.util.List nfsExportOptions_; + /** + * + * + *
+   * Nfs Export Options.
+   * There is a limit of 10 export options per file share.
+   * 
+ * + * repeated .google.cloud.filestore.v1.NfsExportOptions nfs_export_options = 7; + */ + @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.v1.NfsExportOptions nfs_export_options = 7; + */ + @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.v1.NfsExportOptions nfs_export_options = 7; + */ + @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.v1.NfsExportOptions nfs_export_options = 7; + */ + @java.lang.Override + public com.google.cloud.filestore.v1.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.v1.NfsExportOptions nfs_export_options = 7; + */ + @java.lang.Override + public com.google.cloud.filestore.v1.NfsExportOptionsOrBuilder getNfsExportOptionsOrBuilder( + int index) { + return nfsExportOptions_.get(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 { + if (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (capacityGb_ != 0L) { + output.writeInt64(2, capacityGb_); + } + for (int i = 0; i < nfsExportOptions_.size(); i++) { + output.writeMessage(7, nfsExportOptions_.get(i)); + } + if (sourceCase_ == 8) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 8, source_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (capacityGb_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(2, capacityGb_); + } + for (int i = 0; i < nfsExportOptions_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(7, nfsExportOptions_.get(i)); + } + if (sourceCase_ == 8) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(8, source_); + } + size += unknownFields.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.v1.FileShareConfig)) { + return super.equals(obj); + } + com.google.cloud.filestore.v1.FileShareConfig other = + (com.google.cloud.filestore.v1.FileShareConfig) obj; + + if (!getName().equals(other.getName())) return false; + if (getCapacityGb() != other.getCapacityGb()) return false; + if (!getNfsExportOptionsList().equals(other.getNfsExportOptionsList())) return false; + if (!getSourceCase().equals(other.getSourceCase())) return false; + switch (sourceCase_) { + case 8: + if (!getSourceBackup().equals(other.getSourceBackup())) return false; + break; + case 0: + default: + } + if (!unknownFields.equals(other.unknownFields)) 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) + 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(); + } + switch (sourceCase_) { + case 8: + hash = (37 * hash) + SOURCE_BACKUP_FIELD_NUMBER; + hash = (53 * hash) + getSourceBackup().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.filestore.v1.FileShareConfig parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.filestore.v1.FileShareConfig 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.v1.FileShareConfig parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.filestore.v1.FileShareConfig 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.v1.FileShareConfig parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.filestore.v1.FileShareConfig parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.filestore.v1.FileShareConfig parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.filestore.v1.FileShareConfig 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.v1.FileShareConfig parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.filestore.v1.FileShareConfig 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.v1.FileShareConfig parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.filestore.v1.FileShareConfig 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.v1.FileShareConfig 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; + } + /** + * + * + *
+   * File share configuration for the instance.
+   * 
+ * + * Protobuf type {@code google.cloud.filestore.v1.FileShareConfig} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.filestore.v1.FileShareConfig) + com.google.cloud.filestore.v1.FileShareConfigOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.filestore.v1.CloudFilestoreServiceProto + .internal_static_google_cloud_filestore_v1_FileShareConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.filestore.v1.CloudFilestoreServiceProto + .internal_static_google_cloud_filestore_v1_FileShareConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.filestore.v1.FileShareConfig.class, + com.google.cloud.filestore.v1.FileShareConfig.Builder.class); + } + + // Construct using com.google.cloud.filestore.v1.FileShareConfig.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getNfsExportOptionsFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + capacityGb_ = 0L; + + if (nfsExportOptionsBuilder_ == null) { + nfsExportOptions_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + nfsExportOptionsBuilder_.clear(); + } + sourceCase_ = 0; + source_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.filestore.v1.CloudFilestoreServiceProto + .internal_static_google_cloud_filestore_v1_FileShareConfig_descriptor; + } + + @java.lang.Override + public com.google.cloud.filestore.v1.FileShareConfig getDefaultInstanceForType() { + return com.google.cloud.filestore.v1.FileShareConfig.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.filestore.v1.FileShareConfig build() { + com.google.cloud.filestore.v1.FileShareConfig result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.filestore.v1.FileShareConfig buildPartial() { + com.google.cloud.filestore.v1.FileShareConfig result = + new com.google.cloud.filestore.v1.FileShareConfig(this); + int from_bitField0_ = bitField0_; + result.name_ = name_; + result.capacityGb_ = capacityGb_; + if (sourceCase_ == 8) { + result.source_ = source_; + } + 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.sourceCase_ = sourceCase_; + 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.v1.FileShareConfig) { + return mergeFrom((com.google.cloud.filestore.v1.FileShareConfig) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.filestore.v1.FileShareConfig other) { + if (other == com.google.cloud.filestore.v1.FileShareConfig.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + 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_); + } + } + } + switch (other.getSourceCase()) { + case SOURCE_BACKUP: + { + sourceCase_ = 8; + source_ = other.source_; + onChanged(); + break; + } + case SOURCE_NOT_SET: + { + break; + } + } + this.mergeUnknownFields(other.unknownFields); + 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 { + com.google.cloud.filestore.v1.FileShareConfig parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.filestore.v1.FileShareConfig) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int sourceCase_ = 0; + private java.lang.Object source_; + + public SourceCase getSourceCase() { + return SourceCase.forNumber(sourceCase_); + } + + public Builder clearSource() { + sourceCase_ = 0; + source_ = null; + onChanged(); + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * The name of the file share (must be 16 characters or less).
+     * 
+ * + * string name = 1; + * + * @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; + } + } + /** + * + * + *
+     * The name of the file share (must be 16 characters or less).
+     * 
+ * + * string name = 1; + * + * @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; + } + } + /** + * + * + *
+     * The name of the file share (must be 16 characters or less).
+     * 
+ * + * string name = 1; + * + * @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; + } + /** + * + * + *
+     * The name of the file share (must be 16 characters or less).
+     * 
+ * + * string name = 1; + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * The name of the file share (must be 16 characters or less).
+     * 
+ * + * string name = 1; + * + * @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 long capacityGb_; + /** + * + * + *
+     * File share capacity in gigabytes (GB).
+     * Cloud Filestore defines 1 GB as 1024^3 bytes.
+     * 
+ * + * int64 capacity_gb = 2; + * + * @return The capacityGb. + */ + @java.lang.Override + public long getCapacityGb() { + return capacityGb_; + } + /** + * + * + *
+     * File share capacity in gigabytes (GB).
+     * Cloud Filestore defines 1 GB as 1024^3 bytes.
+     * 
+ * + * int64 capacity_gb = 2; + * + * @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).
+     * Cloud Filestore defines 1 GB as 1024^3 bytes.
+     * 
+ * + * int64 capacity_gb = 2; + * + * @return This builder for chaining. + */ + public Builder clearCapacityGb() { + + capacityGb_ = 0L; + onChanged(); + return this; + } + + /** + * + * + *
+     * The resource name of the backup, in the format
+     * projects/{project_number}/locations/{location_id}/backups/{backup_id},
+     * that this file share has been restored from.
+     * 
+ * + * string source_backup = 8 [(.google.api.resource_reference) = { ... } + * + * @return Whether the sourceBackup field is set. + */ + @java.lang.Override + public boolean hasSourceBackup() { + return sourceCase_ == 8; + } + /** + * + * + *
+     * The resource name of the backup, in the format
+     * projects/{project_number}/locations/{location_id}/backups/{backup_id},
+     * that this file share has been restored from.
+     * 
+ * + * string source_backup = 8 [(.google.api.resource_reference) = { ... } + * + * @return The sourceBackup. + */ + @java.lang.Override + public java.lang.String getSourceBackup() { + java.lang.Object ref = ""; + if (sourceCase_ == 8) { + ref = source_; + } + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (sourceCase_ == 8) { + source_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The resource name of the backup, in the format
+     * projects/{project_number}/locations/{location_id}/backups/{backup_id},
+     * that this file share has been restored from.
+     * 
+ * + * string source_backup = 8 [(.google.api.resource_reference) = { ... } + * + * @return The bytes for sourceBackup. + */ + @java.lang.Override + public com.google.protobuf.ByteString getSourceBackupBytes() { + java.lang.Object ref = ""; + if (sourceCase_ == 8) { + ref = source_; + } + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + if (sourceCase_ == 8) { + source_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The resource name of the backup, in the format
+     * projects/{project_number}/locations/{location_id}/backups/{backup_id},
+     * that this file share has been restored from.
+     * 
+ * + * string source_backup = 8 [(.google.api.resource_reference) = { ... } + * + * @param value The sourceBackup to set. + * @return This builder for chaining. + */ + public Builder setSourceBackup(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + sourceCase_ = 8; + source_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The resource name of the backup, in the format
+     * projects/{project_number}/locations/{location_id}/backups/{backup_id},
+     * that this file share has been restored from.
+     * 
+ * + * string source_backup = 8 [(.google.api.resource_reference) = { ... } + * + * @return This builder for chaining. + */ + public Builder clearSourceBackup() { + if (sourceCase_ == 8) { + sourceCase_ = 0; + source_ = null; + onChanged(); + } + return this; + } + /** + * + * + *
+     * The resource name of the backup, in the format
+     * projects/{project_number}/locations/{location_id}/backups/{backup_id},
+     * that this file share has been restored from.
+     * 
+ * + * string source_backup = 8 [(.google.api.resource_reference) = { ... } + * + * @param value The bytes for sourceBackup to set. + * @return This builder for chaining. + */ + public Builder setSourceBackupBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + sourceCase_ = 8; + source_ = value; + 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.v1.NfsExportOptions, + com.google.cloud.filestore.v1.NfsExportOptions.Builder, + com.google.cloud.filestore.v1.NfsExportOptionsOrBuilder> + nfsExportOptionsBuilder_; + + /** + * + * + *
+     * Nfs Export Options.
+     * There is a limit of 10 export options per file share.
+     * 
+ * + * repeated .google.cloud.filestore.v1.NfsExportOptions nfs_export_options = 7; + */ + 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.v1.NfsExportOptions nfs_export_options = 7; + */ + 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.v1.NfsExportOptions nfs_export_options = 7; + */ + public com.google.cloud.filestore.v1.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.v1.NfsExportOptions nfs_export_options = 7; + */ + public Builder setNfsExportOptions( + int index, com.google.cloud.filestore.v1.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.v1.NfsExportOptions nfs_export_options = 7; + */ + public Builder setNfsExportOptions( + int index, com.google.cloud.filestore.v1.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.v1.NfsExportOptions nfs_export_options = 7; + */ + public Builder addNfsExportOptions(com.google.cloud.filestore.v1.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.v1.NfsExportOptions nfs_export_options = 7; + */ + public Builder addNfsExportOptions( + int index, com.google.cloud.filestore.v1.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.v1.NfsExportOptions nfs_export_options = 7; + */ + public Builder addNfsExportOptions( + com.google.cloud.filestore.v1.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.v1.NfsExportOptions nfs_export_options = 7; + */ + public Builder addNfsExportOptions( + int index, com.google.cloud.filestore.v1.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.v1.NfsExportOptions nfs_export_options = 7; + */ + 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.v1.NfsExportOptions nfs_export_options = 7; + */ + 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.v1.NfsExportOptions nfs_export_options = 7; + */ + 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.v1.NfsExportOptions nfs_export_options = 7; + */ + public com.google.cloud.filestore.v1.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.v1.NfsExportOptions nfs_export_options = 7; + */ + public com.google.cloud.filestore.v1.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.v1.NfsExportOptions nfs_export_options = 7; + */ + 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.v1.NfsExportOptions nfs_export_options = 7; + */ + public com.google.cloud.filestore.v1.NfsExportOptions.Builder addNfsExportOptionsBuilder() { + return getNfsExportOptionsFieldBuilder() + .addBuilder(com.google.cloud.filestore.v1.NfsExportOptions.getDefaultInstance()); + } + /** + * + * + *
+     * Nfs Export Options.
+     * There is a limit of 10 export options per file share.
+     * 
+ * + * repeated .google.cloud.filestore.v1.NfsExportOptions nfs_export_options = 7; + */ + public com.google.cloud.filestore.v1.NfsExportOptions.Builder addNfsExportOptionsBuilder( + int index) { + return getNfsExportOptionsFieldBuilder() + .addBuilder(index, com.google.cloud.filestore.v1.NfsExportOptions.getDefaultInstance()); + } + /** + * + * + *
+     * Nfs Export Options.
+     * There is a limit of 10 export options per file share.
+     * 
+ * + * repeated .google.cloud.filestore.v1.NfsExportOptions nfs_export_options = 7; + */ + public java.util.List + getNfsExportOptionsBuilderList() { + return getNfsExportOptionsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.filestore.v1.NfsExportOptions, + com.google.cloud.filestore.v1.NfsExportOptions.Builder, + com.google.cloud.filestore.v1.NfsExportOptionsOrBuilder> + getNfsExportOptionsFieldBuilder() { + if (nfsExportOptionsBuilder_ == null) { + nfsExportOptionsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.filestore.v1.NfsExportOptions, + com.google.cloud.filestore.v1.NfsExportOptions.Builder, + com.google.cloud.filestore.v1.NfsExportOptionsOrBuilder>( + nfsExportOptions_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + nfsExportOptions_ = null; + } + return nfsExportOptionsBuilder_; + } + + @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.v1.FileShareConfig) + } + + // @@protoc_insertion_point(class_scope:google.cloud.filestore.v1.FileShareConfig) + private static final com.google.cloud.filestore.v1.FileShareConfig DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.filestore.v1.FileShareConfig(); + } + + public static com.google.cloud.filestore.v1.FileShareConfig getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public FileShareConfig parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new FileShareConfig(input, extensionRegistry); + } + }; + + 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.v1.FileShareConfig getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-filestore-v1/src/main/java/com/google/cloud/filestore/v1/FileShareConfigOrBuilder.java b/proto-google-cloud-filestore-v1/src/main/java/com/google/cloud/filestore/v1/FileShareConfigOrBuilder.java new file mode 100644 index 00000000..7de499a4 --- /dev/null +++ b/proto-google-cloud-filestore-v1/src/main/java/com/google/cloud/filestore/v1/FileShareConfigOrBuilder.java @@ -0,0 +1,166 @@ +/* + * 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/v1/cloud_filestore_service.proto + +package com.google.cloud.filestore.v1; + +public interface FileShareConfigOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.filestore.v1.FileShareConfig) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The name of the file share (must be 16 characters or less).
+   * 
+ * + * string name = 1; + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * The name of the file share (must be 16 characters or less).
+   * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * File share capacity in gigabytes (GB).
+   * Cloud Filestore defines 1 GB as 1024^3 bytes.
+   * 
+ * + * int64 capacity_gb = 2; + * + * @return The capacityGb. + */ + long getCapacityGb(); + + /** + * + * + *
+   * The resource name of the backup, in the format
+   * projects/{project_number}/locations/{location_id}/backups/{backup_id},
+   * that this file share has been restored from.
+   * 
+ * + * string source_backup = 8 [(.google.api.resource_reference) = { ... } + * + * @return Whether the sourceBackup field is set. + */ + boolean hasSourceBackup(); + /** + * + * + *
+   * The resource name of the backup, in the format
+   * projects/{project_number}/locations/{location_id}/backups/{backup_id},
+   * that this file share has been restored from.
+   * 
+ * + * string source_backup = 8 [(.google.api.resource_reference) = { ... } + * + * @return The sourceBackup. + */ + java.lang.String getSourceBackup(); + /** + * + * + *
+   * The resource name of the backup, in the format
+   * projects/{project_number}/locations/{location_id}/backups/{backup_id},
+   * that this file share has been restored from.
+   * 
+ * + * string source_backup = 8 [(.google.api.resource_reference) = { ... } + * + * @return The bytes for sourceBackup. + */ + com.google.protobuf.ByteString getSourceBackupBytes(); + + /** + * + * + *
+   * Nfs Export Options.
+   * There is a limit of 10 export options per file share.
+   * 
+ * + * repeated .google.cloud.filestore.v1.NfsExportOptions nfs_export_options = 7; + */ + java.util.List getNfsExportOptionsList(); + /** + * + * + *
+   * Nfs Export Options.
+   * There is a limit of 10 export options per file share.
+   * 
+ * + * repeated .google.cloud.filestore.v1.NfsExportOptions nfs_export_options = 7; + */ + com.google.cloud.filestore.v1.NfsExportOptions getNfsExportOptions(int index); + /** + * + * + *
+   * Nfs Export Options.
+   * There is a limit of 10 export options per file share.
+   * 
+ * + * repeated .google.cloud.filestore.v1.NfsExportOptions nfs_export_options = 7; + */ + int getNfsExportOptionsCount(); + /** + * + * + *
+   * Nfs Export Options.
+   * There is a limit of 10 export options per file share.
+   * 
+ * + * repeated .google.cloud.filestore.v1.NfsExportOptions nfs_export_options = 7; + */ + java.util.List + getNfsExportOptionsOrBuilderList(); + /** + * + * + *
+   * Nfs Export Options.
+   * There is a limit of 10 export options per file share.
+   * 
+ * + * repeated .google.cloud.filestore.v1.NfsExportOptions nfs_export_options = 7; + */ + com.google.cloud.filestore.v1.NfsExportOptionsOrBuilder getNfsExportOptionsOrBuilder(int index); + + public com.google.cloud.filestore.v1.FileShareConfig.SourceCase getSourceCase(); +} diff --git a/proto-google-cloud-filestore-v1/src/main/java/com/google/cloud/filestore/v1/GetBackupRequest.java b/proto-google-cloud-filestore-v1/src/main/java/com/google/cloud/filestore/v1/GetBackupRequest.java new file mode 100644 index 00000000..e32ae1c2 --- /dev/null +++ b/proto-google-cloud-filestore-v1/src/main/java/com/google/cloud/filestore/v1/GetBackupRequest.java @@ -0,0 +1,655 @@ +/* + * 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/v1/cloud_filestore_service.proto + +package com.google.cloud.filestore.v1; + +/** + * + * + *
+ * GetBackupRequest gets the state of a backup.
+ * 
+ * + * Protobuf type {@code google.cloud.filestore.v1.GetBackupRequest} + */ +public final class GetBackupRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.filestore.v1.GetBackupRequest) + GetBackupRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use GetBackupRequest.newBuilder() to construct. + private GetBackupRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GetBackupRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GetBackupRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private GetBackupRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.filestore.v1.CloudFilestoreServiceProto + .internal_static_google_cloud_filestore_v1_GetBackupRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.filestore.v1.CloudFilestoreServiceProto + .internal_static_google_cloud_filestore_v1_GetBackupRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.filestore.v1.GetBackupRequest.class, + com.google.cloud.filestore.v1.GetBackupRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Required. The backup resource name, in the format
+   * projects/{project_number}/locations/{location}/backups/{backup_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 backup resource name, in the format
+   * projects/{project_number}/locations/{location}/backups/{backup_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 (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + size += unknownFields.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.v1.GetBackupRequest)) { + return super.equals(obj); + } + com.google.cloud.filestore.v1.GetBackupRequest other = + (com.google.cloud.filestore.v1.GetBackupRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!unknownFields.equals(other.unknownFields)) 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) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.filestore.v1.GetBackupRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.filestore.v1.GetBackupRequest 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.v1.GetBackupRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.filestore.v1.GetBackupRequest 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.v1.GetBackupRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.filestore.v1.GetBackupRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.filestore.v1.GetBackupRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.filestore.v1.GetBackupRequest 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.v1.GetBackupRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.filestore.v1.GetBackupRequest 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.v1.GetBackupRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.filestore.v1.GetBackupRequest 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.v1.GetBackupRequest 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; + } + /** + * + * + *
+   * GetBackupRequest gets the state of a backup.
+   * 
+ * + * Protobuf type {@code google.cloud.filestore.v1.GetBackupRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.filestore.v1.GetBackupRequest) + com.google.cloud.filestore.v1.GetBackupRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.filestore.v1.CloudFilestoreServiceProto + .internal_static_google_cloud_filestore_v1_GetBackupRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.filestore.v1.CloudFilestoreServiceProto + .internal_static_google_cloud_filestore_v1_GetBackupRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.filestore.v1.GetBackupRequest.class, + com.google.cloud.filestore.v1.GetBackupRequest.Builder.class); + } + + // Construct using com.google.cloud.filestore.v1.GetBackupRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @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.v1.CloudFilestoreServiceProto + .internal_static_google_cloud_filestore_v1_GetBackupRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.filestore.v1.GetBackupRequest getDefaultInstanceForType() { + return com.google.cloud.filestore.v1.GetBackupRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.filestore.v1.GetBackupRequest build() { + com.google.cloud.filestore.v1.GetBackupRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.filestore.v1.GetBackupRequest buildPartial() { + com.google.cloud.filestore.v1.GetBackupRequest result = + new com.google.cloud.filestore.v1.GetBackupRequest(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.v1.GetBackupRequest) { + return mergeFrom((com.google.cloud.filestore.v1.GetBackupRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.filestore.v1.GetBackupRequest other) { + if (other == com.google.cloud.filestore.v1.GetBackupRequest.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + 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 { + com.google.cloud.filestore.v1.GetBackupRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.filestore.v1.GetBackupRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. The backup resource name, in the format
+     * projects/{project_number}/locations/{location}/backups/{backup_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 backup resource name, in the format
+     * projects/{project_number}/locations/{location}/backups/{backup_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 backup resource name, in the format
+     * projects/{project_number}/locations/{location}/backups/{backup_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 backup resource name, in the format
+     * projects/{project_number}/locations/{location}/backups/{backup_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 backup resource name, in the format
+     * projects/{project_number}/locations/{location}/backups/{backup_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.v1.GetBackupRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.filestore.v1.GetBackupRequest) + private static final com.google.cloud.filestore.v1.GetBackupRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.filestore.v1.GetBackupRequest(); + } + + public static com.google.cloud.filestore.v1.GetBackupRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetBackupRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new GetBackupRequest(input, extensionRegistry); + } + }; + + 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.v1.GetBackupRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-filestore-v1/src/main/java/com/google/cloud/filestore/v1/GetBackupRequestOrBuilder.java b/proto-google-cloud-filestore-v1/src/main/java/com/google/cloud/filestore/v1/GetBackupRequestOrBuilder.java new file mode 100644 index 00000000..d0107925 --- /dev/null +++ b/proto-google-cloud-filestore-v1/src/main/java/com/google/cloud/filestore/v1/GetBackupRequestOrBuilder.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/v1/cloud_filestore_service.proto + +package com.google.cloud.filestore.v1; + +public interface GetBackupRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.filestore.v1.GetBackupRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The backup resource name, in the format
+   * projects/{project_number}/locations/{location}/backups/{backup_id}.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. The backup resource name, in the format
+   * projects/{project_number}/locations/{location}/backups/{backup_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/proto-google-cloud-filestore-v1/src/main/java/com/google/cloud/filestore/v1/GetInstanceRequest.java b/proto-google-cloud-filestore-v1/src/main/java/com/google/cloud/filestore/v1/GetInstanceRequest.java new file mode 100644 index 00000000..6b000c2c --- /dev/null +++ b/proto-google-cloud-filestore-v1/src/main/java/com/google/cloud/filestore/v1/GetInstanceRequest.java @@ -0,0 +1,656 @@ +/* + * 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/v1/cloud_filestore_service.proto + +package com.google.cloud.filestore.v1; + +/** + * + * + *
+ * GetInstanceRequest gets the state of an instance.
+ * 
+ * + * Protobuf type {@code google.cloud.filestore.v1.GetInstanceRequest} + */ +public final class GetInstanceRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.filestore.v1.GetInstanceRequest) + GetInstanceRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use GetInstanceRequest.newBuilder() to construct. + private GetInstanceRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GetInstanceRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GetInstanceRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private GetInstanceRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.filestore.v1.CloudFilestoreServiceProto + .internal_static_google_cloud_filestore_v1_GetInstanceRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.filestore.v1.CloudFilestoreServiceProto + .internal_static_google_cloud_filestore_v1_GetInstanceRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.filestore.v1.GetInstanceRequest.class, + com.google.cloud.filestore.v1.GetInstanceRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Required. The instance resource name, in the format
+   * projects/{project_id}/locations/{location}/instances/{instance_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 instance resource name, in the format
+   * projects/{project_id}/locations/{location}/instances/{instance_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 (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + size += unknownFields.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.v1.GetInstanceRequest)) { + return super.equals(obj); + } + com.google.cloud.filestore.v1.GetInstanceRequest other = + (com.google.cloud.filestore.v1.GetInstanceRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!unknownFields.equals(other.unknownFields)) 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) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.filestore.v1.GetInstanceRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.filestore.v1.GetInstanceRequest 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.v1.GetInstanceRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.filestore.v1.GetInstanceRequest 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.v1.GetInstanceRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.filestore.v1.GetInstanceRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.filestore.v1.GetInstanceRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.filestore.v1.GetInstanceRequest 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.v1.GetInstanceRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.filestore.v1.GetInstanceRequest 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.v1.GetInstanceRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.filestore.v1.GetInstanceRequest 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.v1.GetInstanceRequest 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; + } + /** + * + * + *
+   * GetInstanceRequest gets the state of an instance.
+   * 
+ * + * Protobuf type {@code google.cloud.filestore.v1.GetInstanceRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.filestore.v1.GetInstanceRequest) + com.google.cloud.filestore.v1.GetInstanceRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.filestore.v1.CloudFilestoreServiceProto + .internal_static_google_cloud_filestore_v1_GetInstanceRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.filestore.v1.CloudFilestoreServiceProto + .internal_static_google_cloud_filestore_v1_GetInstanceRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.filestore.v1.GetInstanceRequest.class, + com.google.cloud.filestore.v1.GetInstanceRequest.Builder.class); + } + + // Construct using com.google.cloud.filestore.v1.GetInstanceRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @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.v1.CloudFilestoreServiceProto + .internal_static_google_cloud_filestore_v1_GetInstanceRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.filestore.v1.GetInstanceRequest getDefaultInstanceForType() { + return com.google.cloud.filestore.v1.GetInstanceRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.filestore.v1.GetInstanceRequest build() { + com.google.cloud.filestore.v1.GetInstanceRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.filestore.v1.GetInstanceRequest buildPartial() { + com.google.cloud.filestore.v1.GetInstanceRequest result = + new com.google.cloud.filestore.v1.GetInstanceRequest(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.v1.GetInstanceRequest) { + return mergeFrom((com.google.cloud.filestore.v1.GetInstanceRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.filestore.v1.GetInstanceRequest other) { + if (other == com.google.cloud.filestore.v1.GetInstanceRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + 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 { + com.google.cloud.filestore.v1.GetInstanceRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.filestore.v1.GetInstanceRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. The instance resource name, in the format
+     * projects/{project_id}/locations/{location}/instances/{instance_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 instance resource name, in the format
+     * projects/{project_id}/locations/{location}/instances/{instance_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 instance resource name, in the format
+     * projects/{project_id}/locations/{location}/instances/{instance_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 instance resource name, in the format
+     * projects/{project_id}/locations/{location}/instances/{instance_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 instance resource name, in the format
+     * projects/{project_id}/locations/{location}/instances/{instance_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.v1.GetInstanceRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.filestore.v1.GetInstanceRequest) + private static final com.google.cloud.filestore.v1.GetInstanceRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.filestore.v1.GetInstanceRequest(); + } + + public static com.google.cloud.filestore.v1.GetInstanceRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetInstanceRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new GetInstanceRequest(input, extensionRegistry); + } + }; + + 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.v1.GetInstanceRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-filestore-v1/src/main/java/com/google/cloud/filestore/v1/GetInstanceRequestOrBuilder.java b/proto-google-cloud-filestore-v1/src/main/java/com/google/cloud/filestore/v1/GetInstanceRequestOrBuilder.java new file mode 100644 index 00000000..c5a02e27 --- /dev/null +++ b/proto-google-cloud-filestore-v1/src/main/java/com/google/cloud/filestore/v1/GetInstanceRequestOrBuilder.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/v1/cloud_filestore_service.proto + +package com.google.cloud.filestore.v1; + +public interface GetInstanceRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.filestore.v1.GetInstanceRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The instance resource name, in the format
+   * projects/{project_id}/locations/{location}/instances/{instance_id}.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. The instance resource name, in the format
+   * projects/{project_id}/locations/{location}/instances/{instance_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/proto-google-cloud-filestore-v1/src/main/java/com/google/cloud/filestore/v1/Instance.java b/proto-google-cloud-filestore-v1/src/main/java/com/google/cloud/filestore/v1/Instance.java new file mode 100644 index 00000000..6c099bd4 --- /dev/null +++ b/proto-google-cloud-filestore-v1/src/main/java/com/google/cloud/filestore/v1/Instance.java @@ -0,0 +1,3927 @@ +/* + * 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/v1/cloud_filestore_service.proto + +package com.google.cloud.filestore.v1; + +/** + * + * + *
+ * A Cloud Filestore instance.
+ * 
+ * + * Protobuf type {@code google.cloud.filestore.v1.Instance} + */ +public final class Instance extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.filestore.v1.Instance) + InstanceOrBuilder { + private static final long serialVersionUID = 0L; + // Use Instance.newBuilder() to construct. + private Instance(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Instance() { + name_ = ""; + description_ = ""; + state_ = 0; + statusMessage_ = ""; + tier_ = 0; + fileShares_ = java.util.Collections.emptyList(); + networks_ = java.util.Collections.emptyList(); + etag_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Instance(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private Instance( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + description_ = s; + break; + } + case 40: + { + int rawValue = input.readEnum(); + + state_ = rawValue; + break; + } + case 50: + { + java.lang.String s = input.readStringRequireUtf8(); + + statusMessage_ = s; + break; + } + case 58: + { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (createTime_ != null) { + subBuilder = createTime_.toBuilder(); + } + createTime_ = + input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(createTime_); + createTime_ = subBuilder.buildPartial(); + } + + break; + } + case 64: + { + int rawValue = input.readEnum(); + + tier_ = rawValue; + break; + } + case 74: + { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + labels_ = + com.google.protobuf.MapField.newMapField(LabelsDefaultEntryHolder.defaultEntry); + mutable_bitField0_ |= 0x00000001; + } + com.google.protobuf.MapEntry labels__ = + input.readMessage( + LabelsDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); + labels_.getMutableMap().put(labels__.getKey(), labels__.getValue()); + break; + } + case 82: + { + if (!((mutable_bitField0_ & 0x00000002) != 0)) { + fileShares_ = + new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000002; + } + fileShares_.add( + input.readMessage( + com.google.cloud.filestore.v1.FileShareConfig.parser(), extensionRegistry)); + break; + } + case 90: + { + if (!((mutable_bitField0_ & 0x00000004) != 0)) { + networks_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000004; + } + networks_.add( + input.readMessage( + com.google.cloud.filestore.v1.NetworkConfig.parser(), extensionRegistry)); + break; + } + case 98: + { + java.lang.String s = input.readStringRequireUtf8(); + + etag_ = s; + break; + } + case 106: + { + com.google.protobuf.BoolValue.Builder subBuilder = null; + if (satisfiesPzs_ != null) { + subBuilder = satisfiesPzs_.toBuilder(); + } + satisfiesPzs_ = + input.readMessage(com.google.protobuf.BoolValue.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(satisfiesPzs_); + satisfiesPzs_ = subBuilder.buildPartial(); + } + + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000002) != 0)) { + fileShares_ = java.util.Collections.unmodifiableList(fileShares_); + } + if (((mutable_bitField0_ & 0x00000004) != 0)) { + networks_ = java.util.Collections.unmodifiableList(networks_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.filestore.v1.CloudFilestoreServiceProto + .internal_static_google_cloud_filestore_v1_Instance_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 9: + 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.v1.CloudFilestoreServiceProto + .internal_static_google_cloud_filestore_v1_Instance_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.filestore.v1.Instance.class, + com.google.cloud.filestore.v1.Instance.Builder.class); + } + + /** + * + * + *
+   * The instance state.
+   * 
+ * + * Protobuf enum {@code google.cloud.filestore.v1.Instance.State} + */ + public enum State implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * State not set.
+     * 
+ * + * STATE_UNSPECIFIED = 0; + */ + STATE_UNSPECIFIED(0), + /** + * + * + *
+     * The instance is being created.
+     * 
+ * + * CREATING = 1; + */ + CREATING(1), + /** + * + * + *
+     * The instance is available for use.
+     * 
+ * + * READY = 2; + */ + READY(2), + /** + * + * + *
+     * Work is being done on the instance. You can get further details from the
+     * `statusMessage` field of the `Instance` resource.
+     * 
+ * + * REPAIRING = 3; + */ + REPAIRING(3), + /** + * + * + *
+     * The instance is shutting down.
+     * 
+ * + * DELETING = 4; + */ + DELETING(4), + /** + * + * + *
+     * The instance is experiencing an issue and might be unusable. You can get
+     * further details from the `statusMessage` field of the `Instance`
+     * resource.
+     * 
+ * + * ERROR = 6; + */ + ERROR(6), + /** + * + * + *
+     * The instance is restoring a backup to an existing file share and may be
+     * unusable during this time.
+     * 
+ * + * RESTORING = 7; + */ + RESTORING(7), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * State not set.
+     * 
+ * + * STATE_UNSPECIFIED = 0; + */ + public static final int STATE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * The instance is being created.
+     * 
+ * + * CREATING = 1; + */ + public static final int CREATING_VALUE = 1; + /** + * + * + *
+     * The instance is available for use.
+     * 
+ * + * READY = 2; + */ + public static final int READY_VALUE = 2; + /** + * + * + *
+     * Work is being done on the instance. You can get further details from the
+     * `statusMessage` field of the `Instance` resource.
+     * 
+ * + * REPAIRING = 3; + */ + public static final int REPAIRING_VALUE = 3; + /** + * + * + *
+     * The instance is shutting down.
+     * 
+ * + * DELETING = 4; + */ + public static final int DELETING_VALUE = 4; + /** + * + * + *
+     * The instance is experiencing an issue and might be unusable. You can get
+     * further details from the `statusMessage` field of the `Instance`
+     * resource.
+     * 
+ * + * ERROR = 6; + */ + public static final int ERROR_VALUE = 6; + /** + * + * + *
+     * The instance is restoring a backup to an existing file share and may be
+     * unusable during this time.
+     * 
+ * + * RESTORING = 7; + */ + public static final int RESTORING_VALUE = 7; + + 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 2: + return READY; + case 3: + return REPAIRING; + case 4: + return DELETING; + case 6: + return ERROR; + case 7: + return RESTORING; + 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.v1.Instance.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.v1.Instance.State) + } + + /** + * + * + *
+   * Available service tiers.
+   * 
+ * + * Protobuf enum {@code google.cloud.filestore.v1.Instance.Tier} + */ + public enum Tier implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Not set.
+     * 
+ * + * TIER_UNSPECIFIED = 0; + */ + TIER_UNSPECIFIED(0), + /** + * + * + *
+     * STANDARD tier.
+     * 
+ * + * STANDARD = 1; + */ + STANDARD(1), + /** + * + * + *
+     * PREMIUM tier.
+     * 
+ * + * PREMIUM = 2; + */ + PREMIUM(2), + /** + * + * + *
+     * BASIC instances offer a maximum capacity of 63.9 TB.
+     * BASIC_HDD is an alias for STANDARD Tier, offering economical
+     * performance backed by HDD.
+     * 
+ * + * BASIC_HDD = 3; + */ + BASIC_HDD(3), + /** + * + * + *
+     * BASIC instances offer a maximum capacity of 63.9 TB.
+     * BASIC_SSD is an alias for PREMIUM Tier, and offers improved
+     * performance backed by SSD.
+     * 
+ * + * BASIC_SSD = 4; + */ + BASIC_SSD(4), + /** + * + * + *
+     * HIGH_SCALE instances offer expanded capacity and performance scaling
+     * capabilities.
+     * 
+ * + * HIGH_SCALE_SSD = 5; + */ + HIGH_SCALE_SSD(5), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * Not set.
+     * 
+ * + * TIER_UNSPECIFIED = 0; + */ + public static final int TIER_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * STANDARD tier.
+     * 
+ * + * STANDARD = 1; + */ + public static final int STANDARD_VALUE = 1; + /** + * + * + *
+     * PREMIUM tier.
+     * 
+ * + * PREMIUM = 2; + */ + public static final int PREMIUM_VALUE = 2; + /** + * + * + *
+     * BASIC instances offer a maximum capacity of 63.9 TB.
+     * BASIC_HDD is an alias for STANDARD Tier, offering economical
+     * performance backed by HDD.
+     * 
+ * + * BASIC_HDD = 3; + */ + public static final int BASIC_HDD_VALUE = 3; + /** + * + * + *
+     * BASIC instances offer a maximum capacity of 63.9 TB.
+     * BASIC_SSD is an alias for PREMIUM Tier, and offers improved
+     * performance backed by SSD.
+     * 
+ * + * BASIC_SSD = 4; + */ + public static final int BASIC_SSD_VALUE = 4; + /** + * + * + *
+     * HIGH_SCALE instances offer expanded capacity and performance scaling
+     * capabilities.
+     * 
+ * + * HIGH_SCALE_SSD = 5; + */ + public static final int HIGH_SCALE_SSD_VALUE = 5; + + 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 Tier 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 Tier forNumber(int value) { + switch (value) { + case 0: + return TIER_UNSPECIFIED; + case 1: + return STANDARD; + case 2: + return PREMIUM; + case 3: + return BASIC_HDD; + case 4: + return BASIC_SSD; + case 5: + return HIGH_SCALE_SSD; + 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 Tier findValueByNumber(int number) { + return Tier.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.v1.Instance.getDescriptor().getEnumTypes().get(1); + } + + private static final Tier[] VALUES = values(); + + public static Tier 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 Tier(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.filestore.v1.Instance.Tier) + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Output only. The resource name of the instance, in the format
+   * projects/{project}/locations/{location}/instances/{instance}.
+   * 
+ * + * 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 instance, in the format
+   * projects/{project}/locations/{location}/instances/{instance}.
+   * 
+ * + * 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 DESCRIPTION_FIELD_NUMBER = 2; + private volatile java.lang.Object description_; + /** + * + * + *
+   * The description of the instance (2048 characters or less).
+   * 
+ * + * string description = 2; + * + * @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; + } + } + /** + * + * + *
+   * The description of the instance (2048 characters or less).
+   * 
+ * + * string description = 2; + * + * @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 STATE_FIELD_NUMBER = 5; + private int state_; + /** + * + * + *
+   * Output only. The instance state.
+   * 
+ * + * + * .google.cloud.filestore.v1.Instance.State state = 5 [(.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 instance state.
+   * 
+ * + * + * .google.cloud.filestore.v1.Instance.State state = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The state. + */ + @java.lang.Override + public com.google.cloud.filestore.v1.Instance.State getState() { + @SuppressWarnings("deprecation") + com.google.cloud.filestore.v1.Instance.State result = + com.google.cloud.filestore.v1.Instance.State.valueOf(state_); + return result == null ? com.google.cloud.filestore.v1.Instance.State.UNRECOGNIZED : result; + } + + public static final int STATUS_MESSAGE_FIELD_NUMBER = 6; + private volatile java.lang.Object statusMessage_; + /** + * + * + *
+   * Output only. Additional information about the instance state, if available.
+   * 
+ * + * string status_message = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The statusMessage. + */ + @java.lang.Override + public java.lang.String getStatusMessage() { + java.lang.Object ref = statusMessage_; + 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(); + statusMessage_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. Additional information about the instance state, if available.
+   * 
+ * + * string status_message = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for statusMessage. + */ + @java.lang.Override + public com.google.protobuf.ByteString getStatusMessageBytes() { + java.lang.Object ref = statusMessage_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + statusMessage_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CREATE_TIME_FIELD_NUMBER = 7; + private com.google.protobuf.Timestamp createTime_; + /** + * + * + *
+   * Output only. The time when the instance 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 instance 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 instance 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 TIER_FIELD_NUMBER = 8; + private int tier_; + /** + * + * + *
+   * The service tier of the instance.
+   * 
+ * + * .google.cloud.filestore.v1.Instance.Tier tier = 8; + * + * @return The enum numeric value on the wire for tier. + */ + @java.lang.Override + public int getTierValue() { + return tier_; + } + /** + * + * + *
+   * The service tier of the instance.
+   * 
+ * + * .google.cloud.filestore.v1.Instance.Tier tier = 8; + * + * @return The tier. + */ + @java.lang.Override + public com.google.cloud.filestore.v1.Instance.Tier getTier() { + @SuppressWarnings("deprecation") + com.google.cloud.filestore.v1.Instance.Tier result = + com.google.cloud.filestore.v1.Instance.Tier.valueOf(tier_); + return result == null ? com.google.cloud.filestore.v1.Instance.Tier.UNRECOGNIZED : result; + } + + public static final int LABELS_FIELD_NUMBER = 9; + + private static final class LabelsDefaultEntryHolder { + static final com.google.protobuf.MapEntry defaultEntry = + com.google.protobuf.MapEntry.newDefaultInstance( + com.google.cloud.filestore.v1.CloudFilestoreServiceProto + .internal_static_google_cloud_filestore_v1_Instance_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 = 9; + */ + @java.lang.Override + public boolean containsLabels(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + 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 = 9; + */ + @java.lang.Override + public java.util.Map getLabelsMap() { + return internalGetLabels().getMap(); + } + /** + * + * + *
+   * Resource labels to represent user provided metadata.
+   * 
+ * + * map<string, string> labels = 9; + */ + @java.lang.Override + public java.lang.String getLabelsOrDefault(java.lang.String key, java.lang.String defaultValue) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + 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 = 9; + */ + @java.lang.Override + public java.lang.String getLabelsOrThrow(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = internalGetLabels().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public static final int FILE_SHARES_FIELD_NUMBER = 10; + private java.util.List fileShares_; + /** + * + * + *
+   * File system shares on the instance.
+   * For this version, only a single file share is supported.
+   * 
+ * + * repeated .google.cloud.filestore.v1.FileShareConfig file_shares = 10; + */ + @java.lang.Override + public java.util.List getFileSharesList() { + return fileShares_; + } + /** + * + * + *
+   * File system shares on the instance.
+   * For this version, only a single file share is supported.
+   * 
+ * + * repeated .google.cloud.filestore.v1.FileShareConfig file_shares = 10; + */ + @java.lang.Override + public java.util.List + getFileSharesOrBuilderList() { + return fileShares_; + } + /** + * + * + *
+   * File system shares on the instance.
+   * For this version, only a single file share is supported.
+   * 
+ * + * repeated .google.cloud.filestore.v1.FileShareConfig file_shares = 10; + */ + @java.lang.Override + public int getFileSharesCount() { + return fileShares_.size(); + } + /** + * + * + *
+   * File system shares on the instance.
+   * For this version, only a single file share is supported.
+   * 
+ * + * repeated .google.cloud.filestore.v1.FileShareConfig file_shares = 10; + */ + @java.lang.Override + public com.google.cloud.filestore.v1.FileShareConfig getFileShares(int index) { + return fileShares_.get(index); + } + /** + * + * + *
+   * File system shares on the instance.
+   * For this version, only a single file share is supported.
+   * 
+ * + * repeated .google.cloud.filestore.v1.FileShareConfig file_shares = 10; + */ + @java.lang.Override + public com.google.cloud.filestore.v1.FileShareConfigOrBuilder getFileSharesOrBuilder(int index) { + return fileShares_.get(index); + } + + public static final int NETWORKS_FIELD_NUMBER = 11; + private java.util.List networks_; + /** + * + * + *
+   * VPC networks to which the instance is connected.
+   * For this version, only a single network is supported.
+   * 
+ * + * repeated .google.cloud.filestore.v1.NetworkConfig networks = 11; + */ + @java.lang.Override + public java.util.List getNetworksList() { + return networks_; + } + /** + * + * + *
+   * VPC networks to which the instance is connected.
+   * For this version, only a single network is supported.
+   * 
+ * + * repeated .google.cloud.filestore.v1.NetworkConfig networks = 11; + */ + @java.lang.Override + public java.util.List + getNetworksOrBuilderList() { + return networks_; + } + /** + * + * + *
+   * VPC networks to which the instance is connected.
+   * For this version, only a single network is supported.
+   * 
+ * + * repeated .google.cloud.filestore.v1.NetworkConfig networks = 11; + */ + @java.lang.Override + public int getNetworksCount() { + return networks_.size(); + } + /** + * + * + *
+   * VPC networks to which the instance is connected.
+   * For this version, only a single network is supported.
+   * 
+ * + * repeated .google.cloud.filestore.v1.NetworkConfig networks = 11; + */ + @java.lang.Override + public com.google.cloud.filestore.v1.NetworkConfig getNetworks(int index) { + return networks_.get(index); + } + /** + * + * + *
+   * VPC networks to which the instance is connected.
+   * For this version, only a single network is supported.
+   * 
+ * + * repeated .google.cloud.filestore.v1.NetworkConfig networks = 11; + */ + @java.lang.Override + public com.google.cloud.filestore.v1.NetworkConfigOrBuilder getNetworksOrBuilder(int index) { + return networks_.get(index); + } + + public static final int ETAG_FIELD_NUMBER = 12; + private volatile java.lang.Object etag_; + /** + * + * + *
+   * Server-specified ETag for the instance resource to prevent simultaneous
+   * updates from overwriting each other.
+   * 
+ * + * string etag = 12; + * + * @return The etag. + */ + @java.lang.Override + public java.lang.String getEtag() { + java.lang.Object ref = etag_; + 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(); + etag_ = s; + return s; + } + } + /** + * + * + *
+   * Server-specified ETag for the instance resource to prevent simultaneous
+   * updates from overwriting each other.
+   * 
+ * + * string etag = 12; + * + * @return The bytes for etag. + */ + @java.lang.Override + public com.google.protobuf.ByteString getEtagBytes() { + java.lang.Object ref = etag_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + etag_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SATISFIES_PZS_FIELD_NUMBER = 13; + private com.google.protobuf.BoolValue satisfiesPzs_; + /** + * + * + *
+   * Output only. Reserved for future use.
+   * 
+ * + * + * .google.protobuf.BoolValue satisfies_pzs = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the satisfiesPzs field is set. + */ + @java.lang.Override + public boolean hasSatisfiesPzs() { + return satisfiesPzs_ != null; + } + /** + * + * + *
+   * Output only. Reserved for future use.
+   * 
+ * + * + * .google.protobuf.BoolValue satisfies_pzs = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The satisfiesPzs. + */ + @java.lang.Override + public com.google.protobuf.BoolValue getSatisfiesPzs() { + return satisfiesPzs_ == null + ? com.google.protobuf.BoolValue.getDefaultInstance() + : satisfiesPzs_; + } + /** + * + * + *
+   * Output only. Reserved for future use.
+   * 
+ * + * + * .google.protobuf.BoolValue satisfies_pzs = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.BoolValueOrBuilder getSatisfiesPzsOrBuilder() { + return getSatisfiesPzs(); + } + + 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 (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (!getDescriptionBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, description_); + } + if (state_ != com.google.cloud.filestore.v1.Instance.State.STATE_UNSPECIFIED.getNumber()) { + output.writeEnum(5, state_); + } + if (!getStatusMessageBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 6, statusMessage_); + } + if (createTime_ != null) { + output.writeMessage(7, getCreateTime()); + } + if (tier_ != com.google.cloud.filestore.v1.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 (!getEtagBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 12, etag_); + } + if (satisfiesPzs_ != null) { + output.writeMessage(13, getSatisfiesPzs()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (!getDescriptionBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, description_); + } + if (state_ != com.google.cloud.filestore.v1.Instance.State.STATE_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(5, state_); + } + if (!getStatusMessageBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, statusMessage_); + } + if (createTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(7, getCreateTime()); + } + if (tier_ != com.google.cloud.filestore.v1.Instance.Tier.TIER_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(8, tier_); + } + 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(9, labels__); + } + for (int i = 0; i < fileShares_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(10, fileShares_.get(i)); + } + for (int i = 0; i < networks_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(11, networks_.get(i)); + } + if (!getEtagBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(12, etag_); + } + if (satisfiesPzs_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(13, getSatisfiesPzs()); + } + size += unknownFields.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.v1.Instance)) { + return super.equals(obj); + } + com.google.cloud.filestore.v1.Instance other = (com.google.cloud.filestore.v1.Instance) obj; + + if (!getName().equals(other.getName())) return false; + if (!getDescription().equals(other.getDescription())) return false; + if (state_ != other.state_) return false; + if (!getStatusMessage().equals(other.getStatusMessage())) return false; + if (hasCreateTime() != other.hasCreateTime()) return false; + if (hasCreateTime()) { + if (!getCreateTime().equals(other.getCreateTime())) return false; + } + if (tier_ != other.tier_) return false; + if (!internalGetLabels().equals(other.internalGetLabels())) return false; + if (!getFileSharesList().equals(other.getFileSharesList())) return false; + if (!getNetworksList().equals(other.getNetworksList())) return false; + if (!getEtag().equals(other.getEtag())) return false; + if (hasSatisfiesPzs() != other.hasSatisfiesPzs()) return false; + if (hasSatisfiesPzs()) { + if (!getSatisfiesPzs().equals(other.getSatisfiesPzs())) return false; + } + if (!unknownFields.equals(other.unknownFields)) 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) + DESCRIPTION_FIELD_NUMBER; + hash = (53 * hash) + getDescription().hashCode(); + hash = (37 * hash) + STATE_FIELD_NUMBER; + hash = (53 * hash) + state_; + hash = (37 * hash) + STATUS_MESSAGE_FIELD_NUMBER; + hash = (53 * hash) + getStatusMessage().hashCode(); + if (hasCreateTime()) { + hash = (37 * hash) + CREATE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getCreateTime().hashCode(); + } + hash = (37 * hash) + TIER_FIELD_NUMBER; + hash = (53 * hash) + tier_; + if (!internalGetLabels().getMap().isEmpty()) { + hash = (37 * hash) + LABELS_FIELD_NUMBER; + hash = (53 * hash) + internalGetLabels().hashCode(); + } + if (getFileSharesCount() > 0) { + hash = (37 * hash) + FILE_SHARES_FIELD_NUMBER; + hash = (53 * hash) + getFileSharesList().hashCode(); + } + if (getNetworksCount() > 0) { + hash = (37 * hash) + NETWORKS_FIELD_NUMBER; + hash = (53 * hash) + getNetworksList().hashCode(); + } + hash = (37 * hash) + ETAG_FIELD_NUMBER; + hash = (53 * hash) + getEtag().hashCode(); + if (hasSatisfiesPzs()) { + hash = (37 * hash) + SATISFIES_PZS_FIELD_NUMBER; + hash = (53 * hash) + getSatisfiesPzs().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.filestore.v1.Instance parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.filestore.v1.Instance 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.v1.Instance parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.filestore.v1.Instance 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.v1.Instance parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.filestore.v1.Instance parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.filestore.v1.Instance parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.filestore.v1.Instance 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.v1.Instance parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.filestore.v1.Instance 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.v1.Instance parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.filestore.v1.Instance 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.v1.Instance 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 Cloud Filestore instance.
+   * 
+ * + * Protobuf type {@code google.cloud.filestore.v1.Instance} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.filestore.v1.Instance) + com.google.cloud.filestore.v1.InstanceOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.filestore.v1.CloudFilestoreServiceProto + .internal_static_google_cloud_filestore_v1_Instance_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 9: + return internalGetLabels(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMutableMapField(int number) { + switch (number) { + case 9: + 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.v1.CloudFilestoreServiceProto + .internal_static_google_cloud_filestore_v1_Instance_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.filestore.v1.Instance.class, + com.google.cloud.filestore.v1.Instance.Builder.class); + } + + // Construct using com.google.cloud.filestore.v1.Instance.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getFileSharesFieldBuilder(); + getNetworksFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + description_ = ""; + + state_ = 0; + + statusMessage_ = ""; + + if (createTimeBuilder_ == null) { + createTime_ = null; + } else { + createTime_ = null; + createTimeBuilder_ = null; + } + tier_ = 0; + + internalGetMutableLabels().clear(); + if (fileSharesBuilder_ == null) { + fileShares_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + } else { + fileSharesBuilder_.clear(); + } + if (networksBuilder_ == null) { + networks_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000004); + } else { + networksBuilder_.clear(); + } + etag_ = ""; + + if (satisfiesPzsBuilder_ == null) { + satisfiesPzs_ = null; + } else { + satisfiesPzs_ = null; + satisfiesPzsBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.filestore.v1.CloudFilestoreServiceProto + .internal_static_google_cloud_filestore_v1_Instance_descriptor; + } + + @java.lang.Override + public com.google.cloud.filestore.v1.Instance getDefaultInstanceForType() { + return com.google.cloud.filestore.v1.Instance.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.filestore.v1.Instance build() { + com.google.cloud.filestore.v1.Instance result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.filestore.v1.Instance buildPartial() { + com.google.cloud.filestore.v1.Instance result = + new com.google.cloud.filestore.v1.Instance(this); + int from_bitField0_ = bitField0_; + result.name_ = name_; + result.description_ = description_; + result.state_ = state_; + result.statusMessage_ = statusMessage_; + if (createTimeBuilder_ == null) { + result.createTime_ = createTime_; + } else { + result.createTime_ = createTimeBuilder_.build(); + } + result.tier_ = tier_; + result.labels_ = internalGetLabels(); + result.labels_.makeImmutable(); + if (fileSharesBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0)) { + fileShares_ = java.util.Collections.unmodifiableList(fileShares_); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.fileShares_ = fileShares_; + } else { + result.fileShares_ = fileSharesBuilder_.build(); + } + if (networksBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0)) { + networks_ = java.util.Collections.unmodifiableList(networks_); + bitField0_ = (bitField0_ & ~0x00000004); + } + result.networks_ = networks_; + } else { + result.networks_ = networksBuilder_.build(); + } + result.etag_ = etag_; + if (satisfiesPzsBuilder_ == null) { + result.satisfiesPzs_ = satisfiesPzs_; + } else { + result.satisfiesPzs_ = satisfiesPzsBuilder_.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.v1.Instance) { + return mergeFrom((com.google.cloud.filestore.v1.Instance) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.filestore.v1.Instance other) { + if (other == com.google.cloud.filestore.v1.Instance.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (!other.getDescription().isEmpty()) { + description_ = other.description_; + onChanged(); + } + if (other.state_ != 0) { + setStateValue(other.getStateValue()); + } + if (!other.getStatusMessage().isEmpty()) { + statusMessage_ = other.statusMessage_; + onChanged(); + } + if (other.hasCreateTime()) { + mergeCreateTime(other.getCreateTime()); + } + if (other.tier_ != 0) { + setTierValue(other.getTierValue()); + } + internalGetMutableLabels().mergeFrom(other.internalGetLabels()); + if (fileSharesBuilder_ == null) { + if (!other.fileShares_.isEmpty()) { + if (fileShares_.isEmpty()) { + fileShares_ = other.fileShares_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureFileSharesIsMutable(); + fileShares_.addAll(other.fileShares_); + } + onChanged(); + } + } else { + if (!other.fileShares_.isEmpty()) { + if (fileSharesBuilder_.isEmpty()) { + fileSharesBuilder_.dispose(); + fileSharesBuilder_ = null; + fileShares_ = other.fileShares_; + bitField0_ = (bitField0_ & ~0x00000002); + fileSharesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getFileSharesFieldBuilder() + : null; + } else { + fileSharesBuilder_.addAllMessages(other.fileShares_); + } + } + } + if (networksBuilder_ == null) { + if (!other.networks_.isEmpty()) { + if (networks_.isEmpty()) { + networks_ = other.networks_; + bitField0_ = (bitField0_ & ~0x00000004); + } else { + ensureNetworksIsMutable(); + networks_.addAll(other.networks_); + } + onChanged(); + } + } else { + if (!other.networks_.isEmpty()) { + if (networksBuilder_.isEmpty()) { + networksBuilder_.dispose(); + networksBuilder_ = null; + networks_ = other.networks_; + bitField0_ = (bitField0_ & ~0x00000004); + networksBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getNetworksFieldBuilder() + : null; + } else { + networksBuilder_.addAllMessages(other.networks_); + } + } + } + if (!other.getEtag().isEmpty()) { + etag_ = other.etag_; + onChanged(); + } + if (other.hasSatisfiesPzs()) { + mergeSatisfiesPzs(other.getSatisfiesPzs()); + } + this.mergeUnknownFields(other.unknownFields); + 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 { + com.google.cloud.filestore.v1.Instance parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.filestore.v1.Instance) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Output only. The resource name of the instance, in the format
+     * projects/{project}/locations/{location}/instances/{instance}.
+     * 
+ * + * 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 instance, in the format
+     * projects/{project}/locations/{location}/instances/{instance}.
+     * 
+ * + * 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 instance, in the format
+     * projects/{project}/locations/{location}/instances/{instance}.
+     * 
+ * + * 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 instance, in the format
+     * projects/{project}/locations/{location}/instances/{instance}.
+     * 
+ * + * 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 instance, in the format
+     * projects/{project}/locations/{location}/instances/{instance}.
+     * 
+ * + * 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 description_ = ""; + /** + * + * + *
+     * The description of the instance (2048 characters or less).
+     * 
+ * + * string description = 2; + * + * @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; + } + } + /** + * + * + *
+     * The description of the instance (2048 characters or less).
+     * 
+ * + * string description = 2; + * + * @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; + } + } + /** + * + * + *
+     * The description of the instance (2048 characters or less).
+     * 
+ * + * string description = 2; + * + * @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; + } + /** + * + * + *
+     * The description of the instance (2048 characters or less).
+     * 
+ * + * string description = 2; + * + * @return This builder for chaining. + */ + public Builder clearDescription() { + + description_ = getDefaultInstance().getDescription(); + onChanged(); + return this; + } + /** + * + * + *
+     * The description of the instance (2048 characters or less).
+     * 
+ * + * string description = 2; + * + * @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 int state_ = 0; + /** + * + * + *
+     * Output only. The instance state.
+     * 
+ * + * + * .google.cloud.filestore.v1.Instance.State state = 5 [(.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 instance state.
+     * 
+ * + * + * .google.cloud.filestore.v1.Instance.State state = 5 [(.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 instance state.
+     * 
+ * + * + * .google.cloud.filestore.v1.Instance.State state = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The state. + */ + @java.lang.Override + public com.google.cloud.filestore.v1.Instance.State getState() { + @SuppressWarnings("deprecation") + com.google.cloud.filestore.v1.Instance.State result = + com.google.cloud.filestore.v1.Instance.State.valueOf(state_); + return result == null ? com.google.cloud.filestore.v1.Instance.State.UNRECOGNIZED : result; + } + /** + * + * + *
+     * Output only. The instance state.
+     * 
+ * + * + * .google.cloud.filestore.v1.Instance.State state = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The state to set. + * @return This builder for chaining. + */ + public Builder setState(com.google.cloud.filestore.v1.Instance.State value) { + if (value == null) { + throw new NullPointerException(); + } + + state_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The instance state.
+     * 
+ * + * + * .google.cloud.filestore.v1.Instance.State state = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return This builder for chaining. + */ + public Builder clearState() { + + state_ = 0; + onChanged(); + return this; + } + + private java.lang.Object statusMessage_ = ""; + /** + * + * + *
+     * Output only. Additional information about the instance state, if available.
+     * 
+ * + * string status_message = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The statusMessage. + */ + public java.lang.String getStatusMessage() { + java.lang.Object ref = statusMessage_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + statusMessage_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. Additional information about the instance state, if available.
+     * 
+ * + * string status_message = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for statusMessage. + */ + public com.google.protobuf.ByteString getStatusMessageBytes() { + java.lang.Object ref = statusMessage_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + statusMessage_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. Additional information about the instance state, if available.
+     * 
+ * + * string status_message = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The statusMessage to set. + * @return This builder for chaining. + */ + public Builder setStatusMessage(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + statusMessage_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Additional information about the instance state, if available.
+     * 
+ * + * string status_message = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearStatusMessage() { + + statusMessage_ = getDefaultInstance().getStatusMessage(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Additional information about the instance state, if available.
+     * 
+ * + * string status_message = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for statusMessage to set. + * @return This builder for chaining. + */ + public Builder setStatusMessageBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + statusMessage_ = value; + 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 instance 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 instance 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 instance 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 instance 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 instance 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 instance 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 instance 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 instance 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 instance 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 int tier_ = 0; + /** + * + * + *
+     * The service tier of the instance.
+     * 
+ * + * .google.cloud.filestore.v1.Instance.Tier tier = 8; + * + * @return The enum numeric value on the wire for tier. + */ + @java.lang.Override + public int getTierValue() { + return tier_; + } + /** + * + * + *
+     * The service tier of the instance.
+     * 
+ * + * .google.cloud.filestore.v1.Instance.Tier tier = 8; + * + * @param value The enum numeric value on the wire for tier to set. + * @return This builder for chaining. + */ + public Builder setTierValue(int value) { + + tier_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The service tier of the instance.
+     * 
+ * + * .google.cloud.filestore.v1.Instance.Tier tier = 8; + * + * @return The tier. + */ + @java.lang.Override + public com.google.cloud.filestore.v1.Instance.Tier getTier() { + @SuppressWarnings("deprecation") + com.google.cloud.filestore.v1.Instance.Tier result = + com.google.cloud.filestore.v1.Instance.Tier.valueOf(tier_); + return result == null ? com.google.cloud.filestore.v1.Instance.Tier.UNRECOGNIZED : result; + } + /** + * + * + *
+     * The service tier of the instance.
+     * 
+ * + * .google.cloud.filestore.v1.Instance.Tier tier = 8; + * + * @param value The tier to set. + * @return This builder for chaining. + */ + public Builder setTier(com.google.cloud.filestore.v1.Instance.Tier value) { + if (value == null) { + throw new NullPointerException(); + } + + tier_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * The service tier of the instance.
+     * 
+ * + * .google.cloud.filestore.v1.Instance.Tier tier = 8; + * + * @return This builder for chaining. + */ + public Builder clearTier() { + + tier_ = 0; + onChanged(); + return this; + } + + 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 = 9; + */ + @java.lang.Override + public boolean containsLabels(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + 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 = 9; + */ + @java.lang.Override + public java.util.Map getLabelsMap() { + return internalGetLabels().getMap(); + } + /** + * + * + *
+     * Resource labels to represent user provided metadata.
+     * 
+ * + * map<string, string> labels = 9; + */ + @java.lang.Override + public java.lang.String getLabelsOrDefault( + java.lang.String key, java.lang.String defaultValue) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + 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 = 9; + */ + @java.lang.Override + public java.lang.String getLabelsOrThrow(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + 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 = 9; + */ + public Builder removeLabels(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + 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 = 9; + */ + public Builder putLabels(java.lang.String key, java.lang.String value) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + if (value == null) { + throw new java.lang.NullPointerException(); + } + internalGetMutableLabels().getMutableMap().put(key, value); + return this; + } + /** + * + * + *
+     * Resource labels to represent user provided metadata.
+     * 
+ * + * map<string, string> labels = 9; + */ + public Builder putAllLabels(java.util.Map values) { + internalGetMutableLabels().getMutableMap().putAll(values); + return this; + } + + private java.util.List fileShares_ = + java.util.Collections.emptyList(); + + private void ensureFileSharesIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + fileShares_ = + new java.util.ArrayList(fileShares_); + bitField0_ |= 0x00000002; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.filestore.v1.FileShareConfig, + com.google.cloud.filestore.v1.FileShareConfig.Builder, + com.google.cloud.filestore.v1.FileShareConfigOrBuilder> + fileSharesBuilder_; + + /** + * + * + *
+     * File system shares on the instance.
+     * For this version, only a single file share is supported.
+     * 
+ * + * repeated .google.cloud.filestore.v1.FileShareConfig file_shares = 10; + */ + public java.util.List getFileSharesList() { + if (fileSharesBuilder_ == null) { + return java.util.Collections.unmodifiableList(fileShares_); + } else { + return fileSharesBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * File system shares on the instance.
+     * For this version, only a single file share is supported.
+     * 
+ * + * repeated .google.cloud.filestore.v1.FileShareConfig file_shares = 10; + */ + public int getFileSharesCount() { + if (fileSharesBuilder_ == null) { + return fileShares_.size(); + } else { + return fileSharesBuilder_.getCount(); + } + } + /** + * + * + *
+     * File system shares on the instance.
+     * For this version, only a single file share is supported.
+     * 
+ * + * repeated .google.cloud.filestore.v1.FileShareConfig file_shares = 10; + */ + public com.google.cloud.filestore.v1.FileShareConfig getFileShares(int index) { + if (fileSharesBuilder_ == null) { + return fileShares_.get(index); + } else { + return fileSharesBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * File system shares on the instance.
+     * For this version, only a single file share is supported.
+     * 
+ * + * repeated .google.cloud.filestore.v1.FileShareConfig file_shares = 10; + */ + public Builder setFileShares(int index, com.google.cloud.filestore.v1.FileShareConfig value) { + if (fileSharesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureFileSharesIsMutable(); + fileShares_.set(index, value); + onChanged(); + } else { + fileSharesBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * File system shares on the instance.
+     * For this version, only a single file share is supported.
+     * 
+ * + * repeated .google.cloud.filestore.v1.FileShareConfig file_shares = 10; + */ + public Builder setFileShares( + int index, com.google.cloud.filestore.v1.FileShareConfig.Builder builderForValue) { + if (fileSharesBuilder_ == null) { + ensureFileSharesIsMutable(); + fileShares_.set(index, builderForValue.build()); + onChanged(); + } else { + fileSharesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * File system shares on the instance.
+     * For this version, only a single file share is supported.
+     * 
+ * + * repeated .google.cloud.filestore.v1.FileShareConfig file_shares = 10; + */ + public Builder addFileShares(com.google.cloud.filestore.v1.FileShareConfig value) { + if (fileSharesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureFileSharesIsMutable(); + fileShares_.add(value); + onChanged(); + } else { + fileSharesBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * File system shares on the instance.
+     * For this version, only a single file share is supported.
+     * 
+ * + * repeated .google.cloud.filestore.v1.FileShareConfig file_shares = 10; + */ + public Builder addFileShares(int index, com.google.cloud.filestore.v1.FileShareConfig value) { + if (fileSharesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureFileSharesIsMutable(); + fileShares_.add(index, value); + onChanged(); + } else { + fileSharesBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * File system shares on the instance.
+     * For this version, only a single file share is supported.
+     * 
+ * + * repeated .google.cloud.filestore.v1.FileShareConfig file_shares = 10; + */ + public Builder addFileShares( + com.google.cloud.filestore.v1.FileShareConfig.Builder builderForValue) { + if (fileSharesBuilder_ == null) { + ensureFileSharesIsMutable(); + fileShares_.add(builderForValue.build()); + onChanged(); + } else { + fileSharesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * File system shares on the instance.
+     * For this version, only a single file share is supported.
+     * 
+ * + * repeated .google.cloud.filestore.v1.FileShareConfig file_shares = 10; + */ + public Builder addFileShares( + int index, com.google.cloud.filestore.v1.FileShareConfig.Builder builderForValue) { + if (fileSharesBuilder_ == null) { + ensureFileSharesIsMutable(); + fileShares_.add(index, builderForValue.build()); + onChanged(); + } else { + fileSharesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * File system shares on the instance.
+     * For this version, only a single file share is supported.
+     * 
+ * + * repeated .google.cloud.filestore.v1.FileShareConfig file_shares = 10; + */ + public Builder addAllFileShares( + java.lang.Iterable values) { + if (fileSharesBuilder_ == null) { + ensureFileSharesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, fileShares_); + onChanged(); + } else { + fileSharesBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * File system shares on the instance.
+     * For this version, only a single file share is supported.
+     * 
+ * + * repeated .google.cloud.filestore.v1.FileShareConfig file_shares = 10; + */ + public Builder clearFileShares() { + if (fileSharesBuilder_ == null) { + fileShares_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + } else { + fileSharesBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * File system shares on the instance.
+     * For this version, only a single file share is supported.
+     * 
+ * + * repeated .google.cloud.filestore.v1.FileShareConfig file_shares = 10; + */ + public Builder removeFileShares(int index) { + if (fileSharesBuilder_ == null) { + ensureFileSharesIsMutable(); + fileShares_.remove(index); + onChanged(); + } else { + fileSharesBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * File system shares on the instance.
+     * For this version, only a single file share is supported.
+     * 
+ * + * repeated .google.cloud.filestore.v1.FileShareConfig file_shares = 10; + */ + public com.google.cloud.filestore.v1.FileShareConfig.Builder getFileSharesBuilder(int index) { + return getFileSharesFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * File system shares on the instance.
+     * For this version, only a single file share is supported.
+     * 
+ * + * repeated .google.cloud.filestore.v1.FileShareConfig file_shares = 10; + */ + public com.google.cloud.filestore.v1.FileShareConfigOrBuilder getFileSharesOrBuilder( + int index) { + if (fileSharesBuilder_ == null) { + return fileShares_.get(index); + } else { + return fileSharesBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * File system shares on the instance.
+     * For this version, only a single file share is supported.
+     * 
+ * + * repeated .google.cloud.filestore.v1.FileShareConfig file_shares = 10; + */ + public java.util.List + getFileSharesOrBuilderList() { + if (fileSharesBuilder_ != null) { + return fileSharesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(fileShares_); + } + } + /** + * + * + *
+     * File system shares on the instance.
+     * For this version, only a single file share is supported.
+     * 
+ * + * repeated .google.cloud.filestore.v1.FileShareConfig file_shares = 10; + */ + public com.google.cloud.filestore.v1.FileShareConfig.Builder addFileSharesBuilder() { + return getFileSharesFieldBuilder() + .addBuilder(com.google.cloud.filestore.v1.FileShareConfig.getDefaultInstance()); + } + /** + * + * + *
+     * File system shares on the instance.
+     * For this version, only a single file share is supported.
+     * 
+ * + * repeated .google.cloud.filestore.v1.FileShareConfig file_shares = 10; + */ + public com.google.cloud.filestore.v1.FileShareConfig.Builder addFileSharesBuilder(int index) { + return getFileSharesFieldBuilder() + .addBuilder(index, com.google.cloud.filestore.v1.FileShareConfig.getDefaultInstance()); + } + /** + * + * + *
+     * File system shares on the instance.
+     * For this version, only a single file share is supported.
+     * 
+ * + * repeated .google.cloud.filestore.v1.FileShareConfig file_shares = 10; + */ + public java.util.List + getFileSharesBuilderList() { + return getFileSharesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.filestore.v1.FileShareConfig, + com.google.cloud.filestore.v1.FileShareConfig.Builder, + com.google.cloud.filestore.v1.FileShareConfigOrBuilder> + getFileSharesFieldBuilder() { + if (fileSharesBuilder_ == null) { + fileSharesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.filestore.v1.FileShareConfig, + com.google.cloud.filestore.v1.FileShareConfig.Builder, + com.google.cloud.filestore.v1.FileShareConfigOrBuilder>( + fileShares_, ((bitField0_ & 0x00000002) != 0), getParentForChildren(), isClean()); + fileShares_ = null; + } + return fileSharesBuilder_; + } + + private java.util.List networks_ = + java.util.Collections.emptyList(); + + private void ensureNetworksIsMutable() { + if (!((bitField0_ & 0x00000004) != 0)) { + networks_ = new java.util.ArrayList(networks_); + bitField0_ |= 0x00000004; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.filestore.v1.NetworkConfig, + com.google.cloud.filestore.v1.NetworkConfig.Builder, + com.google.cloud.filestore.v1.NetworkConfigOrBuilder> + networksBuilder_; + + /** + * + * + *
+     * VPC networks to which the instance is connected.
+     * For this version, only a single network is supported.
+     * 
+ * + * repeated .google.cloud.filestore.v1.NetworkConfig networks = 11; + */ + public java.util.List getNetworksList() { + if (networksBuilder_ == null) { + return java.util.Collections.unmodifiableList(networks_); + } else { + return networksBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * VPC networks to which the instance is connected.
+     * For this version, only a single network is supported.
+     * 
+ * + * repeated .google.cloud.filestore.v1.NetworkConfig networks = 11; + */ + public int getNetworksCount() { + if (networksBuilder_ == null) { + return networks_.size(); + } else { + return networksBuilder_.getCount(); + } + } + /** + * + * + *
+     * VPC networks to which the instance is connected.
+     * For this version, only a single network is supported.
+     * 
+ * + * repeated .google.cloud.filestore.v1.NetworkConfig networks = 11; + */ + public com.google.cloud.filestore.v1.NetworkConfig getNetworks(int index) { + if (networksBuilder_ == null) { + return networks_.get(index); + } else { + return networksBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * VPC networks to which the instance is connected.
+     * For this version, only a single network is supported.
+     * 
+ * + * repeated .google.cloud.filestore.v1.NetworkConfig networks = 11; + */ + public Builder setNetworks(int index, com.google.cloud.filestore.v1.NetworkConfig value) { + if (networksBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureNetworksIsMutable(); + networks_.set(index, value); + onChanged(); + } else { + networksBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * VPC networks to which the instance is connected.
+     * For this version, only a single network is supported.
+     * 
+ * + * repeated .google.cloud.filestore.v1.NetworkConfig networks = 11; + */ + public Builder setNetworks( + int index, com.google.cloud.filestore.v1.NetworkConfig.Builder builderForValue) { + if (networksBuilder_ == null) { + ensureNetworksIsMutable(); + networks_.set(index, builderForValue.build()); + onChanged(); + } else { + networksBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * VPC networks to which the instance is connected.
+     * For this version, only a single network is supported.
+     * 
+ * + * repeated .google.cloud.filestore.v1.NetworkConfig networks = 11; + */ + public Builder addNetworks(com.google.cloud.filestore.v1.NetworkConfig value) { + if (networksBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureNetworksIsMutable(); + networks_.add(value); + onChanged(); + } else { + networksBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * VPC networks to which the instance is connected.
+     * For this version, only a single network is supported.
+     * 
+ * + * repeated .google.cloud.filestore.v1.NetworkConfig networks = 11; + */ + public Builder addNetworks(int index, com.google.cloud.filestore.v1.NetworkConfig value) { + if (networksBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureNetworksIsMutable(); + networks_.add(index, value); + onChanged(); + } else { + networksBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * VPC networks to which the instance is connected.
+     * For this version, only a single network is supported.
+     * 
+ * + * repeated .google.cloud.filestore.v1.NetworkConfig networks = 11; + */ + public Builder addNetworks( + com.google.cloud.filestore.v1.NetworkConfig.Builder builderForValue) { + if (networksBuilder_ == null) { + ensureNetworksIsMutable(); + networks_.add(builderForValue.build()); + onChanged(); + } else { + networksBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * VPC networks to which the instance is connected.
+     * For this version, only a single network is supported.
+     * 
+ * + * repeated .google.cloud.filestore.v1.NetworkConfig networks = 11; + */ + public Builder addNetworks( + int index, com.google.cloud.filestore.v1.NetworkConfig.Builder builderForValue) { + if (networksBuilder_ == null) { + ensureNetworksIsMutable(); + networks_.add(index, builderForValue.build()); + onChanged(); + } else { + networksBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * VPC networks to which the instance is connected.
+     * For this version, only a single network is supported.
+     * 
+ * + * repeated .google.cloud.filestore.v1.NetworkConfig networks = 11; + */ + public Builder addAllNetworks( + java.lang.Iterable values) { + if (networksBuilder_ == null) { + ensureNetworksIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, networks_); + onChanged(); + } else { + networksBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * VPC networks to which the instance is connected.
+     * For this version, only a single network is supported.
+     * 
+ * + * repeated .google.cloud.filestore.v1.NetworkConfig networks = 11; + */ + public Builder clearNetworks() { + if (networksBuilder_ == null) { + networks_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + } else { + networksBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * VPC networks to which the instance is connected.
+     * For this version, only a single network is supported.
+     * 
+ * + * repeated .google.cloud.filestore.v1.NetworkConfig networks = 11; + */ + public Builder removeNetworks(int index) { + if (networksBuilder_ == null) { + ensureNetworksIsMutable(); + networks_.remove(index); + onChanged(); + } else { + networksBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * VPC networks to which the instance is connected.
+     * For this version, only a single network is supported.
+     * 
+ * + * repeated .google.cloud.filestore.v1.NetworkConfig networks = 11; + */ + public com.google.cloud.filestore.v1.NetworkConfig.Builder getNetworksBuilder(int index) { + return getNetworksFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * VPC networks to which the instance is connected.
+     * For this version, only a single network is supported.
+     * 
+ * + * repeated .google.cloud.filestore.v1.NetworkConfig networks = 11; + */ + public com.google.cloud.filestore.v1.NetworkConfigOrBuilder getNetworksOrBuilder(int index) { + if (networksBuilder_ == null) { + return networks_.get(index); + } else { + return networksBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * VPC networks to which the instance is connected.
+     * For this version, only a single network is supported.
+     * 
+ * + * repeated .google.cloud.filestore.v1.NetworkConfig networks = 11; + */ + public java.util.List + getNetworksOrBuilderList() { + if (networksBuilder_ != null) { + return networksBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(networks_); + } + } + /** + * + * + *
+     * VPC networks to which the instance is connected.
+     * For this version, only a single network is supported.
+     * 
+ * + * repeated .google.cloud.filestore.v1.NetworkConfig networks = 11; + */ + public com.google.cloud.filestore.v1.NetworkConfig.Builder addNetworksBuilder() { + return getNetworksFieldBuilder() + .addBuilder(com.google.cloud.filestore.v1.NetworkConfig.getDefaultInstance()); + } + /** + * + * + *
+     * VPC networks to which the instance is connected.
+     * For this version, only a single network is supported.
+     * 
+ * + * repeated .google.cloud.filestore.v1.NetworkConfig networks = 11; + */ + public com.google.cloud.filestore.v1.NetworkConfig.Builder addNetworksBuilder(int index) { + return getNetworksFieldBuilder() + .addBuilder(index, com.google.cloud.filestore.v1.NetworkConfig.getDefaultInstance()); + } + /** + * + * + *
+     * VPC networks to which the instance is connected.
+     * For this version, only a single network is supported.
+     * 
+ * + * repeated .google.cloud.filestore.v1.NetworkConfig networks = 11; + */ + public java.util.List + getNetworksBuilderList() { + return getNetworksFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.filestore.v1.NetworkConfig, + com.google.cloud.filestore.v1.NetworkConfig.Builder, + com.google.cloud.filestore.v1.NetworkConfigOrBuilder> + getNetworksFieldBuilder() { + if (networksBuilder_ == null) { + networksBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.filestore.v1.NetworkConfig, + com.google.cloud.filestore.v1.NetworkConfig.Builder, + com.google.cloud.filestore.v1.NetworkConfigOrBuilder>( + networks_, ((bitField0_ & 0x00000004) != 0), getParentForChildren(), isClean()); + networks_ = null; + } + return networksBuilder_; + } + + private java.lang.Object etag_ = ""; + /** + * + * + *
+     * Server-specified ETag for the instance resource to prevent simultaneous
+     * updates from overwriting each other.
+     * 
+ * + * string etag = 12; + * + * @return The etag. + */ + public java.lang.String getEtag() { + java.lang.Object ref = etag_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + etag_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Server-specified ETag for the instance resource to prevent simultaneous
+     * updates from overwriting each other.
+     * 
+ * + * string etag = 12; + * + * @return The bytes for etag. + */ + public com.google.protobuf.ByteString getEtagBytes() { + java.lang.Object ref = etag_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + etag_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Server-specified ETag for the instance resource to prevent simultaneous
+     * updates from overwriting each other.
+     * 
+ * + * string etag = 12; + * + * @param value The etag to set. + * @return This builder for chaining. + */ + public Builder setEtag(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + etag_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Server-specified ETag for the instance resource to prevent simultaneous
+     * updates from overwriting each other.
+     * 
+ * + * string etag = 12; + * + * @return This builder for chaining. + */ + public Builder clearEtag() { + + etag_ = getDefaultInstance().getEtag(); + onChanged(); + return this; + } + /** + * + * + *
+     * Server-specified ETag for the instance resource to prevent simultaneous
+     * updates from overwriting each other.
+     * 
+ * + * string etag = 12; + * + * @param value The bytes for etag to set. + * @return This builder for chaining. + */ + public Builder setEtagBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + etag_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.BoolValue satisfiesPzs_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder> + satisfiesPzsBuilder_; + /** + * + * + *
+     * Output only. Reserved for future use.
+     * 
+ * + * + * .google.protobuf.BoolValue satisfies_pzs = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the satisfiesPzs field is set. + */ + public boolean hasSatisfiesPzs() { + return satisfiesPzsBuilder_ != null || satisfiesPzs_ != null; + } + /** + * + * + *
+     * Output only. Reserved for future use.
+     * 
+ * + * + * .google.protobuf.BoolValue satisfies_pzs = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The satisfiesPzs. + */ + public com.google.protobuf.BoolValue getSatisfiesPzs() { + if (satisfiesPzsBuilder_ == null) { + return satisfiesPzs_ == null + ? com.google.protobuf.BoolValue.getDefaultInstance() + : satisfiesPzs_; + } else { + return satisfiesPzsBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Output only. Reserved for future use.
+     * 
+ * + * + * .google.protobuf.BoolValue satisfies_pzs = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setSatisfiesPzs(com.google.protobuf.BoolValue value) { + if (satisfiesPzsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + satisfiesPzs_ = value; + onChanged(); + } else { + satisfiesPzsBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Output only. Reserved for future use.
+     * 
+ * + * + * .google.protobuf.BoolValue satisfies_pzs = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setSatisfiesPzs(com.google.protobuf.BoolValue.Builder builderForValue) { + if (satisfiesPzsBuilder_ == null) { + satisfiesPzs_ = builderForValue.build(); + onChanged(); + } else { + satisfiesPzsBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Output only. Reserved for future use.
+     * 
+ * + * + * .google.protobuf.BoolValue satisfies_pzs = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeSatisfiesPzs(com.google.protobuf.BoolValue value) { + if (satisfiesPzsBuilder_ == null) { + if (satisfiesPzs_ != null) { + satisfiesPzs_ = + com.google.protobuf.BoolValue.newBuilder(satisfiesPzs_) + .mergeFrom(value) + .buildPartial(); + } else { + satisfiesPzs_ = value; + } + onChanged(); + } else { + satisfiesPzsBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Output only. Reserved for future use.
+     * 
+ * + * + * .google.protobuf.BoolValue satisfies_pzs = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearSatisfiesPzs() { + if (satisfiesPzsBuilder_ == null) { + satisfiesPzs_ = null; + onChanged(); + } else { + satisfiesPzs_ = null; + satisfiesPzsBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Output only. Reserved for future use.
+     * 
+ * + * + * .google.protobuf.BoolValue satisfies_pzs = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.BoolValue.Builder getSatisfiesPzsBuilder() { + + onChanged(); + return getSatisfiesPzsFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. Reserved for future use.
+     * 
+ * + * + * .google.protobuf.BoolValue satisfies_pzs = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.BoolValueOrBuilder getSatisfiesPzsOrBuilder() { + if (satisfiesPzsBuilder_ != null) { + return satisfiesPzsBuilder_.getMessageOrBuilder(); + } else { + return satisfiesPzs_ == null + ? com.google.protobuf.BoolValue.getDefaultInstance() + : satisfiesPzs_; + } + } + /** + * + * + *
+     * Output only. Reserved for future use.
+     * 
+ * + * + * .google.protobuf.BoolValue satisfies_pzs = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder> + getSatisfiesPzsFieldBuilder() { + if (satisfiesPzsBuilder_ == null) { + satisfiesPzsBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder>( + getSatisfiesPzs(), getParentForChildren(), isClean()); + satisfiesPzs_ = null; + } + return satisfiesPzsBuilder_; + } + + @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.v1.Instance) + } + + // @@protoc_insertion_point(class_scope:google.cloud.filestore.v1.Instance) + private static final com.google.cloud.filestore.v1.Instance DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.filestore.v1.Instance(); + } + + public static com.google.cloud.filestore.v1.Instance getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Instance parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Instance(input, extensionRegistry); + } + }; + + 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.v1.Instance getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-filestore-v1/src/main/java/com/google/cloud/filestore/v1/InstanceName.java b/proto-google-cloud-filestore-v1/src/main/java/com/google/cloud/filestore/v1/InstanceName.java new file mode 100644 index 00000000..8597b9db --- /dev/null +++ b/proto-google-cloud-filestore-v1/src/main/java/com/google/cloud/filestore/v1/InstanceName.java @@ -0,0 +1,223 @@ +/* + * Copyright 2021 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.v1; + +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 InstanceName implements ResourceName { + private static final PathTemplate PROJECT_LOCATION_INSTANCE = + PathTemplate.createWithoutUrlEncoding( + "projects/{project}/locations/{location}/instances/{instance}"); + private volatile Map fieldValuesMap; + private final String project; + private final String location; + private final String instance; + + @Deprecated + protected InstanceName() { + project = null; + location = null; + instance = null; + } + + private InstanceName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + location = Preconditions.checkNotNull(builder.getLocation()); + instance = Preconditions.checkNotNull(builder.getInstance()); + } + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getInstance() { + return instance; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static InstanceName of(String project, String location, String instance) { + return newBuilder().setProject(project).setLocation(location).setInstance(instance).build(); + } + + public static String format(String project, String location, String instance) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setInstance(instance) + .build() + .toString(); + } + + public static InstanceName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PROJECT_LOCATION_INSTANCE.validatedMatch( + formattedString, "InstanceName.parse: formattedString not in valid format"); + return of(matchMap.get("project"), matchMap.get("location"), matchMap.get("instance")); + } + + 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 (InstanceName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PROJECT_LOCATION_INSTANCE.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); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return PROJECT_LOCATION_INSTANCE.instantiate( + "project", project, "location", location, "instance", instance); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null || getClass() == o.getClass()) { + InstanceName that = ((InstanceName) o); + return Objects.equals(this.project, that.project) + && Objects.equals(this.location, that.location) + && Objects.equals(this.instance, that.instance); + } + 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); + return h; + } + + /** Builder for projects/{project}/locations/{location}/instances/{instance}. */ + public static class Builder { + private String project; + private String location; + private String instance; + + protected Builder() {} + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getInstance() { + return instance; + } + + 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; + } + + private Builder(InstanceName instanceName) { + this.project = instanceName.project; + this.location = instanceName.location; + this.instance = instanceName.instance; + } + + public InstanceName build() { + return new InstanceName(this); + } + } +} diff --git a/proto-google-cloud-filestore-v1/src/main/java/com/google/cloud/filestore/v1/InstanceOrBuilder.java b/proto-google-cloud-filestore-v1/src/main/java/com/google/cloud/filestore/v1/InstanceOrBuilder.java new file mode 100644 index 00000000..f545c837 --- /dev/null +++ b/proto-google-cloud-filestore-v1/src/main/java/com/google/cloud/filestore/v1/InstanceOrBuilder.java @@ -0,0 +1,430 @@ +/* + * 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/v1/cloud_filestore_service.proto + +package com.google.cloud.filestore.v1; + +public interface InstanceOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.filestore.v1.Instance) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Output only. The resource name of the instance, in the format
+   * projects/{project}/locations/{location}/instances/{instance}.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Output only. The resource name of the instance, in the format
+   * projects/{project}/locations/{location}/instances/{instance}.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * The description of the instance (2048 characters or less).
+   * 
+ * + * string description = 2; + * + * @return The description. + */ + java.lang.String getDescription(); + /** + * + * + *
+   * The description of the instance (2048 characters or less).
+   * 
+ * + * string description = 2; + * + * @return The bytes for description. + */ + com.google.protobuf.ByteString getDescriptionBytes(); + + /** + * + * + *
+   * Output only. The instance state.
+   * 
+ * + * + * .google.cloud.filestore.v1.Instance.State state = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for state. + */ + int getStateValue(); + /** + * + * + *
+   * Output only. The instance state.
+   * 
+ * + * + * .google.cloud.filestore.v1.Instance.State state = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The state. + */ + com.google.cloud.filestore.v1.Instance.State getState(); + + /** + * + * + *
+   * Output only. Additional information about the instance state, if available.
+   * 
+ * + * string status_message = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The statusMessage. + */ + java.lang.String getStatusMessage(); + /** + * + * + *
+   * Output only. Additional information about the instance state, if available.
+   * 
+ * + * string status_message = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for statusMessage. + */ + com.google.protobuf.ByteString getStatusMessageBytes(); + + /** + * + * + *
+   * Output only. The time when the instance 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 instance 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 instance was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder(); + + /** + * + * + *
+   * The service tier of the instance.
+   * 
+ * + * .google.cloud.filestore.v1.Instance.Tier tier = 8; + * + * @return The enum numeric value on the wire for tier. + */ + int getTierValue(); + /** + * + * + *
+   * The service tier of the instance.
+   * 
+ * + * .google.cloud.filestore.v1.Instance.Tier tier = 8; + * + * @return The tier. + */ + com.google.cloud.filestore.v1.Instance.Tier getTier(); + + /** + * + * + *
+   * Resource labels to represent user provided metadata.
+   * 
+ * + * map<string, string> labels = 9; + */ + int getLabelsCount(); + /** + * + * + *
+   * Resource labels to represent user provided metadata.
+   * 
+ * + * map<string, string> labels = 9; + */ + 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 = 9; + */ + java.util.Map getLabelsMap(); + /** + * + * + *
+   * Resource labels to represent user provided metadata.
+   * 
+ * + * map<string, string> labels = 9; + */ + java.lang.String getLabelsOrDefault(java.lang.String key, java.lang.String defaultValue); + /** + * + * + *
+   * Resource labels to represent user provided metadata.
+   * 
+ * + * map<string, string> labels = 9; + */ + java.lang.String getLabelsOrThrow(java.lang.String key); + + /** + * + * + *
+   * File system shares on the instance.
+   * For this version, only a single file share is supported.
+   * 
+ * + * repeated .google.cloud.filestore.v1.FileShareConfig file_shares = 10; + */ + java.util.List getFileSharesList(); + /** + * + * + *
+   * File system shares on the instance.
+   * For this version, only a single file share is supported.
+   * 
+ * + * repeated .google.cloud.filestore.v1.FileShareConfig file_shares = 10; + */ + com.google.cloud.filestore.v1.FileShareConfig getFileShares(int index); + /** + * + * + *
+   * File system shares on the instance.
+   * For this version, only a single file share is supported.
+   * 
+ * + * repeated .google.cloud.filestore.v1.FileShareConfig file_shares = 10; + */ + int getFileSharesCount(); + /** + * + * + *
+   * File system shares on the instance.
+   * For this version, only a single file share is supported.
+   * 
+ * + * repeated .google.cloud.filestore.v1.FileShareConfig file_shares = 10; + */ + java.util.List + getFileSharesOrBuilderList(); + /** + * + * + *
+   * File system shares on the instance.
+   * For this version, only a single file share is supported.
+   * 
+ * + * repeated .google.cloud.filestore.v1.FileShareConfig file_shares = 10; + */ + com.google.cloud.filestore.v1.FileShareConfigOrBuilder getFileSharesOrBuilder(int index); + + /** + * + * + *
+   * VPC networks to which the instance is connected.
+   * For this version, only a single network is supported.
+   * 
+ * + * repeated .google.cloud.filestore.v1.NetworkConfig networks = 11; + */ + java.util.List getNetworksList(); + /** + * + * + *
+   * VPC networks to which the instance is connected.
+   * For this version, only a single network is supported.
+   * 
+ * + * repeated .google.cloud.filestore.v1.NetworkConfig networks = 11; + */ + com.google.cloud.filestore.v1.NetworkConfig getNetworks(int index); + /** + * + * + *
+   * VPC networks to which the instance is connected.
+   * For this version, only a single network is supported.
+   * 
+ * + * repeated .google.cloud.filestore.v1.NetworkConfig networks = 11; + */ + int getNetworksCount(); + /** + * + * + *
+   * VPC networks to which the instance is connected.
+   * For this version, only a single network is supported.
+   * 
+ * + * repeated .google.cloud.filestore.v1.NetworkConfig networks = 11; + */ + java.util.List + getNetworksOrBuilderList(); + /** + * + * + *
+   * VPC networks to which the instance is connected.
+   * For this version, only a single network is supported.
+   * 
+ * + * repeated .google.cloud.filestore.v1.NetworkConfig networks = 11; + */ + com.google.cloud.filestore.v1.NetworkConfigOrBuilder getNetworksOrBuilder(int index); + + /** + * + * + *
+   * Server-specified ETag for the instance resource to prevent simultaneous
+   * updates from overwriting each other.
+   * 
+ * + * string etag = 12; + * + * @return The etag. + */ + java.lang.String getEtag(); + /** + * + * + *
+   * Server-specified ETag for the instance resource to prevent simultaneous
+   * updates from overwriting each other.
+   * 
+ * + * string etag = 12; + * + * @return The bytes for etag. + */ + com.google.protobuf.ByteString getEtagBytes(); + + /** + * + * + *
+   * Output only. Reserved for future use.
+   * 
+ * + * + * .google.protobuf.BoolValue satisfies_pzs = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the satisfiesPzs field is set. + */ + boolean hasSatisfiesPzs(); + /** + * + * + *
+   * Output only. Reserved for future use.
+   * 
+ * + * + * .google.protobuf.BoolValue satisfies_pzs = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The satisfiesPzs. + */ + com.google.protobuf.BoolValue getSatisfiesPzs(); + /** + * + * + *
+   * Output only. Reserved for future use.
+   * 
+ * + * + * .google.protobuf.BoolValue satisfies_pzs = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.BoolValueOrBuilder getSatisfiesPzsOrBuilder(); +} diff --git a/proto-google-cloud-filestore-v1/src/main/java/com/google/cloud/filestore/v1/ListBackupsRequest.java b/proto-google-cloud-filestore-v1/src/main/java/com/google/cloud/filestore/v1/ListBackupsRequest.java new file mode 100644 index 00000000..bdb382e7 --- /dev/null +++ b/proto-google-cloud-filestore-v1/src/main/java/com/google/cloud/filestore/v1/ListBackupsRequest.java @@ -0,0 +1,1318 @@ +/* + * 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/v1/cloud_filestore_service.proto + +package com.google.cloud.filestore.v1; + +/** + * + * + *
+ * ListBackupsRequest lists backups.
+ * 
+ * + * Protobuf type {@code google.cloud.filestore.v1.ListBackupsRequest} + */ +public final class ListBackupsRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.filestore.v1.ListBackupsRequest) + ListBackupsRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListBackupsRequest.newBuilder() to construct. + private ListBackupsRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListBackupsRequest() { + parent_ = ""; + pageToken_ = ""; + orderBy_ = ""; + filter_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListBackupsRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ListBackupsRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + parent_ = s; + break; + } + case 16: + { + pageSize_ = input.readInt32(); + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + + pageToken_ = s; + break; + } + case 34: + { + java.lang.String s = input.readStringRequireUtf8(); + + orderBy_ = s; + break; + } + case 42: + { + java.lang.String s = input.readStringRequireUtf8(); + + filter_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.filestore.v1.CloudFilestoreServiceProto + .internal_static_google_cloud_filestore_v1_ListBackupsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.filestore.v1.CloudFilestoreServiceProto + .internal_static_google_cloud_filestore_v1_ListBackupsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.filestore.v1.ListBackupsRequest.class, + com.google.cloud.filestore.v1.ListBackupsRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + * + * + *
+   * Required. The project and location for which to retrieve backup information,
+   * in the format projects/{project_number}/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.
+   * 
+ * + * + * 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 project and location for which to retrieve backup information,
+   * in the format projects/{project_number}/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.
+   * 
+ * + * + * 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 (!getParentBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (pageSize_ != 0) { + output.writeInt32(2, pageSize_); + } + if (!getPageTokenBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, pageToken_); + } + if (!getOrderByBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, orderBy_); + } + if (!getFilterBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, filter_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getParentBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (pageSize_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(2, pageSize_); + } + if (!getPageTokenBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, pageToken_); + } + if (!getOrderByBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, orderBy_); + } + if (!getFilterBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, filter_); + } + size += unknownFields.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.v1.ListBackupsRequest)) { + return super.equals(obj); + } + com.google.cloud.filestore.v1.ListBackupsRequest other = + (com.google.cloud.filestore.v1.ListBackupsRequest) 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 (!unknownFields.equals(other.unknownFields)) 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) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.filestore.v1.ListBackupsRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.filestore.v1.ListBackupsRequest 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.v1.ListBackupsRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.filestore.v1.ListBackupsRequest 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.v1.ListBackupsRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.filestore.v1.ListBackupsRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.filestore.v1.ListBackupsRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.filestore.v1.ListBackupsRequest 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.v1.ListBackupsRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.filestore.v1.ListBackupsRequest 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.v1.ListBackupsRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.filestore.v1.ListBackupsRequest 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.v1.ListBackupsRequest 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; + } + /** + * + * + *
+   * ListBackupsRequest lists backups.
+   * 
+ * + * Protobuf type {@code google.cloud.filestore.v1.ListBackupsRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.filestore.v1.ListBackupsRequest) + com.google.cloud.filestore.v1.ListBackupsRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.filestore.v1.CloudFilestoreServiceProto + .internal_static_google_cloud_filestore_v1_ListBackupsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.filestore.v1.CloudFilestoreServiceProto + .internal_static_google_cloud_filestore_v1_ListBackupsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.filestore.v1.ListBackupsRequest.class, + com.google.cloud.filestore.v1.ListBackupsRequest.Builder.class); + } + + // Construct using com.google.cloud.filestore.v1.ListBackupsRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @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.v1.CloudFilestoreServiceProto + .internal_static_google_cloud_filestore_v1_ListBackupsRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.filestore.v1.ListBackupsRequest getDefaultInstanceForType() { + return com.google.cloud.filestore.v1.ListBackupsRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.filestore.v1.ListBackupsRequest build() { + com.google.cloud.filestore.v1.ListBackupsRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.filestore.v1.ListBackupsRequest buildPartial() { + com.google.cloud.filestore.v1.ListBackupsRequest result = + new com.google.cloud.filestore.v1.ListBackupsRequest(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.v1.ListBackupsRequest) { + return mergeFrom((com.google.cloud.filestore.v1.ListBackupsRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.filestore.v1.ListBackupsRequest other) { + if (other == com.google.cloud.filestore.v1.ListBackupsRequest.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.unknownFields); + 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 { + com.google.cloud.filestore.v1.ListBackupsRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.filestore.v1.ListBackupsRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. The project and location for which to retrieve backup information,
+     * in the format projects/{project_number}/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.
+     * 
+ * + * + * 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 project and location for which to retrieve backup information,
+     * in the format projects/{project_number}/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.
+     * 
+ * + * + * 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 project and location for which to retrieve backup information,
+     * in the format projects/{project_number}/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.
+     * 
+ * + * + * 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 project and location for which to retrieve backup information,
+     * in the format projects/{project_number}/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.
+     * 
+ * + * + * 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 project and location for which to retrieve backup information,
+     * in the format projects/{project_number}/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.
+     * 
+ * + * + * 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.v1.ListBackupsRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.filestore.v1.ListBackupsRequest) + private static final com.google.cloud.filestore.v1.ListBackupsRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.filestore.v1.ListBackupsRequest(); + } + + public static com.google.cloud.filestore.v1.ListBackupsRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListBackupsRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListBackupsRequest(input, extensionRegistry); + } + }; + + 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.v1.ListBackupsRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-filestore-v1/src/main/java/com/google/cloud/filestore/v1/ListBackupsRequestOrBuilder.java b/proto-google-cloud-filestore-v1/src/main/java/com/google/cloud/filestore/v1/ListBackupsRequestOrBuilder.java new file mode 100644 index 00000000..338e40ff --- /dev/null +++ b/proto-google-cloud-filestore-v1/src/main/java/com/google/cloud/filestore/v1/ListBackupsRequestOrBuilder.java @@ -0,0 +1,154 @@ +/* + * 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/v1/cloud_filestore_service.proto + +package com.google.cloud.filestore.v1; + +public interface ListBackupsRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.filestore.v1.ListBackupsRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The project and location for which to retrieve backup information,
+   * in the format projects/{project_number}/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.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. The project and location for which to retrieve backup information,
+   * in the format projects/{project_number}/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.
+   * 
+ * + * + * 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/proto-google-cloud-filestore-v1/src/main/java/com/google/cloud/filestore/v1/ListBackupsResponse.java b/proto-google-cloud-filestore-v1/src/main/java/com/google/cloud/filestore/v1/ListBackupsResponse.java new file mode 100644 index 00000000..d732a703 --- /dev/null +++ b/proto-google-cloud-filestore-v1/src/main/java/com/google/cloud/filestore/v1/ListBackupsResponse.java @@ -0,0 +1,1525 @@ +/* + * 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/v1/cloud_filestore_service.proto + +package com.google.cloud.filestore.v1; + +/** + * + * + *
+ * ListBackupsResponse is the result of ListBackupsRequest.
+ * 
+ * + * Protobuf type {@code google.cloud.filestore.v1.ListBackupsResponse} + */ +public final class ListBackupsResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.filestore.v1.ListBackupsResponse) + ListBackupsResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListBackupsResponse.newBuilder() to construct. + private ListBackupsResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListBackupsResponse() { + backups_ = 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 ListBackupsResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ListBackupsResponse( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + backups_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + backups_.add( + input.readMessage( + com.google.cloud.filestore.v1.Backup.parser(), extensionRegistry)); + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + nextPageToken_ = s; + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000002) != 0)) { + unreachable_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000002; + } + unreachable_.add(s); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + backups_ = java.util.Collections.unmodifiableList(backups_); + } + if (((mutable_bitField0_ & 0x00000002) != 0)) { + unreachable_ = unreachable_.getUnmodifiableView(); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.filestore.v1.CloudFilestoreServiceProto + .internal_static_google_cloud_filestore_v1_ListBackupsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.filestore.v1.CloudFilestoreServiceProto + .internal_static_google_cloud_filestore_v1_ListBackupsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.filestore.v1.ListBackupsResponse.class, + com.google.cloud.filestore.v1.ListBackupsResponse.Builder.class); + } + + public static final int BACKUPS_FIELD_NUMBER = 1; + private java.util.List backups_; + /** + * + * + *
+   * A list of backups in the project for the specified location.
+   * If the {location} value in the request is "-", the response contains a list
+   * of backups from all locations. If any location is unreachable, the
+   * response will only return backups in reachable locations and the
+   * "unreachable" field will be populated with a list of unreachable
+   * locations.
+   * 
+ * + * repeated .google.cloud.filestore.v1.Backup backups = 1; + */ + @java.lang.Override + public java.util.List getBackupsList() { + return backups_; + } + /** + * + * + *
+   * A list of backups in the project for the specified location.
+   * If the {location} value in the request is "-", the response contains a list
+   * of backups from all locations. If any location is unreachable, the
+   * response will only return backups in reachable locations and the
+   * "unreachable" field will be populated with a list of unreachable
+   * locations.
+   * 
+ * + * repeated .google.cloud.filestore.v1.Backup backups = 1; + */ + @java.lang.Override + public java.util.List + getBackupsOrBuilderList() { + return backups_; + } + /** + * + * + *
+   * A list of backups in the project for the specified location.
+   * If the {location} value in the request is "-", the response contains a list
+   * of backups from all locations. If any location is unreachable, the
+   * response will only return backups in reachable locations and the
+   * "unreachable" field will be populated with a list of unreachable
+   * locations.
+   * 
+ * + * repeated .google.cloud.filestore.v1.Backup backups = 1; + */ + @java.lang.Override + public int getBackupsCount() { + return backups_.size(); + } + /** + * + * + *
+   * A list of backups in the project for the specified location.
+   * If the {location} value in the request is "-", the response contains a list
+   * of backups from all locations. If any location is unreachable, the
+   * response will only return backups in reachable locations and the
+   * "unreachable" field will be populated with a list of unreachable
+   * locations.
+   * 
+ * + * repeated .google.cloud.filestore.v1.Backup backups = 1; + */ + @java.lang.Override + public com.google.cloud.filestore.v1.Backup getBackups(int index) { + return backups_.get(index); + } + /** + * + * + *
+   * A list of backups in the project for the specified location.
+   * If the {location} value in the request is "-", the response contains a list
+   * of backups from all locations. If any location is unreachable, the
+   * response will only return backups in reachable locations and the
+   * "unreachable" field will be populated with a list of unreachable
+   * locations.
+   * 
+ * + * repeated .google.cloud.filestore.v1.Backup backups = 1; + */ + @java.lang.Override + public com.google.cloud.filestore.v1.BackupOrBuilder getBackupsOrBuilder(int index) { + return backups_.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 < backups_.size(); i++) { + output.writeMessage(1, backups_.get(i)); + } + if (!getNextPageTokenBytes().isEmpty()) { + 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)); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < backups_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, backups_.get(i)); + } + if (!getNextPageTokenBytes().isEmpty()) { + 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 += unknownFields.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.v1.ListBackupsResponse)) { + return super.equals(obj); + } + com.google.cloud.filestore.v1.ListBackupsResponse other = + (com.google.cloud.filestore.v1.ListBackupsResponse) obj; + + if (!getBackupsList().equals(other.getBackupsList())) return false; + if (!getNextPageToken().equals(other.getNextPageToken())) return false; + if (!getUnreachableList().equals(other.getUnreachableList())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getBackupsCount() > 0) { + hash = (37 * hash) + BACKUPS_FIELD_NUMBER; + hash = (53 * hash) + getBackupsList().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) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.filestore.v1.ListBackupsResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.filestore.v1.ListBackupsResponse 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.v1.ListBackupsResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.filestore.v1.ListBackupsResponse 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.v1.ListBackupsResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.filestore.v1.ListBackupsResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.filestore.v1.ListBackupsResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.filestore.v1.ListBackupsResponse 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.v1.ListBackupsResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.filestore.v1.ListBackupsResponse 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.v1.ListBackupsResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.filestore.v1.ListBackupsResponse 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.v1.ListBackupsResponse 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; + } + /** + * + * + *
+   * ListBackupsResponse is the result of ListBackupsRequest.
+   * 
+ * + * Protobuf type {@code google.cloud.filestore.v1.ListBackupsResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.filestore.v1.ListBackupsResponse) + com.google.cloud.filestore.v1.ListBackupsResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.filestore.v1.CloudFilestoreServiceProto + .internal_static_google_cloud_filestore_v1_ListBackupsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.filestore.v1.CloudFilestoreServiceProto + .internal_static_google_cloud_filestore_v1_ListBackupsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.filestore.v1.ListBackupsResponse.class, + com.google.cloud.filestore.v1.ListBackupsResponse.Builder.class); + } + + // Construct using com.google.cloud.filestore.v1.ListBackupsResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getBackupsFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (backupsBuilder_ == null) { + backups_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + backupsBuilder_.clear(); + } + 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.v1.CloudFilestoreServiceProto + .internal_static_google_cloud_filestore_v1_ListBackupsResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.filestore.v1.ListBackupsResponse getDefaultInstanceForType() { + return com.google.cloud.filestore.v1.ListBackupsResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.filestore.v1.ListBackupsResponse build() { + com.google.cloud.filestore.v1.ListBackupsResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.filestore.v1.ListBackupsResponse buildPartial() { + com.google.cloud.filestore.v1.ListBackupsResponse result = + new com.google.cloud.filestore.v1.ListBackupsResponse(this); + int from_bitField0_ = bitField0_; + if (backupsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + backups_ = java.util.Collections.unmodifiableList(backups_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.backups_ = backups_; + } else { + result.backups_ = backupsBuilder_.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.v1.ListBackupsResponse) { + return mergeFrom((com.google.cloud.filestore.v1.ListBackupsResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.filestore.v1.ListBackupsResponse other) { + if (other == com.google.cloud.filestore.v1.ListBackupsResponse.getDefaultInstance()) + return this; + if (backupsBuilder_ == null) { + if (!other.backups_.isEmpty()) { + if (backups_.isEmpty()) { + backups_ = other.backups_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureBackupsIsMutable(); + backups_.addAll(other.backups_); + } + onChanged(); + } + } else { + if (!other.backups_.isEmpty()) { + if (backupsBuilder_.isEmpty()) { + backupsBuilder_.dispose(); + backupsBuilder_ = null; + backups_ = other.backups_; + bitField0_ = (bitField0_ & ~0x00000001); + backupsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getBackupsFieldBuilder() + : null; + } else { + backupsBuilder_.addAllMessages(other.backups_); + } + } + } + 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.unknownFields); + 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 { + com.google.cloud.filestore.v1.ListBackupsResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.filestore.v1.ListBackupsResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.util.List backups_ = + java.util.Collections.emptyList(); + + private void ensureBackupsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + backups_ = new java.util.ArrayList(backups_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.filestore.v1.Backup, + com.google.cloud.filestore.v1.Backup.Builder, + com.google.cloud.filestore.v1.BackupOrBuilder> + backupsBuilder_; + + /** + * + * + *
+     * A list of backups in the project for the specified location.
+     * If the {location} value in the request is "-", the response contains a list
+     * of backups from all locations. If any location is unreachable, the
+     * response will only return backups in reachable locations and the
+     * "unreachable" field will be populated with a list of unreachable
+     * locations.
+     * 
+ * + * repeated .google.cloud.filestore.v1.Backup backups = 1; + */ + public java.util.List getBackupsList() { + if (backupsBuilder_ == null) { + return java.util.Collections.unmodifiableList(backups_); + } else { + return backupsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * A list of backups in the project for the specified location.
+     * If the {location} value in the request is "-", the response contains a list
+     * of backups from all locations. If any location is unreachable, the
+     * response will only return backups in reachable locations and the
+     * "unreachable" field will be populated with a list of unreachable
+     * locations.
+     * 
+ * + * repeated .google.cloud.filestore.v1.Backup backups = 1; + */ + public int getBackupsCount() { + if (backupsBuilder_ == null) { + return backups_.size(); + } else { + return backupsBuilder_.getCount(); + } + } + /** + * + * + *
+     * A list of backups in the project for the specified location.
+     * If the {location} value in the request is "-", the response contains a list
+     * of backups from all locations. If any location is unreachable, the
+     * response will only return backups in reachable locations and the
+     * "unreachable" field will be populated with a list of unreachable
+     * locations.
+     * 
+ * + * repeated .google.cloud.filestore.v1.Backup backups = 1; + */ + public com.google.cloud.filestore.v1.Backup getBackups(int index) { + if (backupsBuilder_ == null) { + return backups_.get(index); + } else { + return backupsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * A list of backups in the project for the specified location.
+     * If the {location} value in the request is "-", the response contains a list
+     * of backups from all locations. If any location is unreachable, the
+     * response will only return backups in reachable locations and the
+     * "unreachable" field will be populated with a list of unreachable
+     * locations.
+     * 
+ * + * repeated .google.cloud.filestore.v1.Backup backups = 1; + */ + public Builder setBackups(int index, com.google.cloud.filestore.v1.Backup value) { + if (backupsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureBackupsIsMutable(); + backups_.set(index, value); + onChanged(); + } else { + backupsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * A list of backups in the project for the specified location.
+     * If the {location} value in the request is "-", the response contains a list
+     * of backups from all locations. If any location is unreachable, the
+     * response will only return backups in reachable locations and the
+     * "unreachable" field will be populated with a list of unreachable
+     * locations.
+     * 
+ * + * repeated .google.cloud.filestore.v1.Backup backups = 1; + */ + public Builder setBackups( + int index, com.google.cloud.filestore.v1.Backup.Builder builderForValue) { + if (backupsBuilder_ == null) { + ensureBackupsIsMutable(); + backups_.set(index, builderForValue.build()); + onChanged(); + } else { + backupsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * A list of backups in the project for the specified location.
+     * If the {location} value in the request is "-", the response contains a list
+     * of backups from all locations. If any location is unreachable, the
+     * response will only return backups in reachable locations and the
+     * "unreachable" field will be populated with a list of unreachable
+     * locations.
+     * 
+ * + * repeated .google.cloud.filestore.v1.Backup backups = 1; + */ + public Builder addBackups(com.google.cloud.filestore.v1.Backup value) { + if (backupsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureBackupsIsMutable(); + backups_.add(value); + onChanged(); + } else { + backupsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * A list of backups in the project for the specified location.
+     * If the {location} value in the request is "-", the response contains a list
+     * of backups from all locations. If any location is unreachable, the
+     * response will only return backups in reachable locations and the
+     * "unreachable" field will be populated with a list of unreachable
+     * locations.
+     * 
+ * + * repeated .google.cloud.filestore.v1.Backup backups = 1; + */ + public Builder addBackups(int index, com.google.cloud.filestore.v1.Backup value) { + if (backupsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureBackupsIsMutable(); + backups_.add(index, value); + onChanged(); + } else { + backupsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * A list of backups in the project for the specified location.
+     * If the {location} value in the request is "-", the response contains a list
+     * of backups from all locations. If any location is unreachable, the
+     * response will only return backups in reachable locations and the
+     * "unreachable" field will be populated with a list of unreachable
+     * locations.
+     * 
+ * + * repeated .google.cloud.filestore.v1.Backup backups = 1; + */ + public Builder addBackups(com.google.cloud.filestore.v1.Backup.Builder builderForValue) { + if (backupsBuilder_ == null) { + ensureBackupsIsMutable(); + backups_.add(builderForValue.build()); + onChanged(); + } else { + backupsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * A list of backups in the project for the specified location.
+     * If the {location} value in the request is "-", the response contains a list
+     * of backups from all locations. If any location is unreachable, the
+     * response will only return backups in reachable locations and the
+     * "unreachable" field will be populated with a list of unreachable
+     * locations.
+     * 
+ * + * repeated .google.cloud.filestore.v1.Backup backups = 1; + */ + public Builder addBackups( + int index, com.google.cloud.filestore.v1.Backup.Builder builderForValue) { + if (backupsBuilder_ == null) { + ensureBackupsIsMutable(); + backups_.add(index, builderForValue.build()); + onChanged(); + } else { + backupsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * A list of backups in the project for the specified location.
+     * If the {location} value in the request is "-", the response contains a list
+     * of backups from all locations. If any location is unreachable, the
+     * response will only return backups in reachable locations and the
+     * "unreachable" field will be populated with a list of unreachable
+     * locations.
+     * 
+ * + * repeated .google.cloud.filestore.v1.Backup backups = 1; + */ + public Builder addAllBackups( + java.lang.Iterable values) { + if (backupsBuilder_ == null) { + ensureBackupsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, backups_); + onChanged(); + } else { + backupsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * A list of backups in the project for the specified location.
+     * If the {location} value in the request is "-", the response contains a list
+     * of backups from all locations. If any location is unreachable, the
+     * response will only return backups in reachable locations and the
+     * "unreachable" field will be populated with a list of unreachable
+     * locations.
+     * 
+ * + * repeated .google.cloud.filestore.v1.Backup backups = 1; + */ + public Builder clearBackups() { + if (backupsBuilder_ == null) { + backups_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + backupsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * A list of backups in the project for the specified location.
+     * If the {location} value in the request is "-", the response contains a list
+     * of backups from all locations. If any location is unreachable, the
+     * response will only return backups in reachable locations and the
+     * "unreachable" field will be populated with a list of unreachable
+     * locations.
+     * 
+ * + * repeated .google.cloud.filestore.v1.Backup backups = 1; + */ + public Builder removeBackups(int index) { + if (backupsBuilder_ == null) { + ensureBackupsIsMutable(); + backups_.remove(index); + onChanged(); + } else { + backupsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * A list of backups in the project for the specified location.
+     * If the {location} value in the request is "-", the response contains a list
+     * of backups from all locations. If any location is unreachable, the
+     * response will only return backups in reachable locations and the
+     * "unreachable" field will be populated with a list of unreachable
+     * locations.
+     * 
+ * + * repeated .google.cloud.filestore.v1.Backup backups = 1; + */ + public com.google.cloud.filestore.v1.Backup.Builder getBackupsBuilder(int index) { + return getBackupsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * A list of backups in the project for the specified location.
+     * If the {location} value in the request is "-", the response contains a list
+     * of backups from all locations. If any location is unreachable, the
+     * response will only return backups in reachable locations and the
+     * "unreachable" field will be populated with a list of unreachable
+     * locations.
+     * 
+ * + * repeated .google.cloud.filestore.v1.Backup backups = 1; + */ + public com.google.cloud.filestore.v1.BackupOrBuilder getBackupsOrBuilder(int index) { + if (backupsBuilder_ == null) { + return backups_.get(index); + } else { + return backupsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * A list of backups in the project for the specified location.
+     * If the {location} value in the request is "-", the response contains a list
+     * of backups from all locations. If any location is unreachable, the
+     * response will only return backups in reachable locations and the
+     * "unreachable" field will be populated with a list of unreachable
+     * locations.
+     * 
+ * + * repeated .google.cloud.filestore.v1.Backup backups = 1; + */ + public java.util.List + getBackupsOrBuilderList() { + if (backupsBuilder_ != null) { + return backupsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(backups_); + } + } + /** + * + * + *
+     * A list of backups in the project for the specified location.
+     * If the {location} value in the request is "-", the response contains a list
+     * of backups from all locations. If any location is unreachable, the
+     * response will only return backups in reachable locations and the
+     * "unreachable" field will be populated with a list of unreachable
+     * locations.
+     * 
+ * + * repeated .google.cloud.filestore.v1.Backup backups = 1; + */ + public com.google.cloud.filestore.v1.Backup.Builder addBackupsBuilder() { + return getBackupsFieldBuilder() + .addBuilder(com.google.cloud.filestore.v1.Backup.getDefaultInstance()); + } + /** + * + * + *
+     * A list of backups in the project for the specified location.
+     * If the {location} value in the request is "-", the response contains a list
+     * of backups from all locations. If any location is unreachable, the
+     * response will only return backups in reachable locations and the
+     * "unreachable" field will be populated with a list of unreachable
+     * locations.
+     * 
+ * + * repeated .google.cloud.filestore.v1.Backup backups = 1; + */ + public com.google.cloud.filestore.v1.Backup.Builder addBackupsBuilder(int index) { + return getBackupsFieldBuilder() + .addBuilder(index, com.google.cloud.filestore.v1.Backup.getDefaultInstance()); + } + /** + * + * + *
+     * A list of backups in the project for the specified location.
+     * If the {location} value in the request is "-", the response contains a list
+     * of backups from all locations. If any location is unreachable, the
+     * response will only return backups in reachable locations and the
+     * "unreachable" field will be populated with a list of unreachable
+     * locations.
+     * 
+ * + * repeated .google.cloud.filestore.v1.Backup backups = 1; + */ + public java.util.List getBackupsBuilderList() { + return getBackupsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.filestore.v1.Backup, + com.google.cloud.filestore.v1.Backup.Builder, + com.google.cloud.filestore.v1.BackupOrBuilder> + getBackupsFieldBuilder() { + if (backupsBuilder_ == null) { + backupsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.filestore.v1.Backup, + com.google.cloud.filestore.v1.Backup.Builder, + com.google.cloud.filestore.v1.BackupOrBuilder>( + backups_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + backups_ = null; + } + return backupsBuilder_; + } + + 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.v1.ListBackupsResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.filestore.v1.ListBackupsResponse) + private static final com.google.cloud.filestore.v1.ListBackupsResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.filestore.v1.ListBackupsResponse(); + } + + public static com.google.cloud.filestore.v1.ListBackupsResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListBackupsResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListBackupsResponse(input, extensionRegistry); + } + }; + + 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.v1.ListBackupsResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-filestore-v1/src/main/java/com/google/cloud/filestore/v1/ListBackupsResponseOrBuilder.java b/proto-google-cloud-filestore-v1/src/main/java/com/google/cloud/filestore/v1/ListBackupsResponseOrBuilder.java new file mode 100644 index 00000000..893ef68f --- /dev/null +++ b/proto-google-cloud-filestore-v1/src/main/java/com/google/cloud/filestore/v1/ListBackupsResponseOrBuilder.java @@ -0,0 +1,179 @@ +/* + * 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/v1/cloud_filestore_service.proto + +package com.google.cloud.filestore.v1; + +public interface ListBackupsResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.filestore.v1.ListBackupsResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * A list of backups in the project for the specified location.
+   * If the {location} value in the request is "-", the response contains a list
+   * of backups from all locations. If any location is unreachable, the
+   * response will only return backups in reachable locations and the
+   * "unreachable" field will be populated with a list of unreachable
+   * locations.
+   * 
+ * + * repeated .google.cloud.filestore.v1.Backup backups = 1; + */ + java.util.List getBackupsList(); + /** + * + * + *
+   * A list of backups in the project for the specified location.
+   * If the {location} value in the request is "-", the response contains a list
+   * of backups from all locations. If any location is unreachable, the
+   * response will only return backups in reachable locations and the
+   * "unreachable" field will be populated with a list of unreachable
+   * locations.
+   * 
+ * + * repeated .google.cloud.filestore.v1.Backup backups = 1; + */ + com.google.cloud.filestore.v1.Backup getBackups(int index); + /** + * + * + *
+   * A list of backups in the project for the specified location.
+   * If the {location} value in the request is "-", the response contains a list
+   * of backups from all locations. If any location is unreachable, the
+   * response will only return backups in reachable locations and the
+   * "unreachable" field will be populated with a list of unreachable
+   * locations.
+   * 
+ * + * repeated .google.cloud.filestore.v1.Backup backups = 1; + */ + int getBackupsCount(); + /** + * + * + *
+   * A list of backups in the project for the specified location.
+   * If the {location} value in the request is "-", the response contains a list
+   * of backups from all locations. If any location is unreachable, the
+   * response will only return backups in reachable locations and the
+   * "unreachable" field will be populated with a list of unreachable
+   * locations.
+   * 
+ * + * repeated .google.cloud.filestore.v1.Backup backups = 1; + */ + java.util.List getBackupsOrBuilderList(); + /** + * + * + *
+   * A list of backups in the project for the specified location.
+   * If the {location} value in the request is "-", the response contains a list
+   * of backups from all locations. If any location is unreachable, the
+   * response will only return backups in reachable locations and the
+   * "unreachable" field will be populated with a list of unreachable
+   * locations.
+   * 
+ * + * repeated .google.cloud.filestore.v1.Backup backups = 1; + */ + com.google.cloud.filestore.v1.BackupOrBuilder getBackupsOrBuilder(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/proto-google-cloud-filestore-v1/src/main/java/com/google/cloud/filestore/v1/ListInstancesRequest.java b/proto-google-cloud-filestore-v1/src/main/java/com/google/cloud/filestore/v1/ListInstancesRequest.java new file mode 100644 index 00000000..1dcb6aae --- /dev/null +++ b/proto-google-cloud-filestore-v1/src/main/java/com/google/cloud/filestore/v1/ListInstancesRequest.java @@ -0,0 +1,1312 @@ +/* + * 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/v1/cloud_filestore_service.proto + +package com.google.cloud.filestore.v1; + +/** + * + * + *
+ * ListInstancesRequest lists instances.
+ * 
+ * + * Protobuf type {@code google.cloud.filestore.v1.ListInstancesRequest} + */ +public final class ListInstancesRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.filestore.v1.ListInstancesRequest) + ListInstancesRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListInstancesRequest.newBuilder() to construct. + private ListInstancesRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListInstancesRequest() { + parent_ = ""; + pageToken_ = ""; + orderBy_ = ""; + filter_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListInstancesRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ListInstancesRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + parent_ = s; + break; + } + case 16: + { + pageSize_ = input.readInt32(); + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + + pageToken_ = s; + break; + } + case 34: + { + java.lang.String s = input.readStringRequireUtf8(); + + orderBy_ = s; + break; + } + case 42: + { + java.lang.String s = input.readStringRequireUtf8(); + + filter_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.filestore.v1.CloudFilestoreServiceProto + .internal_static_google_cloud_filestore_v1_ListInstancesRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.filestore.v1.CloudFilestoreServiceProto + .internal_static_google_cloud_filestore_v1_ListInstancesRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.filestore.v1.ListInstancesRequest.class, + com.google.cloud.filestore.v1.ListInstancesRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + * + * + *
+   * Required. The project and location for which to retrieve instance information,
+   * in the format projects/{project_id}/locations/{location}. In Cloud
+   * Filestore, locations map to GCP zones, for example **us-west1-b**. To
+   * retrieve instance information for all locations, use "-" for the {location}
+   * value.
+   * 
+ * + * + * 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 project and location for which to retrieve instance information,
+   * in the format projects/{project_id}/locations/{location}. In Cloud
+   * Filestore, locations map to GCP zones, for example **us-west1-b**. To
+   * retrieve instance information for all locations, use "-" for the {location}
+   * value.
+   * 
+ * + * + * 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 (!getParentBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (pageSize_ != 0) { + output.writeInt32(2, pageSize_); + } + if (!getPageTokenBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, pageToken_); + } + if (!getOrderByBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, orderBy_); + } + if (!getFilterBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, filter_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getParentBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (pageSize_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(2, pageSize_); + } + if (!getPageTokenBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, pageToken_); + } + if (!getOrderByBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, orderBy_); + } + if (!getFilterBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, filter_); + } + size += unknownFields.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.v1.ListInstancesRequest)) { + return super.equals(obj); + } + com.google.cloud.filestore.v1.ListInstancesRequest other = + (com.google.cloud.filestore.v1.ListInstancesRequest) 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 (!unknownFields.equals(other.unknownFields)) 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) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.filestore.v1.ListInstancesRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.filestore.v1.ListInstancesRequest 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.v1.ListInstancesRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.filestore.v1.ListInstancesRequest 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.v1.ListInstancesRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.filestore.v1.ListInstancesRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.filestore.v1.ListInstancesRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.filestore.v1.ListInstancesRequest 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.v1.ListInstancesRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.filestore.v1.ListInstancesRequest 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.v1.ListInstancesRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.filestore.v1.ListInstancesRequest 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.v1.ListInstancesRequest 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; + } + /** + * + * + *
+   * ListInstancesRequest lists instances.
+   * 
+ * + * Protobuf type {@code google.cloud.filestore.v1.ListInstancesRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.filestore.v1.ListInstancesRequest) + com.google.cloud.filestore.v1.ListInstancesRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.filestore.v1.CloudFilestoreServiceProto + .internal_static_google_cloud_filestore_v1_ListInstancesRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.filestore.v1.CloudFilestoreServiceProto + .internal_static_google_cloud_filestore_v1_ListInstancesRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.filestore.v1.ListInstancesRequest.class, + com.google.cloud.filestore.v1.ListInstancesRequest.Builder.class); + } + + // Construct using com.google.cloud.filestore.v1.ListInstancesRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @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.v1.CloudFilestoreServiceProto + .internal_static_google_cloud_filestore_v1_ListInstancesRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.filestore.v1.ListInstancesRequest getDefaultInstanceForType() { + return com.google.cloud.filestore.v1.ListInstancesRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.filestore.v1.ListInstancesRequest build() { + com.google.cloud.filestore.v1.ListInstancesRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.filestore.v1.ListInstancesRequest buildPartial() { + com.google.cloud.filestore.v1.ListInstancesRequest result = + new com.google.cloud.filestore.v1.ListInstancesRequest(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.v1.ListInstancesRequest) { + return mergeFrom((com.google.cloud.filestore.v1.ListInstancesRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.filestore.v1.ListInstancesRequest other) { + if (other == com.google.cloud.filestore.v1.ListInstancesRequest.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.unknownFields); + 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 { + com.google.cloud.filestore.v1.ListInstancesRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.filestore.v1.ListInstancesRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. The project and location for which to retrieve instance information,
+     * in the format projects/{project_id}/locations/{location}. In Cloud
+     * Filestore, locations map to GCP zones, for example **us-west1-b**. To
+     * retrieve instance information for all locations, use "-" for the {location}
+     * value.
+     * 
+ * + * + * 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 project and location for which to retrieve instance information,
+     * in the format projects/{project_id}/locations/{location}. In Cloud
+     * Filestore, locations map to GCP zones, for example **us-west1-b**. To
+     * retrieve instance information for all locations, use "-" for the {location}
+     * value.
+     * 
+ * + * + * 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 project and location for which to retrieve instance information,
+     * in the format projects/{project_id}/locations/{location}. In Cloud
+     * Filestore, locations map to GCP zones, for example **us-west1-b**. To
+     * retrieve instance information for all locations, use "-" for the {location}
+     * value.
+     * 
+ * + * + * 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 project and location for which to retrieve instance information,
+     * in the format projects/{project_id}/locations/{location}. In Cloud
+     * Filestore, locations map to GCP zones, for example **us-west1-b**. To
+     * retrieve instance information for all locations, use "-" for the {location}
+     * value.
+     * 
+ * + * + * 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 project and location for which to retrieve instance information,
+     * in the format projects/{project_id}/locations/{location}. In Cloud
+     * Filestore, locations map to GCP zones, for example **us-west1-b**. To
+     * retrieve instance information for all locations, use "-" for the {location}
+     * value.
+     * 
+ * + * + * 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.v1.ListInstancesRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.filestore.v1.ListInstancesRequest) + private static final com.google.cloud.filestore.v1.ListInstancesRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.filestore.v1.ListInstancesRequest(); + } + + public static com.google.cloud.filestore.v1.ListInstancesRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListInstancesRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListInstancesRequest(input, extensionRegistry); + } + }; + + 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.v1.ListInstancesRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-filestore-v1/src/main/java/com/google/cloud/filestore/v1/ListInstancesRequestOrBuilder.java b/proto-google-cloud-filestore-v1/src/main/java/com/google/cloud/filestore/v1/ListInstancesRequestOrBuilder.java new file mode 100644 index 00000000..34c4e0b9 --- /dev/null +++ b/proto-google-cloud-filestore-v1/src/main/java/com/google/cloud/filestore/v1/ListInstancesRequestOrBuilder.java @@ -0,0 +1,152 @@ +/* + * 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/v1/cloud_filestore_service.proto + +package com.google.cloud.filestore.v1; + +public interface ListInstancesRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.filestore.v1.ListInstancesRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The project and location for which to retrieve instance information,
+   * in the format projects/{project_id}/locations/{location}. In Cloud
+   * Filestore, locations map to GCP zones, for example **us-west1-b**. To
+   * retrieve instance information for all locations, use "-" for the {location}
+   * value.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. The project and location for which to retrieve instance information,
+   * in the format projects/{project_id}/locations/{location}. In Cloud
+   * Filestore, locations map to GCP zones, for example **us-west1-b**. To
+   * retrieve instance information for all locations, use "-" for the {location}
+   * value.
+   * 
+ * + * + * 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/proto-google-cloud-filestore-v1/src/main/java/com/google/cloud/filestore/v1/ListInstancesResponse.java b/proto-google-cloud-filestore-v1/src/main/java/com/google/cloud/filestore/v1/ListInstancesResponse.java new file mode 100644 index 00000000..db0fd533 --- /dev/null +++ b/proto-google-cloud-filestore-v1/src/main/java/com/google/cloud/filestore/v1/ListInstancesResponse.java @@ -0,0 +1,1503 @@ +/* + * 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/v1/cloud_filestore_service.proto + +package com.google.cloud.filestore.v1; + +/** + * + * + *
+ * ListInstancesResponse is the result of ListInstancesRequest.
+ * 
+ * + * Protobuf type {@code google.cloud.filestore.v1.ListInstancesResponse} + */ +public final class ListInstancesResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.filestore.v1.ListInstancesResponse) + ListInstancesResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListInstancesResponse.newBuilder() to construct. + private ListInstancesResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListInstancesResponse() { + instances_ = 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 ListInstancesResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ListInstancesResponse( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + instances_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + instances_.add( + input.readMessage( + com.google.cloud.filestore.v1.Instance.parser(), extensionRegistry)); + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + nextPageToken_ = s; + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000002) != 0)) { + unreachable_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000002; + } + unreachable_.add(s); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + instances_ = java.util.Collections.unmodifiableList(instances_); + } + if (((mutable_bitField0_ & 0x00000002) != 0)) { + unreachable_ = unreachable_.getUnmodifiableView(); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.filestore.v1.CloudFilestoreServiceProto + .internal_static_google_cloud_filestore_v1_ListInstancesResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.filestore.v1.CloudFilestoreServiceProto + .internal_static_google_cloud_filestore_v1_ListInstancesResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.filestore.v1.ListInstancesResponse.class, + com.google.cloud.filestore.v1.ListInstancesResponse.Builder.class); + } + + public static final int INSTANCES_FIELD_NUMBER = 1; + private java.util.List instances_; + /** + * + * + *
+   * A list of instances in the project for the specified location.
+   * If the {location} value in the request is "-", the response contains a list
+   * of instances from all locations. If any location is unreachable, the
+   * response will only return instances in reachable locations and the
+   * "unreachable" field will be populated with a list of unreachable locations.
+   * 
+ * + * repeated .google.cloud.filestore.v1.Instance instances = 1; + */ + @java.lang.Override + public java.util.List getInstancesList() { + return instances_; + } + /** + * + * + *
+   * A list of instances in the project for the specified location.
+   * If the {location} value in the request is "-", the response contains a list
+   * of instances from all locations. If any location is unreachable, the
+   * response will only return instances in reachable locations and the
+   * "unreachable" field will be populated with a list of unreachable locations.
+   * 
+ * + * repeated .google.cloud.filestore.v1.Instance instances = 1; + */ + @java.lang.Override + public java.util.List + getInstancesOrBuilderList() { + return instances_; + } + /** + * + * + *
+   * A list of instances in the project for the specified location.
+   * If the {location} value in the request is "-", the response contains a list
+   * of instances from all locations. If any location is unreachable, the
+   * response will only return instances in reachable locations and the
+   * "unreachable" field will be populated with a list of unreachable locations.
+   * 
+ * + * repeated .google.cloud.filestore.v1.Instance instances = 1; + */ + @java.lang.Override + public int getInstancesCount() { + return instances_.size(); + } + /** + * + * + *
+   * A list of instances in the project for the specified location.
+   * If the {location} value in the request is "-", the response contains a list
+   * of instances from all locations. If any location is unreachable, the
+   * response will only return instances in reachable locations and the
+   * "unreachable" field will be populated with a list of unreachable locations.
+   * 
+ * + * repeated .google.cloud.filestore.v1.Instance instances = 1; + */ + @java.lang.Override + public com.google.cloud.filestore.v1.Instance getInstances(int index) { + return instances_.get(index); + } + /** + * + * + *
+   * A list of instances in the project for the specified location.
+   * If the {location} value in the request is "-", the response contains a list
+   * of instances from all locations. If any location is unreachable, the
+   * response will only return instances in reachable locations and the
+   * "unreachable" field will be populated with a list of unreachable locations.
+   * 
+ * + * repeated .google.cloud.filestore.v1.Instance instances = 1; + */ + @java.lang.Override + public com.google.cloud.filestore.v1.InstanceOrBuilder getInstancesOrBuilder(int index) { + return instances_.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 < instances_.size(); i++) { + output.writeMessage(1, instances_.get(i)); + } + if (!getNextPageTokenBytes().isEmpty()) { + 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)); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < instances_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, instances_.get(i)); + } + if (!getNextPageTokenBytes().isEmpty()) { + 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 += unknownFields.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.v1.ListInstancesResponse)) { + return super.equals(obj); + } + com.google.cloud.filestore.v1.ListInstancesResponse other = + (com.google.cloud.filestore.v1.ListInstancesResponse) obj; + + if (!getInstancesList().equals(other.getInstancesList())) return false; + if (!getNextPageToken().equals(other.getNextPageToken())) return false; + if (!getUnreachableList().equals(other.getUnreachableList())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getInstancesCount() > 0) { + hash = (37 * hash) + INSTANCES_FIELD_NUMBER; + hash = (53 * hash) + getInstancesList().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) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.filestore.v1.ListInstancesResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.filestore.v1.ListInstancesResponse 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.v1.ListInstancesResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.filestore.v1.ListInstancesResponse 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.v1.ListInstancesResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.filestore.v1.ListInstancesResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.filestore.v1.ListInstancesResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.filestore.v1.ListInstancesResponse 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.v1.ListInstancesResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.filestore.v1.ListInstancesResponse 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.v1.ListInstancesResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.filestore.v1.ListInstancesResponse 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.v1.ListInstancesResponse 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; + } + /** + * + * + *
+   * ListInstancesResponse is the result of ListInstancesRequest.
+   * 
+ * + * Protobuf type {@code google.cloud.filestore.v1.ListInstancesResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.filestore.v1.ListInstancesResponse) + com.google.cloud.filestore.v1.ListInstancesResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.filestore.v1.CloudFilestoreServiceProto + .internal_static_google_cloud_filestore_v1_ListInstancesResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.filestore.v1.CloudFilestoreServiceProto + .internal_static_google_cloud_filestore_v1_ListInstancesResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.filestore.v1.ListInstancesResponse.class, + com.google.cloud.filestore.v1.ListInstancesResponse.Builder.class); + } + + // Construct using com.google.cloud.filestore.v1.ListInstancesResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getInstancesFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (instancesBuilder_ == null) { + instances_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + instancesBuilder_.clear(); + } + 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.v1.CloudFilestoreServiceProto + .internal_static_google_cloud_filestore_v1_ListInstancesResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.filestore.v1.ListInstancesResponse getDefaultInstanceForType() { + return com.google.cloud.filestore.v1.ListInstancesResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.filestore.v1.ListInstancesResponse build() { + com.google.cloud.filestore.v1.ListInstancesResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.filestore.v1.ListInstancesResponse buildPartial() { + com.google.cloud.filestore.v1.ListInstancesResponse result = + new com.google.cloud.filestore.v1.ListInstancesResponse(this); + int from_bitField0_ = bitField0_; + if (instancesBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + instances_ = java.util.Collections.unmodifiableList(instances_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.instances_ = instances_; + } else { + result.instances_ = instancesBuilder_.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.v1.ListInstancesResponse) { + return mergeFrom((com.google.cloud.filestore.v1.ListInstancesResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.filestore.v1.ListInstancesResponse other) { + if (other == com.google.cloud.filestore.v1.ListInstancesResponse.getDefaultInstance()) + return this; + if (instancesBuilder_ == null) { + if (!other.instances_.isEmpty()) { + if (instances_.isEmpty()) { + instances_ = other.instances_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureInstancesIsMutable(); + instances_.addAll(other.instances_); + } + onChanged(); + } + } else { + if (!other.instances_.isEmpty()) { + if (instancesBuilder_.isEmpty()) { + instancesBuilder_.dispose(); + instancesBuilder_ = null; + instances_ = other.instances_; + bitField0_ = (bitField0_ & ~0x00000001); + instancesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getInstancesFieldBuilder() + : null; + } else { + instancesBuilder_.addAllMessages(other.instances_); + } + } + } + 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.unknownFields); + 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 { + com.google.cloud.filestore.v1.ListInstancesResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.filestore.v1.ListInstancesResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.util.List instances_ = + java.util.Collections.emptyList(); + + private void ensureInstancesIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + instances_ = new java.util.ArrayList(instances_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.filestore.v1.Instance, + com.google.cloud.filestore.v1.Instance.Builder, + com.google.cloud.filestore.v1.InstanceOrBuilder> + instancesBuilder_; + + /** + * + * + *
+     * A list of instances in the project for the specified location.
+     * If the {location} value in the request is "-", the response contains a list
+     * of instances from all locations. If any location is unreachable, the
+     * response will only return instances in reachable locations and the
+     * "unreachable" field will be populated with a list of unreachable locations.
+     * 
+ * + * repeated .google.cloud.filestore.v1.Instance instances = 1; + */ + public java.util.List getInstancesList() { + if (instancesBuilder_ == null) { + return java.util.Collections.unmodifiableList(instances_); + } else { + return instancesBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * A list of instances in the project for the specified location.
+     * If the {location} value in the request is "-", the response contains a list
+     * of instances from all locations. If any location is unreachable, the
+     * response will only return instances in reachable locations and the
+     * "unreachable" field will be populated with a list of unreachable locations.
+     * 
+ * + * repeated .google.cloud.filestore.v1.Instance instances = 1; + */ + public int getInstancesCount() { + if (instancesBuilder_ == null) { + return instances_.size(); + } else { + return instancesBuilder_.getCount(); + } + } + /** + * + * + *
+     * A list of instances in the project for the specified location.
+     * If the {location} value in the request is "-", the response contains a list
+     * of instances from all locations. If any location is unreachable, the
+     * response will only return instances in reachable locations and the
+     * "unreachable" field will be populated with a list of unreachable locations.
+     * 
+ * + * repeated .google.cloud.filestore.v1.Instance instances = 1; + */ + public com.google.cloud.filestore.v1.Instance getInstances(int index) { + if (instancesBuilder_ == null) { + return instances_.get(index); + } else { + return instancesBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * A list of instances in the project for the specified location.
+     * If the {location} value in the request is "-", the response contains a list
+     * of instances from all locations. If any location is unreachable, the
+     * response will only return instances in reachable locations and the
+     * "unreachable" field will be populated with a list of unreachable locations.
+     * 
+ * + * repeated .google.cloud.filestore.v1.Instance instances = 1; + */ + public Builder setInstances(int index, com.google.cloud.filestore.v1.Instance value) { + if (instancesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureInstancesIsMutable(); + instances_.set(index, value); + onChanged(); + } else { + instancesBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * A list of instances in the project for the specified location.
+     * If the {location} value in the request is "-", the response contains a list
+     * of instances from all locations. If any location is unreachable, the
+     * response will only return instances in reachable locations and the
+     * "unreachable" field will be populated with a list of unreachable locations.
+     * 
+ * + * repeated .google.cloud.filestore.v1.Instance instances = 1; + */ + public Builder setInstances( + int index, com.google.cloud.filestore.v1.Instance.Builder builderForValue) { + if (instancesBuilder_ == null) { + ensureInstancesIsMutable(); + instances_.set(index, builderForValue.build()); + onChanged(); + } else { + instancesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * A list of instances in the project for the specified location.
+     * If the {location} value in the request is "-", the response contains a list
+     * of instances from all locations. If any location is unreachable, the
+     * response will only return instances in reachable locations and the
+     * "unreachable" field will be populated with a list of unreachable locations.
+     * 
+ * + * repeated .google.cloud.filestore.v1.Instance instances = 1; + */ + public Builder addInstances(com.google.cloud.filestore.v1.Instance value) { + if (instancesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureInstancesIsMutable(); + instances_.add(value); + onChanged(); + } else { + instancesBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * A list of instances in the project for the specified location.
+     * If the {location} value in the request is "-", the response contains a list
+     * of instances from all locations. If any location is unreachable, the
+     * response will only return instances in reachable locations and the
+     * "unreachable" field will be populated with a list of unreachable locations.
+     * 
+ * + * repeated .google.cloud.filestore.v1.Instance instances = 1; + */ + public Builder addInstances(int index, com.google.cloud.filestore.v1.Instance value) { + if (instancesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureInstancesIsMutable(); + instances_.add(index, value); + onChanged(); + } else { + instancesBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * A list of instances in the project for the specified location.
+     * If the {location} value in the request is "-", the response contains a list
+     * of instances from all locations. If any location is unreachable, the
+     * response will only return instances in reachable locations and the
+     * "unreachable" field will be populated with a list of unreachable locations.
+     * 
+ * + * repeated .google.cloud.filestore.v1.Instance instances = 1; + */ + public Builder addInstances(com.google.cloud.filestore.v1.Instance.Builder builderForValue) { + if (instancesBuilder_ == null) { + ensureInstancesIsMutable(); + instances_.add(builderForValue.build()); + onChanged(); + } else { + instancesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * A list of instances in the project for the specified location.
+     * If the {location} value in the request is "-", the response contains a list
+     * of instances from all locations. If any location is unreachable, the
+     * response will only return instances in reachable locations and the
+     * "unreachable" field will be populated with a list of unreachable locations.
+     * 
+ * + * repeated .google.cloud.filestore.v1.Instance instances = 1; + */ + public Builder addInstances( + int index, com.google.cloud.filestore.v1.Instance.Builder builderForValue) { + if (instancesBuilder_ == null) { + ensureInstancesIsMutable(); + instances_.add(index, builderForValue.build()); + onChanged(); + } else { + instancesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * A list of instances in the project for the specified location.
+     * If the {location} value in the request is "-", the response contains a list
+     * of instances from all locations. If any location is unreachable, the
+     * response will only return instances in reachable locations and the
+     * "unreachable" field will be populated with a list of unreachable locations.
+     * 
+ * + * repeated .google.cloud.filestore.v1.Instance instances = 1; + */ + public Builder addAllInstances( + java.lang.Iterable values) { + if (instancesBuilder_ == null) { + ensureInstancesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, instances_); + onChanged(); + } else { + instancesBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * A list of instances in the project for the specified location.
+     * If the {location} value in the request is "-", the response contains a list
+     * of instances from all locations. If any location is unreachable, the
+     * response will only return instances in reachable locations and the
+     * "unreachable" field will be populated with a list of unreachable locations.
+     * 
+ * + * repeated .google.cloud.filestore.v1.Instance instances = 1; + */ + public Builder clearInstances() { + if (instancesBuilder_ == null) { + instances_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + instancesBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * A list of instances in the project for the specified location.
+     * If the {location} value in the request is "-", the response contains a list
+     * of instances from all locations. If any location is unreachable, the
+     * response will only return instances in reachable locations and the
+     * "unreachable" field will be populated with a list of unreachable locations.
+     * 
+ * + * repeated .google.cloud.filestore.v1.Instance instances = 1; + */ + public Builder removeInstances(int index) { + if (instancesBuilder_ == null) { + ensureInstancesIsMutable(); + instances_.remove(index); + onChanged(); + } else { + instancesBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * A list of instances in the project for the specified location.
+     * If the {location} value in the request is "-", the response contains a list
+     * of instances from all locations. If any location is unreachable, the
+     * response will only return instances in reachable locations and the
+     * "unreachable" field will be populated with a list of unreachable locations.
+     * 
+ * + * repeated .google.cloud.filestore.v1.Instance instances = 1; + */ + public com.google.cloud.filestore.v1.Instance.Builder getInstancesBuilder(int index) { + return getInstancesFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * A list of instances in the project for the specified location.
+     * If the {location} value in the request is "-", the response contains a list
+     * of instances from all locations. If any location is unreachable, the
+     * response will only return instances in reachable locations and the
+     * "unreachable" field will be populated with a list of unreachable locations.
+     * 
+ * + * repeated .google.cloud.filestore.v1.Instance instances = 1; + */ + public com.google.cloud.filestore.v1.InstanceOrBuilder getInstancesOrBuilder(int index) { + if (instancesBuilder_ == null) { + return instances_.get(index); + } else { + return instancesBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * A list of instances in the project for the specified location.
+     * If the {location} value in the request is "-", the response contains a list
+     * of instances from all locations. If any location is unreachable, the
+     * response will only return instances in reachable locations and the
+     * "unreachable" field will be populated with a list of unreachable locations.
+     * 
+ * + * repeated .google.cloud.filestore.v1.Instance instances = 1; + */ + public java.util.List + getInstancesOrBuilderList() { + if (instancesBuilder_ != null) { + return instancesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(instances_); + } + } + /** + * + * + *
+     * A list of instances in the project for the specified location.
+     * If the {location} value in the request is "-", the response contains a list
+     * of instances from all locations. If any location is unreachable, the
+     * response will only return instances in reachable locations and the
+     * "unreachable" field will be populated with a list of unreachable locations.
+     * 
+ * + * repeated .google.cloud.filestore.v1.Instance instances = 1; + */ + public com.google.cloud.filestore.v1.Instance.Builder addInstancesBuilder() { + return getInstancesFieldBuilder() + .addBuilder(com.google.cloud.filestore.v1.Instance.getDefaultInstance()); + } + /** + * + * + *
+     * A list of instances in the project for the specified location.
+     * If the {location} value in the request is "-", the response contains a list
+     * of instances from all locations. If any location is unreachable, the
+     * response will only return instances in reachable locations and the
+     * "unreachable" field will be populated with a list of unreachable locations.
+     * 
+ * + * repeated .google.cloud.filestore.v1.Instance instances = 1; + */ + public com.google.cloud.filestore.v1.Instance.Builder addInstancesBuilder(int index) { + return getInstancesFieldBuilder() + .addBuilder(index, com.google.cloud.filestore.v1.Instance.getDefaultInstance()); + } + /** + * + * + *
+     * A list of instances in the project for the specified location.
+     * If the {location} value in the request is "-", the response contains a list
+     * of instances from all locations. If any location is unreachable, the
+     * response will only return instances in reachable locations and the
+     * "unreachable" field will be populated with a list of unreachable locations.
+     * 
+ * + * repeated .google.cloud.filestore.v1.Instance instances = 1; + */ + public java.util.List + getInstancesBuilderList() { + return getInstancesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.filestore.v1.Instance, + com.google.cloud.filestore.v1.Instance.Builder, + com.google.cloud.filestore.v1.InstanceOrBuilder> + getInstancesFieldBuilder() { + if (instancesBuilder_ == null) { + instancesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.filestore.v1.Instance, + com.google.cloud.filestore.v1.Instance.Builder, + com.google.cloud.filestore.v1.InstanceOrBuilder>( + instances_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + instances_ = null; + } + return instancesBuilder_; + } + + 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.v1.ListInstancesResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.filestore.v1.ListInstancesResponse) + private static final com.google.cloud.filestore.v1.ListInstancesResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.filestore.v1.ListInstancesResponse(); + } + + public static com.google.cloud.filestore.v1.ListInstancesResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListInstancesResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListInstancesResponse(input, extensionRegistry); + } + }; + + 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.v1.ListInstancesResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-filestore-v1/src/main/java/com/google/cloud/filestore/v1/ListInstancesResponseOrBuilder.java b/proto-google-cloud-filestore-v1/src/main/java/com/google/cloud/filestore/v1/ListInstancesResponseOrBuilder.java new file mode 100644 index 00000000..1126fd67 --- /dev/null +++ b/proto-google-cloud-filestore-v1/src/main/java/com/google/cloud/filestore/v1/ListInstancesResponseOrBuilder.java @@ -0,0 +1,175 @@ +/* + * 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/v1/cloud_filestore_service.proto + +package com.google.cloud.filestore.v1; + +public interface ListInstancesResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.filestore.v1.ListInstancesResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * A list of instances in the project for the specified location.
+   * If the {location} value in the request is "-", the response contains a list
+   * of instances from all locations. If any location is unreachable, the
+   * response will only return instances in reachable locations and the
+   * "unreachable" field will be populated with a list of unreachable locations.
+   * 
+ * + * repeated .google.cloud.filestore.v1.Instance instances = 1; + */ + java.util.List getInstancesList(); + /** + * + * + *
+   * A list of instances in the project for the specified location.
+   * If the {location} value in the request is "-", the response contains a list
+   * of instances from all locations. If any location is unreachable, the
+   * response will only return instances in reachable locations and the
+   * "unreachable" field will be populated with a list of unreachable locations.
+   * 
+ * + * repeated .google.cloud.filestore.v1.Instance instances = 1; + */ + com.google.cloud.filestore.v1.Instance getInstances(int index); + /** + * + * + *
+   * A list of instances in the project for the specified location.
+   * If the {location} value in the request is "-", the response contains a list
+   * of instances from all locations. If any location is unreachable, the
+   * response will only return instances in reachable locations and the
+   * "unreachable" field will be populated with a list of unreachable locations.
+   * 
+ * + * repeated .google.cloud.filestore.v1.Instance instances = 1; + */ + int getInstancesCount(); + /** + * + * + *
+   * A list of instances in the project for the specified location.
+   * If the {location} value in the request is "-", the response contains a list
+   * of instances from all locations. If any location is unreachable, the
+   * response will only return instances in reachable locations and the
+   * "unreachable" field will be populated with a list of unreachable locations.
+   * 
+ * + * repeated .google.cloud.filestore.v1.Instance instances = 1; + */ + java.util.List + getInstancesOrBuilderList(); + /** + * + * + *
+   * A list of instances in the project for the specified location.
+   * If the {location} value in the request is "-", the response contains a list
+   * of instances from all locations. If any location is unreachable, the
+   * response will only return instances in reachable locations and the
+   * "unreachable" field will be populated with a list of unreachable locations.
+   * 
+ * + * repeated .google.cloud.filestore.v1.Instance instances = 1; + */ + com.google.cloud.filestore.v1.InstanceOrBuilder getInstancesOrBuilder(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/proto-google-cloud-filestore-v1/src/main/java/com/google/cloud/filestore/v1/LocationName.java b/proto-google-cloud-filestore-v1/src/main/java/com/google/cloud/filestore/v1/LocationName.java new file mode 100644 index 00000000..4523f8b3 --- /dev/null +++ b/proto-google-cloud-filestore-v1/src/main/java/com/google/cloud/filestore/v1/LocationName.java @@ -0,0 +1,192 @@ +/* + * Copyright 2021 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.v1; + +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 LocationName implements ResourceName { + private static final PathTemplate PROJECT_LOCATION = + PathTemplate.createWithoutUrlEncoding("projects/{project}/locations/{location}"); + private volatile Map fieldValuesMap; + private final String project; + private final String location; + + @Deprecated + protected LocationName() { + project = null; + location = null; + } + + private LocationName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + location = Preconditions.checkNotNull(builder.getLocation()); + } + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static LocationName of(String project, String location) { + return newBuilder().setProject(project).setLocation(location).build(); + } + + public static String format(String project, String location) { + return newBuilder().setProject(project).setLocation(location).build().toString(); + } + + public static LocationName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PROJECT_LOCATION.validatedMatch( + formattedString, "LocationName.parse: formattedString not in valid format"); + return of(matchMap.get("project"), matchMap.get("location")); + } + + 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 (LocationName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PROJECT_LOCATION.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); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return PROJECT_LOCATION.instantiate("project", project, "location", location); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null || getClass() == o.getClass()) { + LocationName that = ((LocationName) o); + return Objects.equals(this.project, that.project) + && Objects.equals(this.location, that.location); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(project); + h *= 1000003; + h ^= Objects.hashCode(location); + return h; + } + + /** Builder for projects/{project}/locations/{location}. */ + public static class Builder { + private String project; + private String location; + + protected Builder() {} + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setLocation(String location) { + this.location = location; + return this; + } + + private Builder(LocationName locationName) { + this.project = locationName.project; + this.location = locationName.location; + } + + public LocationName build() { + return new LocationName(this); + } + } +} diff --git a/proto-google-cloud-filestore-v1/src/main/java/com/google/cloud/filestore/v1/NetworkConfig.java b/proto-google-cloud-filestore-v1/src/main/java/com/google/cloud/filestore/v1/NetworkConfig.java new file mode 100644 index 00000000..7d78b316 --- /dev/null +++ b/proto-google-cloud-filestore-v1/src/main/java/com/google/cloud/filestore/v1/NetworkConfig.java @@ -0,0 +1,1733 @@ +/* + * 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/v1/cloud_filestore_service.proto + +package com.google.cloud.filestore.v1; + +/** + * + * + *
+ * Network configuration for the instance.
+ * 
+ * + * Protobuf type {@code google.cloud.filestore.v1.NetworkConfig} + */ +public final class NetworkConfig extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.filestore.v1.NetworkConfig) + NetworkConfigOrBuilder { + private static final long serialVersionUID = 0L; + // Use NetworkConfig.newBuilder() to construct. + private NetworkConfig(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private NetworkConfig() { + network_ = ""; + modes_ = java.util.Collections.emptyList(); + reservedIpRange_ = ""; + ipAddresses_ = com.google.protobuf.LazyStringArrayList.EMPTY; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new NetworkConfig(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private NetworkConfig( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + network_ = s; + break; + } + case 24: + { + int rawValue = input.readEnum(); + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + modes_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + modes_.add(rawValue); + break; + } + case 26: + { + int length = input.readRawVarint32(); + int oldLimit = input.pushLimit(length); + while (input.getBytesUntilLimit() > 0) { + int rawValue = input.readEnum(); + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + modes_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + modes_.add(rawValue); + } + input.popLimit(oldLimit); + break; + } + case 34: + { + java.lang.String s = input.readStringRequireUtf8(); + + reservedIpRange_ = s; + break; + } + case 42: + { + java.lang.String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000002) != 0)) { + ipAddresses_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000002; + } + ipAddresses_.add(s); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + modes_ = java.util.Collections.unmodifiableList(modes_); + } + if (((mutable_bitField0_ & 0x00000002) != 0)) { + ipAddresses_ = ipAddresses_.getUnmodifiableView(); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.filestore.v1.CloudFilestoreServiceProto + .internal_static_google_cloud_filestore_v1_NetworkConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.filestore.v1.CloudFilestoreServiceProto + .internal_static_google_cloud_filestore_v1_NetworkConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.filestore.v1.NetworkConfig.class, + com.google.cloud.filestore.v1.NetworkConfig.Builder.class); + } + + /** + * + * + *
+   * Internet protocol versions supported by Cloud Filestore.
+   * 
+ * + * Protobuf enum {@code google.cloud.filestore.v1.NetworkConfig.AddressMode} + */ + public enum AddressMode implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Internet protocol not set.
+     * 
+ * + * ADDRESS_MODE_UNSPECIFIED = 0; + */ + ADDRESS_MODE_UNSPECIFIED(0), + /** + * + * + *
+     * Use the IPv4 internet protocol.
+     * 
+ * + * MODE_IPV4 = 1; + */ + MODE_IPV4(1), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * Internet protocol not set.
+     * 
+ * + * ADDRESS_MODE_UNSPECIFIED = 0; + */ + public static final int ADDRESS_MODE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * Use the IPv4 internet protocol.
+     * 
+ * + * MODE_IPV4 = 1; + */ + public static final int MODE_IPV4_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 AddressMode 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 AddressMode forNumber(int value) { + switch (value) { + case 0: + return ADDRESS_MODE_UNSPECIFIED; + case 1: + return MODE_IPV4; + 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 AddressMode findValueByNumber(int number) { + return AddressMode.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.v1.NetworkConfig.getDescriptor().getEnumTypes().get(0); + } + + private static final AddressMode[] VALUES = values(); + + public static AddressMode 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 AddressMode(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.filestore.v1.NetworkConfig.AddressMode) + } + + public static final int NETWORK_FIELD_NUMBER = 1; + private volatile java.lang.Object network_; + /** + * + * + *
+   * The name of the Google Compute Engine
+   * [VPC network](/compute/docs/networks-and-firewalls#networks) to which the
+   * instance is connected.
+   * 
+ * + * string network = 1; + * + * @return The network. + */ + @java.lang.Override + public java.lang.String getNetwork() { + java.lang.Object ref = network_; + 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(); + network_ = s; + return s; + } + } + /** + * + * + *
+   * The name of the Google Compute Engine
+   * [VPC network](/compute/docs/networks-and-firewalls#networks) to which the
+   * instance is connected.
+   * 
+ * + * string network = 1; + * + * @return The bytes for network. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNetworkBytes() { + java.lang.Object ref = network_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + network_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int MODES_FIELD_NUMBER = 3; + private java.util.List modes_; + private static final com.google.protobuf.Internal.ListAdapter.Converter< + java.lang.Integer, com.google.cloud.filestore.v1.NetworkConfig.AddressMode> + modes_converter_ = + new com.google.protobuf.Internal.ListAdapter.Converter< + java.lang.Integer, com.google.cloud.filestore.v1.NetworkConfig.AddressMode>() { + public com.google.cloud.filestore.v1.NetworkConfig.AddressMode convert( + java.lang.Integer from) { + @SuppressWarnings("deprecation") + com.google.cloud.filestore.v1.NetworkConfig.AddressMode result = + com.google.cloud.filestore.v1.NetworkConfig.AddressMode.valueOf(from); + return result == null + ? com.google.cloud.filestore.v1.NetworkConfig.AddressMode.UNRECOGNIZED + : result; + } + }; + /** + * + * + *
+   * Internet protocol versions for which the instance has IP addresses
+   * assigned. For this version, only MODE_IPV4 is supported.
+   * 
+ * + * repeated .google.cloud.filestore.v1.NetworkConfig.AddressMode modes = 3; + * + * @return A list containing the modes. + */ + @java.lang.Override + public java.util.List getModesList() { + return new com.google.protobuf.Internal.ListAdapter< + java.lang.Integer, com.google.cloud.filestore.v1.NetworkConfig.AddressMode>( + modes_, modes_converter_); + } + /** + * + * + *
+   * Internet protocol versions for which the instance has IP addresses
+   * assigned. For this version, only MODE_IPV4 is supported.
+   * 
+ * + * repeated .google.cloud.filestore.v1.NetworkConfig.AddressMode modes = 3; + * + * @return The count of modes. + */ + @java.lang.Override + public int getModesCount() { + return modes_.size(); + } + /** + * + * + *
+   * Internet protocol versions for which the instance has IP addresses
+   * assigned. For this version, only MODE_IPV4 is supported.
+   * 
+ * + * repeated .google.cloud.filestore.v1.NetworkConfig.AddressMode modes = 3; + * + * @param index The index of the element to return. + * @return The modes at the given index. + */ + @java.lang.Override + public com.google.cloud.filestore.v1.NetworkConfig.AddressMode getModes(int index) { + return modes_converter_.convert(modes_.get(index)); + } + /** + * + * + *
+   * Internet protocol versions for which the instance has IP addresses
+   * assigned. For this version, only MODE_IPV4 is supported.
+   * 
+ * + * repeated .google.cloud.filestore.v1.NetworkConfig.AddressMode modes = 3; + * + * @return A list containing the enum numeric values on the wire for modes. + */ + @java.lang.Override + public java.util.List getModesValueList() { + return modes_; + } + /** + * + * + *
+   * Internet protocol versions for which the instance has IP addresses
+   * assigned. For this version, only MODE_IPV4 is supported.
+   * 
+ * + * repeated .google.cloud.filestore.v1.NetworkConfig.AddressMode modes = 3; + * + * @param index The index of the value to return. + * @return The enum numeric value on the wire of modes at the given index. + */ + @java.lang.Override + public int getModesValue(int index) { + return modes_.get(index); + } + + private int modesMemoizedSerializedSize; + + public static final int RESERVED_IP_RANGE_FIELD_NUMBER = 4; + private volatile java.lang.Object reservedIpRange_; + /** + * + * + *
+   * A /29 CIDR block in one of the
+   * [internal IP address
+   * ranges](https://www.arin.net/knowledge/address_filters.html) that
+   * identifies the range of IP addresses reserved for this instance. For
+   * example, 10.0.0.0/29 or 192.168.0.0/29. 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.
+   * 
+ * + * string reserved_ip_range = 4; + * + * @return The reservedIpRange. + */ + @java.lang.Override + public java.lang.String getReservedIpRange() { + java.lang.Object ref = reservedIpRange_; + 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(); + reservedIpRange_ = s; + return s; + } + } + /** + * + * + *
+   * A /29 CIDR block in one of the
+   * [internal IP address
+   * ranges](https://www.arin.net/knowledge/address_filters.html) that
+   * identifies the range of IP addresses reserved for this instance. For
+   * example, 10.0.0.0/29 or 192.168.0.0/29. 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.
+   * 
+ * + * string reserved_ip_range = 4; + * + * @return The bytes for reservedIpRange. + */ + @java.lang.Override + public com.google.protobuf.ByteString getReservedIpRangeBytes() { + java.lang.Object ref = reservedIpRange_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + reservedIpRange_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int IP_ADDRESSES_FIELD_NUMBER = 5; + private com.google.protobuf.LazyStringList ipAddresses_; + /** + * + * + *
+   * Output only. IPv4 addresses in the format
+   * {octet 1}.{octet 2}.{octet 3}.{octet 4} or IPv6 addresses in the format
+   * {block 1}:{block 2}:{block 3}:{block 4}:{block 5}:{block 6}:{block
+   * 7}:{block 8}.
+   * 
+ * + * repeated string ip_addresses = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return A list containing the ipAddresses. + */ + public com.google.protobuf.ProtocolStringList getIpAddressesList() { + return ipAddresses_; + } + /** + * + * + *
+   * Output only. IPv4 addresses in the format
+   * {octet 1}.{octet 2}.{octet 3}.{octet 4} or IPv6 addresses in the format
+   * {block 1}:{block 2}:{block 3}:{block 4}:{block 5}:{block 6}:{block
+   * 7}:{block 8}.
+   * 
+ * + * repeated string ip_addresses = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The count of ipAddresses. + */ + public int getIpAddressesCount() { + return ipAddresses_.size(); + } + /** + * + * + *
+   * Output only. IPv4 addresses in the format
+   * {octet 1}.{octet 2}.{octet 3}.{octet 4} or IPv6 addresses in the format
+   * {block 1}:{block 2}:{block 3}:{block 4}:{block 5}:{block 6}:{block
+   * 7}:{block 8}.
+   * 
+ * + * repeated string ip_addresses = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param index The index of the element to return. + * @return The ipAddresses at the given index. + */ + public java.lang.String getIpAddresses(int index) { + return ipAddresses_.get(index); + } + /** + * + * + *
+   * Output only. IPv4 addresses in the format
+   * {octet 1}.{octet 2}.{octet 3}.{octet 4} or IPv6 addresses in the format
+   * {block 1}:{block 2}:{block 3}:{block 4}:{block 5}:{block 6}:{block
+   * 7}:{block 8}.
+   * 
+ * + * repeated string ip_addresses = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param index The index of the value to return. + * @return The bytes of the ipAddresses at the given index. + */ + public com.google.protobuf.ByteString getIpAddressesBytes(int index) { + return ipAddresses_.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 { + getSerializedSize(); + if (!getNetworkBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, network_); + } + if (getModesList().size() > 0) { + output.writeUInt32NoTag(26); + output.writeUInt32NoTag(modesMemoizedSerializedSize); + } + for (int i = 0; i < modes_.size(); i++) { + output.writeEnumNoTag(modes_.get(i)); + } + if (!getReservedIpRangeBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, reservedIpRange_); + } + for (int i = 0; i < ipAddresses_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, ipAddresses_.getRaw(i)); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getNetworkBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, network_); + } + { + int dataSize = 0; + for (int i = 0; i < modes_.size(); i++) { + dataSize += com.google.protobuf.CodedOutputStream.computeEnumSizeNoTag(modes_.get(i)); + } + size += dataSize; + if (!getModesList().isEmpty()) { + size += 1; + size += com.google.protobuf.CodedOutputStream.computeUInt32SizeNoTag(dataSize); + } + modesMemoizedSerializedSize = dataSize; + } + if (!getReservedIpRangeBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, reservedIpRange_); + } + { + int dataSize = 0; + for (int i = 0; i < ipAddresses_.size(); i++) { + dataSize += computeStringSizeNoTag(ipAddresses_.getRaw(i)); + } + size += dataSize; + size += 1 * getIpAddressesList().size(); + } + size += unknownFields.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.v1.NetworkConfig)) { + return super.equals(obj); + } + com.google.cloud.filestore.v1.NetworkConfig other = + (com.google.cloud.filestore.v1.NetworkConfig) obj; + + if (!getNetwork().equals(other.getNetwork())) return false; + if (!modes_.equals(other.modes_)) return false; + if (!getReservedIpRange().equals(other.getReservedIpRange())) return false; + if (!getIpAddressesList().equals(other.getIpAddressesList())) return false; + if (!unknownFields.equals(other.unknownFields)) 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) + NETWORK_FIELD_NUMBER; + hash = (53 * hash) + getNetwork().hashCode(); + if (getModesCount() > 0) { + hash = (37 * hash) + MODES_FIELD_NUMBER; + hash = (53 * hash) + modes_.hashCode(); + } + hash = (37 * hash) + RESERVED_IP_RANGE_FIELD_NUMBER; + hash = (53 * hash) + getReservedIpRange().hashCode(); + if (getIpAddressesCount() > 0) { + hash = (37 * hash) + IP_ADDRESSES_FIELD_NUMBER; + hash = (53 * hash) + getIpAddressesList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.filestore.v1.NetworkConfig parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.filestore.v1.NetworkConfig 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.v1.NetworkConfig parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.filestore.v1.NetworkConfig 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.v1.NetworkConfig parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.filestore.v1.NetworkConfig parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.filestore.v1.NetworkConfig parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.filestore.v1.NetworkConfig 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.v1.NetworkConfig parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.filestore.v1.NetworkConfig 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.v1.NetworkConfig parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.filestore.v1.NetworkConfig 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.v1.NetworkConfig 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; + } + /** + * + * + *
+   * Network configuration for the instance.
+   * 
+ * + * Protobuf type {@code google.cloud.filestore.v1.NetworkConfig} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.filestore.v1.NetworkConfig) + com.google.cloud.filestore.v1.NetworkConfigOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.filestore.v1.CloudFilestoreServiceProto + .internal_static_google_cloud_filestore_v1_NetworkConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.filestore.v1.CloudFilestoreServiceProto + .internal_static_google_cloud_filestore_v1_NetworkConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.filestore.v1.NetworkConfig.class, + com.google.cloud.filestore.v1.NetworkConfig.Builder.class); + } + + // Construct using com.google.cloud.filestore.v1.NetworkConfig.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + network_ = ""; + + modes_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + reservedIpRange_ = ""; + + ipAddresses_ = 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.v1.CloudFilestoreServiceProto + .internal_static_google_cloud_filestore_v1_NetworkConfig_descriptor; + } + + @java.lang.Override + public com.google.cloud.filestore.v1.NetworkConfig getDefaultInstanceForType() { + return com.google.cloud.filestore.v1.NetworkConfig.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.filestore.v1.NetworkConfig build() { + com.google.cloud.filestore.v1.NetworkConfig result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.filestore.v1.NetworkConfig buildPartial() { + com.google.cloud.filestore.v1.NetworkConfig result = + new com.google.cloud.filestore.v1.NetworkConfig(this); + int from_bitField0_ = bitField0_; + result.network_ = network_; + if (((bitField0_ & 0x00000001) != 0)) { + modes_ = java.util.Collections.unmodifiableList(modes_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.modes_ = modes_; + result.reservedIpRange_ = reservedIpRange_; + if (((bitField0_ & 0x00000002) != 0)) { + ipAddresses_ = ipAddresses_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.ipAddresses_ = ipAddresses_; + 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.v1.NetworkConfig) { + return mergeFrom((com.google.cloud.filestore.v1.NetworkConfig) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.filestore.v1.NetworkConfig other) { + if (other == com.google.cloud.filestore.v1.NetworkConfig.getDefaultInstance()) return this; + if (!other.getNetwork().isEmpty()) { + network_ = other.network_; + onChanged(); + } + if (!other.modes_.isEmpty()) { + if (modes_.isEmpty()) { + modes_ = other.modes_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureModesIsMutable(); + modes_.addAll(other.modes_); + } + onChanged(); + } + if (!other.getReservedIpRange().isEmpty()) { + reservedIpRange_ = other.reservedIpRange_; + onChanged(); + } + if (!other.ipAddresses_.isEmpty()) { + if (ipAddresses_.isEmpty()) { + ipAddresses_ = other.ipAddresses_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureIpAddressesIsMutable(); + ipAddresses_.addAll(other.ipAddresses_); + } + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + 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 { + com.google.cloud.filestore.v1.NetworkConfig parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.filestore.v1.NetworkConfig) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.lang.Object network_ = ""; + /** + * + * + *
+     * The name of the Google Compute Engine
+     * [VPC network](/compute/docs/networks-and-firewalls#networks) to which the
+     * instance is connected.
+     * 
+ * + * string network = 1; + * + * @return The network. + */ + public java.lang.String getNetwork() { + java.lang.Object ref = network_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + network_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The name of the Google Compute Engine
+     * [VPC network](/compute/docs/networks-and-firewalls#networks) to which the
+     * instance is connected.
+     * 
+ * + * string network = 1; + * + * @return The bytes for network. + */ + public com.google.protobuf.ByteString getNetworkBytes() { + java.lang.Object ref = network_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + network_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The name of the Google Compute Engine
+     * [VPC network](/compute/docs/networks-and-firewalls#networks) to which the
+     * instance is connected.
+     * 
+ * + * string network = 1; + * + * @param value The network to set. + * @return This builder for chaining. + */ + public Builder setNetwork(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + network_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The name of the Google Compute Engine
+     * [VPC network](/compute/docs/networks-and-firewalls#networks) to which the
+     * instance is connected.
+     * 
+ * + * string network = 1; + * + * @return This builder for chaining. + */ + public Builder clearNetwork() { + + network_ = getDefaultInstance().getNetwork(); + onChanged(); + return this; + } + /** + * + * + *
+     * The name of the Google Compute Engine
+     * [VPC network](/compute/docs/networks-and-firewalls#networks) to which the
+     * instance is connected.
+     * 
+ * + * string network = 1; + * + * @param value The bytes for network to set. + * @return This builder for chaining. + */ + public Builder setNetworkBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + network_ = value; + onChanged(); + return this; + } + + private java.util.List modes_ = java.util.Collections.emptyList(); + + private void ensureModesIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + modes_ = new java.util.ArrayList(modes_); + bitField0_ |= 0x00000001; + } + } + /** + * + * + *
+     * Internet protocol versions for which the instance has IP addresses
+     * assigned. For this version, only MODE_IPV4 is supported.
+     * 
+ * + * repeated .google.cloud.filestore.v1.NetworkConfig.AddressMode modes = 3; + * + * @return A list containing the modes. + */ + public java.util.List getModesList() { + return new com.google.protobuf.Internal.ListAdapter< + java.lang.Integer, com.google.cloud.filestore.v1.NetworkConfig.AddressMode>( + modes_, modes_converter_); + } + /** + * + * + *
+     * Internet protocol versions for which the instance has IP addresses
+     * assigned. For this version, only MODE_IPV4 is supported.
+     * 
+ * + * repeated .google.cloud.filestore.v1.NetworkConfig.AddressMode modes = 3; + * + * @return The count of modes. + */ + public int getModesCount() { + return modes_.size(); + } + /** + * + * + *
+     * Internet protocol versions for which the instance has IP addresses
+     * assigned. For this version, only MODE_IPV4 is supported.
+     * 
+ * + * repeated .google.cloud.filestore.v1.NetworkConfig.AddressMode modes = 3; + * + * @param index The index of the element to return. + * @return The modes at the given index. + */ + public com.google.cloud.filestore.v1.NetworkConfig.AddressMode getModes(int index) { + return modes_converter_.convert(modes_.get(index)); + } + /** + * + * + *
+     * Internet protocol versions for which the instance has IP addresses
+     * assigned. For this version, only MODE_IPV4 is supported.
+     * 
+ * + * repeated .google.cloud.filestore.v1.NetworkConfig.AddressMode modes = 3; + * + * @param index The index to set the value at. + * @param value The modes to set. + * @return This builder for chaining. + */ + public Builder setModes( + int index, com.google.cloud.filestore.v1.NetworkConfig.AddressMode value) { + if (value == null) { + throw new NullPointerException(); + } + ensureModesIsMutable(); + modes_.set(index, value.getNumber()); + onChanged(); + return this; + } + /** + * + * + *
+     * Internet protocol versions for which the instance has IP addresses
+     * assigned. For this version, only MODE_IPV4 is supported.
+     * 
+ * + * repeated .google.cloud.filestore.v1.NetworkConfig.AddressMode modes = 3; + * + * @param value The modes to add. + * @return This builder for chaining. + */ + public Builder addModes(com.google.cloud.filestore.v1.NetworkConfig.AddressMode value) { + if (value == null) { + throw new NullPointerException(); + } + ensureModesIsMutable(); + modes_.add(value.getNumber()); + onChanged(); + return this; + } + /** + * + * + *
+     * Internet protocol versions for which the instance has IP addresses
+     * assigned. For this version, only MODE_IPV4 is supported.
+     * 
+ * + * repeated .google.cloud.filestore.v1.NetworkConfig.AddressMode modes = 3; + * + * @param values The modes to add. + * @return This builder for chaining. + */ + public Builder addAllModes( + java.lang.Iterable + values) { + ensureModesIsMutable(); + for (com.google.cloud.filestore.v1.NetworkConfig.AddressMode value : values) { + modes_.add(value.getNumber()); + } + onChanged(); + return this; + } + /** + * + * + *
+     * Internet protocol versions for which the instance has IP addresses
+     * assigned. For this version, only MODE_IPV4 is supported.
+     * 
+ * + * repeated .google.cloud.filestore.v1.NetworkConfig.AddressMode modes = 3; + * + * @return This builder for chaining. + */ + public Builder clearModes() { + modes_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Internet protocol versions for which the instance has IP addresses
+     * assigned. For this version, only MODE_IPV4 is supported.
+     * 
+ * + * repeated .google.cloud.filestore.v1.NetworkConfig.AddressMode modes = 3; + * + * @return A list containing the enum numeric values on the wire for modes. + */ + public java.util.List getModesValueList() { + return java.util.Collections.unmodifiableList(modes_); + } + /** + * + * + *
+     * Internet protocol versions for which the instance has IP addresses
+     * assigned. For this version, only MODE_IPV4 is supported.
+     * 
+ * + * repeated .google.cloud.filestore.v1.NetworkConfig.AddressMode modes = 3; + * + * @param index The index of the value to return. + * @return The enum numeric value on the wire of modes at the given index. + */ + public int getModesValue(int index) { + return modes_.get(index); + } + /** + * + * + *
+     * Internet protocol versions for which the instance has IP addresses
+     * assigned. For this version, only MODE_IPV4 is supported.
+     * 
+ * + * repeated .google.cloud.filestore.v1.NetworkConfig.AddressMode modes = 3; + * + * @param index The index of the value to return. + * @return The enum numeric value on the wire of modes at the given index. + * @return This builder for chaining. + */ + public Builder setModesValue(int index, int value) { + ensureModesIsMutable(); + modes_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * Internet protocol versions for which the instance has IP addresses
+     * assigned. For this version, only MODE_IPV4 is supported.
+     * 
+ * + * repeated .google.cloud.filestore.v1.NetworkConfig.AddressMode modes = 3; + * + * @param value The enum numeric value on the wire for modes to add. + * @return This builder for chaining. + */ + public Builder addModesValue(int value) { + ensureModesIsMutable(); + modes_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+     * Internet protocol versions for which the instance has IP addresses
+     * assigned. For this version, only MODE_IPV4 is supported.
+     * 
+ * + * repeated .google.cloud.filestore.v1.NetworkConfig.AddressMode modes = 3; + * + * @param values The enum numeric values on the wire for modes to add. + * @return This builder for chaining. + */ + public Builder addAllModesValue(java.lang.Iterable values) { + ensureModesIsMutable(); + for (int value : values) { + modes_.add(value); + } + onChanged(); + return this; + } + + private java.lang.Object reservedIpRange_ = ""; + /** + * + * + *
+     * A /29 CIDR block in one of the
+     * [internal IP address
+     * ranges](https://www.arin.net/knowledge/address_filters.html) that
+     * identifies the range of IP addresses reserved for this instance. For
+     * example, 10.0.0.0/29 or 192.168.0.0/29. 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.
+     * 
+ * + * string reserved_ip_range = 4; + * + * @return The reservedIpRange. + */ + public java.lang.String getReservedIpRange() { + java.lang.Object ref = reservedIpRange_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + reservedIpRange_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * A /29 CIDR block in one of the
+     * [internal IP address
+     * ranges](https://www.arin.net/knowledge/address_filters.html) that
+     * identifies the range of IP addresses reserved for this instance. For
+     * example, 10.0.0.0/29 or 192.168.0.0/29. 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.
+     * 
+ * + * string reserved_ip_range = 4; + * + * @return The bytes for reservedIpRange. + */ + public com.google.protobuf.ByteString getReservedIpRangeBytes() { + java.lang.Object ref = reservedIpRange_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + reservedIpRange_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * A /29 CIDR block in one of the
+     * [internal IP address
+     * ranges](https://www.arin.net/knowledge/address_filters.html) that
+     * identifies the range of IP addresses reserved for this instance. For
+     * example, 10.0.0.0/29 or 192.168.0.0/29. 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.
+     * 
+ * + * string reserved_ip_range = 4; + * + * @param value The reservedIpRange to set. + * @return This builder for chaining. + */ + public Builder setReservedIpRange(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + reservedIpRange_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * A /29 CIDR block in one of the
+     * [internal IP address
+     * ranges](https://www.arin.net/knowledge/address_filters.html) that
+     * identifies the range of IP addresses reserved for this instance. For
+     * example, 10.0.0.0/29 or 192.168.0.0/29. 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.
+     * 
+ * + * string reserved_ip_range = 4; + * + * @return This builder for chaining. + */ + public Builder clearReservedIpRange() { + + reservedIpRange_ = getDefaultInstance().getReservedIpRange(); + onChanged(); + return this; + } + /** + * + * + *
+     * A /29 CIDR block in one of the
+     * [internal IP address
+     * ranges](https://www.arin.net/knowledge/address_filters.html) that
+     * identifies the range of IP addresses reserved for this instance. For
+     * example, 10.0.0.0/29 or 192.168.0.0/29. 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.
+     * 
+ * + * string reserved_ip_range = 4; + * + * @param value The bytes for reservedIpRange to set. + * @return This builder for chaining. + */ + public Builder setReservedIpRangeBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + reservedIpRange_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringList ipAddresses_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureIpAddressesIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + ipAddresses_ = new com.google.protobuf.LazyStringArrayList(ipAddresses_); + bitField0_ |= 0x00000002; + } + } + /** + * + * + *
+     * Output only. IPv4 addresses in the format
+     * {octet 1}.{octet 2}.{octet 3}.{octet 4} or IPv6 addresses in the format
+     * {block 1}:{block 2}:{block 3}:{block 4}:{block 5}:{block 6}:{block
+     * 7}:{block 8}.
+     * 
+ * + * repeated string ip_addresses = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return A list containing the ipAddresses. + */ + public com.google.protobuf.ProtocolStringList getIpAddressesList() { + return ipAddresses_.getUnmodifiableView(); + } + /** + * + * + *
+     * Output only. IPv4 addresses in the format
+     * {octet 1}.{octet 2}.{octet 3}.{octet 4} or IPv6 addresses in the format
+     * {block 1}:{block 2}:{block 3}:{block 4}:{block 5}:{block 6}:{block
+     * 7}:{block 8}.
+     * 
+ * + * repeated string ip_addresses = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The count of ipAddresses. + */ + public int getIpAddressesCount() { + return ipAddresses_.size(); + } + /** + * + * + *
+     * Output only. IPv4 addresses in the format
+     * {octet 1}.{octet 2}.{octet 3}.{octet 4} or IPv6 addresses in the format
+     * {block 1}:{block 2}:{block 3}:{block 4}:{block 5}:{block 6}:{block
+     * 7}:{block 8}.
+     * 
+ * + * repeated string ip_addresses = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param index The index of the element to return. + * @return The ipAddresses at the given index. + */ + public java.lang.String getIpAddresses(int index) { + return ipAddresses_.get(index); + } + /** + * + * + *
+     * Output only. IPv4 addresses in the format
+     * {octet 1}.{octet 2}.{octet 3}.{octet 4} or IPv6 addresses in the format
+     * {block 1}:{block 2}:{block 3}:{block 4}:{block 5}:{block 6}:{block
+     * 7}:{block 8}.
+     * 
+ * + * repeated string ip_addresses = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param index The index of the value to return. + * @return The bytes of the ipAddresses at the given index. + */ + public com.google.protobuf.ByteString getIpAddressesBytes(int index) { + return ipAddresses_.getByteString(index); + } + /** + * + * + *
+     * Output only. IPv4 addresses in the format
+     * {octet 1}.{octet 2}.{octet 3}.{octet 4} or IPv6 addresses in the format
+     * {block 1}:{block 2}:{block 3}:{block 4}:{block 5}:{block 6}:{block
+     * 7}:{block 8}.
+     * 
+ * + * repeated string ip_addresses = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param index The index to set the value at. + * @param value The ipAddresses to set. + * @return This builder for chaining. + */ + public Builder setIpAddresses(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureIpAddressesIsMutable(); + ipAddresses_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. IPv4 addresses in the format
+     * {octet 1}.{octet 2}.{octet 3}.{octet 4} or IPv6 addresses in the format
+     * {block 1}:{block 2}:{block 3}:{block 4}:{block 5}:{block 6}:{block
+     * 7}:{block 8}.
+     * 
+ * + * repeated string ip_addresses = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The ipAddresses to add. + * @return This builder for chaining. + */ + public Builder addIpAddresses(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureIpAddressesIsMutable(); + ipAddresses_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. IPv4 addresses in the format
+     * {octet 1}.{octet 2}.{octet 3}.{octet 4} or IPv6 addresses in the format
+     * {block 1}:{block 2}:{block 3}:{block 4}:{block 5}:{block 6}:{block
+     * 7}:{block 8}.
+     * 
+ * + * repeated string ip_addresses = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param values The ipAddresses to add. + * @return This builder for chaining. + */ + public Builder addAllIpAddresses(java.lang.Iterable values) { + ensureIpAddressesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, ipAddresses_); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. IPv4 addresses in the format
+     * {octet 1}.{octet 2}.{octet 3}.{octet 4} or IPv6 addresses in the format
+     * {block 1}:{block 2}:{block 3}:{block 4}:{block 5}:{block 6}:{block
+     * 7}:{block 8}.
+     * 
+ * + * repeated string ip_addresses = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearIpAddresses() { + ipAddresses_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. IPv4 addresses in the format
+     * {octet 1}.{octet 2}.{octet 3}.{octet 4} or IPv6 addresses in the format
+     * {block 1}:{block 2}:{block 3}:{block 4}:{block 5}:{block 6}:{block
+     * 7}:{block 8}.
+     * 
+ * + * repeated string ip_addresses = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes of the ipAddresses to add. + * @return This builder for chaining. + */ + public Builder addIpAddressesBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureIpAddressesIsMutable(); + ipAddresses_.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.v1.NetworkConfig) + } + + // @@protoc_insertion_point(class_scope:google.cloud.filestore.v1.NetworkConfig) + private static final com.google.cloud.filestore.v1.NetworkConfig DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.filestore.v1.NetworkConfig(); + } + + public static com.google.cloud.filestore.v1.NetworkConfig getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public NetworkConfig parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new NetworkConfig(input, extensionRegistry); + } + }; + + 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.v1.NetworkConfig getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-filestore-v1/src/main/java/com/google/cloud/filestore/v1/NetworkConfigOrBuilder.java b/proto-google-cloud-filestore-v1/src/main/java/com/google/cloud/filestore/v1/NetworkConfigOrBuilder.java new file mode 100644 index 00000000..8fd1f3a2 --- /dev/null +++ b/proto-google-cloud-filestore-v1/src/main/java/com/google/cloud/filestore/v1/NetworkConfigOrBuilder.java @@ -0,0 +1,222 @@ +/* + * 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/v1/cloud_filestore_service.proto + +package com.google.cloud.filestore.v1; + +public interface NetworkConfigOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.filestore.v1.NetworkConfig) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The name of the Google Compute Engine
+   * [VPC network](/compute/docs/networks-and-firewalls#networks) to which the
+   * instance is connected.
+   * 
+ * + * string network = 1; + * + * @return The network. + */ + java.lang.String getNetwork(); + /** + * + * + *
+   * The name of the Google Compute Engine
+   * [VPC network](/compute/docs/networks-and-firewalls#networks) to which the
+   * instance is connected.
+   * 
+ * + * string network = 1; + * + * @return The bytes for network. + */ + com.google.protobuf.ByteString getNetworkBytes(); + + /** + * + * + *
+   * Internet protocol versions for which the instance has IP addresses
+   * assigned. For this version, only MODE_IPV4 is supported.
+   * 
+ * + * repeated .google.cloud.filestore.v1.NetworkConfig.AddressMode modes = 3; + * + * @return A list containing the modes. + */ + java.util.List getModesList(); + /** + * + * + *
+   * Internet protocol versions for which the instance has IP addresses
+   * assigned. For this version, only MODE_IPV4 is supported.
+   * 
+ * + * repeated .google.cloud.filestore.v1.NetworkConfig.AddressMode modes = 3; + * + * @return The count of modes. + */ + int getModesCount(); + /** + * + * + *
+   * Internet protocol versions for which the instance has IP addresses
+   * assigned. For this version, only MODE_IPV4 is supported.
+   * 
+ * + * repeated .google.cloud.filestore.v1.NetworkConfig.AddressMode modes = 3; + * + * @param index The index of the element to return. + * @return The modes at the given index. + */ + com.google.cloud.filestore.v1.NetworkConfig.AddressMode getModes(int index); + /** + * + * + *
+   * Internet protocol versions for which the instance has IP addresses
+   * assigned. For this version, only MODE_IPV4 is supported.
+   * 
+ * + * repeated .google.cloud.filestore.v1.NetworkConfig.AddressMode modes = 3; + * + * @return A list containing the enum numeric values on the wire for modes. + */ + java.util.List getModesValueList(); + /** + * + * + *
+   * Internet protocol versions for which the instance has IP addresses
+   * assigned. For this version, only MODE_IPV4 is supported.
+   * 
+ * + * repeated .google.cloud.filestore.v1.NetworkConfig.AddressMode modes = 3; + * + * @param index The index of the value to return. + * @return The enum numeric value on the wire of modes at the given index. + */ + int getModesValue(int index); + + /** + * + * + *
+   * A /29 CIDR block in one of the
+   * [internal IP address
+   * ranges](https://www.arin.net/knowledge/address_filters.html) that
+   * identifies the range of IP addresses reserved for this instance. For
+   * example, 10.0.0.0/29 or 192.168.0.0/29. 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.
+   * 
+ * + * string reserved_ip_range = 4; + * + * @return The reservedIpRange. + */ + java.lang.String getReservedIpRange(); + /** + * + * + *
+   * A /29 CIDR block in one of the
+   * [internal IP address
+   * ranges](https://www.arin.net/knowledge/address_filters.html) that
+   * identifies the range of IP addresses reserved for this instance. For
+   * example, 10.0.0.0/29 or 192.168.0.0/29. 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.
+   * 
+ * + * string reserved_ip_range = 4; + * + * @return The bytes for reservedIpRange. + */ + com.google.protobuf.ByteString getReservedIpRangeBytes(); + + /** + * + * + *
+   * Output only. IPv4 addresses in the format
+   * {octet 1}.{octet 2}.{octet 3}.{octet 4} or IPv6 addresses in the format
+   * {block 1}:{block 2}:{block 3}:{block 4}:{block 5}:{block 6}:{block
+   * 7}:{block 8}.
+   * 
+ * + * repeated string ip_addresses = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return A list containing the ipAddresses. + */ + java.util.List getIpAddressesList(); + /** + * + * + *
+   * Output only. IPv4 addresses in the format
+   * {octet 1}.{octet 2}.{octet 3}.{octet 4} or IPv6 addresses in the format
+   * {block 1}:{block 2}:{block 3}:{block 4}:{block 5}:{block 6}:{block
+   * 7}:{block 8}.
+   * 
+ * + * repeated string ip_addresses = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The count of ipAddresses. + */ + int getIpAddressesCount(); + /** + * + * + *
+   * Output only. IPv4 addresses in the format
+   * {octet 1}.{octet 2}.{octet 3}.{octet 4} or IPv6 addresses in the format
+   * {block 1}:{block 2}:{block 3}:{block 4}:{block 5}:{block 6}:{block
+   * 7}:{block 8}.
+   * 
+ * + * repeated string ip_addresses = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param index The index of the element to return. + * @return The ipAddresses at the given index. + */ + java.lang.String getIpAddresses(int index); + /** + * + * + *
+   * Output only. IPv4 addresses in the format
+   * {octet 1}.{octet 2}.{octet 3}.{octet 4} or IPv6 addresses in the format
+   * {block 1}:{block 2}:{block 3}:{block 4}:{block 5}:{block 6}:{block
+   * 7}:{block 8}.
+   * 
+ * + * repeated string ip_addresses = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param index The index of the value to return. + * @return The bytes of the ipAddresses at the given index. + */ + com.google.protobuf.ByteString getIpAddressesBytes(int index); +} diff --git a/proto-google-cloud-filestore-v1/src/main/java/com/google/cloud/filestore/v1/NfsExportOptions.java b/proto-google-cloud-filestore-v1/src/main/java/com/google/cloud/filestore/v1/NfsExportOptions.java new file mode 100644 index 00000000..0f1ef0b0 --- /dev/null +++ b/proto-google-cloud-filestore-v1/src/main/java/com/google/cloud/filestore/v1/NfsExportOptions.java @@ -0,0 +1,1688 @@ +/* + * 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/v1/cloud_filestore_service.proto + +package com.google.cloud.filestore.v1; + +/** + * + * + *
+ * NFS export options specifications.
+ * 
+ * + * Protobuf type {@code google.cloud.filestore.v1.NfsExportOptions} + */ +public final class NfsExportOptions extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.filestore.v1.NfsExportOptions) + NfsExportOptionsOrBuilder { + private static final long serialVersionUID = 0L; + // Use NfsExportOptions.newBuilder() to construct. + private NfsExportOptions(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private NfsExportOptions() { + ipRanges_ = com.google.protobuf.LazyStringArrayList.EMPTY; + accessMode_ = 0; + squashMode_ = 0; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new NfsExportOptions(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private NfsExportOptions( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + ipRanges_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000001; + } + ipRanges_.add(s); + break; + } + case 16: + { + int rawValue = input.readEnum(); + + accessMode_ = rawValue; + break; + } + case 24: + { + int rawValue = input.readEnum(); + + squashMode_ = rawValue; + break; + } + case 32: + { + anonUid_ = input.readInt64(); + break; + } + case 40: + { + anonGid_ = input.readInt64(); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + ipRanges_ = ipRanges_.getUnmodifiableView(); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.filestore.v1.CloudFilestoreServiceProto + .internal_static_google_cloud_filestore_v1_NfsExportOptions_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.filestore.v1.CloudFilestoreServiceProto + .internal_static_google_cloud_filestore_v1_NfsExportOptions_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.filestore.v1.NfsExportOptions.class, + com.google.cloud.filestore.v1.NfsExportOptions.Builder.class); + } + + /** + * + * + *
+   * The access mode.
+   * 
+ * + * Protobuf enum {@code google.cloud.filestore.v1.NfsExportOptions.AccessMode} + */ + public enum AccessMode implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * AccessMode not set.
+     * 
+ * + * ACCESS_MODE_UNSPECIFIED = 0; + */ + ACCESS_MODE_UNSPECIFIED(0), + /** + * + * + *
+     * The client can only read the file share.
+     * 
+ * + * READ_ONLY = 1; + */ + READ_ONLY(1), + /** + * + * + *
+     * The client can read and write the file share (default).
+     * 
+ * + * READ_WRITE = 2; + */ + READ_WRITE(2), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * AccessMode not set.
+     * 
+ * + * ACCESS_MODE_UNSPECIFIED = 0; + */ + public static final int ACCESS_MODE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * The client can only read the file share.
+     * 
+ * + * READ_ONLY = 1; + */ + public static final int READ_ONLY_VALUE = 1; + /** + * + * + *
+     * The client can read and write the file share (default).
+     * 
+ * + * READ_WRITE = 2; + */ + public static final int READ_WRITE_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 AccessMode 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 AccessMode forNumber(int value) { + switch (value) { + case 0: + return ACCESS_MODE_UNSPECIFIED; + case 1: + return READ_ONLY; + case 2: + return READ_WRITE; + 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 AccessMode findValueByNumber(int number) { + return AccessMode.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.v1.NfsExportOptions.getDescriptor().getEnumTypes().get(0); + } + + private static final AccessMode[] VALUES = values(); + + public static AccessMode 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 AccessMode(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.filestore.v1.NfsExportOptions.AccessMode) + } + + /** + * + * + *
+   * The squash mode.
+   * 
+ * + * Protobuf enum {@code google.cloud.filestore.v1.NfsExportOptions.SquashMode} + */ + public enum SquashMode implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * SquashMode not set.
+     * 
+ * + * SQUASH_MODE_UNSPECIFIED = 0; + */ + SQUASH_MODE_UNSPECIFIED(0), + /** + * + * + *
+     * The Root user has root access to the file share (default).
+     * 
+ * + * NO_ROOT_SQUASH = 1; + */ + NO_ROOT_SQUASH(1), + /** + * + * + *
+     * The Root user has squashed access to the anonymous uid/gid.
+     * 
+ * + * ROOT_SQUASH = 2; + */ + ROOT_SQUASH(2), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * SquashMode not set.
+     * 
+ * + * SQUASH_MODE_UNSPECIFIED = 0; + */ + public static final int SQUASH_MODE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * The Root user has root access to the file share (default).
+     * 
+ * + * NO_ROOT_SQUASH = 1; + */ + public static final int NO_ROOT_SQUASH_VALUE = 1; + /** + * + * + *
+     * The Root user has squashed access to the anonymous uid/gid.
+     * 
+ * + * ROOT_SQUASH = 2; + */ + public static final int ROOT_SQUASH_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 SquashMode 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 SquashMode forNumber(int value) { + switch (value) { + case 0: + return SQUASH_MODE_UNSPECIFIED; + case 1: + return NO_ROOT_SQUASH; + case 2: + return ROOT_SQUASH; + 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 SquashMode findValueByNumber(int number) { + return SquashMode.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.v1.NfsExportOptions.getDescriptor().getEnumTypes().get(1); + } + + private static final SquashMode[] VALUES = values(); + + public static SquashMode 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 SquashMode(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.filestore.v1.NfsExportOptions.SquashMode) + } + + public static final int IP_RANGES_FIELD_NUMBER = 1; + private com.google.protobuf.LazyStringList ipRanges_; + /** + * + * + *
+   * List of either an IPv4 addresses in the format
+   * {octet 1}.{octet 2}.{octet 3}.{octet 4} or CIDR ranges in the format
+   * {octet 1}.{octet 2}.{octet 3}.{octet 4}/{mask size} which may mount the
+   * file share.
+   * Overlapping IP ranges are not allowed, both within and across
+   * NfsExportOptions. An error will be returned.
+   * The limit is 64 IP ranges/addresses for each FileShareConfig among all
+   * NfsExportOptions.
+   * 
+ * + * repeated string ip_ranges = 1; + * + * @return A list containing the ipRanges. + */ + public com.google.protobuf.ProtocolStringList getIpRangesList() { + return ipRanges_; + } + /** + * + * + *
+   * List of either an IPv4 addresses in the format
+   * {octet 1}.{octet 2}.{octet 3}.{octet 4} or CIDR ranges in the format
+   * {octet 1}.{octet 2}.{octet 3}.{octet 4}/{mask size} which may mount the
+   * file share.
+   * Overlapping IP ranges are not allowed, both within and across
+   * NfsExportOptions. An error will be returned.
+   * The limit is 64 IP ranges/addresses for each FileShareConfig among all
+   * NfsExportOptions.
+   * 
+ * + * repeated string ip_ranges = 1; + * + * @return The count of ipRanges. + */ + public int getIpRangesCount() { + return ipRanges_.size(); + } + /** + * + * + *
+   * List of either an IPv4 addresses in the format
+   * {octet 1}.{octet 2}.{octet 3}.{octet 4} or CIDR ranges in the format
+   * {octet 1}.{octet 2}.{octet 3}.{octet 4}/{mask size} which may mount the
+   * file share.
+   * Overlapping IP ranges are not allowed, both within and across
+   * NfsExportOptions. An error will be returned.
+   * The limit is 64 IP ranges/addresses for each FileShareConfig among all
+   * NfsExportOptions.
+   * 
+ * + * repeated string ip_ranges = 1; + * + * @param index The index of the element to return. + * @return The ipRanges at the given index. + */ + public java.lang.String getIpRanges(int index) { + return ipRanges_.get(index); + } + /** + * + * + *
+   * List of either an IPv4 addresses in the format
+   * {octet 1}.{octet 2}.{octet 3}.{octet 4} or CIDR ranges in the format
+   * {octet 1}.{octet 2}.{octet 3}.{octet 4}/{mask size} which may mount the
+   * file share.
+   * Overlapping IP ranges are not allowed, both within and across
+   * NfsExportOptions. An error will be returned.
+   * The limit is 64 IP ranges/addresses for each FileShareConfig among all
+   * NfsExportOptions.
+   * 
+ * + * repeated string ip_ranges = 1; + * + * @param index The index of the value to return. + * @return The bytes of the ipRanges at the given index. + */ + public com.google.protobuf.ByteString getIpRangesBytes(int index) { + return ipRanges_.getByteString(index); + } + + public static final int ACCESS_MODE_FIELD_NUMBER = 2; + private int accessMode_; + /** + * + * + *
+   * Either READ_ONLY, for allowing only read requests on the exported
+   * directory, or READ_WRITE, for allowing both read and write requests.
+   * The default is READ_WRITE.
+   * 
+ * + * .google.cloud.filestore.v1.NfsExportOptions.AccessMode access_mode = 2; + * + * @return The enum numeric value on the wire for accessMode. + */ + @java.lang.Override + public int getAccessModeValue() { + return accessMode_; + } + /** + * + * + *
+   * Either READ_ONLY, for allowing only read requests on the exported
+   * directory, or READ_WRITE, for allowing both read and write requests.
+   * The default is READ_WRITE.
+   * 
+ * + * .google.cloud.filestore.v1.NfsExportOptions.AccessMode access_mode = 2; + * + * @return The accessMode. + */ + @java.lang.Override + public com.google.cloud.filestore.v1.NfsExportOptions.AccessMode getAccessMode() { + @SuppressWarnings("deprecation") + com.google.cloud.filestore.v1.NfsExportOptions.AccessMode result = + com.google.cloud.filestore.v1.NfsExportOptions.AccessMode.valueOf(accessMode_); + return result == null + ? com.google.cloud.filestore.v1.NfsExportOptions.AccessMode.UNRECOGNIZED + : result; + } + + public static final int SQUASH_MODE_FIELD_NUMBER = 3; + private int squashMode_; + /** + * + * + *
+   * Either NO_ROOT_SQUASH, for allowing root access on the exported directory,
+   * or ROOT_SQUASH, for not allowing root access. The default is
+   * NO_ROOT_SQUASH.
+   * 
+ * + * .google.cloud.filestore.v1.NfsExportOptions.SquashMode squash_mode = 3; + * + * @return The enum numeric value on the wire for squashMode. + */ + @java.lang.Override + public int getSquashModeValue() { + return squashMode_; + } + /** + * + * + *
+   * Either NO_ROOT_SQUASH, for allowing root access on the exported directory,
+   * or ROOT_SQUASH, for not allowing root access. The default is
+   * NO_ROOT_SQUASH.
+   * 
+ * + * .google.cloud.filestore.v1.NfsExportOptions.SquashMode squash_mode = 3; + * + * @return The squashMode. + */ + @java.lang.Override + public com.google.cloud.filestore.v1.NfsExportOptions.SquashMode getSquashMode() { + @SuppressWarnings("deprecation") + com.google.cloud.filestore.v1.NfsExportOptions.SquashMode result = + com.google.cloud.filestore.v1.NfsExportOptions.SquashMode.valueOf(squashMode_); + return result == null + ? com.google.cloud.filestore.v1.NfsExportOptions.SquashMode.UNRECOGNIZED + : result; + } + + public static final int ANON_UID_FIELD_NUMBER = 4; + private long anonUid_; + /** + * + * + *
+   * An integer representing the anonymous user id with a default value of
+   * 65534.
+   * Anon_uid may only be set with squash_mode of ROOT_SQUASH.  An error will be
+   * returned if this field is specified for other squash_mode settings.
+   * 
+ * + * int64 anon_uid = 4; + * + * @return The anonUid. + */ + @java.lang.Override + public long getAnonUid() { + return anonUid_; + } + + public static final int ANON_GID_FIELD_NUMBER = 5; + private long anonGid_; + /** + * + * + *
+   * An integer representing the anonymous group id with a default value of
+   * 65534.
+   * Anon_gid may only be set with squash_mode of ROOT_SQUASH.  An error will be
+   * returned if this field is specified for other squash_mode settings.
+   * 
+ * + * int64 anon_gid = 5; + * + * @return The anonGid. + */ + @java.lang.Override + public long getAnonGid() { + return anonGid_; + } + + 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 < ipRanges_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, ipRanges_.getRaw(i)); + } + if (accessMode_ + != com.google.cloud.filestore.v1.NfsExportOptions.AccessMode.ACCESS_MODE_UNSPECIFIED + .getNumber()) { + output.writeEnum(2, accessMode_); + } + if (squashMode_ + != com.google.cloud.filestore.v1.NfsExportOptions.SquashMode.SQUASH_MODE_UNSPECIFIED + .getNumber()) { + output.writeEnum(3, squashMode_); + } + if (anonUid_ != 0L) { + output.writeInt64(4, anonUid_); + } + if (anonGid_ != 0L) { + output.writeInt64(5, anonGid_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + { + int dataSize = 0; + for (int i = 0; i < ipRanges_.size(); i++) { + dataSize += computeStringSizeNoTag(ipRanges_.getRaw(i)); + } + size += dataSize; + size += 1 * getIpRangesList().size(); + } + if (accessMode_ + != com.google.cloud.filestore.v1.NfsExportOptions.AccessMode.ACCESS_MODE_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(2, accessMode_); + } + if (squashMode_ + != com.google.cloud.filestore.v1.NfsExportOptions.SquashMode.SQUASH_MODE_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(3, squashMode_); + } + if (anonUid_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(4, anonUid_); + } + if (anonGid_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(5, anonGid_); + } + size += unknownFields.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.v1.NfsExportOptions)) { + return super.equals(obj); + } + com.google.cloud.filestore.v1.NfsExportOptions other = + (com.google.cloud.filestore.v1.NfsExportOptions) obj; + + if (!getIpRangesList().equals(other.getIpRangesList())) return false; + if (accessMode_ != other.accessMode_) return false; + if (squashMode_ != other.squashMode_) return false; + if (getAnonUid() != other.getAnonUid()) return false; + if (getAnonGid() != other.getAnonGid()) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getIpRangesCount() > 0) { + hash = (37 * hash) + IP_RANGES_FIELD_NUMBER; + hash = (53 * hash) + getIpRangesList().hashCode(); + } + hash = (37 * hash) + ACCESS_MODE_FIELD_NUMBER; + hash = (53 * hash) + accessMode_; + hash = (37 * hash) + SQUASH_MODE_FIELD_NUMBER; + hash = (53 * hash) + squashMode_; + hash = (37 * hash) + ANON_UID_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getAnonUid()); + hash = (37 * hash) + ANON_GID_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getAnonGid()); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.filestore.v1.NfsExportOptions parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.filestore.v1.NfsExportOptions 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.v1.NfsExportOptions parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.filestore.v1.NfsExportOptions 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.v1.NfsExportOptions parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.filestore.v1.NfsExportOptions parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.filestore.v1.NfsExportOptions parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.filestore.v1.NfsExportOptions 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.v1.NfsExportOptions parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.filestore.v1.NfsExportOptions 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.v1.NfsExportOptions parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.filestore.v1.NfsExportOptions 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.v1.NfsExportOptions 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; + } + /** + * + * + *
+   * NFS export options specifications.
+   * 
+ * + * Protobuf type {@code google.cloud.filestore.v1.NfsExportOptions} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.filestore.v1.NfsExportOptions) + com.google.cloud.filestore.v1.NfsExportOptionsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.filestore.v1.CloudFilestoreServiceProto + .internal_static_google_cloud_filestore_v1_NfsExportOptions_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.filestore.v1.CloudFilestoreServiceProto + .internal_static_google_cloud_filestore_v1_NfsExportOptions_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.filestore.v1.NfsExportOptions.class, + com.google.cloud.filestore.v1.NfsExportOptions.Builder.class); + } + + // Construct using com.google.cloud.filestore.v1.NfsExportOptions.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + ipRanges_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + accessMode_ = 0; + + squashMode_ = 0; + + anonUid_ = 0L; + + anonGid_ = 0L; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.filestore.v1.CloudFilestoreServiceProto + .internal_static_google_cloud_filestore_v1_NfsExportOptions_descriptor; + } + + @java.lang.Override + public com.google.cloud.filestore.v1.NfsExportOptions getDefaultInstanceForType() { + return com.google.cloud.filestore.v1.NfsExportOptions.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.filestore.v1.NfsExportOptions build() { + com.google.cloud.filestore.v1.NfsExportOptions result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.filestore.v1.NfsExportOptions buildPartial() { + com.google.cloud.filestore.v1.NfsExportOptions result = + new com.google.cloud.filestore.v1.NfsExportOptions(this); + int from_bitField0_ = bitField0_; + if (((bitField0_ & 0x00000001) != 0)) { + ipRanges_ = ipRanges_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.ipRanges_ = ipRanges_; + result.accessMode_ = accessMode_; + result.squashMode_ = squashMode_; + result.anonUid_ = anonUid_; + result.anonGid_ = anonGid_; + 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.v1.NfsExportOptions) { + return mergeFrom((com.google.cloud.filestore.v1.NfsExportOptions) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.filestore.v1.NfsExportOptions other) { + if (other == com.google.cloud.filestore.v1.NfsExportOptions.getDefaultInstance()) return this; + if (!other.ipRanges_.isEmpty()) { + if (ipRanges_.isEmpty()) { + ipRanges_ = other.ipRanges_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureIpRangesIsMutable(); + ipRanges_.addAll(other.ipRanges_); + } + onChanged(); + } + if (other.accessMode_ != 0) { + setAccessModeValue(other.getAccessModeValue()); + } + if (other.squashMode_ != 0) { + setSquashModeValue(other.getSquashModeValue()); + } + if (other.getAnonUid() != 0L) { + setAnonUid(other.getAnonUid()); + } + if (other.getAnonGid() != 0L) { + setAnonGid(other.getAnonGid()); + } + this.mergeUnknownFields(other.unknownFields); + 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 { + com.google.cloud.filestore.v1.NfsExportOptions parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.filestore.v1.NfsExportOptions) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private com.google.protobuf.LazyStringList ipRanges_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureIpRangesIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + ipRanges_ = new com.google.protobuf.LazyStringArrayList(ipRanges_); + bitField0_ |= 0x00000001; + } + } + /** + * + * + *
+     * List of either an IPv4 addresses in the format
+     * {octet 1}.{octet 2}.{octet 3}.{octet 4} or CIDR ranges in the format
+     * {octet 1}.{octet 2}.{octet 3}.{octet 4}/{mask size} which may mount the
+     * file share.
+     * Overlapping IP ranges are not allowed, both within and across
+     * NfsExportOptions. An error will be returned.
+     * The limit is 64 IP ranges/addresses for each FileShareConfig among all
+     * NfsExportOptions.
+     * 
+ * + * repeated string ip_ranges = 1; + * + * @return A list containing the ipRanges. + */ + public com.google.protobuf.ProtocolStringList getIpRangesList() { + return ipRanges_.getUnmodifiableView(); + } + /** + * + * + *
+     * List of either an IPv4 addresses in the format
+     * {octet 1}.{octet 2}.{octet 3}.{octet 4} or CIDR ranges in the format
+     * {octet 1}.{octet 2}.{octet 3}.{octet 4}/{mask size} which may mount the
+     * file share.
+     * Overlapping IP ranges are not allowed, both within and across
+     * NfsExportOptions. An error will be returned.
+     * The limit is 64 IP ranges/addresses for each FileShareConfig among all
+     * NfsExportOptions.
+     * 
+ * + * repeated string ip_ranges = 1; + * + * @return The count of ipRanges. + */ + public int getIpRangesCount() { + return ipRanges_.size(); + } + /** + * + * + *
+     * List of either an IPv4 addresses in the format
+     * {octet 1}.{octet 2}.{octet 3}.{octet 4} or CIDR ranges in the format
+     * {octet 1}.{octet 2}.{octet 3}.{octet 4}/{mask size} which may mount the
+     * file share.
+     * Overlapping IP ranges are not allowed, both within and across
+     * NfsExportOptions. An error will be returned.
+     * The limit is 64 IP ranges/addresses for each FileShareConfig among all
+     * NfsExportOptions.
+     * 
+ * + * repeated string ip_ranges = 1; + * + * @param index The index of the element to return. + * @return The ipRanges at the given index. + */ + public java.lang.String getIpRanges(int index) { + return ipRanges_.get(index); + } + /** + * + * + *
+     * List of either an IPv4 addresses in the format
+     * {octet 1}.{octet 2}.{octet 3}.{octet 4} or CIDR ranges in the format
+     * {octet 1}.{octet 2}.{octet 3}.{octet 4}/{mask size} which may mount the
+     * file share.
+     * Overlapping IP ranges are not allowed, both within and across
+     * NfsExportOptions. An error will be returned.
+     * The limit is 64 IP ranges/addresses for each FileShareConfig among all
+     * NfsExportOptions.
+     * 
+ * + * repeated string ip_ranges = 1; + * + * @param index The index of the value to return. + * @return The bytes of the ipRanges at the given index. + */ + public com.google.protobuf.ByteString getIpRangesBytes(int index) { + return ipRanges_.getByteString(index); + } + /** + * + * + *
+     * List of either an IPv4 addresses in the format
+     * {octet 1}.{octet 2}.{octet 3}.{octet 4} or CIDR ranges in the format
+     * {octet 1}.{octet 2}.{octet 3}.{octet 4}/{mask size} which may mount the
+     * file share.
+     * Overlapping IP ranges are not allowed, both within and across
+     * NfsExportOptions. An error will be returned.
+     * The limit is 64 IP ranges/addresses for each FileShareConfig among all
+     * NfsExportOptions.
+     * 
+ * + * repeated string ip_ranges = 1; + * + * @param index The index to set the value at. + * @param value The ipRanges to set. + * @return This builder for chaining. + */ + public Builder setIpRanges(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureIpRangesIsMutable(); + ipRanges_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * List of either an IPv4 addresses in the format
+     * {octet 1}.{octet 2}.{octet 3}.{octet 4} or CIDR ranges in the format
+     * {octet 1}.{octet 2}.{octet 3}.{octet 4}/{mask size} which may mount the
+     * file share.
+     * Overlapping IP ranges are not allowed, both within and across
+     * NfsExportOptions. An error will be returned.
+     * The limit is 64 IP ranges/addresses for each FileShareConfig among all
+     * NfsExportOptions.
+     * 
+ * + * repeated string ip_ranges = 1; + * + * @param value The ipRanges to add. + * @return This builder for chaining. + */ + public Builder addIpRanges(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureIpRangesIsMutable(); + ipRanges_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+     * List of either an IPv4 addresses in the format
+     * {octet 1}.{octet 2}.{octet 3}.{octet 4} or CIDR ranges in the format
+     * {octet 1}.{octet 2}.{octet 3}.{octet 4}/{mask size} which may mount the
+     * file share.
+     * Overlapping IP ranges are not allowed, both within and across
+     * NfsExportOptions. An error will be returned.
+     * The limit is 64 IP ranges/addresses for each FileShareConfig among all
+     * NfsExportOptions.
+     * 
+ * + * repeated string ip_ranges = 1; + * + * @param values The ipRanges to add. + * @return This builder for chaining. + */ + public Builder addAllIpRanges(java.lang.Iterable values) { + ensureIpRangesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, ipRanges_); + onChanged(); + return this; + } + /** + * + * + *
+     * List of either an IPv4 addresses in the format
+     * {octet 1}.{octet 2}.{octet 3}.{octet 4} or CIDR ranges in the format
+     * {octet 1}.{octet 2}.{octet 3}.{octet 4}/{mask size} which may mount the
+     * file share.
+     * Overlapping IP ranges are not allowed, both within and across
+     * NfsExportOptions. An error will be returned.
+     * The limit is 64 IP ranges/addresses for each FileShareConfig among all
+     * NfsExportOptions.
+     * 
+ * + * repeated string ip_ranges = 1; + * + * @return This builder for chaining. + */ + public Builder clearIpRanges() { + ipRanges_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * List of either an IPv4 addresses in the format
+     * {octet 1}.{octet 2}.{octet 3}.{octet 4} or CIDR ranges in the format
+     * {octet 1}.{octet 2}.{octet 3}.{octet 4}/{mask size} which may mount the
+     * file share.
+     * Overlapping IP ranges are not allowed, both within and across
+     * NfsExportOptions. An error will be returned.
+     * The limit is 64 IP ranges/addresses for each FileShareConfig among all
+     * NfsExportOptions.
+     * 
+ * + * repeated string ip_ranges = 1; + * + * @param value The bytes of the ipRanges to add. + * @return This builder for chaining. + */ + public Builder addIpRangesBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureIpRangesIsMutable(); + ipRanges_.add(value); + onChanged(); + return this; + } + + private int accessMode_ = 0; + /** + * + * + *
+     * Either READ_ONLY, for allowing only read requests on the exported
+     * directory, or READ_WRITE, for allowing both read and write requests.
+     * The default is READ_WRITE.
+     * 
+ * + * .google.cloud.filestore.v1.NfsExportOptions.AccessMode access_mode = 2; + * + * @return The enum numeric value on the wire for accessMode. + */ + @java.lang.Override + public int getAccessModeValue() { + return accessMode_; + } + /** + * + * + *
+     * Either READ_ONLY, for allowing only read requests on the exported
+     * directory, or READ_WRITE, for allowing both read and write requests.
+     * The default is READ_WRITE.
+     * 
+ * + * .google.cloud.filestore.v1.NfsExportOptions.AccessMode access_mode = 2; + * + * @param value The enum numeric value on the wire for accessMode to set. + * @return This builder for chaining. + */ + public Builder setAccessModeValue(int value) { + + accessMode_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Either READ_ONLY, for allowing only read requests on the exported
+     * directory, or READ_WRITE, for allowing both read and write requests.
+     * The default is READ_WRITE.
+     * 
+ * + * .google.cloud.filestore.v1.NfsExportOptions.AccessMode access_mode = 2; + * + * @return The accessMode. + */ + @java.lang.Override + public com.google.cloud.filestore.v1.NfsExportOptions.AccessMode getAccessMode() { + @SuppressWarnings("deprecation") + com.google.cloud.filestore.v1.NfsExportOptions.AccessMode result = + com.google.cloud.filestore.v1.NfsExportOptions.AccessMode.valueOf(accessMode_); + return result == null + ? com.google.cloud.filestore.v1.NfsExportOptions.AccessMode.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * Either READ_ONLY, for allowing only read requests on the exported
+     * directory, or READ_WRITE, for allowing both read and write requests.
+     * The default is READ_WRITE.
+     * 
+ * + * .google.cloud.filestore.v1.NfsExportOptions.AccessMode access_mode = 2; + * + * @param value The accessMode to set. + * @return This builder for chaining. + */ + public Builder setAccessMode(com.google.cloud.filestore.v1.NfsExportOptions.AccessMode value) { + if (value == null) { + throw new NullPointerException(); + } + + accessMode_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Either READ_ONLY, for allowing only read requests on the exported
+     * directory, or READ_WRITE, for allowing both read and write requests.
+     * The default is READ_WRITE.
+     * 
+ * + * .google.cloud.filestore.v1.NfsExportOptions.AccessMode access_mode = 2; + * + * @return This builder for chaining. + */ + public Builder clearAccessMode() { + + accessMode_ = 0; + onChanged(); + return this; + } + + private int squashMode_ = 0; + /** + * + * + *
+     * Either NO_ROOT_SQUASH, for allowing root access on the exported directory,
+     * or ROOT_SQUASH, for not allowing root access. The default is
+     * NO_ROOT_SQUASH.
+     * 
+ * + * .google.cloud.filestore.v1.NfsExportOptions.SquashMode squash_mode = 3; + * + * @return The enum numeric value on the wire for squashMode. + */ + @java.lang.Override + public int getSquashModeValue() { + return squashMode_; + } + /** + * + * + *
+     * Either NO_ROOT_SQUASH, for allowing root access on the exported directory,
+     * or ROOT_SQUASH, for not allowing root access. The default is
+     * NO_ROOT_SQUASH.
+     * 
+ * + * .google.cloud.filestore.v1.NfsExportOptions.SquashMode squash_mode = 3; + * + * @param value The enum numeric value on the wire for squashMode to set. + * @return This builder for chaining. + */ + public Builder setSquashModeValue(int value) { + + squashMode_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Either NO_ROOT_SQUASH, for allowing root access on the exported directory,
+     * or ROOT_SQUASH, for not allowing root access. The default is
+     * NO_ROOT_SQUASH.
+     * 
+ * + * .google.cloud.filestore.v1.NfsExportOptions.SquashMode squash_mode = 3; + * + * @return The squashMode. + */ + @java.lang.Override + public com.google.cloud.filestore.v1.NfsExportOptions.SquashMode getSquashMode() { + @SuppressWarnings("deprecation") + com.google.cloud.filestore.v1.NfsExportOptions.SquashMode result = + com.google.cloud.filestore.v1.NfsExportOptions.SquashMode.valueOf(squashMode_); + return result == null + ? com.google.cloud.filestore.v1.NfsExportOptions.SquashMode.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * Either NO_ROOT_SQUASH, for allowing root access on the exported directory,
+     * or ROOT_SQUASH, for not allowing root access. The default is
+     * NO_ROOT_SQUASH.
+     * 
+ * + * .google.cloud.filestore.v1.NfsExportOptions.SquashMode squash_mode = 3; + * + * @param value The squashMode to set. + * @return This builder for chaining. + */ + public Builder setSquashMode(com.google.cloud.filestore.v1.NfsExportOptions.SquashMode value) { + if (value == null) { + throw new NullPointerException(); + } + + squashMode_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Either NO_ROOT_SQUASH, for allowing root access on the exported directory,
+     * or ROOT_SQUASH, for not allowing root access. The default is
+     * NO_ROOT_SQUASH.
+     * 
+ * + * .google.cloud.filestore.v1.NfsExportOptions.SquashMode squash_mode = 3; + * + * @return This builder for chaining. + */ + public Builder clearSquashMode() { + + squashMode_ = 0; + onChanged(); + return this; + } + + private long anonUid_; + /** + * + * + *
+     * An integer representing the anonymous user id with a default value of
+     * 65534.
+     * Anon_uid may only be set with squash_mode of ROOT_SQUASH.  An error will be
+     * returned if this field is specified for other squash_mode settings.
+     * 
+ * + * int64 anon_uid = 4; + * + * @return The anonUid. + */ + @java.lang.Override + public long getAnonUid() { + return anonUid_; + } + /** + * + * + *
+     * An integer representing the anonymous user id with a default value of
+     * 65534.
+     * Anon_uid may only be set with squash_mode of ROOT_SQUASH.  An error will be
+     * returned if this field is specified for other squash_mode settings.
+     * 
+ * + * int64 anon_uid = 4; + * + * @param value The anonUid to set. + * @return This builder for chaining. + */ + public Builder setAnonUid(long value) { + + anonUid_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * An integer representing the anonymous user id with a default value of
+     * 65534.
+     * Anon_uid may only be set with squash_mode of ROOT_SQUASH.  An error will be
+     * returned if this field is specified for other squash_mode settings.
+     * 
+ * + * int64 anon_uid = 4; + * + * @return This builder for chaining. + */ + public Builder clearAnonUid() { + + anonUid_ = 0L; + onChanged(); + return this; + } + + private long anonGid_; + /** + * + * + *
+     * An integer representing the anonymous group id with a default value of
+     * 65534.
+     * Anon_gid may only be set with squash_mode of ROOT_SQUASH.  An error will be
+     * returned if this field is specified for other squash_mode settings.
+     * 
+ * + * int64 anon_gid = 5; + * + * @return The anonGid. + */ + @java.lang.Override + public long getAnonGid() { + return anonGid_; + } + /** + * + * + *
+     * An integer representing the anonymous group id with a default value of
+     * 65534.
+     * Anon_gid may only be set with squash_mode of ROOT_SQUASH.  An error will be
+     * returned if this field is specified for other squash_mode settings.
+     * 
+ * + * int64 anon_gid = 5; + * + * @param value The anonGid to set. + * @return This builder for chaining. + */ + public Builder setAnonGid(long value) { + + anonGid_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * An integer representing the anonymous group id with a default value of
+     * 65534.
+     * Anon_gid may only be set with squash_mode of ROOT_SQUASH.  An error will be
+     * returned if this field is specified for other squash_mode settings.
+     * 
+ * + * int64 anon_gid = 5; + * + * @return This builder for chaining. + */ + public Builder clearAnonGid() { + + anonGid_ = 0L; + 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.v1.NfsExportOptions) + } + + // @@protoc_insertion_point(class_scope:google.cloud.filestore.v1.NfsExportOptions) + private static final com.google.cloud.filestore.v1.NfsExportOptions DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.filestore.v1.NfsExportOptions(); + } + + public static com.google.cloud.filestore.v1.NfsExportOptions getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public NfsExportOptions parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new NfsExportOptions(input, extensionRegistry); + } + }; + + 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.v1.NfsExportOptions getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-filestore-v1/src/main/java/com/google/cloud/filestore/v1/NfsExportOptionsOrBuilder.java b/proto-google-cloud-filestore-v1/src/main/java/com/google/cloud/filestore/v1/NfsExportOptionsOrBuilder.java new file mode 100644 index 00000000..8075468f --- /dev/null +++ b/proto-google-cloud-filestore-v1/src/main/java/com/google/cloud/filestore/v1/NfsExportOptionsOrBuilder.java @@ -0,0 +1,194 @@ +/* + * 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/v1/cloud_filestore_service.proto + +package com.google.cloud.filestore.v1; + +public interface NfsExportOptionsOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.filestore.v1.NfsExportOptions) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * List of either an IPv4 addresses in the format
+   * {octet 1}.{octet 2}.{octet 3}.{octet 4} or CIDR ranges in the format
+   * {octet 1}.{octet 2}.{octet 3}.{octet 4}/{mask size} which may mount the
+   * file share.
+   * Overlapping IP ranges are not allowed, both within and across
+   * NfsExportOptions. An error will be returned.
+   * The limit is 64 IP ranges/addresses for each FileShareConfig among all
+   * NfsExportOptions.
+   * 
+ * + * repeated string ip_ranges = 1; + * + * @return A list containing the ipRanges. + */ + java.util.List getIpRangesList(); + /** + * + * + *
+   * List of either an IPv4 addresses in the format
+   * {octet 1}.{octet 2}.{octet 3}.{octet 4} or CIDR ranges in the format
+   * {octet 1}.{octet 2}.{octet 3}.{octet 4}/{mask size} which may mount the
+   * file share.
+   * Overlapping IP ranges are not allowed, both within and across
+   * NfsExportOptions. An error will be returned.
+   * The limit is 64 IP ranges/addresses for each FileShareConfig among all
+   * NfsExportOptions.
+   * 
+ * + * repeated string ip_ranges = 1; + * + * @return The count of ipRanges. + */ + int getIpRangesCount(); + /** + * + * + *
+   * List of either an IPv4 addresses in the format
+   * {octet 1}.{octet 2}.{octet 3}.{octet 4} or CIDR ranges in the format
+   * {octet 1}.{octet 2}.{octet 3}.{octet 4}/{mask size} which may mount the
+   * file share.
+   * Overlapping IP ranges are not allowed, both within and across
+   * NfsExportOptions. An error will be returned.
+   * The limit is 64 IP ranges/addresses for each FileShareConfig among all
+   * NfsExportOptions.
+   * 
+ * + * repeated string ip_ranges = 1; + * + * @param index The index of the element to return. + * @return The ipRanges at the given index. + */ + java.lang.String getIpRanges(int index); + /** + * + * + *
+   * List of either an IPv4 addresses in the format
+   * {octet 1}.{octet 2}.{octet 3}.{octet 4} or CIDR ranges in the format
+   * {octet 1}.{octet 2}.{octet 3}.{octet 4}/{mask size} which may mount the
+   * file share.
+   * Overlapping IP ranges are not allowed, both within and across
+   * NfsExportOptions. An error will be returned.
+   * The limit is 64 IP ranges/addresses for each FileShareConfig among all
+   * NfsExportOptions.
+   * 
+ * + * repeated string ip_ranges = 1; + * + * @param index The index of the value to return. + * @return The bytes of the ipRanges at the given index. + */ + com.google.protobuf.ByteString getIpRangesBytes(int index); + + /** + * + * + *
+   * Either READ_ONLY, for allowing only read requests on the exported
+   * directory, or READ_WRITE, for allowing both read and write requests.
+   * The default is READ_WRITE.
+   * 
+ * + * .google.cloud.filestore.v1.NfsExportOptions.AccessMode access_mode = 2; + * + * @return The enum numeric value on the wire for accessMode. + */ + int getAccessModeValue(); + /** + * + * + *
+   * Either READ_ONLY, for allowing only read requests on the exported
+   * directory, or READ_WRITE, for allowing both read and write requests.
+   * The default is READ_WRITE.
+   * 
+ * + * .google.cloud.filestore.v1.NfsExportOptions.AccessMode access_mode = 2; + * + * @return The accessMode. + */ + com.google.cloud.filestore.v1.NfsExportOptions.AccessMode getAccessMode(); + + /** + * + * + *
+   * Either NO_ROOT_SQUASH, for allowing root access on the exported directory,
+   * or ROOT_SQUASH, for not allowing root access. The default is
+   * NO_ROOT_SQUASH.
+   * 
+ * + * .google.cloud.filestore.v1.NfsExportOptions.SquashMode squash_mode = 3; + * + * @return The enum numeric value on the wire for squashMode. + */ + int getSquashModeValue(); + /** + * + * + *
+   * Either NO_ROOT_SQUASH, for allowing root access on the exported directory,
+   * or ROOT_SQUASH, for not allowing root access. The default is
+   * NO_ROOT_SQUASH.
+   * 
+ * + * .google.cloud.filestore.v1.NfsExportOptions.SquashMode squash_mode = 3; + * + * @return The squashMode. + */ + com.google.cloud.filestore.v1.NfsExportOptions.SquashMode getSquashMode(); + + /** + * + * + *
+   * An integer representing the anonymous user id with a default value of
+   * 65534.
+   * Anon_uid may only be set with squash_mode of ROOT_SQUASH.  An error will be
+   * returned if this field is specified for other squash_mode settings.
+   * 
+ * + * int64 anon_uid = 4; + * + * @return The anonUid. + */ + long getAnonUid(); + + /** + * + * + *
+   * An integer representing the anonymous group id with a default value of
+   * 65534.
+   * Anon_gid may only be set with squash_mode of ROOT_SQUASH.  An error will be
+   * returned if this field is specified for other squash_mode settings.
+   * 
+ * + * int64 anon_gid = 5; + * + * @return The anonGid. + */ + long getAnonGid(); +} diff --git a/proto-google-cloud-filestore-v1/src/main/java/com/google/cloud/filestore/v1/RestoreInstanceRequest.java b/proto-google-cloud-filestore-v1/src/main/java/com/google/cloud/filestore/v1/RestoreInstanceRequest.java new file mode 100644 index 00000000..fdeb3de8 --- /dev/null +++ b/proto-google-cloud-filestore-v1/src/main/java/com/google/cloud/filestore/v1/RestoreInstanceRequest.java @@ -0,0 +1,1164 @@ +/* + * 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/v1/cloud_filestore_service.proto + +package com.google.cloud.filestore.v1; + +/** + * + * + *
+ * RestoreInstanceRequest restores an existing instances's file share from a
+ * backup.
+ * 
+ * + * Protobuf type {@code google.cloud.filestore.v1.RestoreInstanceRequest} + */ +public final class RestoreInstanceRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.filestore.v1.RestoreInstanceRequest) + RestoreInstanceRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use RestoreInstanceRequest.newBuilder() to construct. + private RestoreInstanceRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private RestoreInstanceRequest() { + name_ = ""; + fileShare_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new RestoreInstanceRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private RestoreInstanceRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + fileShare_ = s; + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + sourceCase_ = 3; + source_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.filestore.v1.CloudFilestoreServiceProto + .internal_static_google_cloud_filestore_v1_RestoreInstanceRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.filestore.v1.CloudFilestoreServiceProto + .internal_static_google_cloud_filestore_v1_RestoreInstanceRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.filestore.v1.RestoreInstanceRequest.class, + com.google.cloud.filestore.v1.RestoreInstanceRequest.Builder.class); + } + + private int sourceCase_ = 0; + private java.lang.Object source_; + + public enum SourceCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + SOURCE_BACKUP(3), + SOURCE_NOT_SET(0); + private final int value; + + private SourceCase(int value) { + this.value = value; + } + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static SourceCase valueOf(int value) { + return forNumber(value); + } + + public static SourceCase forNumber(int value) { + switch (value) { + case 3: + return SOURCE_BACKUP; + case 0: + return SOURCE_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public SourceCase getSourceCase() { + return SourceCase.forNumber(sourceCase_); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Required. The resource name of the instance, in the format
+   * projects/{project_number}/locations/{location_id}/instances/{instance_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 resource name of the instance, in the format
+   * projects/{project_number}/locations/{location_id}/instances/{instance_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; + } + } + + public static final int FILE_SHARE_FIELD_NUMBER = 2; + private volatile java.lang.Object fileShare_; + /** + * + * + *
+   * Required. Name of the file share in the Cloud Filestore instance that the backup
+   * is being restored to.
+   * 
+ * + * string file_share = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The fileShare. + */ + @java.lang.Override + public java.lang.String getFileShare() { + java.lang.Object ref = fileShare_; + 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(); + fileShare_ = s; + return s; + } + } + /** + * + * + *
+   * Required. Name of the file share in the Cloud Filestore instance that the backup
+   * is being restored to.
+   * 
+ * + * string file_share = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for fileShare. + */ + @java.lang.Override + public com.google.protobuf.ByteString getFileShareBytes() { + java.lang.Object ref = fileShare_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + fileShare_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SOURCE_BACKUP_FIELD_NUMBER = 3; + /** + * + * + *
+   * The resource name of the backup, in the format
+   * projects/{project_number}/locations/{location_id}/backups/{backup_id}.
+   * 
+ * + * string source_backup = 3 [(.google.api.resource_reference) = { ... } + * + * @return Whether the sourceBackup field is set. + */ + public boolean hasSourceBackup() { + return sourceCase_ == 3; + } + /** + * + * + *
+   * The resource name of the backup, in the format
+   * projects/{project_number}/locations/{location_id}/backups/{backup_id}.
+   * 
+ * + * string source_backup = 3 [(.google.api.resource_reference) = { ... } + * + * @return The sourceBackup. + */ + public java.lang.String getSourceBackup() { + java.lang.Object ref = ""; + if (sourceCase_ == 3) { + ref = source_; + } + 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(); + if (sourceCase_ == 3) { + source_ = s; + } + return s; + } + } + /** + * + * + *
+   * The resource name of the backup, in the format
+   * projects/{project_number}/locations/{location_id}/backups/{backup_id}.
+   * 
+ * + * string source_backup = 3 [(.google.api.resource_reference) = { ... } + * + * @return The bytes for sourceBackup. + */ + public com.google.protobuf.ByteString getSourceBackupBytes() { + java.lang.Object ref = ""; + if (sourceCase_ == 3) { + ref = source_; + } + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + if (sourceCase_ == 3) { + source_ = 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 (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (!getFileShareBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, fileShare_); + } + if (sourceCase_ == 3) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, source_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (!getFileShareBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, fileShare_); + } + if (sourceCase_ == 3) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, source_); + } + size += unknownFields.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.v1.RestoreInstanceRequest)) { + return super.equals(obj); + } + com.google.cloud.filestore.v1.RestoreInstanceRequest other = + (com.google.cloud.filestore.v1.RestoreInstanceRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!getFileShare().equals(other.getFileShare())) return false; + if (!getSourceCase().equals(other.getSourceCase())) return false; + switch (sourceCase_) { + case 3: + if (!getSourceBackup().equals(other.getSourceBackup())) return false; + break; + case 0: + default: + } + if (!unknownFields.equals(other.unknownFields)) 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) + FILE_SHARE_FIELD_NUMBER; + hash = (53 * hash) + getFileShare().hashCode(); + switch (sourceCase_) { + case 3: + hash = (37 * hash) + SOURCE_BACKUP_FIELD_NUMBER; + hash = (53 * hash) + getSourceBackup().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.filestore.v1.RestoreInstanceRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.filestore.v1.RestoreInstanceRequest 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.v1.RestoreInstanceRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.filestore.v1.RestoreInstanceRequest 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.v1.RestoreInstanceRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.filestore.v1.RestoreInstanceRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.filestore.v1.RestoreInstanceRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.filestore.v1.RestoreInstanceRequest 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.v1.RestoreInstanceRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.filestore.v1.RestoreInstanceRequest 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.v1.RestoreInstanceRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.filestore.v1.RestoreInstanceRequest 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.v1.RestoreInstanceRequest 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; + } + /** + * + * + *
+   * RestoreInstanceRequest restores an existing instances's file share from a
+   * backup.
+   * 
+ * + * Protobuf type {@code google.cloud.filestore.v1.RestoreInstanceRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.filestore.v1.RestoreInstanceRequest) + com.google.cloud.filestore.v1.RestoreInstanceRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.filestore.v1.CloudFilestoreServiceProto + .internal_static_google_cloud_filestore_v1_RestoreInstanceRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.filestore.v1.CloudFilestoreServiceProto + .internal_static_google_cloud_filestore_v1_RestoreInstanceRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.filestore.v1.RestoreInstanceRequest.class, + com.google.cloud.filestore.v1.RestoreInstanceRequest.Builder.class); + } + + // Construct using com.google.cloud.filestore.v1.RestoreInstanceRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + fileShare_ = ""; + + sourceCase_ = 0; + source_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.filestore.v1.CloudFilestoreServiceProto + .internal_static_google_cloud_filestore_v1_RestoreInstanceRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.filestore.v1.RestoreInstanceRequest getDefaultInstanceForType() { + return com.google.cloud.filestore.v1.RestoreInstanceRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.filestore.v1.RestoreInstanceRequest build() { + com.google.cloud.filestore.v1.RestoreInstanceRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.filestore.v1.RestoreInstanceRequest buildPartial() { + com.google.cloud.filestore.v1.RestoreInstanceRequest result = + new com.google.cloud.filestore.v1.RestoreInstanceRequest(this); + result.name_ = name_; + result.fileShare_ = fileShare_; + if (sourceCase_ == 3) { + result.source_ = source_; + } + result.sourceCase_ = sourceCase_; + 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.v1.RestoreInstanceRequest) { + return mergeFrom((com.google.cloud.filestore.v1.RestoreInstanceRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.filestore.v1.RestoreInstanceRequest other) { + if (other == com.google.cloud.filestore.v1.RestoreInstanceRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (!other.getFileShare().isEmpty()) { + fileShare_ = other.fileShare_; + onChanged(); + } + switch (other.getSourceCase()) { + case SOURCE_BACKUP: + { + sourceCase_ = 3; + source_ = other.source_; + onChanged(); + break; + } + case SOURCE_NOT_SET: + { + break; + } + } + this.mergeUnknownFields(other.unknownFields); + 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 { + com.google.cloud.filestore.v1.RestoreInstanceRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.filestore.v1.RestoreInstanceRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int sourceCase_ = 0; + private java.lang.Object source_; + + public SourceCase getSourceCase() { + return SourceCase.forNumber(sourceCase_); + } + + public Builder clearSource() { + sourceCase_ = 0; + source_ = null; + onChanged(); + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. The resource name of the instance, in the format
+     * projects/{project_number}/locations/{location_id}/instances/{instance_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 resource name of the instance, in the format
+     * projects/{project_number}/locations/{location_id}/instances/{instance_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 resource name of the instance, in the format
+     * projects/{project_number}/locations/{location_id}/instances/{instance_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 resource name of the instance, in the format
+     * projects/{project_number}/locations/{location_id}/instances/{instance_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 resource name of the instance, in the format
+     * projects/{project_number}/locations/{location_id}/instances/{instance_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; + } + + private java.lang.Object fileShare_ = ""; + /** + * + * + *
+     * Required. Name of the file share in the Cloud Filestore instance that the backup
+     * is being restored to.
+     * 
+ * + * string file_share = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The fileShare. + */ + public java.lang.String getFileShare() { + java.lang.Object ref = fileShare_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + fileShare_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. Name of the file share in the Cloud Filestore instance that the backup
+     * is being restored to.
+     * 
+ * + * string file_share = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for fileShare. + */ + public com.google.protobuf.ByteString getFileShareBytes() { + java.lang.Object ref = fileShare_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + fileShare_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. Name of the file share in the Cloud Filestore instance that the backup
+     * is being restored to.
+     * 
+ * + * string file_share = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The fileShare to set. + * @return This builder for chaining. + */ + public Builder setFileShare(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + fileShare_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Name of the file share in the Cloud Filestore instance that the backup
+     * is being restored to.
+     * 
+ * + * string file_share = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearFileShare() { + + fileShare_ = getDefaultInstance().getFileShare(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Name of the file share in the Cloud Filestore instance that the backup
+     * is being restored to.
+     * 
+ * + * string file_share = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for fileShare to set. + * @return This builder for chaining. + */ + public Builder setFileShareBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + fileShare_ = value; + onChanged(); + return this; + } + + /** + * + * + *
+     * The resource name of the backup, in the format
+     * projects/{project_number}/locations/{location_id}/backups/{backup_id}.
+     * 
+ * + * string source_backup = 3 [(.google.api.resource_reference) = { ... } + * + * @return Whether the sourceBackup field is set. + */ + @java.lang.Override + public boolean hasSourceBackup() { + return sourceCase_ == 3; + } + /** + * + * + *
+     * The resource name of the backup, in the format
+     * projects/{project_number}/locations/{location_id}/backups/{backup_id}.
+     * 
+ * + * string source_backup = 3 [(.google.api.resource_reference) = { ... } + * + * @return The sourceBackup. + */ + @java.lang.Override + public java.lang.String getSourceBackup() { + java.lang.Object ref = ""; + if (sourceCase_ == 3) { + ref = source_; + } + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (sourceCase_ == 3) { + source_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The resource name of the backup, in the format
+     * projects/{project_number}/locations/{location_id}/backups/{backup_id}.
+     * 
+ * + * string source_backup = 3 [(.google.api.resource_reference) = { ... } + * + * @return The bytes for sourceBackup. + */ + @java.lang.Override + public com.google.protobuf.ByteString getSourceBackupBytes() { + java.lang.Object ref = ""; + if (sourceCase_ == 3) { + ref = source_; + } + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + if (sourceCase_ == 3) { + source_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The resource name of the backup, in the format
+     * projects/{project_number}/locations/{location_id}/backups/{backup_id}.
+     * 
+ * + * string source_backup = 3 [(.google.api.resource_reference) = { ... } + * + * @param value The sourceBackup to set. + * @return This builder for chaining. + */ + public Builder setSourceBackup(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + sourceCase_ = 3; + source_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The resource name of the backup, in the format
+     * projects/{project_number}/locations/{location_id}/backups/{backup_id}.
+     * 
+ * + * string source_backup = 3 [(.google.api.resource_reference) = { ... } + * + * @return This builder for chaining. + */ + public Builder clearSourceBackup() { + if (sourceCase_ == 3) { + sourceCase_ = 0; + source_ = null; + onChanged(); + } + return this; + } + /** + * + * + *
+     * The resource name of the backup, in the format
+     * projects/{project_number}/locations/{location_id}/backups/{backup_id}.
+     * 
+ * + * string source_backup = 3 [(.google.api.resource_reference) = { ... } + * + * @param value The bytes for sourceBackup to set. + * @return This builder for chaining. + */ + public Builder setSourceBackupBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + sourceCase_ = 3; + source_ = 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.v1.RestoreInstanceRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.filestore.v1.RestoreInstanceRequest) + private static final com.google.cloud.filestore.v1.RestoreInstanceRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.filestore.v1.RestoreInstanceRequest(); + } + + public static com.google.cloud.filestore.v1.RestoreInstanceRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public RestoreInstanceRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new RestoreInstanceRequest(input, extensionRegistry); + } + }; + + 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.v1.RestoreInstanceRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-filestore-v1/src/main/java/com/google/cloud/filestore/v1/RestoreInstanceRequestOrBuilder.java b/proto-google-cloud-filestore-v1/src/main/java/com/google/cloud/filestore/v1/RestoreInstanceRequestOrBuilder.java new file mode 100644 index 00000000..138f4dad --- /dev/null +++ b/proto-google-cloud-filestore-v1/src/main/java/com/google/cloud/filestore/v1/RestoreInstanceRequestOrBuilder.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/v1/cloud_filestore_service.proto + +package com.google.cloud.filestore.v1; + +public interface RestoreInstanceRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.filestore.v1.RestoreInstanceRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The resource name of the instance, in the format
+   * projects/{project_number}/locations/{location_id}/instances/{instance_id}.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. The resource name of the instance, in the format
+   * projects/{project_number}/locations/{location_id}/instances/{instance_id}.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Required. Name of the file share in the Cloud Filestore instance that the backup
+   * is being restored to.
+   * 
+ * + * string file_share = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The fileShare. + */ + java.lang.String getFileShare(); + /** + * + * + *
+   * Required. Name of the file share in the Cloud Filestore instance that the backup
+   * is being restored to.
+   * 
+ * + * string file_share = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for fileShare. + */ + com.google.protobuf.ByteString getFileShareBytes(); + + /** + * + * + *
+   * The resource name of the backup, in the format
+   * projects/{project_number}/locations/{location_id}/backups/{backup_id}.
+   * 
+ * + * string source_backup = 3 [(.google.api.resource_reference) = { ... } + * + * @return Whether the sourceBackup field is set. + */ + boolean hasSourceBackup(); + /** + * + * + *
+   * The resource name of the backup, in the format
+   * projects/{project_number}/locations/{location_id}/backups/{backup_id}.
+   * 
+ * + * string source_backup = 3 [(.google.api.resource_reference) = { ... } + * + * @return The sourceBackup. + */ + java.lang.String getSourceBackup(); + /** + * + * + *
+   * The resource name of the backup, in the format
+   * projects/{project_number}/locations/{location_id}/backups/{backup_id}.
+   * 
+ * + * string source_backup = 3 [(.google.api.resource_reference) = { ... } + * + * @return The bytes for sourceBackup. + */ + com.google.protobuf.ByteString getSourceBackupBytes(); + + public com.google.cloud.filestore.v1.RestoreInstanceRequest.SourceCase getSourceCase(); +} diff --git a/proto-google-cloud-filestore-v1/src/main/java/com/google/cloud/filestore/v1/UpdateBackupRequest.java b/proto-google-cloud-filestore-v1/src/main/java/com/google/cloud/filestore/v1/UpdateBackupRequest.java new file mode 100644 index 00000000..9151b914 --- /dev/null +++ b/proto-google-cloud-filestore-v1/src/main/java/com/google/cloud/filestore/v1/UpdateBackupRequest.java @@ -0,0 +1,1051 @@ +/* + * 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/v1/cloud_filestore_service.proto + +package com.google.cloud.filestore.v1; + +/** + * + * + *
+ * UpdateBackupRequest updates description and/or labels for a backup.
+ * 
+ * + * Protobuf type {@code google.cloud.filestore.v1.UpdateBackupRequest} + */ +public final class UpdateBackupRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.filestore.v1.UpdateBackupRequest) + UpdateBackupRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use UpdateBackupRequest.newBuilder() to construct. + private UpdateBackupRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private UpdateBackupRequest() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new UpdateBackupRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private UpdateBackupRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.cloud.filestore.v1.Backup.Builder subBuilder = null; + if (backup_ != null) { + subBuilder = backup_.toBuilder(); + } + backup_ = + input.readMessage( + com.google.cloud.filestore.v1.Backup.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(backup_); + backup_ = subBuilder.buildPartial(); + } + + break; + } + case 18: + { + com.google.protobuf.FieldMask.Builder subBuilder = null; + if (updateMask_ != null) { + subBuilder = updateMask_.toBuilder(); + } + updateMask_ = + input.readMessage(com.google.protobuf.FieldMask.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(updateMask_); + updateMask_ = subBuilder.buildPartial(); + } + + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.filestore.v1.CloudFilestoreServiceProto + .internal_static_google_cloud_filestore_v1_UpdateBackupRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.filestore.v1.CloudFilestoreServiceProto + .internal_static_google_cloud_filestore_v1_UpdateBackupRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.filestore.v1.UpdateBackupRequest.class, + com.google.cloud.filestore.v1.UpdateBackupRequest.Builder.class); + } + + public static final int BACKUP_FIELD_NUMBER = 1; + private com.google.cloud.filestore.v1.Backup backup_; + /** + * + * + *
+   * Required. A [backup resource]
+   * (/cloud-filestore/reference/rest/v1/projects.locations.backups)
+   * 
+ * + * .google.cloud.filestore.v1.Backup backup = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the backup field is set. + */ + @java.lang.Override + public boolean hasBackup() { + return backup_ != null; + } + /** + * + * + *
+   * Required. A [backup resource]
+   * (/cloud-filestore/reference/rest/v1/projects.locations.backups)
+   * 
+ * + * .google.cloud.filestore.v1.Backup backup = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The backup. + */ + @java.lang.Override + public com.google.cloud.filestore.v1.Backup getBackup() { + return backup_ == null ? com.google.cloud.filestore.v1.Backup.getDefaultInstance() : backup_; + } + /** + * + * + *
+   * Required. A [backup resource]
+   * (/cloud-filestore/reference/rest/v1/projects.locations.backups)
+   * 
+ * + * .google.cloud.filestore.v1.Backup backup = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.filestore.v1.BackupOrBuilder getBackupOrBuilder() { + return getBackup(); + } + + 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.
+   * 
+ * + * .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.
+   * 
+ * + * .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.
+   * 
+ * + * .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 (backup_ != null) { + output.writeMessage(1, getBackup()); + } + if (updateMask_ != null) { + output.writeMessage(2, getUpdateMask()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (backup_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getBackup()); + } + if (updateMask_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getUpdateMask()); + } + size += unknownFields.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.v1.UpdateBackupRequest)) { + return super.equals(obj); + } + com.google.cloud.filestore.v1.UpdateBackupRequest other = + (com.google.cloud.filestore.v1.UpdateBackupRequest) obj; + + if (hasBackup() != other.hasBackup()) return false; + if (hasBackup()) { + if (!getBackup().equals(other.getBackup())) return false; + } + if (hasUpdateMask() != other.hasUpdateMask()) return false; + if (hasUpdateMask()) { + if (!getUpdateMask().equals(other.getUpdateMask())) return false; + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasBackup()) { + hash = (37 * hash) + BACKUP_FIELD_NUMBER; + hash = (53 * hash) + getBackup().hashCode(); + } + if (hasUpdateMask()) { + hash = (37 * hash) + UPDATE_MASK_FIELD_NUMBER; + hash = (53 * hash) + getUpdateMask().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.filestore.v1.UpdateBackupRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.filestore.v1.UpdateBackupRequest 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.v1.UpdateBackupRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.filestore.v1.UpdateBackupRequest 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.v1.UpdateBackupRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.filestore.v1.UpdateBackupRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.filestore.v1.UpdateBackupRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.filestore.v1.UpdateBackupRequest 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.v1.UpdateBackupRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.filestore.v1.UpdateBackupRequest 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.v1.UpdateBackupRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.filestore.v1.UpdateBackupRequest 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.v1.UpdateBackupRequest 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; + } + /** + * + * + *
+   * UpdateBackupRequest updates description and/or labels for a backup.
+   * 
+ * + * Protobuf type {@code google.cloud.filestore.v1.UpdateBackupRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.filestore.v1.UpdateBackupRequest) + com.google.cloud.filestore.v1.UpdateBackupRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.filestore.v1.CloudFilestoreServiceProto + .internal_static_google_cloud_filestore_v1_UpdateBackupRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.filestore.v1.CloudFilestoreServiceProto + .internal_static_google_cloud_filestore_v1_UpdateBackupRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.filestore.v1.UpdateBackupRequest.class, + com.google.cloud.filestore.v1.UpdateBackupRequest.Builder.class); + } + + // Construct using com.google.cloud.filestore.v1.UpdateBackupRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (backupBuilder_ == null) { + backup_ = null; + } else { + backup_ = null; + backupBuilder_ = 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.v1.CloudFilestoreServiceProto + .internal_static_google_cloud_filestore_v1_UpdateBackupRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.filestore.v1.UpdateBackupRequest getDefaultInstanceForType() { + return com.google.cloud.filestore.v1.UpdateBackupRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.filestore.v1.UpdateBackupRequest build() { + com.google.cloud.filestore.v1.UpdateBackupRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.filestore.v1.UpdateBackupRequest buildPartial() { + com.google.cloud.filestore.v1.UpdateBackupRequest result = + new com.google.cloud.filestore.v1.UpdateBackupRequest(this); + if (backupBuilder_ == null) { + result.backup_ = backup_; + } else { + result.backup_ = backupBuilder_.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.v1.UpdateBackupRequest) { + return mergeFrom((com.google.cloud.filestore.v1.UpdateBackupRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.filestore.v1.UpdateBackupRequest other) { + if (other == com.google.cloud.filestore.v1.UpdateBackupRequest.getDefaultInstance()) + return this; + if (other.hasBackup()) { + mergeBackup(other.getBackup()); + } + if (other.hasUpdateMask()) { + mergeUpdateMask(other.getUpdateMask()); + } + this.mergeUnknownFields(other.unknownFields); + 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 { + com.google.cloud.filestore.v1.UpdateBackupRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.filestore.v1.UpdateBackupRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.cloud.filestore.v1.Backup backup_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.filestore.v1.Backup, + com.google.cloud.filestore.v1.Backup.Builder, + com.google.cloud.filestore.v1.BackupOrBuilder> + backupBuilder_; + /** + * + * + *
+     * Required. A [backup resource]
+     * (/cloud-filestore/reference/rest/v1/projects.locations.backups)
+     * 
+ * + * .google.cloud.filestore.v1.Backup backup = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the backup field is set. + */ + public boolean hasBackup() { + return backupBuilder_ != null || backup_ != null; + } + /** + * + * + *
+     * Required. A [backup resource]
+     * (/cloud-filestore/reference/rest/v1/projects.locations.backups)
+     * 
+ * + * .google.cloud.filestore.v1.Backup backup = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The backup. + */ + public com.google.cloud.filestore.v1.Backup getBackup() { + if (backupBuilder_ == null) { + return backup_ == null + ? com.google.cloud.filestore.v1.Backup.getDefaultInstance() + : backup_; + } else { + return backupBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. A [backup resource]
+     * (/cloud-filestore/reference/rest/v1/projects.locations.backups)
+     * 
+ * + * .google.cloud.filestore.v1.Backup backup = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setBackup(com.google.cloud.filestore.v1.Backup value) { + if (backupBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + backup_ = value; + onChanged(); + } else { + backupBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Required. A [backup resource]
+     * (/cloud-filestore/reference/rest/v1/projects.locations.backups)
+     * 
+ * + * .google.cloud.filestore.v1.Backup backup = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setBackup(com.google.cloud.filestore.v1.Backup.Builder builderForValue) { + if (backupBuilder_ == null) { + backup_ = builderForValue.build(); + onChanged(); + } else { + backupBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Required. A [backup resource]
+     * (/cloud-filestore/reference/rest/v1/projects.locations.backups)
+     * 
+ * + * .google.cloud.filestore.v1.Backup backup = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeBackup(com.google.cloud.filestore.v1.Backup value) { + if (backupBuilder_ == null) { + if (backup_ != null) { + backup_ = + com.google.cloud.filestore.v1.Backup.newBuilder(backup_) + .mergeFrom(value) + .buildPartial(); + } else { + backup_ = value; + } + onChanged(); + } else { + backupBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Required. A [backup resource]
+     * (/cloud-filestore/reference/rest/v1/projects.locations.backups)
+     * 
+ * + * .google.cloud.filestore.v1.Backup backup = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearBackup() { + if (backupBuilder_ == null) { + backup_ = null; + onChanged(); + } else { + backup_ = null; + backupBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Required. A [backup resource]
+     * (/cloud-filestore/reference/rest/v1/projects.locations.backups)
+     * 
+ * + * .google.cloud.filestore.v1.Backup backup = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.filestore.v1.Backup.Builder getBackupBuilder() { + + onChanged(); + return getBackupFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. A [backup resource]
+     * (/cloud-filestore/reference/rest/v1/projects.locations.backups)
+     * 
+ * + * .google.cloud.filestore.v1.Backup backup = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.filestore.v1.BackupOrBuilder getBackupOrBuilder() { + if (backupBuilder_ != null) { + return backupBuilder_.getMessageOrBuilder(); + } else { + return backup_ == null + ? com.google.cloud.filestore.v1.Backup.getDefaultInstance() + : backup_; + } + } + /** + * + * + *
+     * Required. A [backup resource]
+     * (/cloud-filestore/reference/rest/v1/projects.locations.backups)
+     * 
+ * + * .google.cloud.filestore.v1.Backup backup = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.filestore.v1.Backup, + com.google.cloud.filestore.v1.Backup.Builder, + com.google.cloud.filestore.v1.BackupOrBuilder> + getBackupFieldBuilder() { + if (backupBuilder_ == null) { + backupBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.filestore.v1.Backup, + com.google.cloud.filestore.v1.Backup.Builder, + com.google.cloud.filestore.v1.BackupOrBuilder>( + getBackup(), getParentForChildren(), isClean()); + backup_ = null; + } + return backupBuilder_; + } + + 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 = 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.
+     * 
+ * + * .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.
+     * 
+ * + * .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.
+     * 
+ * + * .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.
+     * 
+ * + * .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.
+     * 
+ * + * .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.
+     * 
+ * + * .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.
+     * 
+ * + * .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.
+     * 
+ * + * .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.v1.UpdateBackupRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.filestore.v1.UpdateBackupRequest) + private static final com.google.cloud.filestore.v1.UpdateBackupRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.filestore.v1.UpdateBackupRequest(); + } + + public static com.google.cloud.filestore.v1.UpdateBackupRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public UpdateBackupRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new UpdateBackupRequest(input, extensionRegistry); + } + }; + + 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.v1.UpdateBackupRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-filestore-v1/src/main/java/com/google/cloud/filestore/v1/UpdateBackupRequestOrBuilder.java b/proto-google-cloud-filestore-v1/src/main/java/com/google/cloud/filestore/v1/UpdateBackupRequestOrBuilder.java new file mode 100644 index 00000000..b6b44a89 --- /dev/null +++ b/proto-google-cloud-filestore-v1/src/main/java/com/google/cloud/filestore/v1/UpdateBackupRequestOrBuilder.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/v1/cloud_filestore_service.proto + +package com.google.cloud.filestore.v1; + +public interface UpdateBackupRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.filestore.v1.UpdateBackupRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. A [backup resource]
+   * (/cloud-filestore/reference/rest/v1/projects.locations.backups)
+   * 
+ * + * .google.cloud.filestore.v1.Backup backup = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the backup field is set. + */ + boolean hasBackup(); + /** + * + * + *
+   * Required. A [backup resource]
+   * (/cloud-filestore/reference/rest/v1/projects.locations.backups)
+   * 
+ * + * .google.cloud.filestore.v1.Backup backup = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The backup. + */ + com.google.cloud.filestore.v1.Backup getBackup(); + /** + * + * + *
+   * Required. A [backup resource]
+   * (/cloud-filestore/reference/rest/v1/projects.locations.backups)
+   * 
+ * + * .google.cloud.filestore.v1.Backup backup = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.filestore.v1.BackupOrBuilder getBackupOrBuilder(); + + /** + * + * + *
+   * Required. Mask of fields to update.  At least one path must be supplied in this
+   * field.
+   * 
+ * + * .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.
+   * 
+ * + * .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.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder(); +} diff --git a/proto-google-cloud-filestore-v1/src/main/java/com/google/cloud/filestore/v1/UpdateInstanceRequest.java b/proto-google-cloud-filestore-v1/src/main/java/com/google/cloud/filestore/v1/UpdateInstanceRequest.java new file mode 100644 index 00000000..81d507c4 --- /dev/null +++ b/proto-google-cloud-filestore-v1/src/main/java/com/google/cloud/filestore/v1/UpdateInstanceRequest.java @@ -0,0 +1,1065 @@ +/* + * 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/v1/cloud_filestore_service.proto + +package com.google.cloud.filestore.v1; + +/** + * + * + *
+ * UpdateInstanceRequest updates the settings of an instance.
+ * 
+ * + * Protobuf type {@code google.cloud.filestore.v1.UpdateInstanceRequest} + */ +public final class UpdateInstanceRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.filestore.v1.UpdateInstanceRequest) + UpdateInstanceRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use UpdateInstanceRequest.newBuilder() to construct. + private UpdateInstanceRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private UpdateInstanceRequest() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new UpdateInstanceRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private UpdateInstanceRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.protobuf.FieldMask.Builder subBuilder = null; + if (updateMask_ != null) { + subBuilder = updateMask_.toBuilder(); + } + updateMask_ = + input.readMessage(com.google.protobuf.FieldMask.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(updateMask_); + updateMask_ = subBuilder.buildPartial(); + } + + break; + } + case 18: + { + com.google.cloud.filestore.v1.Instance.Builder subBuilder = null; + if (instance_ != null) { + subBuilder = instance_.toBuilder(); + } + instance_ = + input.readMessage( + com.google.cloud.filestore.v1.Instance.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(instance_); + instance_ = subBuilder.buildPartial(); + } + + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.filestore.v1.CloudFilestoreServiceProto + .internal_static_google_cloud_filestore_v1_UpdateInstanceRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.filestore.v1.CloudFilestoreServiceProto + .internal_static_google_cloud_filestore_v1_UpdateInstanceRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.filestore.v1.UpdateInstanceRequest.class, + com.google.cloud.filestore.v1.UpdateInstanceRequest.Builder.class); + } + + public static final int UPDATE_MASK_FIELD_NUMBER = 1; + private com.google.protobuf.FieldMask updateMask_; + /** + * + * + *
+   * 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"
+   * * "file_shares"
+   * * "labels"
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 1; + * + * @return Whether the updateMask field is set. + */ + @java.lang.Override + public boolean hasUpdateMask() { + return updateMask_ != null; + } + /** + * + * + *
+   * 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"
+   * * "file_shares"
+   * * "labels"
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 1; + * + * @return The updateMask. + */ + @java.lang.Override + public com.google.protobuf.FieldMask getUpdateMask() { + return updateMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; + } + /** + * + * + *
+   * 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"
+   * * "file_shares"
+   * * "labels"
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 1; + */ + @java.lang.Override + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + return getUpdateMask(); + } + + public static final int INSTANCE_FIELD_NUMBER = 2; + private com.google.cloud.filestore.v1.Instance instance_; + /** + * + * + *
+   * Only fields specified in update_mask are updated.
+   * 
+ * + * .google.cloud.filestore.v1.Instance instance = 2; + * + * @return Whether the instance field is set. + */ + @java.lang.Override + public boolean hasInstance() { + return instance_ != null; + } + /** + * + * + *
+   * Only fields specified in update_mask are updated.
+   * 
+ * + * .google.cloud.filestore.v1.Instance instance = 2; + * + * @return The instance. + */ + @java.lang.Override + public com.google.cloud.filestore.v1.Instance getInstance() { + return instance_ == null + ? com.google.cloud.filestore.v1.Instance.getDefaultInstance() + : instance_; + } + /** + * + * + *
+   * Only fields specified in update_mask are updated.
+   * 
+ * + * .google.cloud.filestore.v1.Instance instance = 2; + */ + @java.lang.Override + public com.google.cloud.filestore.v1.InstanceOrBuilder getInstanceOrBuilder() { + return getInstance(); + } + + 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 (instance_ != null) { + output.writeMessage(2, getInstance()); + } + unknownFields.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 (instance_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getInstance()); + } + size += unknownFields.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.v1.UpdateInstanceRequest)) { + return super.equals(obj); + } + com.google.cloud.filestore.v1.UpdateInstanceRequest other = + (com.google.cloud.filestore.v1.UpdateInstanceRequest) obj; + + if (hasUpdateMask() != other.hasUpdateMask()) return false; + if (hasUpdateMask()) { + if (!getUpdateMask().equals(other.getUpdateMask())) return false; + } + if (hasInstance() != other.hasInstance()) return false; + if (hasInstance()) { + if (!getInstance().equals(other.getInstance())) return false; + } + if (!unknownFields.equals(other.unknownFields)) 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 (hasInstance()) { + hash = (37 * hash) + INSTANCE_FIELD_NUMBER; + hash = (53 * hash) + getInstance().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.filestore.v1.UpdateInstanceRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.filestore.v1.UpdateInstanceRequest 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.v1.UpdateInstanceRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.filestore.v1.UpdateInstanceRequest 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.v1.UpdateInstanceRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.filestore.v1.UpdateInstanceRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.filestore.v1.UpdateInstanceRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.filestore.v1.UpdateInstanceRequest 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.v1.UpdateInstanceRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.filestore.v1.UpdateInstanceRequest 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.v1.UpdateInstanceRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.filestore.v1.UpdateInstanceRequest 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.v1.UpdateInstanceRequest 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; + } + /** + * + * + *
+   * UpdateInstanceRequest updates the settings of an instance.
+   * 
+ * + * Protobuf type {@code google.cloud.filestore.v1.UpdateInstanceRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.filestore.v1.UpdateInstanceRequest) + com.google.cloud.filestore.v1.UpdateInstanceRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.filestore.v1.CloudFilestoreServiceProto + .internal_static_google_cloud_filestore_v1_UpdateInstanceRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.filestore.v1.CloudFilestoreServiceProto + .internal_static_google_cloud_filestore_v1_UpdateInstanceRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.filestore.v1.UpdateInstanceRequest.class, + com.google.cloud.filestore.v1.UpdateInstanceRequest.Builder.class); + } + + // Construct using com.google.cloud.filestore.v1.UpdateInstanceRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (updateMaskBuilder_ == null) { + updateMask_ = null; + } else { + updateMask_ = null; + updateMaskBuilder_ = null; + } + if (instanceBuilder_ == null) { + instance_ = null; + } else { + instance_ = null; + instanceBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.filestore.v1.CloudFilestoreServiceProto + .internal_static_google_cloud_filestore_v1_UpdateInstanceRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.filestore.v1.UpdateInstanceRequest getDefaultInstanceForType() { + return com.google.cloud.filestore.v1.UpdateInstanceRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.filestore.v1.UpdateInstanceRequest build() { + com.google.cloud.filestore.v1.UpdateInstanceRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.filestore.v1.UpdateInstanceRequest buildPartial() { + com.google.cloud.filestore.v1.UpdateInstanceRequest result = + new com.google.cloud.filestore.v1.UpdateInstanceRequest(this); + if (updateMaskBuilder_ == null) { + result.updateMask_ = updateMask_; + } else { + result.updateMask_ = updateMaskBuilder_.build(); + } + if (instanceBuilder_ == null) { + result.instance_ = instance_; + } else { + result.instance_ = instanceBuilder_.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.v1.UpdateInstanceRequest) { + return mergeFrom((com.google.cloud.filestore.v1.UpdateInstanceRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.filestore.v1.UpdateInstanceRequest other) { + if (other == com.google.cloud.filestore.v1.UpdateInstanceRequest.getDefaultInstance()) + return this; + if (other.hasUpdateMask()) { + mergeUpdateMask(other.getUpdateMask()); + } + if (other.hasInstance()) { + mergeInstance(other.getInstance()); + } + this.mergeUnknownFields(other.unknownFields); + 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 { + com.google.cloud.filestore.v1.UpdateInstanceRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.filestore.v1.UpdateInstanceRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + 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_; + /** + * + * + *
+     * 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"
+     * * "file_shares"
+     * * "labels"
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1; + * + * @return Whether the updateMask field is set. + */ + public boolean hasUpdateMask() { + return updateMaskBuilder_ != null || updateMask_ != null; + } + /** + * + * + *
+     * 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"
+     * * "file_shares"
+     * * "labels"
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1; + * + * @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(); + } + } + /** + * + * + *
+     * 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"
+     * * "file_shares"
+     * * "labels"
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1; + */ + 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; + } + /** + * + * + *
+     * 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"
+     * * "file_shares"
+     * * "labels"
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1; + */ + public Builder setUpdateMask(com.google.protobuf.FieldMask.Builder builderForValue) { + if (updateMaskBuilder_ == null) { + updateMask_ = builderForValue.build(); + onChanged(); + } else { + updateMaskBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * 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"
+     * * "file_shares"
+     * * "labels"
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1; + */ + 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; + } + /** + * + * + *
+     * 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"
+     * * "file_shares"
+     * * "labels"
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1; + */ + public Builder clearUpdateMask() { + if (updateMaskBuilder_ == null) { + updateMask_ = null; + onChanged(); + } else { + updateMask_ = null; + updateMaskBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * 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"
+     * * "file_shares"
+     * * "labels"
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1; + */ + public com.google.protobuf.FieldMask.Builder getUpdateMaskBuilder() { + + onChanged(); + return getUpdateMaskFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * 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"
+     * * "file_shares"
+     * * "labels"
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1; + */ + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + if (updateMaskBuilder_ != null) { + return updateMaskBuilder_.getMessageOrBuilder(); + } else { + return updateMask_ == null + ? com.google.protobuf.FieldMask.getDefaultInstance() + : updateMask_; + } + } + /** + * + * + *
+     * 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"
+     * * "file_shares"
+     * * "labels"
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1; + */ + 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.v1.Instance instance_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.filestore.v1.Instance, + com.google.cloud.filestore.v1.Instance.Builder, + com.google.cloud.filestore.v1.InstanceOrBuilder> + instanceBuilder_; + /** + * + * + *
+     * Only fields specified in update_mask are updated.
+     * 
+ * + * .google.cloud.filestore.v1.Instance instance = 2; + * + * @return Whether the instance field is set. + */ + public boolean hasInstance() { + return instanceBuilder_ != null || instance_ != null; + } + /** + * + * + *
+     * Only fields specified in update_mask are updated.
+     * 
+ * + * .google.cloud.filestore.v1.Instance instance = 2; + * + * @return The instance. + */ + public com.google.cloud.filestore.v1.Instance getInstance() { + if (instanceBuilder_ == null) { + return instance_ == null + ? com.google.cloud.filestore.v1.Instance.getDefaultInstance() + : instance_; + } else { + return instanceBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Only fields specified in update_mask are updated.
+     * 
+ * + * .google.cloud.filestore.v1.Instance instance = 2; + */ + public Builder setInstance(com.google.cloud.filestore.v1.Instance value) { + if (instanceBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + instance_ = value; + onChanged(); + } else { + instanceBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Only fields specified in update_mask are updated.
+     * 
+ * + * .google.cloud.filestore.v1.Instance instance = 2; + */ + public Builder setInstance(com.google.cloud.filestore.v1.Instance.Builder builderForValue) { + if (instanceBuilder_ == null) { + instance_ = builderForValue.build(); + onChanged(); + } else { + instanceBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Only fields specified in update_mask are updated.
+     * 
+ * + * .google.cloud.filestore.v1.Instance instance = 2; + */ + public Builder mergeInstance(com.google.cloud.filestore.v1.Instance value) { + if (instanceBuilder_ == null) { + if (instance_ != null) { + instance_ = + com.google.cloud.filestore.v1.Instance.newBuilder(instance_) + .mergeFrom(value) + .buildPartial(); + } else { + instance_ = value; + } + onChanged(); + } else { + instanceBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Only fields specified in update_mask are updated.
+     * 
+ * + * .google.cloud.filestore.v1.Instance instance = 2; + */ + public Builder clearInstance() { + if (instanceBuilder_ == null) { + instance_ = null; + onChanged(); + } else { + instance_ = null; + instanceBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Only fields specified in update_mask are updated.
+     * 
+ * + * .google.cloud.filestore.v1.Instance instance = 2; + */ + public com.google.cloud.filestore.v1.Instance.Builder getInstanceBuilder() { + + onChanged(); + return getInstanceFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Only fields specified in update_mask are updated.
+     * 
+ * + * .google.cloud.filestore.v1.Instance instance = 2; + */ + public com.google.cloud.filestore.v1.InstanceOrBuilder getInstanceOrBuilder() { + if (instanceBuilder_ != null) { + return instanceBuilder_.getMessageOrBuilder(); + } else { + return instance_ == null + ? com.google.cloud.filestore.v1.Instance.getDefaultInstance() + : instance_; + } + } + /** + * + * + *
+     * Only fields specified in update_mask are updated.
+     * 
+ * + * .google.cloud.filestore.v1.Instance instance = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.filestore.v1.Instance, + com.google.cloud.filestore.v1.Instance.Builder, + com.google.cloud.filestore.v1.InstanceOrBuilder> + getInstanceFieldBuilder() { + if (instanceBuilder_ == null) { + instanceBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.filestore.v1.Instance, + com.google.cloud.filestore.v1.Instance.Builder, + com.google.cloud.filestore.v1.InstanceOrBuilder>( + getInstance(), getParentForChildren(), isClean()); + instance_ = null; + } + return instanceBuilder_; + } + + @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.v1.UpdateInstanceRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.filestore.v1.UpdateInstanceRequest) + private static final com.google.cloud.filestore.v1.UpdateInstanceRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.filestore.v1.UpdateInstanceRequest(); + } + + public static com.google.cloud.filestore.v1.UpdateInstanceRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public UpdateInstanceRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new UpdateInstanceRequest(input, extensionRegistry); + } + }; + + 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.v1.UpdateInstanceRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-filestore-v1/src/main/java/com/google/cloud/filestore/v1/UpdateInstanceRequestOrBuilder.java b/proto-google-cloud-filestore-v1/src/main/java/com/google/cloud/filestore/v1/UpdateInstanceRequestOrBuilder.java new file mode 100644 index 00000000..d9879b0c --- /dev/null +++ b/proto-google-cloud-filestore-v1/src/main/java/com/google/cloud/filestore/v1/UpdateInstanceRequestOrBuilder.java @@ -0,0 +1,110 @@ +/* + * 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/v1/cloud_filestore_service.proto + +package com.google.cloud.filestore.v1; + +public interface UpdateInstanceRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.filestore.v1.UpdateInstanceRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * 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"
+   * * "file_shares"
+   * * "labels"
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 1; + * + * @return Whether the updateMask field is set. + */ + boolean hasUpdateMask(); + /** + * + * + *
+   * 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"
+   * * "file_shares"
+   * * "labels"
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 1; + * + * @return The updateMask. + */ + com.google.protobuf.FieldMask getUpdateMask(); + /** + * + * + *
+   * 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"
+   * * "file_shares"
+   * * "labels"
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 1; + */ + com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder(); + + /** + * + * + *
+   * Only fields specified in update_mask are updated.
+   * 
+ * + * .google.cloud.filestore.v1.Instance instance = 2; + * + * @return Whether the instance field is set. + */ + boolean hasInstance(); + /** + * + * + *
+   * Only fields specified in update_mask are updated.
+   * 
+ * + * .google.cloud.filestore.v1.Instance instance = 2; + * + * @return The instance. + */ + com.google.cloud.filestore.v1.Instance getInstance(); + /** + * + * + *
+   * Only fields specified in update_mask are updated.
+   * 
+ * + * .google.cloud.filestore.v1.Instance instance = 2; + */ + com.google.cloud.filestore.v1.InstanceOrBuilder getInstanceOrBuilder(); +} diff --git a/proto-google-cloud-filestore-v1/src/main/proto/google/cloud/filestore/v1/cloud_filestore_service.proto b/proto-google-cloud-filestore-v1/src/main/proto/google/cloud/filestore/v1/cloud_filestore_service.proto new file mode 100644 index 00000000..7959abf0 --- /dev/null +++ b/proto-google-cloud-filestore-v1/src/main/proto/google/cloud/filestore/v1/cloud_filestore_service.proto @@ -0,0 +1,719 @@ +// Copyright 2021 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 +// +// http://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. + +syntax = "proto3"; + +package google.cloud.filestore.v1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/longrunning/operations.proto"; +import "google/protobuf/field_mask.proto"; +import "google/protobuf/timestamp.proto"; +import "google/protobuf/wrappers.proto"; + +option csharp_namespace = "Google.Cloud.Filestore.V1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/filestore/v1;filestore"; +option java_multiple_files = true; +option java_outer_classname = "CloudFilestoreServiceProto"; +option java_package = "com.google.cloud.filestore.v1"; +option php_namespace = "Google\\Cloud\\Filestore\\V1"; + +// Configures and manages Cloud Filestore resources. +// +// Cloud Filestore Manager v1. +// +// The `file.googleapis.com` service implements the Cloud Filestore API and +// defines the following resource model for managing instances: +// * 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: +// `/projects/{project_number}/locations/{location_id}/instances/{instance_id}` +// and backups are resources of the form: +// `/projects/{project_number}/locations/{location_id}/backup/{backup_id}` +// +// Note that location_id must be a GCP `zone` for instances and but to a GCP +// `region` for backups; for example: +// * `projects/12345/locations/us-central1-c/instances/my-filestore` +// * `projects/12345/locations/us-central1/backups/my-backup` +service CloudFilestoreManager { + option (google.api.default_host) = "file.googleapis.com"; + option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform"; + + // Lists all instances in a project for either a specified location + // or for all locations. + rpc ListInstances(ListInstancesRequest) returns (ListInstancesResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*}/instances" + }; + option (google.api.method_signature) = "parent"; + } + + // Gets the details of a specific instance. + rpc GetInstance(GetInstanceRequest) returns (Instance) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/instances/*}" + }; + option (google.api.method_signature) = "name"; + } + + // 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). + rpc CreateInstance(CreateInstanceRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*}/instances" + body: "instance" + }; + option (google.api.method_signature) = "parent,instance,instance_id"; + option (google.longrunning.operation_info) = { + response_type: "Instance" + metadata_type: "google.cloud.common.OperationMetadata" + }; + } + + // Updates the settings of a specific instance. + rpc UpdateInstance(UpdateInstanceRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v1/{instance.name=projects/*/locations/*/instances/*}" + body: "instance" + }; + option (google.api.method_signature) = "instance,update_mask"; + option (google.longrunning.operation_info) = { + response_type: "Instance" + metadata_type: "google.cloud.common.OperationMetadata" + }; + } + + // 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). + rpc RestoreInstance(RestoreInstanceRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{name=projects/*/locations/*/instances/*}:restore" + 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) = { + delete: "/v1/{name=projects/*/locations/*/instances/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + 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) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*}/backups" + }; + option (google.api.method_signature) = "parent"; + } + + // Gets the details of a specific backup. + rpc GetBackup(GetBackupRequest) returns (Backup) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/backups/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Creates a backup. + rpc CreateBackup(CreateBackupRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*}/backups" + body: "backup" + }; + option (google.api.method_signature) = "parent,backup,backup_id"; + option (google.longrunning.operation_info) = { + response_type: "Backup" + metadata_type: "google.cloud.common.OperationMetadata" + }; + } + + // Deletes a backup. + rpc DeleteBackup(DeleteBackupRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/backups/*}" + }; + 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 backup. + rpc UpdateBackup(UpdateBackupRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v1/{backup.name=projects/*/locations/*/backups/*}" + body: "backup" + }; + option (google.api.method_signature) = "backup,update_mask"; + option (google.longrunning.operation_info) = { + response_type: "Backup" + metadata_type: "google.cloud.common.OperationMetadata" + }; + } +} + +// Network configuration for the instance. +message NetworkConfig { + // Internet protocol versions supported by Cloud Filestore. + enum AddressMode { + // Internet protocol not set. + ADDRESS_MODE_UNSPECIFIED = 0; + + // Use the IPv4 internet protocol. + MODE_IPV4 = 1; + } + + // The name of the Google Compute Engine + // [VPC network](/compute/docs/networks-and-firewalls#networks) to which the + // instance is connected. + string network = 1; + + // Internet protocol versions for which the instance has IP addresses + // assigned. For this version, only MODE_IPV4 is supported. + repeated AddressMode modes = 3; + + // A /29 CIDR block in one of the + // [internal IP address + // ranges](https://www.arin.net/knowledge/address_filters.html) that + // identifies the range of IP addresses reserved for this instance. For + // example, 10.0.0.0/29 or 192.168.0.0/29. 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. + string reserved_ip_range = 4; + + // Output only. IPv4 addresses in the format + // {octet 1}.{octet 2}.{octet 3}.{octet 4} or IPv6 addresses in the format + // {block 1}:{block 2}:{block 3}:{block 4}:{block 5}:{block 6}:{block + // 7}:{block 8}. + repeated string ip_addresses = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// File share configuration for the instance. +message FileShareConfig { + // The name of the file share (must be 16 characters or less). + string name = 1; + + // File share capacity in gigabytes (GB). + // Cloud 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 + // share is created from scratch. + oneof source { + // The resource name of the backup, in the format + // projects/{project_number}/locations/{location_id}/backups/{backup_id}, + // that this file share has been restored from. + string source_backup = 8 [(google.api.resource_reference) = { + type: "file.googleapis.com/Backup" + }]; + } + + // Nfs Export Options. + // There is a limit of 10 export options per file share. + repeated NfsExportOptions nfs_export_options = 7; +} + +// NFS export options specifications. +message NfsExportOptions { + // The access mode. + enum AccessMode { + // AccessMode not set. + ACCESS_MODE_UNSPECIFIED = 0; + + // The client can only read the file share. + READ_ONLY = 1; + + // The client can read and write the file share (default). + READ_WRITE = 2; + } + + // The squash mode. + enum SquashMode { + // SquashMode not set. + SQUASH_MODE_UNSPECIFIED = 0; + + // The Root user has root access to the file share (default). + NO_ROOT_SQUASH = 1; + + // The Root user has squashed access to the anonymous uid/gid. + ROOT_SQUASH = 2; + } + + // List of either an IPv4 addresses in the format + // {octet 1}.{octet 2}.{octet 3}.{octet 4} or CIDR ranges in the format + // {octet 1}.{octet 2}.{octet 3}.{octet 4}/{mask size} which may mount the + // file share. + // Overlapping IP ranges are not allowed, both within and across + // NfsExportOptions. An error will be returned. + // The limit is 64 IP ranges/addresses for each FileShareConfig among all + // NfsExportOptions. + repeated string ip_ranges = 1; + + // Either READ_ONLY, for allowing only read requests on the exported + // directory, or READ_WRITE, for allowing both read and write requests. + // The default is READ_WRITE. + AccessMode access_mode = 2; + + // Either NO_ROOT_SQUASH, for allowing root access on the exported directory, + // or ROOT_SQUASH, for not allowing root access. The default is + // NO_ROOT_SQUASH. + SquashMode squash_mode = 3; + + // An integer representing the anonymous user id with a default value of + // 65534. + // Anon_uid may only be set with squash_mode of ROOT_SQUASH. An error will be + // returned if this field is specified for other squash_mode settings. + int64 anon_uid = 4; + + // An integer representing the anonymous group id with a default value of + // 65534. + // Anon_gid may only be set with squash_mode of ROOT_SQUASH. An error will be + // returned if this field is specified for other squash_mode settings. + int64 anon_gid = 5; +} + +// A Cloud Filestore instance. +message Instance { + option (google.api.resource) = { + type: "file.googleapis.com/Instance" + pattern: "projects/{project}/locations/{location}/instances/{instance}" + }; + + // The instance state. + enum State { + // State not set. + STATE_UNSPECIFIED = 0; + + // The instance is being created. + CREATING = 1; + + // The instance is available for use. + READY = 2; + + // Work is being done on the instance. You can get further details from the + // `statusMessage` field of the `Instance` resource. + REPAIRING = 3; + + // The instance is shutting down. + DELETING = 4; + + // The instance is experiencing an issue and might be unusable. You can get + // further details from the `statusMessage` field of the `Instance` + // resource. + ERROR = 6; + + // The instance is restoring a backup to an existing file share and may be + // unusable during this time. + RESTORING = 7; + } + + // Available service tiers. + enum Tier { + // Not set. + TIER_UNSPECIFIED = 0; + + // STANDARD tier. + STANDARD = 1; + + // PREMIUM tier. + PREMIUM = 2; + + // BASIC instances offer a maximum capacity of 63.9 TB. + // BASIC_HDD is an alias for STANDARD Tier, offering economical + // performance backed by HDD. + BASIC_HDD = 3; + + // BASIC instances offer a maximum capacity of 63.9 TB. + // BASIC_SSD is an alias for PREMIUM Tier, and offers improved + // performance backed by SSD. + BASIC_SSD = 4; + + // HIGH_SCALE instances offer expanded capacity and performance scaling + // capabilities. + HIGH_SCALE_SSD = 5; + } + + // Output only. The resource name of the instance, in the format + // projects/{project}/locations/{location}/instances/{instance}. + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The description of the instance (2048 characters or less). + string description = 2; + + // Output only. The instance state. + State state = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Additional information about the instance state, if available. + string status_message = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time when the instance was created. + google.protobuf.Timestamp create_time = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The service tier of the instance. + Tier tier = 8; + + // Resource labels to represent user provided metadata. + map labels = 9; + + // File system shares on the instance. + // For this version, only a single file share is supported. + repeated FileShareConfig file_shares = 10; + + // VPC networks to which the instance is connected. + // For this version, only a single network is supported. + repeated NetworkConfig networks = 11; + + // Server-specified ETag for the instance resource to prevent simultaneous + // updates from overwriting each other. + string etag = 12; + + // Output only. Reserved for future use. + google.protobuf.BoolValue satisfies_pzs = 13 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// CreateInstanceRequest creates an instance. +message CreateInstanceRequest { + // 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**. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; + + // Required. The name of the instance to create. + // The name must be unique for the specified project and location. + string instance_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. A [instance resource] + // (/cloud-filestore/reference/rest/v1/projects.locations.instances) + Instance instance = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// GetInstanceRequest gets the state of an instance. +message GetInstanceRequest { + // Required. The instance resource name, in the format + // projects/{project_id}/locations/{location}/instances/{instance_id}. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "file.googleapis.com/Instance" + } + ]; +} + +// UpdateInstanceRequest updates the settings of an instance. +message UpdateInstanceRequest { + // 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" + // * "file_shares" + // * "labels" + google.protobuf.FieldMask update_mask = 1; + + // Only fields specified in update_mask are updated. + Instance instance = 2; +} + +// RestoreInstanceRequest restores an existing instances's file share from a +// backup. +message RestoreInstanceRequest { + // Required. The resource name of the instance, in the format + // projects/{project_number}/locations/{location_id}/instances/{instance_id}. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "file.googleapis.com/Instance" + } + ]; + + // Required. Name of the file share in the Cloud Filestore instance that the backup + // is being restored to. + string file_share = 2 [(google.api.field_behavior) = REQUIRED]; + + oneof source { + // The resource name of the backup, in the format + // projects/{project_number}/locations/{location_id}/backups/{backup_id}. + string source_backup = 3 [(google.api.resource_reference) = { + type: "file.googleapis.com/Backup" + }]; + } +} + +// DeleteInstanceRequest deletes an instance. +message DeleteInstanceRequest { + // Required. The instance resource name, in the format + // projects/{project_id}/locations/{location}/instances/{instance_id} + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "file.googleapis.com/Instance" + } + ]; +} + +// ListInstancesRequest lists instances. +message ListInstancesRequest { + // Required. The project and location for which to retrieve instance information, + // in the format projects/{project_id}/locations/{location}. In Cloud + // Filestore, locations map to GCP zones, for example **us-west1-b**. To + // retrieve instance information for all locations, use "-" for the {location} + // value. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; + + // 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; +} + +// ListInstancesResponse is the result of ListInstancesRequest. +message ListInstancesResponse { + // A list of instances in the project for the specified location. + // + // If the {location} value in the request is "-", the response contains a list + // of instances from all locations. If any location is unreachable, the + // response will only return instances in reachable locations and the + // "unreachable" field will be populated with a list of unreachable locations. + repeated Instance instances = 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; +} + +// A Cloud Filestore backup. +message Backup { + option (google.api.resource) = { + type: "file.googleapis.com/Backup" + pattern: "projects/{project}/locations/{location}/backups/{backup}" + }; + + // The backup state. + enum State { + // State not set. + STATE_UNSPECIFIED = 0; + + // Backup is being created. + CREATING = 1; + + // Backup has been taken and the operation is being finalized. At this + // point, changes to the file share will not be reflected in the backup. + FINALIZING = 2; + + // Backup is available for use. + READY = 3; + + // Backup is being deleted. + DELETING = 4; + } + + // Output only. The resource name of the backup, in the format + // projects/{project_number}/locations/{location_id}/backups/{backup_id}. + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // A description of the backup with 2048 characters or less. + // Requests with longer descriptions will be rejected. + string description = 2; + + // Output only. The backup state. + State state = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time when the backup was created. + google.protobuf.Timestamp create_time = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Resource labels to represent user provided metadata. + map labels = 5; + + // Output only. Capacity of the source file share when the backup was created. + int64 capacity_gb = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The size of the storage used by the backup. As backups share storage, + // 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 + // projects/{project_number}/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 + // backup is created from. + string source_file_share = 9; + + // Output only. The service tier of the source Cloud Filestore instance that this backup + // is created from. + Instance.Tier source_instance_tier = 10 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Amount of bytes that will be downloaded if the backup is restored. This + // may be different than storage bytes, since sequential backups of the same + // disk will share storage. + int64 download_bytes = 11 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Reserved for future use. + google.protobuf.BoolValue satisfies_pzs = 12 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// CreateBackupRequest creates a backup. +message CreateBackupRequest { + // Required. The backup's project and location, in the format + // projects/{project_number}/locations/{location}. In Cloud Filestore, + // backup locations map to GCP regions, for example **us-west1**. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; + + // Required. A [backup resource] + // (/cloud-filestore/reference/rest/v1/projects.locations.backups) + Backup backup = 2 [(google.api.field_behavior) = REQUIRED]; + + // 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. + // Values that do not match this pattern will trigger an INVALID_ARGUMENT + // error. + string backup_id = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// DeleteBackupRequest deletes a backup. +message DeleteBackupRequest { + // Required. The backup resource name, in the format + // projects/{project_number}/locations/{location}/backups/{backup_id} + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "file.googleapis.com/Backup" + } + ]; +} + +// UpdateBackupRequest updates description and/or labels for a backup. +message UpdateBackupRequest { + // Required. A [backup resource] + // (/cloud-filestore/reference/rest/v1/projects.locations.backups) + Backup backup = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. Mask of fields to update. At least one path must be supplied in this + // field. + google.protobuf.FieldMask update_mask = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// GetBackupRequest gets the state of a backup. +message GetBackupRequest { + // Required. The backup resource name, in the format + // projects/{project_number}/locations/{location}/backups/{backup_id}. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "file.googleapis.com/Backup" + } + ]; +} + +// ListBackupsRequest lists backups. +message ListBackupsRequest { + // Required. The project and location for which to retrieve backup information, + // in the format projects/{project_number}/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. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; + + // 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; +} + +// ListBackupsResponse is the result of ListBackupsRequest. +message ListBackupsResponse { + // A list of backups in the project for the specified location. + // + // If the {location} value in the request is "-", the response contains a list + // of backups from all locations. If any location is unreachable, the + // response will only return backups in reachable locations and the + // "unreachable" field will be populated with a list of unreachable + // locations. + repeated Backup backups = 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; +} diff --git a/proto-google-cloud-filestore-v1beta1/clirr-ignored-differences.xml b/proto-google-cloud-filestore-v1beta1/clirr-ignored-differences.xml new file mode 100644 index 00000000..d0e28308 --- /dev/null +++ b/proto-google-cloud-filestore-v1beta1/clirr-ignored-differences.xml @@ -0,0 +1,33 @@ + + + + + 7012 + com/google/cloud/common/*OrBuilder + * get*(*) + + + 7012 + com/google/cloud/common/*OrBuilder + boolean contains*(*) + + + 7012 + com/google/cloud/common/*OrBuilder + boolean has*(*) + + 7012 + com/google/cloud/filestore/v1beta1/*OrBuilder + * get*(*) + + + 7012 + com/google/cloud/filestore/v1beta1/*OrBuilder + boolean contains*(*) + + + 7012 + com/google/cloud/filestore/v1beta1/*OrBuilder + boolean has*(*) + + diff --git a/proto-google-cloud-filestore-v1beta1/pom.xml b/proto-google-cloud-filestore-v1beta1/pom.xml new file mode 100644 index 00000000..6dc29a77 --- /dev/null +++ b/proto-google-cloud-filestore-v1beta1/pom.xml @@ -0,0 +1,46 @@ + + 4.0.0 + com.google.api.grpc + proto-google-cloud-filestore-v1beta1 + 0.0.1-SNAPSHOT + proto-google-cloud-filestore-v1beta1 + Proto library for google-cloud-filestore + + com.google.cloud + google-cloud-filestore-parent + 0.0.1-SNAPSHOT + + + + com.google.protobuf + protobuf-java + + + com.google.api.grpc + proto-google-common-protos + + + com.google.api.grpc + proto-google-iam-v1 + + + com.google.api + api-common + + + com.google.guava + guava + + + + + + + org.codehaus.mojo + flatten-maven-plugin + + + + diff --git a/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/common/OperationMetadata.java b/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/common/OperationMetadata.java new file mode 100644 index 00000000..965742be --- /dev/null +++ b/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/common/OperationMetadata.java @@ -0,0 +1,1846 @@ +/* + * 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/common/operation_metadata.proto + +package com.google.cloud.common; + +/** + * + * + *
+ * Represents the metadata of the long-running operation.
+ * 
+ * + * Protobuf type {@code google.cloud.common.OperationMetadata} + */ +public final class OperationMetadata extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.common.OperationMetadata) + OperationMetadataOrBuilder { + private static final long serialVersionUID = 0L; + // Use OperationMetadata.newBuilder() to construct. + private OperationMetadata(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private OperationMetadata() { + target_ = ""; + verb_ = ""; + statusDetail_ = ""; + apiVersion_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new OperationMetadata(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private OperationMetadata( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (createTime_ != null) { + subBuilder = createTime_.toBuilder(); + } + createTime_ = + input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(createTime_); + createTime_ = subBuilder.buildPartial(); + } + + break; + } + case 18: + { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (endTime_ != null) { + subBuilder = endTime_.toBuilder(); + } + endTime_ = + input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(endTime_); + endTime_ = subBuilder.buildPartial(); + } + + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + + target_ = s; + break; + } + case 34: + { + java.lang.String s = input.readStringRequireUtf8(); + + verb_ = s; + break; + } + case 42: + { + java.lang.String s = input.readStringRequireUtf8(); + + statusDetail_ = s; + break; + } + case 48: + { + cancelRequested_ = input.readBool(); + break; + } + case 58: + { + java.lang.String s = input.readStringRequireUtf8(); + + apiVersion_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.common.OperationMetadataOuterClass + .internal_static_google_cloud_common_OperationMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.common.OperationMetadataOuterClass + .internal_static_google_cloud_common_OperationMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.common.OperationMetadata.class, + com.google.cloud.common.OperationMetadata.Builder.class); + } + + public static final int CREATE_TIME_FIELD_NUMBER = 1; + private com.google.protobuf.Timestamp createTime_; + /** + * + * + *
+   * Output only. The time the operation was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 1 [(.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 the operation was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 1 [(.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 the operation was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { + return getCreateTime(); + } + + public static final int END_TIME_FIELD_NUMBER = 2; + private com.google.protobuf.Timestamp endTime_; + /** + * + * + *
+   * Output only. The time the operation finished running.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the endTime field is set. + */ + @java.lang.Override + public boolean hasEndTime() { + return endTime_ != null; + } + /** + * + * + *
+   * Output only. The time the operation finished running.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The endTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getEndTime() { + return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; + } + /** + * + * + *
+   * Output only. The time the operation finished running.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder() { + return getEndTime(); + } + + public static final int TARGET_FIELD_NUMBER = 3; + private volatile java.lang.Object target_; + /** + * + * + *
+   * Output only. Server-defined resource path for the target of the operation.
+   * 
+ * + * string target = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The target. + */ + @java.lang.Override + public java.lang.String getTarget() { + java.lang.Object ref = target_; + 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(); + target_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. Server-defined resource path for the target of the operation.
+   * 
+ * + * string target = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for target. + */ + @java.lang.Override + public com.google.protobuf.ByteString getTargetBytes() { + java.lang.Object ref = target_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + target_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int VERB_FIELD_NUMBER = 4; + private volatile java.lang.Object verb_; + /** + * + * + *
+   * Output only. Name of the verb executed by the operation.
+   * 
+ * + * string verb = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The verb. + */ + @java.lang.Override + public java.lang.String getVerb() { + java.lang.Object ref = verb_; + 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(); + verb_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. Name of the verb executed by the operation.
+   * 
+ * + * string verb = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for verb. + */ + @java.lang.Override + public com.google.protobuf.ByteString getVerbBytes() { + java.lang.Object ref = verb_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + verb_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int STATUS_DETAIL_FIELD_NUMBER = 5; + private volatile java.lang.Object statusDetail_; + /** + * + * + *
+   * Output only. Human-readable status of the operation, if any.
+   * 
+ * + * string status_detail = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The statusDetail. + */ + @java.lang.Override + public java.lang.String getStatusDetail() { + java.lang.Object ref = statusDetail_; + 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(); + statusDetail_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. Human-readable status of the operation, if any.
+   * 
+ * + * string status_detail = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for statusDetail. + */ + @java.lang.Override + public com.google.protobuf.ByteString getStatusDetailBytes() { + java.lang.Object ref = statusDetail_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + statusDetail_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CANCEL_REQUESTED_FIELD_NUMBER = 6; + private boolean cancelRequested_; + /** + * + * + *
+   * Output only. Identifies whether the user has requested cancellation
+   * of the operation. Operations that have successfully been cancelled
+   * have [Operation.error][] value with a [google.rpc.Status.code][] of 1,
+   * corresponding to `Code.CANCELLED`.
+   * 
+ * + * bool cancel_requested = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The cancelRequested. + */ + @java.lang.Override + public boolean getCancelRequested() { + return cancelRequested_; + } + + public static final int API_VERSION_FIELD_NUMBER = 7; + private volatile java.lang.Object apiVersion_; + /** + * + * + *
+   * Output only. API version used to start the operation.
+   * 
+ * + * string api_version = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The apiVersion. + */ + @java.lang.Override + public java.lang.String getApiVersion() { + java.lang.Object ref = apiVersion_; + 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(); + apiVersion_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. API version used to start the operation.
+   * 
+ * + * string api_version = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for apiVersion. + */ + @java.lang.Override + public com.google.protobuf.ByteString getApiVersionBytes() { + java.lang.Object ref = apiVersion_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + apiVersion_ = 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 (createTime_ != null) { + output.writeMessage(1, getCreateTime()); + } + if (endTime_ != null) { + output.writeMessage(2, getEndTime()); + } + if (!getTargetBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, target_); + } + if (!getVerbBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, verb_); + } + if (!getStatusDetailBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, statusDetail_); + } + if (cancelRequested_ != false) { + output.writeBool(6, cancelRequested_); + } + if (!getApiVersionBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 7, apiVersion_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (createTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getCreateTime()); + } + if (endTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getEndTime()); + } + if (!getTargetBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, target_); + } + if (!getVerbBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, verb_); + } + if (!getStatusDetailBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, statusDetail_); + } + if (cancelRequested_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(6, cancelRequested_); + } + if (!getApiVersionBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(7, apiVersion_); + } + size += unknownFields.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.common.OperationMetadata)) { + return super.equals(obj); + } + com.google.cloud.common.OperationMetadata other = + (com.google.cloud.common.OperationMetadata) obj; + + if (hasCreateTime() != other.hasCreateTime()) return false; + if (hasCreateTime()) { + if (!getCreateTime().equals(other.getCreateTime())) return false; + } + if (hasEndTime() != other.hasEndTime()) return false; + if (hasEndTime()) { + if (!getEndTime().equals(other.getEndTime())) return false; + } + if (!getTarget().equals(other.getTarget())) return false; + if (!getVerb().equals(other.getVerb())) return false; + if (!getStatusDetail().equals(other.getStatusDetail())) return false; + if (getCancelRequested() != other.getCancelRequested()) return false; + if (!getApiVersion().equals(other.getApiVersion())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasCreateTime()) { + hash = (37 * hash) + CREATE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getCreateTime().hashCode(); + } + if (hasEndTime()) { + hash = (37 * hash) + END_TIME_FIELD_NUMBER; + hash = (53 * hash) + getEndTime().hashCode(); + } + hash = (37 * hash) + TARGET_FIELD_NUMBER; + hash = (53 * hash) + getTarget().hashCode(); + hash = (37 * hash) + VERB_FIELD_NUMBER; + hash = (53 * hash) + getVerb().hashCode(); + hash = (37 * hash) + STATUS_DETAIL_FIELD_NUMBER; + hash = (53 * hash) + getStatusDetail().hashCode(); + hash = (37 * hash) + CANCEL_REQUESTED_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getCancelRequested()); + hash = (37 * hash) + API_VERSION_FIELD_NUMBER; + hash = (53 * hash) + getApiVersion().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.common.OperationMetadata parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.common.OperationMetadata 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.common.OperationMetadata parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.common.OperationMetadata 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.common.OperationMetadata parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.common.OperationMetadata parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.common.OperationMetadata parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.common.OperationMetadata 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.common.OperationMetadata parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.common.OperationMetadata 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.common.OperationMetadata parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.common.OperationMetadata 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.common.OperationMetadata 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; + } + /** + * + * + *
+   * Represents the metadata of the long-running operation.
+   * 
+ * + * Protobuf type {@code google.cloud.common.OperationMetadata} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.common.OperationMetadata) + com.google.cloud.common.OperationMetadataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.common.OperationMetadataOuterClass + .internal_static_google_cloud_common_OperationMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.common.OperationMetadataOuterClass + .internal_static_google_cloud_common_OperationMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.common.OperationMetadata.class, + com.google.cloud.common.OperationMetadata.Builder.class); + } + + // Construct using com.google.cloud.common.OperationMetadata.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (createTimeBuilder_ == null) { + createTime_ = null; + } else { + createTime_ = null; + createTimeBuilder_ = null; + } + if (endTimeBuilder_ == null) { + endTime_ = null; + } else { + endTime_ = null; + endTimeBuilder_ = null; + } + target_ = ""; + + verb_ = ""; + + statusDetail_ = ""; + + cancelRequested_ = false; + + apiVersion_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.common.OperationMetadataOuterClass + .internal_static_google_cloud_common_OperationMetadata_descriptor; + } + + @java.lang.Override + public com.google.cloud.common.OperationMetadata getDefaultInstanceForType() { + return com.google.cloud.common.OperationMetadata.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.common.OperationMetadata build() { + com.google.cloud.common.OperationMetadata result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.common.OperationMetadata buildPartial() { + com.google.cloud.common.OperationMetadata result = + new com.google.cloud.common.OperationMetadata(this); + if (createTimeBuilder_ == null) { + result.createTime_ = createTime_; + } else { + result.createTime_ = createTimeBuilder_.build(); + } + if (endTimeBuilder_ == null) { + result.endTime_ = endTime_; + } else { + result.endTime_ = endTimeBuilder_.build(); + } + result.target_ = target_; + result.verb_ = verb_; + result.statusDetail_ = statusDetail_; + result.cancelRequested_ = cancelRequested_; + result.apiVersion_ = apiVersion_; + 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.common.OperationMetadata) { + return mergeFrom((com.google.cloud.common.OperationMetadata) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.common.OperationMetadata other) { + if (other == com.google.cloud.common.OperationMetadata.getDefaultInstance()) return this; + if (other.hasCreateTime()) { + mergeCreateTime(other.getCreateTime()); + } + if (other.hasEndTime()) { + mergeEndTime(other.getEndTime()); + } + if (!other.getTarget().isEmpty()) { + target_ = other.target_; + onChanged(); + } + if (!other.getVerb().isEmpty()) { + verb_ = other.verb_; + onChanged(); + } + if (!other.getStatusDetail().isEmpty()) { + statusDetail_ = other.statusDetail_; + onChanged(); + } + if (other.getCancelRequested() != false) { + setCancelRequested(other.getCancelRequested()); + } + if (!other.getApiVersion().isEmpty()) { + apiVersion_ = other.apiVersion_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + 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 { + com.google.cloud.common.OperationMetadata parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.common.OperationMetadata) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + 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 the operation was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 1 [(.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 the operation was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 1 [(.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 the operation was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 1 [(.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 the operation was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 1 [(.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 the operation was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 1 [(.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 the operation was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 1 [(.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 the operation was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getCreateTimeBuilder() { + + onChanged(); + return getCreateTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. The time the operation was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 1 [(.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 the operation was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 1 [(.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.Timestamp endTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + endTimeBuilder_; + /** + * + * + *
+     * Output only. The time the operation finished running.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the endTime field is set. + */ + public boolean hasEndTime() { + return endTimeBuilder_ != null || endTime_ != null; + } + /** + * + * + *
+     * Output only. The time the operation finished running.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The endTime. + */ + public com.google.protobuf.Timestamp getEndTime() { + if (endTimeBuilder_ == null) { + return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; + } else { + return endTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Output only. The time the operation finished running.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setEndTime(com.google.protobuf.Timestamp value) { + if (endTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + endTime_ = value; + onChanged(); + } else { + endTimeBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Output only. The time the operation finished running.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setEndTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (endTimeBuilder_ == null) { + endTime_ = builderForValue.build(); + onChanged(); + } else { + endTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Output only. The time the operation finished running.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeEndTime(com.google.protobuf.Timestamp value) { + if (endTimeBuilder_ == null) { + if (endTime_ != null) { + endTime_ = + com.google.protobuf.Timestamp.newBuilder(endTime_).mergeFrom(value).buildPartial(); + } else { + endTime_ = value; + } + onChanged(); + } else { + endTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Output only. The time the operation finished running.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearEndTime() { + if (endTimeBuilder_ == null) { + endTime_ = null; + onChanged(); + } else { + endTime_ = null; + endTimeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Output only. The time the operation finished running.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getEndTimeBuilder() { + + onChanged(); + return getEndTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. The time the operation finished running.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder() { + if (endTimeBuilder_ != null) { + return endTimeBuilder_.getMessageOrBuilder(); + } else { + return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; + } + } + /** + * + * + *
+     * Output only. The time the operation finished running.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getEndTimeFieldBuilder() { + if (endTimeBuilder_ == null) { + endTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getEndTime(), getParentForChildren(), isClean()); + endTime_ = null; + } + return endTimeBuilder_; + } + + private java.lang.Object target_ = ""; + /** + * + * + *
+     * Output only. Server-defined resource path for the target of the operation.
+     * 
+ * + * string target = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The target. + */ + public java.lang.String getTarget() { + java.lang.Object ref = target_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + target_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. Server-defined resource path for the target of the operation.
+     * 
+ * + * string target = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for target. + */ + public com.google.protobuf.ByteString getTargetBytes() { + java.lang.Object ref = target_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + target_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. Server-defined resource path for the target of the operation.
+     * 
+ * + * string target = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The target to set. + * @return This builder for chaining. + */ + public Builder setTarget(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + target_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Server-defined resource path for the target of the operation.
+     * 
+ * + * string target = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearTarget() { + + target_ = getDefaultInstance().getTarget(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Server-defined resource path for the target of the operation.
+     * 
+ * + * string target = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for target to set. + * @return This builder for chaining. + */ + public Builder setTargetBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + target_ = value; + onChanged(); + return this; + } + + private java.lang.Object verb_ = ""; + /** + * + * + *
+     * Output only. Name of the verb executed by the operation.
+     * 
+ * + * string verb = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The verb. + */ + public java.lang.String getVerb() { + java.lang.Object ref = verb_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + verb_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. Name of the verb executed by the operation.
+     * 
+ * + * string verb = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for verb. + */ + public com.google.protobuf.ByteString getVerbBytes() { + java.lang.Object ref = verb_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + verb_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. Name of the verb executed by the operation.
+     * 
+ * + * string verb = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The verb to set. + * @return This builder for chaining. + */ + public Builder setVerb(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + verb_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Name of the verb executed by the operation.
+     * 
+ * + * string verb = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearVerb() { + + verb_ = getDefaultInstance().getVerb(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Name of the verb executed by the operation.
+     * 
+ * + * string verb = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for verb to set. + * @return This builder for chaining. + */ + public Builder setVerbBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + verb_ = value; + onChanged(); + return this; + } + + private java.lang.Object statusDetail_ = ""; + /** + * + * + *
+     * Output only. Human-readable status of the operation, if any.
+     * 
+ * + * string status_detail = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The statusDetail. + */ + public java.lang.String getStatusDetail() { + java.lang.Object ref = statusDetail_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + statusDetail_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. Human-readable status of the operation, if any.
+     * 
+ * + * string status_detail = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for statusDetail. + */ + public com.google.protobuf.ByteString getStatusDetailBytes() { + java.lang.Object ref = statusDetail_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + statusDetail_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. Human-readable status of the operation, if any.
+     * 
+ * + * string status_detail = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The statusDetail to set. + * @return This builder for chaining. + */ + public Builder setStatusDetail(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + statusDetail_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Human-readable status of the operation, if any.
+     * 
+ * + * string status_detail = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearStatusDetail() { + + statusDetail_ = getDefaultInstance().getStatusDetail(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Human-readable status of the operation, if any.
+     * 
+ * + * string status_detail = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for statusDetail to set. + * @return This builder for chaining. + */ + public Builder setStatusDetailBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + statusDetail_ = value; + onChanged(); + return this; + } + + private boolean cancelRequested_; + /** + * + * + *
+     * Output only. Identifies whether the user has requested cancellation
+     * of the operation. Operations that have successfully been cancelled
+     * have [Operation.error][] value with a [google.rpc.Status.code][] of 1,
+     * corresponding to `Code.CANCELLED`.
+     * 
+ * + * bool cancel_requested = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The cancelRequested. + */ + @java.lang.Override + public boolean getCancelRequested() { + return cancelRequested_; + } + /** + * + * + *
+     * Output only. Identifies whether the user has requested cancellation
+     * of the operation. Operations that have successfully been cancelled
+     * have [Operation.error][] value with a [google.rpc.Status.code][] of 1,
+     * corresponding to `Code.CANCELLED`.
+     * 
+ * + * bool cancel_requested = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The cancelRequested to set. + * @return This builder for chaining. + */ + public Builder setCancelRequested(boolean value) { + + cancelRequested_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Identifies whether the user has requested cancellation
+     * of the operation. Operations that have successfully been cancelled
+     * have [Operation.error][] value with a [google.rpc.Status.code][] of 1,
+     * corresponding to `Code.CANCELLED`.
+     * 
+ * + * bool cancel_requested = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearCancelRequested() { + + cancelRequested_ = false; + onChanged(); + return this; + } + + private java.lang.Object apiVersion_ = ""; + /** + * + * + *
+     * Output only. API version used to start the operation.
+     * 
+ * + * string api_version = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The apiVersion. + */ + public java.lang.String getApiVersion() { + java.lang.Object ref = apiVersion_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + apiVersion_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. API version used to start the operation.
+     * 
+ * + * string api_version = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for apiVersion. + */ + public com.google.protobuf.ByteString getApiVersionBytes() { + java.lang.Object ref = apiVersion_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + apiVersion_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. API version used to start the operation.
+     * 
+ * + * string api_version = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The apiVersion to set. + * @return This builder for chaining. + */ + public Builder setApiVersion(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + apiVersion_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. API version used to start the operation.
+     * 
+ * + * string api_version = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearApiVersion() { + + apiVersion_ = getDefaultInstance().getApiVersion(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. API version used to start the operation.
+     * 
+ * + * string api_version = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for apiVersion to set. + * @return This builder for chaining. + */ + public Builder setApiVersionBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + apiVersion_ = 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.common.OperationMetadata) + } + + // @@protoc_insertion_point(class_scope:google.cloud.common.OperationMetadata) + private static final com.google.cloud.common.OperationMetadata DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.common.OperationMetadata(); + } + + public static com.google.cloud.common.OperationMetadata getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public OperationMetadata parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new OperationMetadata(input, extensionRegistry); + } + }; + + 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.common.OperationMetadata getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/common/OperationMetadataOrBuilder.java b/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/common/OperationMetadataOrBuilder.java new file mode 100644 index 00000000..9d77fb3b --- /dev/null +++ b/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/common/OperationMetadataOrBuilder.java @@ -0,0 +1,217 @@ +/* + * 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/common/operation_metadata.proto + +package com.google.cloud.common; + +public interface OperationMetadataOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.common.OperationMetadata) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Output only. The time the operation was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + boolean hasCreateTime(); + /** + * + * + *
+   * Output only. The time the operation was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The createTime. + */ + com.google.protobuf.Timestamp getCreateTime(); + /** + * + * + *
+   * Output only. The time the operation was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder(); + + /** + * + * + *
+   * Output only. The time the operation finished running.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the endTime field is set. + */ + boolean hasEndTime(); + /** + * + * + *
+   * Output only. The time the operation finished running.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The endTime. + */ + com.google.protobuf.Timestamp getEndTime(); + /** + * + * + *
+   * Output only. The time the operation finished running.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder(); + + /** + * + * + *
+   * Output only. Server-defined resource path for the target of the operation.
+   * 
+ * + * string target = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The target. + */ + java.lang.String getTarget(); + /** + * + * + *
+   * Output only. Server-defined resource path for the target of the operation.
+   * 
+ * + * string target = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for target. + */ + com.google.protobuf.ByteString getTargetBytes(); + + /** + * + * + *
+   * Output only. Name of the verb executed by the operation.
+   * 
+ * + * string verb = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The verb. + */ + java.lang.String getVerb(); + /** + * + * + *
+   * Output only. Name of the verb executed by the operation.
+   * 
+ * + * string verb = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for verb. + */ + com.google.protobuf.ByteString getVerbBytes(); + + /** + * + * + *
+   * Output only. Human-readable status of the operation, if any.
+   * 
+ * + * string status_detail = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The statusDetail. + */ + java.lang.String getStatusDetail(); + /** + * + * + *
+   * Output only. Human-readable status of the operation, if any.
+   * 
+ * + * string status_detail = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for statusDetail. + */ + com.google.protobuf.ByteString getStatusDetailBytes(); + + /** + * + * + *
+   * Output only. Identifies whether the user has requested cancellation
+   * of the operation. Operations that have successfully been cancelled
+   * have [Operation.error][] value with a [google.rpc.Status.code][] of 1,
+   * corresponding to `Code.CANCELLED`.
+   * 
+ * + * bool cancel_requested = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The cancelRequested. + */ + boolean getCancelRequested(); + + /** + * + * + *
+   * Output only. API version used to start the operation.
+   * 
+ * + * string api_version = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The apiVersion. + */ + java.lang.String getApiVersion(); + /** + * + * + *
+   * Output only. API version used to start the operation.
+   * 
+ * + * string api_version = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for apiVersion. + */ + com.google.protobuf.ByteString getApiVersionBytes(); +} diff --git a/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/common/OperationMetadataOuterClass.java b/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/common/OperationMetadataOuterClass.java new file mode 100644 index 00000000..7ed9837c --- /dev/null +++ b/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/common/OperationMetadataOuterClass.java @@ -0,0 +1,88 @@ +/* + * 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/common/operation_metadata.proto + +package com.google.cloud.common; + +public final class OperationMetadataOuterClass { + private OperationMetadataOuterClass() {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions((com.google.protobuf.ExtensionRegistryLite) registry); + } + + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_common_OperationMetadata_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_common_OperationMetadata_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\n,google/cloud/common/operation_metadata" + + ".proto\022\023google.cloud.common\032\037google/api/" + + "field_behavior.proto\032\037google/protobuf/ti" + + "mestamp.proto\"\371\001\n\021OperationMetadata\0224\n\013c" + + "reate_time\030\001 \001(\0132\032.google.protobuf.Times" + + "tampB\003\340A\003\0221\n\010end_time\030\002 \001(\0132\032.google.pro" + + "tobuf.TimestampB\003\340A\003\022\023\n\006target\030\003 \001(\tB\003\340A" + + "\003\022\021\n\004verb\030\004 \001(\tB\003\340A\003\022\032\n\rstatus_detail\030\005 " + + "\001(\tB\003\340A\003\022\035\n\020cancel_requested\030\006 \001(\010B\003\340A\003\022" + + "\030\n\013api_version\030\007 \001(\tB\003\340A\003BV\n\027com.google." + + "cloud.commonP\001Z9google.golang.org/genpro" + + "to/googleapis/cloud/common;commonb\006proto" + + "3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.api.FieldBehaviorProto.getDescriptor(), + com.google.protobuf.TimestampProto.getDescriptor(), + }); + internal_static_google_cloud_common_OperationMetadata_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_common_OperationMetadata_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_common_OperationMetadata_descriptor, + new java.lang.String[] { + "CreateTime", + "EndTime", + "Target", + "Verb", + "StatusDetail", + "CancelRequested", + "ApiVersion", + }); + com.google.protobuf.ExtensionRegistry registry = + com.google.protobuf.ExtensionRegistry.newInstance(); + registry.add(com.google.api.FieldBehaviorProto.fieldBehavior); + com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( + descriptor, registry); + com.google.api.FieldBehaviorProto.getDescriptor(); + com.google.protobuf.TimestampProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/Backup.java b/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/Backup.java new file mode 100644 index 00000000..5bae8dec --- /dev/null +++ b/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/Backup.java @@ -0,0 +1,2939 @@ +/* + * 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 Cloud Filestore backup.
+ * 
+ * + * Protobuf type {@code google.cloud.filestore.v1beta1.Backup} + */ +public final class Backup extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.filestore.v1beta1.Backup) + BackupOrBuilder { + private static final long serialVersionUID = 0L; + // Use Backup.newBuilder() to construct. + private Backup(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Backup() { + name_ = ""; + description_ = ""; + state_ = 0; + sourceInstance_ = ""; + sourceFileShare_ = ""; + sourceInstanceTier_ = 0; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Backup(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private Backup( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + description_ = s; + break; + } + case 24: + { + int rawValue = input.readEnum(); + + state_ = rawValue; + break; + } + case 34: + { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (createTime_ != null) { + subBuilder = createTime_.toBuilder(); + } + createTime_ = + input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(createTime_); + createTime_ = subBuilder.buildPartial(); + } + + break; + } + case 42: + { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + labels_ = + com.google.protobuf.MapField.newMapField(LabelsDefaultEntryHolder.defaultEntry); + mutable_bitField0_ |= 0x00000001; + } + com.google.protobuf.MapEntry labels__ = + input.readMessage( + LabelsDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); + labels_.getMutableMap().put(labels__.getKey(), labels__.getValue()); + break; + } + case 48: + { + capacityGb_ = input.readInt64(); + break; + } + case 56: + { + storageBytes_ = input.readInt64(); + break; + } + case 66: + { + java.lang.String s = input.readStringRequireUtf8(); + + sourceInstance_ = s; + break; + } + case 74: + { + java.lang.String s = input.readStringRequireUtf8(); + + sourceFileShare_ = s; + break; + } + case 80: + { + int rawValue = input.readEnum(); + + sourceInstanceTier_ = rawValue; + break; + } + case 88: + { + downloadBytes_ = input.readInt64(); + break; + } + case 98: + { + com.google.protobuf.BoolValue.Builder subBuilder = null; + if (satisfiesPzs_ != null) { + subBuilder = satisfiesPzs_.toBuilder(); + } + satisfiesPzs_ = + input.readMessage(com.google.protobuf.BoolValue.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(satisfiesPzs_); + satisfiesPzs_ = subBuilder.buildPartial(); + } + + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.filestore.v1beta1.CloudFilestoreServiceProto + .internal_static_google_cloud_filestore_v1beta1_Backup_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 5: + 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_Backup_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.filestore.v1beta1.Backup.class, + com.google.cloud.filestore.v1beta1.Backup.Builder.class); + } + + /** + * + * + *
+   * The backup state.
+   * 
+ * + * Protobuf enum {@code google.cloud.filestore.v1beta1.Backup.State} + */ + public enum State implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * State not set.
+     * 
+ * + * STATE_UNSPECIFIED = 0; + */ + STATE_UNSPECIFIED(0), + /** + * + * + *
+     * Backup is being created.
+     * 
+ * + * CREATING = 1; + */ + CREATING(1), + /** + * + * + *
+     * Backup has been taken and the operation is being finalized. At this
+     * point, changes to the file share will not be reflected in the backup.
+     * 
+ * + * FINALIZING = 2; + */ + FINALIZING(2), + /** + * + * + *
+     * Backup is available for use.
+     * 
+ * + * READY = 3; + */ + READY(3), + /** + * + * + *
+     * Backup is being deleted.
+     * 
+ * + * DELETING = 4; + */ + DELETING(4), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * State not set.
+     * 
+ * + * STATE_UNSPECIFIED = 0; + */ + public static final int STATE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * Backup is being created.
+     * 
+ * + * CREATING = 1; + */ + public static final int CREATING_VALUE = 1; + /** + * + * + *
+     * Backup has been taken and the operation is being finalized. At this
+     * point, changes to the file share will not be reflected in the backup.
+     * 
+ * + * FINALIZING = 2; + */ + public static final int FINALIZING_VALUE = 2; + /** + * + * + *
+     * Backup is available for use.
+     * 
+ * + * READY = 3; + */ + public static final int READY_VALUE = 3; + /** + * + * + *
+     * Backup 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 2: + return FINALIZING; + 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.Backup.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.Backup.State) + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Output only. The resource name of the backup, in the format
+   * projects/{project_id}/locations/{location_id}/backups/{backup_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 backup, in the format
+   * projects/{project_id}/locations/{location_id}/backups/{backup_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 DESCRIPTION_FIELD_NUMBER = 2; + private volatile java.lang.Object description_; + /** + * + * + *
+   * A description of the backup with 2048 characters or less.
+   * Requests with longer descriptions will be rejected.
+   * 
+ * + * string description = 2; + * + * @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 backup with 2048 characters or less.
+   * Requests with longer descriptions will be rejected.
+   * 
+ * + * string description = 2; + * + * @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 STATE_FIELD_NUMBER = 3; + private int state_; + /** + * + * + *
+   * Output only. The backup state.
+   * 
+ * + * + * .google.cloud.filestore.v1beta1.Backup.State state = 3 [(.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 backup state.
+   * 
+ * + * + * .google.cloud.filestore.v1beta1.Backup.State state = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The state. + */ + @java.lang.Override + public com.google.cloud.filestore.v1beta1.Backup.State getState() { + @SuppressWarnings("deprecation") + com.google.cloud.filestore.v1beta1.Backup.State result = + com.google.cloud.filestore.v1beta1.Backup.State.valueOf(state_); + return result == null ? com.google.cloud.filestore.v1beta1.Backup.State.UNRECOGNIZED : result; + } + + public static final int CREATE_TIME_FIELD_NUMBER = 4; + private com.google.protobuf.Timestamp createTime_; + /** + * + * + *
+   * Output only. The time when the backup was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 4 [(.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 backup was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 4 [(.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 backup was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { + return getCreateTime(); + } + + public static final int LABELS_FIELD_NUMBER = 5; + + 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_Backup_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 = 5; + */ + @java.lang.Override + public boolean containsLabels(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + 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 = 5; + */ + @java.lang.Override + public java.util.Map getLabelsMap() { + return internalGetLabels().getMap(); + } + /** + * + * + *
+   * Resource labels to represent user provided metadata.
+   * 
+ * + * map<string, string> labels = 5; + */ + @java.lang.Override + public java.lang.String getLabelsOrDefault(java.lang.String key, java.lang.String defaultValue) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + 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 = 5; + */ + @java.lang.Override + public java.lang.String getLabelsOrThrow(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = internalGetLabels().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public static final int CAPACITY_GB_FIELD_NUMBER = 6; + private long capacityGb_; + /** + * + * + *
+   * Output only. Capacity of the source file share when the backup was created.
+   * 
+ * + * int64 capacity_gb = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The capacityGb. + */ + @java.lang.Override + public long getCapacityGb() { + return capacityGb_; + } + + public static final int STORAGE_BYTES_FIELD_NUMBER = 7; + private long storageBytes_; + /** + * + * + *
+   * Output only. The size of the storage used by the backup. As backups share storage,
+   * this number is expected to change with backup creation/deletion.
+   * 
+ * + * int64 storage_bytes = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The storageBytes. + */ + @java.lang.Override + public long getStorageBytes() { + return storageBytes_; + } + + public static final int SOURCE_INSTANCE_FIELD_NUMBER = 8; + private volatile java.lang.Object sourceInstance_; + /** + * + * + *
+   * The resource name of the source Cloud 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) = { ... } + * + * @return The sourceInstance. + */ + @java.lang.Override + public java.lang.String getSourceInstance() { + java.lang.Object ref = sourceInstance_; + 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(); + sourceInstance_ = s; + return s; + } + } + /** + * + * + *
+   * The resource name of the source Cloud 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) = { ... } + * + * @return The bytes for sourceInstance. + */ + @java.lang.Override + public com.google.protobuf.ByteString getSourceInstanceBytes() { + java.lang.Object ref = sourceInstance_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + sourceInstance_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SOURCE_FILE_SHARE_FIELD_NUMBER = 9; + private volatile java.lang.Object sourceFileShare_; + /** + * + * + *
+   * Name of the file share in the source Cloud Filestore instance that the
+   * backup is created from.
+   * 
+ * + * string source_file_share = 9; + * + * @return The sourceFileShare. + */ + @java.lang.Override + public java.lang.String getSourceFileShare() { + java.lang.Object ref = sourceFileShare_; + 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(); + sourceFileShare_ = s; + return s; + } + } + /** + * + * + *
+   * Name of the file share in the source Cloud Filestore instance that the
+   * backup is created from.
+   * 
+ * + * string source_file_share = 9; + * + * @return The bytes for sourceFileShare. + */ + @java.lang.Override + public com.google.protobuf.ByteString getSourceFileShareBytes() { + java.lang.Object ref = sourceFileShare_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + sourceFileShare_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SOURCE_INSTANCE_TIER_FIELD_NUMBER = 10; + private int sourceInstanceTier_; + /** + * + * + *
+   * Output only. The service tier of the source Cloud Filestore instance that this backup
+   * is created from.
+   * 
+ * + * + * .google.cloud.filestore.v1beta1.Instance.Tier source_instance_tier = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for sourceInstanceTier. + */ + @java.lang.Override + public int getSourceInstanceTierValue() { + return sourceInstanceTier_; + } + /** + * + * + *
+   * Output only. The service tier of the source Cloud Filestore instance that this backup
+   * is created from.
+   * 
+ * + * + * .google.cloud.filestore.v1beta1.Instance.Tier source_instance_tier = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The sourceInstanceTier. + */ + @java.lang.Override + public com.google.cloud.filestore.v1beta1.Instance.Tier getSourceInstanceTier() { + @SuppressWarnings("deprecation") + com.google.cloud.filestore.v1beta1.Instance.Tier result = + com.google.cloud.filestore.v1beta1.Instance.Tier.valueOf(sourceInstanceTier_); + return result == null ? com.google.cloud.filestore.v1beta1.Instance.Tier.UNRECOGNIZED : result; + } + + public static final int DOWNLOAD_BYTES_FIELD_NUMBER = 11; + private long downloadBytes_; + /** + * + * + *
+   * Output only. Amount of bytes that will be downloaded if the backup is restored
+   * 
+ * + * int64 download_bytes = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The downloadBytes. + */ + @java.lang.Override + public long getDownloadBytes() { + return downloadBytes_; + } + + public static final int SATISFIES_PZS_FIELD_NUMBER = 12; + private com.google.protobuf.BoolValue satisfiesPzs_; + /** + * + * + *
+   * Output only. Reserved for future use.
+   * 
+ * + * + * .google.protobuf.BoolValue satisfies_pzs = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the satisfiesPzs field is set. + */ + @java.lang.Override + public boolean hasSatisfiesPzs() { + return satisfiesPzs_ != null; + } + /** + * + * + *
+   * Output only. Reserved for future use.
+   * 
+ * + * + * .google.protobuf.BoolValue satisfies_pzs = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The satisfiesPzs. + */ + @java.lang.Override + public com.google.protobuf.BoolValue getSatisfiesPzs() { + return satisfiesPzs_ == null + ? com.google.protobuf.BoolValue.getDefaultInstance() + : satisfiesPzs_; + } + /** + * + * + *
+   * Output only. Reserved for future use.
+   * 
+ * + * + * .google.protobuf.BoolValue satisfies_pzs = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.BoolValueOrBuilder getSatisfiesPzsOrBuilder() { + return getSatisfiesPzs(); + } + + 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 (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (!getDescriptionBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, description_); + } + if (state_ != com.google.cloud.filestore.v1beta1.Backup.State.STATE_UNSPECIFIED.getNumber()) { + output.writeEnum(3, state_); + } + if (createTime_ != null) { + output.writeMessage(4, getCreateTime()); + } + com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( + output, internalGetLabels(), LabelsDefaultEntryHolder.defaultEntry, 5); + if (capacityGb_ != 0L) { + output.writeInt64(6, capacityGb_); + } + if (storageBytes_ != 0L) { + output.writeInt64(7, storageBytes_); + } + if (!getSourceInstanceBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 8, sourceInstance_); + } + if (!getSourceFileShareBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 9, sourceFileShare_); + } + if (sourceInstanceTier_ + != com.google.cloud.filestore.v1beta1.Instance.Tier.TIER_UNSPECIFIED.getNumber()) { + output.writeEnum(10, sourceInstanceTier_); + } + if (downloadBytes_ != 0L) { + output.writeInt64(11, downloadBytes_); + } + if (satisfiesPzs_ != null) { + output.writeMessage(12, getSatisfiesPzs()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (!getDescriptionBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, description_); + } + if (state_ != com.google.cloud.filestore.v1beta1.Backup.State.STATE_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(3, state_); + } + if (createTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, 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(5, labels__); + } + if (capacityGb_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(6, capacityGb_); + } + if (storageBytes_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(7, storageBytes_); + } + if (!getSourceInstanceBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(8, sourceInstance_); + } + if (!getSourceFileShareBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(9, sourceFileShare_); + } + if (sourceInstanceTier_ + != com.google.cloud.filestore.v1beta1.Instance.Tier.TIER_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(10, sourceInstanceTier_); + } + if (downloadBytes_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(11, downloadBytes_); + } + if (satisfiesPzs_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(12, getSatisfiesPzs()); + } + size += unknownFields.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.Backup)) { + return super.equals(obj); + } + com.google.cloud.filestore.v1beta1.Backup other = + (com.google.cloud.filestore.v1beta1.Backup) obj; + + if (!getName().equals(other.getName())) return false; + if (!getDescription().equals(other.getDescription())) 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 (getCapacityGb() != other.getCapacityGb()) return false; + if (getStorageBytes() != other.getStorageBytes()) return false; + if (!getSourceInstance().equals(other.getSourceInstance())) return false; + if (!getSourceFileShare().equals(other.getSourceFileShare())) return false; + if (sourceInstanceTier_ != other.sourceInstanceTier_) return false; + if (getDownloadBytes() != other.getDownloadBytes()) return false; + if (hasSatisfiesPzs() != other.hasSatisfiesPzs()) return false; + if (hasSatisfiesPzs()) { + if (!getSatisfiesPzs().equals(other.getSatisfiesPzs())) return false; + } + if (!unknownFields.equals(other.unknownFields)) 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) + DESCRIPTION_FIELD_NUMBER; + hash = (53 * hash) + getDescription().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 = (37 * hash) + CAPACITY_GB_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getCapacityGb()); + hash = (37 * hash) + STORAGE_BYTES_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getStorageBytes()); + hash = (37 * hash) + SOURCE_INSTANCE_FIELD_NUMBER; + hash = (53 * hash) + getSourceInstance().hashCode(); + hash = (37 * hash) + SOURCE_FILE_SHARE_FIELD_NUMBER; + hash = (53 * hash) + getSourceFileShare().hashCode(); + hash = (37 * hash) + SOURCE_INSTANCE_TIER_FIELD_NUMBER; + hash = (53 * hash) + sourceInstanceTier_; + hash = (37 * hash) + DOWNLOAD_BYTES_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getDownloadBytes()); + if (hasSatisfiesPzs()) { + hash = (37 * hash) + SATISFIES_PZS_FIELD_NUMBER; + hash = (53 * hash) + getSatisfiesPzs().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.filestore.v1beta1.Backup parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.filestore.v1beta1.Backup 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.Backup parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.filestore.v1beta1.Backup 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.Backup parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.filestore.v1beta1.Backup 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.Backup parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.filestore.v1beta1.Backup 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.Backup parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.filestore.v1beta1.Backup 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.Backup 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.Backup 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.Backup 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 Cloud Filestore backup.
+   * 
+ * + * Protobuf type {@code google.cloud.filestore.v1beta1.Backup} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.filestore.v1beta1.Backup) + com.google.cloud.filestore.v1beta1.BackupOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.filestore.v1beta1.CloudFilestoreServiceProto + .internal_static_google_cloud_filestore_v1beta1_Backup_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 5: + return internalGetLabels(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMutableMapField(int number) { + switch (number) { + case 5: + 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_Backup_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.filestore.v1beta1.Backup.class, + com.google.cloud.filestore.v1beta1.Backup.Builder.class); + } + + // Construct using com.google.cloud.filestore.v1beta1.Backup.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + description_ = ""; + + state_ = 0; + + if (createTimeBuilder_ == null) { + createTime_ = null; + } else { + createTime_ = null; + createTimeBuilder_ = null; + } + internalGetMutableLabels().clear(); + capacityGb_ = 0L; + + storageBytes_ = 0L; + + sourceInstance_ = ""; + + sourceFileShare_ = ""; + + sourceInstanceTier_ = 0; + + downloadBytes_ = 0L; + + if (satisfiesPzsBuilder_ == null) { + satisfiesPzs_ = null; + } else { + satisfiesPzs_ = null; + satisfiesPzsBuilder_ = 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_Backup_descriptor; + } + + @java.lang.Override + public com.google.cloud.filestore.v1beta1.Backup getDefaultInstanceForType() { + return com.google.cloud.filestore.v1beta1.Backup.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.filestore.v1beta1.Backup build() { + com.google.cloud.filestore.v1beta1.Backup result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.filestore.v1beta1.Backup buildPartial() { + com.google.cloud.filestore.v1beta1.Backup result = + new com.google.cloud.filestore.v1beta1.Backup(this); + int from_bitField0_ = bitField0_; + result.name_ = name_; + result.description_ = description_; + result.state_ = state_; + if (createTimeBuilder_ == null) { + result.createTime_ = createTime_; + } else { + result.createTime_ = createTimeBuilder_.build(); + } + result.labels_ = internalGetLabels(); + result.labels_.makeImmutable(); + result.capacityGb_ = capacityGb_; + result.storageBytes_ = storageBytes_; + result.sourceInstance_ = sourceInstance_; + result.sourceFileShare_ = sourceFileShare_; + result.sourceInstanceTier_ = sourceInstanceTier_; + result.downloadBytes_ = downloadBytes_; + if (satisfiesPzsBuilder_ == null) { + result.satisfiesPzs_ = satisfiesPzs_; + } else { + result.satisfiesPzs_ = satisfiesPzsBuilder_.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.Backup) { + return mergeFrom((com.google.cloud.filestore.v1beta1.Backup) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.filestore.v1beta1.Backup other) { + if (other == com.google.cloud.filestore.v1beta1.Backup.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (!other.getDescription().isEmpty()) { + description_ = other.description_; + onChanged(); + } + if (other.state_ != 0) { + setStateValue(other.getStateValue()); + } + if (other.hasCreateTime()) { + mergeCreateTime(other.getCreateTime()); + } + internalGetMutableLabels().mergeFrom(other.internalGetLabels()); + if (other.getCapacityGb() != 0L) { + setCapacityGb(other.getCapacityGb()); + } + if (other.getStorageBytes() != 0L) { + setStorageBytes(other.getStorageBytes()); + } + if (!other.getSourceInstance().isEmpty()) { + sourceInstance_ = other.sourceInstance_; + onChanged(); + } + if (!other.getSourceFileShare().isEmpty()) { + sourceFileShare_ = other.sourceFileShare_; + onChanged(); + } + if (other.sourceInstanceTier_ != 0) { + setSourceInstanceTierValue(other.getSourceInstanceTierValue()); + } + if (other.getDownloadBytes() != 0L) { + setDownloadBytes(other.getDownloadBytes()); + } + if (other.hasSatisfiesPzs()) { + mergeSatisfiesPzs(other.getSatisfiesPzs()); + } + this.mergeUnknownFields(other.unknownFields); + 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 { + com.google.cloud.filestore.v1beta1.Backup parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.filestore.v1beta1.Backup) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Output only. The resource name of the backup, in the format
+     * projects/{project_id}/locations/{location_id}/backups/{backup_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 backup, in the format
+     * projects/{project_id}/locations/{location_id}/backups/{backup_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 backup, in the format
+     * projects/{project_id}/locations/{location_id}/backups/{backup_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 backup, in the format
+     * projects/{project_id}/locations/{location_id}/backups/{backup_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 backup, in the format
+     * projects/{project_id}/locations/{location_id}/backups/{backup_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 description_ = ""; + /** + * + * + *
+     * A description of the backup with 2048 characters or less.
+     * Requests with longer descriptions will be rejected.
+     * 
+ * + * string description = 2; + * + * @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 backup with 2048 characters or less.
+     * Requests with longer descriptions will be rejected.
+     * 
+ * + * string description = 2; + * + * @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 backup with 2048 characters or less.
+     * Requests with longer descriptions will be rejected.
+     * 
+ * + * string description = 2; + * + * @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 backup with 2048 characters or less.
+     * Requests with longer descriptions will be rejected.
+     * 
+ * + * string description = 2; + * + * @return This builder for chaining. + */ + public Builder clearDescription() { + + description_ = getDefaultInstance().getDescription(); + onChanged(); + return this; + } + /** + * + * + *
+     * A description of the backup with 2048 characters or less.
+     * Requests with longer descriptions will be rejected.
+     * 
+ * + * string description = 2; + * + * @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 int state_ = 0; + /** + * + * + *
+     * Output only. The backup state.
+     * 
+ * + * + * .google.cloud.filestore.v1beta1.Backup.State state = 3 [(.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 backup state.
+     * 
+ * + * + * .google.cloud.filestore.v1beta1.Backup.State state = 3 [(.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 backup state.
+     * 
+ * + * + * .google.cloud.filestore.v1beta1.Backup.State state = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The state. + */ + @java.lang.Override + public com.google.cloud.filestore.v1beta1.Backup.State getState() { + @SuppressWarnings("deprecation") + com.google.cloud.filestore.v1beta1.Backup.State result = + com.google.cloud.filestore.v1beta1.Backup.State.valueOf(state_); + return result == null ? com.google.cloud.filestore.v1beta1.Backup.State.UNRECOGNIZED : result; + } + /** + * + * + *
+     * Output only. The backup state.
+     * 
+ * + * + * .google.cloud.filestore.v1beta1.Backup.State state = 3 [(.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.Backup.State value) { + if (value == null) { + throw new NullPointerException(); + } + + state_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The backup state.
+     * 
+ * + * + * .google.cloud.filestore.v1beta1.Backup.State state = 3 [(.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 backup was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 4 [(.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 backup was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 4 [(.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 backup was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 4 [(.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 backup was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 4 [(.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 backup was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 4 [(.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 backup was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 4 [(.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 backup was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getCreateTimeBuilder() { + + onChanged(); + return getCreateTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. The time when the backup was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 4 [(.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 backup was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 4 [(.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 = 5; + */ + @java.lang.Override + public boolean containsLabels(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + 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 = 5; + */ + @java.lang.Override + public java.util.Map getLabelsMap() { + return internalGetLabels().getMap(); + } + /** + * + * + *
+     * Resource labels to represent user provided metadata.
+     * 
+ * + * map<string, string> labels = 5; + */ + @java.lang.Override + public java.lang.String getLabelsOrDefault( + java.lang.String key, java.lang.String defaultValue) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + 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 = 5; + */ + @java.lang.Override + public java.lang.String getLabelsOrThrow(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + 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 = 5; + */ + public Builder removeLabels(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + 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 = 5; + */ + public Builder putLabels(java.lang.String key, java.lang.String value) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + if (value == null) { + throw new java.lang.NullPointerException(); + } + internalGetMutableLabels().getMutableMap().put(key, value); + return this; + } + /** + * + * + *
+     * Resource labels to represent user provided metadata.
+     * 
+ * + * map<string, string> labels = 5; + */ + public Builder putAllLabels(java.util.Map values) { + internalGetMutableLabels().getMutableMap().putAll(values); + return this; + } + + private long capacityGb_; + /** + * + * + *
+     * Output only. Capacity of the source file share when the backup was created.
+     * 
+ * + * int64 capacity_gb = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The capacityGb. + */ + @java.lang.Override + public long getCapacityGb() { + return capacityGb_; + } + /** + * + * + *
+     * Output only. Capacity of the source file share when the backup was created.
+     * 
+ * + * int64 capacity_gb = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The capacityGb to set. + * @return This builder for chaining. + */ + public Builder setCapacityGb(long value) { + + capacityGb_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Capacity of the source file share when the backup was created.
+     * 
+ * + * int64 capacity_gb = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearCapacityGb() { + + capacityGb_ = 0L; + onChanged(); + return this; + } + + private long storageBytes_; + /** + * + * + *
+     * Output only. The size of the storage used by the backup. As backups share storage,
+     * this number is expected to change with backup creation/deletion.
+     * 
+ * + * int64 storage_bytes = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The storageBytes. + */ + @java.lang.Override + public long getStorageBytes() { + return storageBytes_; + } + /** + * + * + *
+     * Output only. The size of the storage used by the backup. As backups share storage,
+     * this number is expected to change with backup creation/deletion.
+     * 
+ * + * int64 storage_bytes = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The storageBytes to set. + * @return This builder for chaining. + */ + public Builder setStorageBytes(long value) { + + storageBytes_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The size of the storage used by the backup. As backups share storage,
+     * this number is expected to change with backup creation/deletion.
+     * 
+ * + * int64 storage_bytes = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearStorageBytes() { + + storageBytes_ = 0L; + onChanged(); + return this; + } + + private java.lang.Object sourceInstance_ = ""; + /** + * + * + *
+     * The resource name of the source Cloud 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) = { ... } + * + * @return The sourceInstance. + */ + public java.lang.String getSourceInstance() { + java.lang.Object ref = sourceInstance_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + sourceInstance_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The resource name of the source Cloud 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) = { ... } + * + * @return The bytes for sourceInstance. + */ + public com.google.protobuf.ByteString getSourceInstanceBytes() { + java.lang.Object ref = sourceInstance_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + sourceInstance_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The resource name of the source Cloud 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) = { ... } + * + * @param value The sourceInstance to set. + * @return This builder for chaining. + */ + public Builder setSourceInstance(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + sourceInstance_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The resource name of the source Cloud 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) = { ... } + * + * @return This builder for chaining. + */ + public Builder clearSourceInstance() { + + sourceInstance_ = getDefaultInstance().getSourceInstance(); + onChanged(); + return this; + } + /** + * + * + *
+     * The resource name of the source Cloud 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) = { ... } + * + * @param value The bytes for sourceInstance to set. + * @return This builder for chaining. + */ + public Builder setSourceInstanceBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + sourceInstance_ = value; + onChanged(); + return this; + } + + private java.lang.Object sourceFileShare_ = ""; + /** + * + * + *
+     * Name of the file share in the source Cloud Filestore instance that the
+     * backup is created from.
+     * 
+ * + * string source_file_share = 9; + * + * @return The sourceFileShare. + */ + public java.lang.String getSourceFileShare() { + java.lang.Object ref = sourceFileShare_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + sourceFileShare_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Name of the file share in the source Cloud Filestore instance that the
+     * backup is created from.
+     * 
+ * + * string source_file_share = 9; + * + * @return The bytes for sourceFileShare. + */ + public com.google.protobuf.ByteString getSourceFileShareBytes() { + java.lang.Object ref = sourceFileShare_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + sourceFileShare_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Name of the file share in the source Cloud Filestore instance that the
+     * backup is created from.
+     * 
+ * + * string source_file_share = 9; + * + * @param value The sourceFileShare to set. + * @return This builder for chaining. + */ + public Builder setSourceFileShare(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + sourceFileShare_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Name of the file share in the source Cloud Filestore instance that the
+     * backup is created from.
+     * 
+ * + * string source_file_share = 9; + * + * @return This builder for chaining. + */ + public Builder clearSourceFileShare() { + + sourceFileShare_ = getDefaultInstance().getSourceFileShare(); + onChanged(); + return this; + } + /** + * + * + *
+     * Name of the file share in the source Cloud Filestore instance that the
+     * backup is created from.
+     * 
+ * + * string source_file_share = 9; + * + * @param value The bytes for sourceFileShare to set. + * @return This builder for chaining. + */ + public Builder setSourceFileShareBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + sourceFileShare_ = value; + onChanged(); + return this; + } + + private int sourceInstanceTier_ = 0; + /** + * + * + *
+     * Output only. The service tier of the source Cloud Filestore instance that this backup
+     * is created from.
+     * 
+ * + * + * .google.cloud.filestore.v1beta1.Instance.Tier source_instance_tier = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for sourceInstanceTier. + */ + @java.lang.Override + public int getSourceInstanceTierValue() { + return sourceInstanceTier_; + } + /** + * + * + *
+     * Output only. The service tier of the source Cloud Filestore instance that this backup
+     * is created from.
+     * 
+ * + * + * .google.cloud.filestore.v1beta1.Instance.Tier source_instance_tier = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The enum numeric value on the wire for sourceInstanceTier to set. + * @return This builder for chaining. + */ + public Builder setSourceInstanceTierValue(int value) { + + sourceInstanceTier_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The service tier of the source Cloud Filestore instance that this backup
+     * is created from.
+     * 
+ * + * + * .google.cloud.filestore.v1beta1.Instance.Tier source_instance_tier = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The sourceInstanceTier. + */ + @java.lang.Override + public com.google.cloud.filestore.v1beta1.Instance.Tier getSourceInstanceTier() { + @SuppressWarnings("deprecation") + com.google.cloud.filestore.v1beta1.Instance.Tier result = + com.google.cloud.filestore.v1beta1.Instance.Tier.valueOf(sourceInstanceTier_); + return result == null + ? com.google.cloud.filestore.v1beta1.Instance.Tier.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * Output only. The service tier of the source Cloud Filestore instance that this backup
+     * is created from.
+     * 
+ * + * + * .google.cloud.filestore.v1beta1.Instance.Tier source_instance_tier = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The sourceInstanceTier to set. + * @return This builder for chaining. + */ + public Builder setSourceInstanceTier(com.google.cloud.filestore.v1beta1.Instance.Tier value) { + if (value == null) { + throw new NullPointerException(); + } + + sourceInstanceTier_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The service tier of the source Cloud Filestore instance that this backup
+     * is created from.
+     * 
+ * + * + * .google.cloud.filestore.v1beta1.Instance.Tier source_instance_tier = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return This builder for chaining. + */ + public Builder clearSourceInstanceTier() { + + sourceInstanceTier_ = 0; + onChanged(); + return this; + } + + private long downloadBytes_; + /** + * + * + *
+     * Output only. Amount of bytes that will be downloaded if the backup is restored
+     * 
+ * + * int64 download_bytes = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The downloadBytes. + */ + @java.lang.Override + public long getDownloadBytes() { + return downloadBytes_; + } + /** + * + * + *
+     * Output only. Amount of bytes that will be downloaded if the backup is restored
+     * 
+ * + * int64 download_bytes = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The downloadBytes to set. + * @return This builder for chaining. + */ + public Builder setDownloadBytes(long value) { + + downloadBytes_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Amount of bytes that will be downloaded if the backup is restored
+     * 
+ * + * int64 download_bytes = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearDownloadBytes() { + + downloadBytes_ = 0L; + onChanged(); + return this; + } + + private com.google.protobuf.BoolValue satisfiesPzs_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder> + satisfiesPzsBuilder_; + /** + * + * + *
+     * Output only. Reserved for future use.
+     * 
+ * + * + * .google.protobuf.BoolValue satisfies_pzs = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the satisfiesPzs field is set. + */ + public boolean hasSatisfiesPzs() { + return satisfiesPzsBuilder_ != null || satisfiesPzs_ != null; + } + /** + * + * + *
+     * Output only. Reserved for future use.
+     * 
+ * + * + * .google.protobuf.BoolValue satisfies_pzs = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The satisfiesPzs. + */ + public com.google.protobuf.BoolValue getSatisfiesPzs() { + if (satisfiesPzsBuilder_ == null) { + return satisfiesPzs_ == null + ? com.google.protobuf.BoolValue.getDefaultInstance() + : satisfiesPzs_; + } else { + return satisfiesPzsBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Output only. Reserved for future use.
+     * 
+ * + * + * .google.protobuf.BoolValue satisfies_pzs = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setSatisfiesPzs(com.google.protobuf.BoolValue value) { + if (satisfiesPzsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + satisfiesPzs_ = value; + onChanged(); + } else { + satisfiesPzsBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Output only. Reserved for future use.
+     * 
+ * + * + * .google.protobuf.BoolValue satisfies_pzs = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setSatisfiesPzs(com.google.protobuf.BoolValue.Builder builderForValue) { + if (satisfiesPzsBuilder_ == null) { + satisfiesPzs_ = builderForValue.build(); + onChanged(); + } else { + satisfiesPzsBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Output only. Reserved for future use.
+     * 
+ * + * + * .google.protobuf.BoolValue satisfies_pzs = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeSatisfiesPzs(com.google.protobuf.BoolValue value) { + if (satisfiesPzsBuilder_ == null) { + if (satisfiesPzs_ != null) { + satisfiesPzs_ = + com.google.protobuf.BoolValue.newBuilder(satisfiesPzs_) + .mergeFrom(value) + .buildPartial(); + } else { + satisfiesPzs_ = value; + } + onChanged(); + } else { + satisfiesPzsBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Output only. Reserved for future use.
+     * 
+ * + * + * .google.protobuf.BoolValue satisfies_pzs = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearSatisfiesPzs() { + if (satisfiesPzsBuilder_ == null) { + satisfiesPzs_ = null; + onChanged(); + } else { + satisfiesPzs_ = null; + satisfiesPzsBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Output only. Reserved for future use.
+     * 
+ * + * + * .google.protobuf.BoolValue satisfies_pzs = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.BoolValue.Builder getSatisfiesPzsBuilder() { + + onChanged(); + return getSatisfiesPzsFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. Reserved for future use.
+     * 
+ * + * + * .google.protobuf.BoolValue satisfies_pzs = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.BoolValueOrBuilder getSatisfiesPzsOrBuilder() { + if (satisfiesPzsBuilder_ != null) { + return satisfiesPzsBuilder_.getMessageOrBuilder(); + } else { + return satisfiesPzs_ == null + ? com.google.protobuf.BoolValue.getDefaultInstance() + : satisfiesPzs_; + } + } + /** + * + * + *
+     * Output only. Reserved for future use.
+     * 
+ * + * + * .google.protobuf.BoolValue satisfies_pzs = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder> + getSatisfiesPzsFieldBuilder() { + if (satisfiesPzsBuilder_ == null) { + satisfiesPzsBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder>( + getSatisfiesPzs(), getParentForChildren(), isClean()); + satisfiesPzs_ = null; + } + return satisfiesPzsBuilder_; + } + + @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.Backup) + } + + // @@protoc_insertion_point(class_scope:google.cloud.filestore.v1beta1.Backup) + private static final com.google.cloud.filestore.v1beta1.Backup DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.filestore.v1beta1.Backup(); + } + + public static com.google.cloud.filestore.v1beta1.Backup getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Backup parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Backup(input, extensionRegistry); + } + }; + + 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.Backup getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/BackupName.java b/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/BackupName.java new file mode 100644 index 00000000..46553143 --- /dev/null +++ b/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/BackupName.java @@ -0,0 +1,223 @@ +/* + * Copyright 2021 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 BackupName implements ResourceName { + private static final PathTemplate PROJECT_LOCATION_BACKUP = + PathTemplate.createWithoutUrlEncoding( + "projects/{project}/locations/{location}/backups/{backup}"); + private volatile Map fieldValuesMap; + private final String project; + private final String location; + private final String backup; + + @Deprecated + protected BackupName() { + project = null; + location = null; + backup = null; + } + + private BackupName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + location = Preconditions.checkNotNull(builder.getLocation()); + backup = Preconditions.checkNotNull(builder.getBackup()); + } + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getBackup() { + return backup; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static BackupName of(String project, String location, String backup) { + return newBuilder().setProject(project).setLocation(location).setBackup(backup).build(); + } + + public static String format(String project, String location, String backup) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setBackup(backup) + .build() + .toString(); + } + + public static BackupName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PROJECT_LOCATION_BACKUP.validatedMatch( + formattedString, "BackupName.parse: formattedString not in valid format"); + return of(matchMap.get("project"), matchMap.get("location"), matchMap.get("backup")); + } + + 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 (BackupName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PROJECT_LOCATION_BACKUP.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 (backup != null) { + fieldMapBuilder.put("backup", backup); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return PROJECT_LOCATION_BACKUP.instantiate( + "project", project, "location", location, "backup", backup); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null || getClass() == o.getClass()) { + BackupName that = ((BackupName) o); + return Objects.equals(this.project, that.project) + && Objects.equals(this.location, that.location) + && Objects.equals(this.backup, that.backup); + } + 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(backup); + return h; + } + + /** Builder for projects/{project}/locations/{location}/backups/{backup}. */ + public static class Builder { + private String project; + private String location; + private String backup; + + protected Builder() {} + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getBackup() { + return backup; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setLocation(String location) { + this.location = location; + return this; + } + + public Builder setBackup(String backup) { + this.backup = backup; + return this; + } + + private Builder(BackupName backupName) { + this.project = backupName.project; + this.location = backupName.location; + this.backup = backupName.backup; + } + + public BackupName build() { + return new BackupName(this); + } + } +} diff --git a/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/BackupOrBuilder.java b/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/BackupOrBuilder.java new file mode 100644 index 00000000..f569b8ef --- /dev/null +++ b/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/BackupOrBuilder.java @@ -0,0 +1,368 @@ +/* + * 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 BackupOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.filestore.v1beta1.Backup) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Output only. The resource name of the backup, in the format
+   * projects/{project_id}/locations/{location_id}/backups/{backup_id}.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Output only. The resource name of the backup, in the format
+   * projects/{project_id}/locations/{location_id}/backups/{backup_id}.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * A description of the backup with 2048 characters or less.
+   * Requests with longer descriptions will be rejected.
+   * 
+ * + * string description = 2; + * + * @return The description. + */ + java.lang.String getDescription(); + /** + * + * + *
+   * A description of the backup with 2048 characters or less.
+   * Requests with longer descriptions will be rejected.
+   * 
+ * + * string description = 2; + * + * @return The bytes for description. + */ + com.google.protobuf.ByteString getDescriptionBytes(); + + /** + * + * + *
+   * Output only. The backup state.
+   * 
+ * + * + * .google.cloud.filestore.v1beta1.Backup.State state = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for state. + */ + int getStateValue(); + /** + * + * + *
+   * Output only. The backup state.
+   * 
+ * + * + * .google.cloud.filestore.v1beta1.Backup.State state = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The state. + */ + com.google.cloud.filestore.v1beta1.Backup.State getState(); + + /** + * + * + *
+   * Output only. The time when the backup was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + boolean hasCreateTime(); + /** + * + * + *
+   * Output only. The time when the backup was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The createTime. + */ + com.google.protobuf.Timestamp getCreateTime(); + /** + * + * + *
+   * Output only. The time when the backup was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder(); + + /** + * + * + *
+   * Resource labels to represent user provided metadata.
+   * 
+ * + * map<string, string> labels = 5; + */ + int getLabelsCount(); + /** + * + * + *
+   * Resource labels to represent user provided metadata.
+   * 
+ * + * map<string, string> labels = 5; + */ + 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 = 5; + */ + java.util.Map getLabelsMap(); + /** + * + * + *
+   * Resource labels to represent user provided metadata.
+   * 
+ * + * map<string, string> labels = 5; + */ + java.lang.String getLabelsOrDefault(java.lang.String key, java.lang.String defaultValue); + /** + * + * + *
+   * Resource labels to represent user provided metadata.
+   * 
+ * + * map<string, string> labels = 5; + */ + java.lang.String getLabelsOrThrow(java.lang.String key); + + /** + * + * + *
+   * Output only. Capacity of the source file share when the backup was created.
+   * 
+ * + * int64 capacity_gb = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The capacityGb. + */ + long getCapacityGb(); + + /** + * + * + *
+   * Output only. The size of the storage used by the backup. As backups share storage,
+   * this number is expected to change with backup creation/deletion.
+   * 
+ * + * int64 storage_bytes = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The storageBytes. + */ + long getStorageBytes(); + + /** + * + * + *
+   * The resource name of the source Cloud 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) = { ... } + * + * @return The sourceInstance. + */ + java.lang.String getSourceInstance(); + /** + * + * + *
+   * The resource name of the source Cloud 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) = { ... } + * + * @return The bytes for sourceInstance. + */ + com.google.protobuf.ByteString getSourceInstanceBytes(); + + /** + * + * + *
+   * Name of the file share in the source Cloud Filestore instance that the
+   * backup is created from.
+   * 
+ * + * string source_file_share = 9; + * + * @return The sourceFileShare. + */ + java.lang.String getSourceFileShare(); + /** + * + * + *
+   * Name of the file share in the source Cloud Filestore instance that the
+   * backup is created from.
+   * 
+ * + * string source_file_share = 9; + * + * @return The bytes for sourceFileShare. + */ + com.google.protobuf.ByteString getSourceFileShareBytes(); + + /** + * + * + *
+   * Output only. The service tier of the source Cloud Filestore instance that this backup
+   * is created from.
+   * 
+ * + * + * .google.cloud.filestore.v1beta1.Instance.Tier source_instance_tier = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for sourceInstanceTier. + */ + int getSourceInstanceTierValue(); + /** + * + * + *
+   * Output only. The service tier of the source Cloud Filestore instance that this backup
+   * is created from.
+   * 
+ * + * + * .google.cloud.filestore.v1beta1.Instance.Tier source_instance_tier = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The sourceInstanceTier. + */ + com.google.cloud.filestore.v1beta1.Instance.Tier getSourceInstanceTier(); + + /** + * + * + *
+   * Output only. Amount of bytes that will be downloaded if the backup is restored
+   * 
+ * + * int64 download_bytes = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The downloadBytes. + */ + long getDownloadBytes(); + + /** + * + * + *
+   * Output only. Reserved for future use.
+   * 
+ * + * + * .google.protobuf.BoolValue satisfies_pzs = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the satisfiesPzs field is set. + */ + boolean hasSatisfiesPzs(); + /** + * + * + *
+   * Output only. Reserved for future use.
+   * 
+ * + * + * .google.protobuf.BoolValue satisfies_pzs = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The satisfiesPzs. + */ + com.google.protobuf.BoolValue getSatisfiesPzs(); + /** + * + * + *
+   * Output only. Reserved for future use.
+   * 
+ * + * + * .google.protobuf.BoolValue satisfies_pzs = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.BoolValueOrBuilder getSatisfiesPzsOrBuilder(); +} diff --git a/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/CloudFilestoreServiceProto.java b/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/CloudFilestoreServiceProto.java new file mode 100644 index 00000000..ec36d834 --- /dev/null +++ b/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/CloudFilestoreServiceProto.java @@ -0,0 +1,524 @@ +/* + * 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 final class CloudFilestoreServiceProto { + private CloudFilestoreServiceProto() {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions((com.google.protobuf.ExtensionRegistryLite) registry); + } + + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_filestore_v1beta1_NetworkConfig_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_filestore_v1beta1_NetworkConfig_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_filestore_v1beta1_FileShareConfig_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_filestore_v1beta1_FileShareConfig_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_filestore_v1beta1_NfsExportOptions_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_filestore_v1beta1_NfsExportOptions_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_filestore_v1beta1_Instance_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_filestore_v1beta1_Instance_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_filestore_v1beta1_Instance_LabelsEntry_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_filestore_v1beta1_Instance_LabelsEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_filestore_v1beta1_CreateInstanceRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_filestore_v1beta1_CreateInstanceRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_filestore_v1beta1_GetInstanceRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_filestore_v1beta1_GetInstanceRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_filestore_v1beta1_UpdateInstanceRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_filestore_v1beta1_UpdateInstanceRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + 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_DeleteInstanceRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_filestore_v1beta1_DeleteInstanceRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_filestore_v1beta1_ListInstancesRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_filestore_v1beta1_ListInstancesRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_filestore_v1beta1_ListInstancesResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_filestore_v1beta1_ListInstancesResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_filestore_v1beta1_Backup_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_filestore_v1beta1_Backup_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_filestore_v1beta1_Backup_LabelsEntry_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_filestore_v1beta1_Backup_LabelsEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_filestore_v1beta1_CreateBackupRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_filestore_v1beta1_CreateBackupRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_filestore_v1beta1_DeleteBackupRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_filestore_v1beta1_DeleteBackupRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_filestore_v1beta1_UpdateBackupRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_filestore_v1beta1_UpdateBackupRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_filestore_v1beta1_GetBackupRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_filestore_v1beta1_GetBackupRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_filestore_v1beta1_ListBackupsRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_filestore_v1beta1_ListBackupsRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_filestore_v1beta1_ListBackupsResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_filestore_v1beta1_ListBackupsResponse_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\n\"2" + + "/v1beta1/{parent=projects/*/locations/*}" + + "/instances:\010instance\332A\033parent,instance,i" + + "nstance_id\312A1\n\010Instance\022%google.cloud.co" + + "mmon.OperationMetadata\022\201\002\n\016UpdateInstanc" + + "e\0225.google.cloud.filestore.v1beta1.Updat" + + "eInstanceRequest\032\035.google.longrunning.Op" + + "eration\"\230\001\202\323\344\223\002G2;/v1beta1/{instance.nam" + + "e=projects/*/locations/*/instances/*}:\010i" + + "nstance\332A\024instance,update_mask\312A1\n\010Insta" + + "nce\022%google.cloud.common.OperationMetada" + + "ta\022\343\001\n\017RestoreInstance\0226.google.cloud.fi" + + "lestore.v1beta1.RestoreInstanceRequest\032\035" + + ".google.longrunning.Operation\"y\202\323\344\223\002?\":/" + + "v1beta1/{name=projects/*/locations/*/ins" + + "tances/*}:restore:\001*\312A1\n\010Instance\022%googl" + + "e.cloud.common.OperationMetadata\022\353\001\n\016Del" + + "eteInstance\0225.google.cloud.filestore.v1b" + + "eta1.DeleteInstanceRequest\032\035.google.long" + + "running.Operation\"\202\001\202\323\344\223\0024*2/v1beta1/{na" + + "me=projects/*/locations/*/instances/*}\332A" + + "\004name\312A>\n\025google.protobuf.Empty\022%google." + + "cloud.common.OperationMetadata\022\271\001\n\013ListB" + + "ackups\0222.google.cloud.filestore.v1beta1." + + "ListBackupsRequest\0323.google.cloud.filest" + + "ore.v1beta1.ListBackupsResponse\"A\202\323\344\223\0022\022" + + "0/v1beta1/{parent=projects/*/locations/*" + + "}/backups\332A\006parent\022\246\001\n\tGetBackup\0220.googl" + + "e.cloud.filestore.v1beta1.GetBackupReque" + + "st\032&.google.cloud.filestore.v1beta1.Back" + + "up\"?\202\323\344\223\0022\0220/v1beta1/{name=projects/*/lo" + + "cations/*/backups/*}\332A\004name\022\361\001\n\014CreateBa" + + "ckup\0223.google.cloud.filestore.v1beta1.Cr" + + "eateBackupRequest\032\035.google.longrunning.O" + + "peration\"\214\001\202\323\344\223\002:\"0/v1beta1/{parent=proj" + + "ects/*/locations/*}/backups:\006backup\332A\027pa" + + "rent,backup,backup_id\312A/\n\006Backup\022%google" + + ".cloud.common.OperationMetadata\022\345\001\n\014Dele" + + "teBackup\0223.google.cloud.filestore.v1beta" + + "1.DeleteBackupRequest\032\035.google.longrunni" + + "ng.Operation\"\200\001\202\323\344\223\0022*0/v1beta1/{name=pr" + + "ojects/*/locations/*/backups/*}\332A\004name\312A" + + ">\n\025google.protobuf.Empty\022%google.cloud.c" + + "ommon.OperationMetadata\022\363\001\n\014UpdateBackup" + + "\0223.google.cloud.filestore.v1beta1.Update" + + "BackupRequest\032\035.google.longrunning.Opera" + + "tion\"\216\001\202\323\344\223\002A27/v1beta1/{backup.name=pro" + + "jects/*/locations/*/backups/*}:\006backup\332A" + + "\022backup,update_mask\312A/\n\006Backup\022%google.c" + + "loud.common.OperationMetadata\032G\312A\023file.g" + + "oogleapis.com\322A.https://www.googleapis.c" + + "om/auth/cloud-platformB\254\002\n\"com.google.cl" + + "oud.filestore.v1beta1B\032CloudFilestoreSer" + + "viceProtoP\001ZGgoogle.golang.org/genproto/" + + "googleapis/cloud/filestore/v1beta1;files" + + "tore\252\002\036Google.Cloud.Filestore.V1Beta1\312\002\036" + + "Google\\Cloud\\Filestore\\V1beta1\352A\\\n\034file." + + "googleapis.com/Snapshot\022 + * CreateBackupRequest creates a backup. + * + * + * Protobuf type {@code google.cloud.filestore.v1beta1.CreateBackupRequest} + */ +public final class CreateBackupRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.filestore.v1beta1.CreateBackupRequest) + CreateBackupRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use CreateBackupRequest.newBuilder() to construct. + private CreateBackupRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CreateBackupRequest() { + parent_ = ""; + backupId_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new CreateBackupRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private CreateBackupRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + parent_ = s; + break; + } + case 18: + { + com.google.cloud.filestore.v1beta1.Backup.Builder subBuilder = null; + if (backup_ != null) { + subBuilder = backup_.toBuilder(); + } + backup_ = + input.readMessage( + com.google.cloud.filestore.v1beta1.Backup.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(backup_); + backup_ = subBuilder.buildPartial(); + } + + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + + backupId_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.filestore.v1beta1.CloudFilestoreServiceProto + .internal_static_google_cloud_filestore_v1beta1_CreateBackupRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.filestore.v1beta1.CloudFilestoreServiceProto + .internal_static_google_cloud_filestore_v1beta1_CreateBackupRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.filestore.v1beta1.CreateBackupRequest.class, + com.google.cloud.filestore.v1beta1.CreateBackupRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object 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**.
+   * 
+ * + * + * 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 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**.
+   * 
+ * + * + * 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 BACKUP_FIELD_NUMBER = 2; + private com.google.cloud.filestore.v1beta1.Backup backup_; + /** + * + * + *
+   * Required. A [backup resource]
+   * (/cloud-filestore/reference/rest/v1beta1/projects.locations.backups)
+   * 
+ * + * + * .google.cloud.filestore.v1beta1.Backup backup = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the backup field is set. + */ + @java.lang.Override + public boolean hasBackup() { + return backup_ != null; + } + /** + * + * + *
+   * Required. A [backup resource]
+   * (/cloud-filestore/reference/rest/v1beta1/projects.locations.backups)
+   * 
+ * + * + * .google.cloud.filestore.v1beta1.Backup backup = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The backup. + */ + @java.lang.Override + public com.google.cloud.filestore.v1beta1.Backup getBackup() { + return backup_ == null + ? com.google.cloud.filestore.v1beta1.Backup.getDefaultInstance() + : backup_; + } + /** + * + * + *
+   * Required. A [backup resource]
+   * (/cloud-filestore/reference/rest/v1beta1/projects.locations.backups)
+   * 
+ * + * + * .google.cloud.filestore.v1beta1.Backup backup = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.filestore.v1beta1.BackupOrBuilder getBackupOrBuilder() { + return getBackup(); + } + + public static final int BACKUP_ID_FIELD_NUMBER = 3; + private volatile java.lang.Object 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.
+   * 
+ * + * string backup_id = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The backupId. + */ + @java.lang.Override + public java.lang.String getBackupId() { + java.lang.Object ref = backupId_; + 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(); + backupId_ = s; + return s; + } + } + /** + * + * + *
+   * 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.
+   * 
+ * + * string backup_id = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for backupId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getBackupIdBytes() { + java.lang.Object ref = backupId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + backupId_ = 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 (!getParentBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (backup_ != null) { + output.writeMessage(2, getBackup()); + } + if (!getBackupIdBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, backupId_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getParentBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (backup_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getBackup()); + } + if (!getBackupIdBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, backupId_); + } + size += unknownFields.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.CreateBackupRequest)) { + return super.equals(obj); + } + com.google.cloud.filestore.v1beta1.CreateBackupRequest other = + (com.google.cloud.filestore.v1beta1.CreateBackupRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (hasBackup() != other.hasBackup()) return false; + if (hasBackup()) { + if (!getBackup().equals(other.getBackup())) return false; + } + if (!getBackupId().equals(other.getBackupId())) return false; + if (!unknownFields.equals(other.unknownFields)) 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(); + if (hasBackup()) { + hash = (37 * hash) + BACKUP_FIELD_NUMBER; + hash = (53 * hash) + getBackup().hashCode(); + } + hash = (37 * hash) + BACKUP_ID_FIELD_NUMBER; + hash = (53 * hash) + getBackupId().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.filestore.v1beta1.CreateBackupRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.filestore.v1beta1.CreateBackupRequest 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.CreateBackupRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.filestore.v1beta1.CreateBackupRequest 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.CreateBackupRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.filestore.v1beta1.CreateBackupRequest 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.CreateBackupRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.filestore.v1beta1.CreateBackupRequest 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.CreateBackupRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.filestore.v1beta1.CreateBackupRequest 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.CreateBackupRequest 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.CreateBackupRequest 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.CreateBackupRequest 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; + } + /** + * + * + *
+   * CreateBackupRequest creates a backup.
+   * 
+ * + * Protobuf type {@code google.cloud.filestore.v1beta1.CreateBackupRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.filestore.v1beta1.CreateBackupRequest) + com.google.cloud.filestore.v1beta1.CreateBackupRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.filestore.v1beta1.CloudFilestoreServiceProto + .internal_static_google_cloud_filestore_v1beta1_CreateBackupRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.filestore.v1beta1.CloudFilestoreServiceProto + .internal_static_google_cloud_filestore_v1beta1_CreateBackupRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.filestore.v1beta1.CreateBackupRequest.class, + com.google.cloud.filestore.v1beta1.CreateBackupRequest.Builder.class); + } + + // Construct using com.google.cloud.filestore.v1beta1.CreateBackupRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + parent_ = ""; + + if (backupBuilder_ == null) { + backup_ = null; + } else { + backup_ = null; + backupBuilder_ = null; + } + backupId_ = ""; + + 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_CreateBackupRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.filestore.v1beta1.CreateBackupRequest getDefaultInstanceForType() { + return com.google.cloud.filestore.v1beta1.CreateBackupRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.filestore.v1beta1.CreateBackupRequest build() { + com.google.cloud.filestore.v1beta1.CreateBackupRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.filestore.v1beta1.CreateBackupRequest buildPartial() { + com.google.cloud.filestore.v1beta1.CreateBackupRequest result = + new com.google.cloud.filestore.v1beta1.CreateBackupRequest(this); + result.parent_ = parent_; + if (backupBuilder_ == null) { + result.backup_ = backup_; + } else { + result.backup_ = backupBuilder_.build(); + } + result.backupId_ = backupId_; + 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.CreateBackupRequest) { + return mergeFrom((com.google.cloud.filestore.v1beta1.CreateBackupRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.filestore.v1beta1.CreateBackupRequest other) { + if (other == com.google.cloud.filestore.v1beta1.CreateBackupRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + onChanged(); + } + if (other.hasBackup()) { + mergeBackup(other.getBackup()); + } + if (!other.getBackupId().isEmpty()) { + backupId_ = other.backupId_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + 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 { + com.google.cloud.filestore.v1beta1.CreateBackupRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.filestore.v1beta1.CreateBackupRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object 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**.
+     * 
+ * + * + * 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 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**.
+     * 
+ * + * + * 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 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**.
+     * 
+ * + * + * 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 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**.
+     * 
+ * + * + * 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 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**.
+     * 
+ * + * + * 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 com.google.cloud.filestore.v1beta1.Backup backup_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.filestore.v1beta1.Backup, + com.google.cloud.filestore.v1beta1.Backup.Builder, + com.google.cloud.filestore.v1beta1.BackupOrBuilder> + backupBuilder_; + /** + * + * + *
+     * Required. A [backup resource]
+     * (/cloud-filestore/reference/rest/v1beta1/projects.locations.backups)
+     * 
+ * + * + * .google.cloud.filestore.v1beta1.Backup backup = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the backup field is set. + */ + public boolean hasBackup() { + return backupBuilder_ != null || backup_ != null; + } + /** + * + * + *
+     * Required. A [backup resource]
+     * (/cloud-filestore/reference/rest/v1beta1/projects.locations.backups)
+     * 
+ * + * + * .google.cloud.filestore.v1beta1.Backup backup = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The backup. + */ + public com.google.cloud.filestore.v1beta1.Backup getBackup() { + if (backupBuilder_ == null) { + return backup_ == null + ? com.google.cloud.filestore.v1beta1.Backup.getDefaultInstance() + : backup_; + } else { + return backupBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. A [backup resource]
+     * (/cloud-filestore/reference/rest/v1beta1/projects.locations.backups)
+     * 
+ * + * + * .google.cloud.filestore.v1beta1.Backup backup = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setBackup(com.google.cloud.filestore.v1beta1.Backup value) { + if (backupBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + backup_ = value; + onChanged(); + } else { + backupBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Required. A [backup resource]
+     * (/cloud-filestore/reference/rest/v1beta1/projects.locations.backups)
+     * 
+ * + * + * .google.cloud.filestore.v1beta1.Backup backup = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setBackup(com.google.cloud.filestore.v1beta1.Backup.Builder builderForValue) { + if (backupBuilder_ == null) { + backup_ = builderForValue.build(); + onChanged(); + } else { + backupBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Required. A [backup resource]
+     * (/cloud-filestore/reference/rest/v1beta1/projects.locations.backups)
+     * 
+ * + * + * .google.cloud.filestore.v1beta1.Backup backup = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeBackup(com.google.cloud.filestore.v1beta1.Backup value) { + if (backupBuilder_ == null) { + if (backup_ != null) { + backup_ = + com.google.cloud.filestore.v1beta1.Backup.newBuilder(backup_) + .mergeFrom(value) + .buildPartial(); + } else { + backup_ = value; + } + onChanged(); + } else { + backupBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Required. A [backup resource]
+     * (/cloud-filestore/reference/rest/v1beta1/projects.locations.backups)
+     * 
+ * + * + * .google.cloud.filestore.v1beta1.Backup backup = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearBackup() { + if (backupBuilder_ == null) { + backup_ = null; + onChanged(); + } else { + backup_ = null; + backupBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Required. A [backup resource]
+     * (/cloud-filestore/reference/rest/v1beta1/projects.locations.backups)
+     * 
+ * + * + * .google.cloud.filestore.v1beta1.Backup backup = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.filestore.v1beta1.Backup.Builder getBackupBuilder() { + + onChanged(); + return getBackupFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. A [backup resource]
+     * (/cloud-filestore/reference/rest/v1beta1/projects.locations.backups)
+     * 
+ * + * + * .google.cloud.filestore.v1beta1.Backup backup = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.filestore.v1beta1.BackupOrBuilder getBackupOrBuilder() { + if (backupBuilder_ != null) { + return backupBuilder_.getMessageOrBuilder(); + } else { + return backup_ == null + ? com.google.cloud.filestore.v1beta1.Backup.getDefaultInstance() + : backup_; + } + } + /** + * + * + *
+     * Required. A [backup resource]
+     * (/cloud-filestore/reference/rest/v1beta1/projects.locations.backups)
+     * 
+ * + * + * .google.cloud.filestore.v1beta1.Backup backup = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.filestore.v1beta1.Backup, + com.google.cloud.filestore.v1beta1.Backup.Builder, + com.google.cloud.filestore.v1beta1.BackupOrBuilder> + getBackupFieldBuilder() { + if (backupBuilder_ == null) { + backupBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.filestore.v1beta1.Backup, + com.google.cloud.filestore.v1beta1.Backup.Builder, + com.google.cloud.filestore.v1beta1.BackupOrBuilder>( + getBackup(), getParentForChildren(), isClean()); + backup_ = null; + } + return backupBuilder_; + } + + private java.lang.Object 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.
+     * 
+ * + * string backup_id = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The backupId. + */ + public java.lang.String getBackupId() { + java.lang.Object ref = backupId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + backupId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * 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.
+     * 
+ * + * string backup_id = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for backupId. + */ + public com.google.protobuf.ByteString getBackupIdBytes() { + java.lang.Object ref = backupId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + backupId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * 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.
+     * 
+ * + * string backup_id = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The backupId to set. + * @return This builder for chaining. + */ + public Builder setBackupId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + backupId_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * 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.
+     * 
+ * + * string backup_id = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearBackupId() { + + backupId_ = getDefaultInstance().getBackupId(); + onChanged(); + return this; + } + /** + * + * + *
+     * 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.
+     * 
+ * + * string backup_id = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for backupId to set. + * @return This builder for chaining. + */ + public Builder setBackupIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + backupId_ = 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.CreateBackupRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.filestore.v1beta1.CreateBackupRequest) + private static final com.google.cloud.filestore.v1beta1.CreateBackupRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.filestore.v1beta1.CreateBackupRequest(); + } + + public static com.google.cloud.filestore.v1beta1.CreateBackupRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CreateBackupRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new CreateBackupRequest(input, extensionRegistry); + } + }; + + 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.CreateBackupRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/CreateBackupRequestOrBuilder.java b/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/CreateBackupRequestOrBuilder.java new file mode 100644 index 00000000..58083f87 --- /dev/null +++ b/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/CreateBackupRequestOrBuilder.java @@ -0,0 +1,133 @@ +/* + * 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 CreateBackupRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.filestore.v1beta1.CreateBackupRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * 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**.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * 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**.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Required. A [backup resource]
+   * (/cloud-filestore/reference/rest/v1beta1/projects.locations.backups)
+   * 
+ * + * + * .google.cloud.filestore.v1beta1.Backup backup = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the backup field is set. + */ + boolean hasBackup(); + /** + * + * + *
+   * Required. A [backup resource]
+   * (/cloud-filestore/reference/rest/v1beta1/projects.locations.backups)
+   * 
+ * + * + * .google.cloud.filestore.v1beta1.Backup backup = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The backup. + */ + com.google.cloud.filestore.v1beta1.Backup getBackup(); + /** + * + * + *
+   * Required. A [backup resource]
+   * (/cloud-filestore/reference/rest/v1beta1/projects.locations.backups)
+   * 
+ * + * + * .google.cloud.filestore.v1beta1.Backup backup = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.filestore.v1beta1.BackupOrBuilder getBackupOrBuilder(); + + /** + * + * + *
+   * 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.
+   * 
+ * + * string backup_id = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The backupId. + */ + java.lang.String getBackupId(); + /** + * + * + *
+   * 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.
+   * 
+ * + * string backup_id = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for backupId. + */ + com.google.protobuf.ByteString getBackupIdBytes(); +} diff --git a/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/CreateInstanceRequest.java b/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/CreateInstanceRequest.java new file mode 100644 index 00000000..db094d32 --- /dev/null +++ b/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/CreateInstanceRequest.java @@ -0,0 +1,1179 @@ +/* + * 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; + +/** + * + * + *
+ * CreateInstanceRequest creates an instance.
+ * 
+ * + * Protobuf type {@code google.cloud.filestore.v1beta1.CreateInstanceRequest} + */ +public final class CreateInstanceRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.filestore.v1beta1.CreateInstanceRequest) + CreateInstanceRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use CreateInstanceRequest.newBuilder() to construct. + private CreateInstanceRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CreateInstanceRequest() { + parent_ = ""; + instanceId_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new CreateInstanceRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private CreateInstanceRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + parent_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + instanceId_ = s; + break; + } + case 26: + { + com.google.cloud.filestore.v1beta1.Instance.Builder subBuilder = null; + if (instance_ != null) { + subBuilder = instance_.toBuilder(); + } + instance_ = + input.readMessage( + com.google.cloud.filestore.v1beta1.Instance.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(instance_); + instance_ = subBuilder.buildPartial(); + } + + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.filestore.v1beta1.CloudFilestoreServiceProto + .internal_static_google_cloud_filestore_v1beta1_CreateInstanceRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.filestore.v1beta1.CloudFilestoreServiceProto + .internal_static_google_cloud_filestore_v1beta1_CreateInstanceRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.filestore.v1beta1.CreateInstanceRequest.class, + com.google.cloud.filestore.v1beta1.CreateInstanceRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object 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**.
+   * 
+ * + * + * 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'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**.
+   * 
+ * + * + * 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 INSTANCE_ID_FIELD_NUMBER = 2; + private volatile java.lang.Object instanceId_; + /** + * + * + *
+   * Required. The ID of the instance to create.
+   * 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.
+   * 
+ * + * string instance_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The instanceId. + */ + @java.lang.Override + public java.lang.String getInstanceId() { + java.lang.Object ref = instanceId_; + 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(); + instanceId_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The ID of the instance to create.
+   * 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.
+   * 
+ * + * string instance_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for instanceId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getInstanceIdBytes() { + java.lang.Object ref = instanceId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instanceId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int INSTANCE_FIELD_NUMBER = 3; + private com.google.cloud.filestore.v1beta1.Instance instance_; + /** + * + * + *
+   * Required. A [instance resource]
+   * (/cloud-filestore/reference/rest/v1beta1/projects.locations.instances)
+   * 
+ * + * + * .google.cloud.filestore.v1beta1.Instance instance = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the instance field is set. + */ + @java.lang.Override + public boolean hasInstance() { + return instance_ != null; + } + /** + * + * + *
+   * Required. A [instance resource]
+   * (/cloud-filestore/reference/rest/v1beta1/projects.locations.instances)
+   * 
+ * + * + * .google.cloud.filestore.v1beta1.Instance instance = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The instance. + */ + @java.lang.Override + public com.google.cloud.filestore.v1beta1.Instance getInstance() { + return instance_ == null + ? com.google.cloud.filestore.v1beta1.Instance.getDefaultInstance() + : instance_; + } + /** + * + * + *
+   * Required. A [instance resource]
+   * (/cloud-filestore/reference/rest/v1beta1/projects.locations.instances)
+   * 
+ * + * + * .google.cloud.filestore.v1beta1.Instance instance = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.filestore.v1beta1.InstanceOrBuilder getInstanceOrBuilder() { + return getInstance(); + } + + 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 (!getParentBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (!getInstanceIdBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, instanceId_); + } + if (instance_ != null) { + output.writeMessage(3, getInstance()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getParentBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (!getInstanceIdBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, instanceId_); + } + if (instance_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getInstance()); + } + size += unknownFields.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.CreateInstanceRequest)) { + return super.equals(obj); + } + com.google.cloud.filestore.v1beta1.CreateInstanceRequest other = + (com.google.cloud.filestore.v1beta1.CreateInstanceRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (!getInstanceId().equals(other.getInstanceId())) return false; + if (hasInstance() != other.hasInstance()) return false; + if (hasInstance()) { + if (!getInstance().equals(other.getInstance())) return false; + } + if (!unknownFields.equals(other.unknownFields)) 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) + INSTANCE_ID_FIELD_NUMBER; + hash = (53 * hash) + getInstanceId().hashCode(); + if (hasInstance()) { + hash = (37 * hash) + INSTANCE_FIELD_NUMBER; + hash = (53 * hash) + getInstance().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.filestore.v1beta1.CreateInstanceRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.filestore.v1beta1.CreateInstanceRequest 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.CreateInstanceRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.filestore.v1beta1.CreateInstanceRequest 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.CreateInstanceRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.filestore.v1beta1.CreateInstanceRequest 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.CreateInstanceRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.filestore.v1beta1.CreateInstanceRequest 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.CreateInstanceRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.filestore.v1beta1.CreateInstanceRequest 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.CreateInstanceRequest 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.CreateInstanceRequest 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.CreateInstanceRequest 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; + } + /** + * + * + *
+   * CreateInstanceRequest creates an instance.
+   * 
+ * + * Protobuf type {@code google.cloud.filestore.v1beta1.CreateInstanceRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.filestore.v1beta1.CreateInstanceRequest) + com.google.cloud.filestore.v1beta1.CreateInstanceRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.filestore.v1beta1.CloudFilestoreServiceProto + .internal_static_google_cloud_filestore_v1beta1_CreateInstanceRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.filestore.v1beta1.CloudFilestoreServiceProto + .internal_static_google_cloud_filestore_v1beta1_CreateInstanceRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.filestore.v1beta1.CreateInstanceRequest.class, + com.google.cloud.filestore.v1beta1.CreateInstanceRequest.Builder.class); + } + + // Construct using com.google.cloud.filestore.v1beta1.CreateInstanceRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + parent_ = ""; + + instanceId_ = ""; + + if (instanceBuilder_ == null) { + instance_ = null; + } else { + instance_ = null; + instanceBuilder_ = 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_CreateInstanceRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.filestore.v1beta1.CreateInstanceRequest getDefaultInstanceForType() { + return com.google.cloud.filestore.v1beta1.CreateInstanceRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.filestore.v1beta1.CreateInstanceRequest build() { + com.google.cloud.filestore.v1beta1.CreateInstanceRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.filestore.v1beta1.CreateInstanceRequest buildPartial() { + com.google.cloud.filestore.v1beta1.CreateInstanceRequest result = + new com.google.cloud.filestore.v1beta1.CreateInstanceRequest(this); + result.parent_ = parent_; + result.instanceId_ = instanceId_; + if (instanceBuilder_ == null) { + result.instance_ = instance_; + } else { + result.instance_ = instanceBuilder_.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.CreateInstanceRequest) { + return mergeFrom((com.google.cloud.filestore.v1beta1.CreateInstanceRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.filestore.v1beta1.CreateInstanceRequest other) { + if (other == com.google.cloud.filestore.v1beta1.CreateInstanceRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + onChanged(); + } + if (!other.getInstanceId().isEmpty()) { + instanceId_ = other.instanceId_; + onChanged(); + } + if (other.hasInstance()) { + mergeInstance(other.getInstance()); + } + this.mergeUnknownFields(other.unknownFields); + 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 { + com.google.cloud.filestore.v1beta1.CreateInstanceRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.filestore.v1beta1.CreateInstanceRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object 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**.
+     * 
+ * + * + * 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'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**.
+     * 
+ * + * + * 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'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**.
+     * 
+ * + * + * 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'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**.
+     * 
+ * + * + * 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'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**.
+     * 
+ * + * + * 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 instanceId_ = ""; + /** + * + * + *
+     * Required. The ID of the instance to create.
+     * 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.
+     * 
+ * + * string instance_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The instanceId. + */ + public java.lang.String getInstanceId() { + java.lang.Object ref = instanceId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instanceId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The ID of the instance to create.
+     * 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.
+     * 
+ * + * string instance_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for instanceId. + */ + public com.google.protobuf.ByteString getInstanceIdBytes() { + java.lang.Object ref = instanceId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instanceId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The ID of the instance to create.
+     * 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.
+     * 
+ * + * string instance_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The instanceId to set. + * @return This builder for chaining. + */ + public Builder setInstanceId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + instanceId_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The ID of the instance to create.
+     * 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.
+     * 
+ * + * string instance_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearInstanceId() { + + instanceId_ = getDefaultInstance().getInstanceId(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The ID of the instance to create.
+     * 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.
+     * 
+ * + * string instance_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for instanceId to set. + * @return This builder for chaining. + */ + public Builder setInstanceIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + instanceId_ = value; + onChanged(); + return this; + } + + private com.google.cloud.filestore.v1beta1.Instance instance_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.filestore.v1beta1.Instance, + com.google.cloud.filestore.v1beta1.Instance.Builder, + com.google.cloud.filestore.v1beta1.InstanceOrBuilder> + instanceBuilder_; + /** + * + * + *
+     * Required. A [instance resource]
+     * (/cloud-filestore/reference/rest/v1beta1/projects.locations.instances)
+     * 
+ * + * + * .google.cloud.filestore.v1beta1.Instance instance = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the instance field is set. + */ + public boolean hasInstance() { + return instanceBuilder_ != null || instance_ != null; + } + /** + * + * + *
+     * Required. A [instance resource]
+     * (/cloud-filestore/reference/rest/v1beta1/projects.locations.instances)
+     * 
+ * + * + * .google.cloud.filestore.v1beta1.Instance instance = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The instance. + */ + public com.google.cloud.filestore.v1beta1.Instance getInstance() { + if (instanceBuilder_ == null) { + return instance_ == null + ? com.google.cloud.filestore.v1beta1.Instance.getDefaultInstance() + : instance_; + } else { + return instanceBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. A [instance resource]
+     * (/cloud-filestore/reference/rest/v1beta1/projects.locations.instances)
+     * 
+ * + * + * .google.cloud.filestore.v1beta1.Instance instance = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setInstance(com.google.cloud.filestore.v1beta1.Instance value) { + if (instanceBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + instance_ = value; + onChanged(); + } else { + instanceBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Required. A [instance resource]
+     * (/cloud-filestore/reference/rest/v1beta1/projects.locations.instances)
+     * 
+ * + * + * .google.cloud.filestore.v1beta1.Instance instance = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setInstance( + com.google.cloud.filestore.v1beta1.Instance.Builder builderForValue) { + if (instanceBuilder_ == null) { + instance_ = builderForValue.build(); + onChanged(); + } else { + instanceBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Required. A [instance resource]
+     * (/cloud-filestore/reference/rest/v1beta1/projects.locations.instances)
+     * 
+ * + * + * .google.cloud.filestore.v1beta1.Instance instance = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeInstance(com.google.cloud.filestore.v1beta1.Instance value) { + if (instanceBuilder_ == null) { + if (instance_ != null) { + instance_ = + com.google.cloud.filestore.v1beta1.Instance.newBuilder(instance_) + .mergeFrom(value) + .buildPartial(); + } else { + instance_ = value; + } + onChanged(); + } else { + instanceBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Required. A [instance resource]
+     * (/cloud-filestore/reference/rest/v1beta1/projects.locations.instances)
+     * 
+ * + * + * .google.cloud.filestore.v1beta1.Instance instance = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearInstance() { + if (instanceBuilder_ == null) { + instance_ = null; + onChanged(); + } else { + instance_ = null; + instanceBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Required. A [instance resource]
+     * (/cloud-filestore/reference/rest/v1beta1/projects.locations.instances)
+     * 
+ * + * + * .google.cloud.filestore.v1beta1.Instance instance = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.filestore.v1beta1.Instance.Builder getInstanceBuilder() { + + onChanged(); + return getInstanceFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. A [instance resource]
+     * (/cloud-filestore/reference/rest/v1beta1/projects.locations.instances)
+     * 
+ * + * + * .google.cloud.filestore.v1beta1.Instance instance = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.filestore.v1beta1.InstanceOrBuilder getInstanceOrBuilder() { + if (instanceBuilder_ != null) { + return instanceBuilder_.getMessageOrBuilder(); + } else { + return instance_ == null + ? com.google.cloud.filestore.v1beta1.Instance.getDefaultInstance() + : instance_; + } + } + /** + * + * + *
+     * Required. A [instance resource]
+     * (/cloud-filestore/reference/rest/v1beta1/projects.locations.instances)
+     * 
+ * + * + * .google.cloud.filestore.v1beta1.Instance instance = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.filestore.v1beta1.Instance, + com.google.cloud.filestore.v1beta1.Instance.Builder, + com.google.cloud.filestore.v1beta1.InstanceOrBuilder> + getInstanceFieldBuilder() { + if (instanceBuilder_ == null) { + instanceBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.filestore.v1beta1.Instance, + com.google.cloud.filestore.v1beta1.Instance.Builder, + com.google.cloud.filestore.v1beta1.InstanceOrBuilder>( + getInstance(), getParentForChildren(), isClean()); + instance_ = null; + } + return instanceBuilder_; + } + + @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.CreateInstanceRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.filestore.v1beta1.CreateInstanceRequest) + private static final com.google.cloud.filestore.v1beta1.CreateInstanceRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.filestore.v1beta1.CreateInstanceRequest(); + } + + public static com.google.cloud.filestore.v1beta1.CreateInstanceRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CreateInstanceRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new CreateInstanceRequest(input, extensionRegistry); + } + }; + + 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.CreateInstanceRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/CreateInstanceRequestOrBuilder.java b/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/CreateInstanceRequestOrBuilder.java new file mode 100644 index 00000000..607d9413 --- /dev/null +++ b/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/CreateInstanceRequestOrBuilder.java @@ -0,0 +1,133 @@ +/* + * 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 CreateInstanceRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.filestore.v1beta1.CreateInstanceRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * 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**.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * 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**.
+   * 
+ * + * + * 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 of the instance to create.
+   * 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.
+   * 
+ * + * string instance_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The instanceId. + */ + java.lang.String getInstanceId(); + /** + * + * + *
+   * Required. The ID of the instance to create.
+   * 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.
+   * 
+ * + * string instance_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for instanceId. + */ + com.google.protobuf.ByteString getInstanceIdBytes(); + + /** + * + * + *
+   * Required. A [instance resource]
+   * (/cloud-filestore/reference/rest/v1beta1/projects.locations.instances)
+   * 
+ * + * + * .google.cloud.filestore.v1beta1.Instance instance = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the instance field is set. + */ + boolean hasInstance(); + /** + * + * + *
+   * Required. A [instance resource]
+   * (/cloud-filestore/reference/rest/v1beta1/projects.locations.instances)
+   * 
+ * + * + * .google.cloud.filestore.v1beta1.Instance instance = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The instance. + */ + com.google.cloud.filestore.v1beta1.Instance getInstance(); + /** + * + * + *
+   * Required. A [instance resource]
+   * (/cloud-filestore/reference/rest/v1beta1/projects.locations.instances)
+   * 
+ * + * + * .google.cloud.filestore.v1beta1.Instance instance = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.filestore.v1beta1.InstanceOrBuilder getInstanceOrBuilder(); +} diff --git a/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/DeleteBackupRequest.java b/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/DeleteBackupRequest.java new file mode 100644 index 00000000..b565e700 --- /dev/null +++ b/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/DeleteBackupRequest.java @@ -0,0 +1,658 @@ +/* + * 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; + +/** + * + * + *
+ * DeleteBackupRequest deletes a backup.
+ * 
+ * + * Protobuf type {@code google.cloud.filestore.v1beta1.DeleteBackupRequest} + */ +public final class DeleteBackupRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.filestore.v1beta1.DeleteBackupRequest) + DeleteBackupRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use DeleteBackupRequest.newBuilder() to construct. + private DeleteBackupRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private DeleteBackupRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new DeleteBackupRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private DeleteBackupRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.filestore.v1beta1.CloudFilestoreServiceProto + .internal_static_google_cloud_filestore_v1beta1_DeleteBackupRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.filestore.v1beta1.CloudFilestoreServiceProto + .internal_static_google_cloud_filestore_v1beta1_DeleteBackupRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.filestore.v1beta1.DeleteBackupRequest.class, + com.google.cloud.filestore.v1beta1.DeleteBackupRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Required. The backup resource name, in the format
+   * projects/{project_id}/locations/{location}/backups/{backup_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 backup resource name, in the format
+   * projects/{project_id}/locations/{location}/backups/{backup_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 (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + size += unknownFields.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.DeleteBackupRequest)) { + return super.equals(obj); + } + com.google.cloud.filestore.v1beta1.DeleteBackupRequest other = + (com.google.cloud.filestore.v1beta1.DeleteBackupRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!unknownFields.equals(other.unknownFields)) 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) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.filestore.v1beta1.DeleteBackupRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.filestore.v1beta1.DeleteBackupRequest 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.DeleteBackupRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.filestore.v1beta1.DeleteBackupRequest 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.DeleteBackupRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.filestore.v1beta1.DeleteBackupRequest 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.DeleteBackupRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.filestore.v1beta1.DeleteBackupRequest 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.DeleteBackupRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.filestore.v1beta1.DeleteBackupRequest 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.DeleteBackupRequest 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.DeleteBackupRequest 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.DeleteBackupRequest 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; + } + /** + * + * + *
+   * DeleteBackupRequest deletes a backup.
+   * 
+ * + * Protobuf type {@code google.cloud.filestore.v1beta1.DeleteBackupRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.filestore.v1beta1.DeleteBackupRequest) + com.google.cloud.filestore.v1beta1.DeleteBackupRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.filestore.v1beta1.CloudFilestoreServiceProto + .internal_static_google_cloud_filestore_v1beta1_DeleteBackupRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.filestore.v1beta1.CloudFilestoreServiceProto + .internal_static_google_cloud_filestore_v1beta1_DeleteBackupRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.filestore.v1beta1.DeleteBackupRequest.class, + com.google.cloud.filestore.v1beta1.DeleteBackupRequest.Builder.class); + } + + // Construct using com.google.cloud.filestore.v1beta1.DeleteBackupRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @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_DeleteBackupRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.filestore.v1beta1.DeleteBackupRequest getDefaultInstanceForType() { + return com.google.cloud.filestore.v1beta1.DeleteBackupRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.filestore.v1beta1.DeleteBackupRequest build() { + com.google.cloud.filestore.v1beta1.DeleteBackupRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.filestore.v1beta1.DeleteBackupRequest buildPartial() { + com.google.cloud.filestore.v1beta1.DeleteBackupRequest result = + new com.google.cloud.filestore.v1beta1.DeleteBackupRequest(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.DeleteBackupRequest) { + return mergeFrom((com.google.cloud.filestore.v1beta1.DeleteBackupRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.filestore.v1beta1.DeleteBackupRequest other) { + if (other == com.google.cloud.filestore.v1beta1.DeleteBackupRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + 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 { + com.google.cloud.filestore.v1beta1.DeleteBackupRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.filestore.v1beta1.DeleteBackupRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. The backup resource name, in the format
+     * projects/{project_id}/locations/{location}/backups/{backup_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 backup resource name, in the format
+     * projects/{project_id}/locations/{location}/backups/{backup_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 backup resource name, in the format
+     * projects/{project_id}/locations/{location}/backups/{backup_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 backup resource name, in the format
+     * projects/{project_id}/locations/{location}/backups/{backup_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 backup resource name, in the format
+     * projects/{project_id}/locations/{location}/backups/{backup_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.DeleteBackupRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.filestore.v1beta1.DeleteBackupRequest) + private static final com.google.cloud.filestore.v1beta1.DeleteBackupRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.filestore.v1beta1.DeleteBackupRequest(); + } + + public static com.google.cloud.filestore.v1beta1.DeleteBackupRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DeleteBackupRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new DeleteBackupRequest(input, extensionRegistry); + } + }; + + 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.DeleteBackupRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/DeleteBackupRequestOrBuilder.java b/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/DeleteBackupRequestOrBuilder.java new file mode 100644 index 00000000..ed793215 --- /dev/null +++ b/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/DeleteBackupRequestOrBuilder.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 DeleteBackupRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.filestore.v1beta1.DeleteBackupRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The backup resource name, in the format
+   * projects/{project_id}/locations/{location}/backups/{backup_id}
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. The backup resource name, in the format
+   * projects/{project_id}/locations/{location}/backups/{backup_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/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/DeleteInstanceRequest.java b/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/DeleteInstanceRequest.java new file mode 100644 index 00000000..d11f5e6e --- /dev/null +++ b/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/DeleteInstanceRequest.java @@ -0,0 +1,658 @@ +/* + * 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; + +/** + * + * + *
+ * DeleteInstanceRequest deletes an instance.
+ * 
+ * + * Protobuf type {@code google.cloud.filestore.v1beta1.DeleteInstanceRequest} + */ +public final class DeleteInstanceRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.filestore.v1beta1.DeleteInstanceRequest) + DeleteInstanceRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use DeleteInstanceRequest.newBuilder() to construct. + private DeleteInstanceRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private DeleteInstanceRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new DeleteInstanceRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private DeleteInstanceRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.filestore.v1beta1.CloudFilestoreServiceProto + .internal_static_google_cloud_filestore_v1beta1_DeleteInstanceRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.filestore.v1beta1.CloudFilestoreServiceProto + .internal_static_google_cloud_filestore_v1beta1_DeleteInstanceRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.filestore.v1beta1.DeleteInstanceRequest.class, + com.google.cloud.filestore.v1beta1.DeleteInstanceRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Required. The instance resource name, in the format
+   * projects/{project_id}/locations/{location}/instances/{instance_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 instance resource name, in the format
+   * projects/{project_id}/locations/{location}/instances/{instance_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 (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + size += unknownFields.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.DeleteInstanceRequest)) { + return super.equals(obj); + } + com.google.cloud.filestore.v1beta1.DeleteInstanceRequest other = + (com.google.cloud.filestore.v1beta1.DeleteInstanceRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!unknownFields.equals(other.unknownFields)) 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) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.filestore.v1beta1.DeleteInstanceRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.filestore.v1beta1.DeleteInstanceRequest 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.DeleteInstanceRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.filestore.v1beta1.DeleteInstanceRequest 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.DeleteInstanceRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.filestore.v1beta1.DeleteInstanceRequest 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.DeleteInstanceRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.filestore.v1beta1.DeleteInstanceRequest 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.DeleteInstanceRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.filestore.v1beta1.DeleteInstanceRequest 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.DeleteInstanceRequest 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.DeleteInstanceRequest 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.DeleteInstanceRequest 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; + } + /** + * + * + *
+   * DeleteInstanceRequest deletes an instance.
+   * 
+ * + * Protobuf type {@code google.cloud.filestore.v1beta1.DeleteInstanceRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.filestore.v1beta1.DeleteInstanceRequest) + com.google.cloud.filestore.v1beta1.DeleteInstanceRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.filestore.v1beta1.CloudFilestoreServiceProto + .internal_static_google_cloud_filestore_v1beta1_DeleteInstanceRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.filestore.v1beta1.CloudFilestoreServiceProto + .internal_static_google_cloud_filestore_v1beta1_DeleteInstanceRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.filestore.v1beta1.DeleteInstanceRequest.class, + com.google.cloud.filestore.v1beta1.DeleteInstanceRequest.Builder.class); + } + + // Construct using com.google.cloud.filestore.v1beta1.DeleteInstanceRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @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_DeleteInstanceRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.filestore.v1beta1.DeleteInstanceRequest getDefaultInstanceForType() { + return com.google.cloud.filestore.v1beta1.DeleteInstanceRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.filestore.v1beta1.DeleteInstanceRequest build() { + com.google.cloud.filestore.v1beta1.DeleteInstanceRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + 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_; + 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.DeleteInstanceRequest) { + return mergeFrom((com.google.cloud.filestore.v1beta1.DeleteInstanceRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.filestore.v1beta1.DeleteInstanceRequest other) { + if (other == com.google.cloud.filestore.v1beta1.DeleteInstanceRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + 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 { + com.google.cloud.filestore.v1beta1.DeleteInstanceRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.filestore.v1beta1.DeleteInstanceRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. The instance resource name, in the format
+     * projects/{project_id}/locations/{location}/instances/{instance_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 instance resource name, in the format
+     * projects/{project_id}/locations/{location}/instances/{instance_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 instance resource name, in the format
+     * projects/{project_id}/locations/{location}/instances/{instance_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 instance resource name, in the format
+     * projects/{project_id}/locations/{location}/instances/{instance_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 instance resource name, in the format
+     * projects/{project_id}/locations/{location}/instances/{instance_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.DeleteInstanceRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.filestore.v1beta1.DeleteInstanceRequest) + private static final com.google.cloud.filestore.v1beta1.DeleteInstanceRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.filestore.v1beta1.DeleteInstanceRequest(); + } + + public static com.google.cloud.filestore.v1beta1.DeleteInstanceRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DeleteInstanceRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new DeleteInstanceRequest(input, extensionRegistry); + } + }; + + 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.DeleteInstanceRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/DeleteInstanceRequestOrBuilder.java b/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/DeleteInstanceRequestOrBuilder.java new file mode 100644 index 00000000..9bfb71c1 --- /dev/null +++ b/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/DeleteInstanceRequestOrBuilder.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 DeleteInstanceRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.filestore.v1beta1.DeleteInstanceRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The instance resource name, in the format
+   * projects/{project_id}/locations/{location}/instances/{instance_id}
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. The instance resource name, in the format
+   * projects/{project_id}/locations/{location}/instances/{instance_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/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/FileShareConfig.java b/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/FileShareConfig.java new file mode 100644 index 00000000..88caa2e6 --- /dev/null +++ b/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/FileShareConfig.java @@ -0,0 +1,1609 @@ +/* + * 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; + +/** + * + * + *
+ * File share configuration for the instance.
+ * 
+ * + * Protobuf type {@code google.cloud.filestore.v1beta1.FileShareConfig} + */ +public final class FileShareConfig extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.filestore.v1beta1.FileShareConfig) + FileShareConfigOrBuilder { + private static final long serialVersionUID = 0L; + // Use FileShareConfig.newBuilder() to construct. + private FileShareConfig(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private FileShareConfig() { + name_ = ""; + nfsExportOptions_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new FileShareConfig(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private FileShareConfig( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + case 16: + { + capacityGb_ = input.readInt64(); + break; + } + case 66: + { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + nfsExportOptions_ = + new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + nfsExportOptions_.add( + input.readMessage( + com.google.cloud.filestore.v1beta1.NfsExportOptions.parser(), + extensionRegistry)); + break; + } + case 74: + { + java.lang.String s = input.readStringRequireUtf8(); + sourceCase_ = 9; + source_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + nfsExportOptions_ = java.util.Collections.unmodifiableList(nfsExportOptions_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.filestore.v1beta1.CloudFilestoreServiceProto + .internal_static_google_cloud_filestore_v1beta1_FileShareConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.filestore.v1beta1.CloudFilestoreServiceProto + .internal_static_google_cloud_filestore_v1beta1_FileShareConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.filestore.v1beta1.FileShareConfig.class, + com.google.cloud.filestore.v1beta1.FileShareConfig.Builder.class); + } + + private int sourceCase_ = 0; + private java.lang.Object source_; + + public enum SourceCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + SOURCE_BACKUP(9), + SOURCE_NOT_SET(0); + private final int value; + + private SourceCase(int value) { + this.value = value; + } + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static SourceCase valueOf(int value) { + return forNumber(value); + } + + public static SourceCase forNumber(int value) { + switch (value) { + case 9: + return SOURCE_BACKUP; + case 0: + return SOURCE_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public SourceCase getSourceCase() { + return SourceCase.forNumber(sourceCase_); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * The name of the file share (must be 16 characters or less).
+   * 
+ * + * string name = 1; + * + * @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; + } + } + /** + * + * + *
+   * The name of the file share (must be 16 characters or less).
+   * 
+ * + * string name = 1; + * + * @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 CAPACITY_GB_FIELD_NUMBER = 2; + private long capacityGb_; + /** + * + * + *
+   * File share capacity in gigabytes (GB).
+   * Cloud Filestore defines 1 GB as 1024^3 bytes.
+   * 
+ * + * int64 capacity_gb = 2; + * + * @return The capacityGb. + */ + @java.lang.Override + public long getCapacityGb() { + return capacityGb_; + } + + public static final int SOURCE_BACKUP_FIELD_NUMBER = 9; + /** + * + * + *
+   * The resource name of the backup, in the format
+   * projects/{project_id}/locations/{location_id}/backups/{backup_id}, that
+   * this file share has been restored from.
+   * 
+ * + * string source_backup = 9 [(.google.api.resource_reference) = { ... } + * + * @return Whether the sourceBackup field is set. + */ + public boolean hasSourceBackup() { + return sourceCase_ == 9; + } + /** + * + * + *
+   * The resource name of the backup, in the format
+   * projects/{project_id}/locations/{location_id}/backups/{backup_id}, that
+   * this file share has been restored from.
+   * 
+ * + * string source_backup = 9 [(.google.api.resource_reference) = { ... } + * + * @return The sourceBackup. + */ + public java.lang.String getSourceBackup() { + java.lang.Object ref = ""; + if (sourceCase_ == 9) { + ref = source_; + } + 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(); + if (sourceCase_ == 9) { + source_ = s; + } + return s; + } + } + /** + * + * + *
+   * The resource name of the backup, in the format
+   * projects/{project_id}/locations/{location_id}/backups/{backup_id}, that
+   * this file share has been restored from.
+   * 
+ * + * string source_backup = 9 [(.google.api.resource_reference) = { ... } + * + * @return The bytes for sourceBackup. + */ + public com.google.protobuf.ByteString getSourceBackupBytes() { + java.lang.Object ref = ""; + if (sourceCase_ == 9) { + ref = source_; + } + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + if (sourceCase_ == 9) { + source_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int NFS_EXPORT_OPTIONS_FIELD_NUMBER = 8; + 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 = 8; + */ + @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 = 8; + */ + @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 = 8; + */ + @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 = 8; + */ + @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 = 8; + */ + @java.lang.Override + public com.google.cloud.filestore.v1beta1.NfsExportOptionsOrBuilder getNfsExportOptionsOrBuilder( + int index) { + return nfsExportOptions_.get(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 { + if (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (capacityGb_ != 0L) { + output.writeInt64(2, capacityGb_); + } + for (int i = 0; i < nfsExportOptions_.size(); i++) { + output.writeMessage(8, nfsExportOptions_.get(i)); + } + if (sourceCase_ == 9) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 9, source_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (capacityGb_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(2, capacityGb_); + } + for (int i = 0; i < nfsExportOptions_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(8, nfsExportOptions_.get(i)); + } + if (sourceCase_ == 9) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(9, source_); + } + size += unknownFields.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.FileShareConfig)) { + return super.equals(obj); + } + com.google.cloud.filestore.v1beta1.FileShareConfig other = + (com.google.cloud.filestore.v1beta1.FileShareConfig) obj; + + if (!getName().equals(other.getName())) return false; + if (getCapacityGb() != other.getCapacityGb()) return false; + if (!getNfsExportOptionsList().equals(other.getNfsExportOptionsList())) return false; + if (!getSourceCase().equals(other.getSourceCase())) return false; + switch (sourceCase_) { + case 9: + if (!getSourceBackup().equals(other.getSourceBackup())) return false; + break; + case 0: + default: + } + if (!unknownFields.equals(other.unknownFields)) 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) + 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(); + } + switch (sourceCase_) { + case 9: + hash = (37 * hash) + SOURCE_BACKUP_FIELD_NUMBER; + hash = (53 * hash) + getSourceBackup().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.filestore.v1beta1.FileShareConfig parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.filestore.v1beta1.FileShareConfig 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.FileShareConfig parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.filestore.v1beta1.FileShareConfig 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.FileShareConfig parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.filestore.v1beta1.FileShareConfig 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.FileShareConfig parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.filestore.v1beta1.FileShareConfig 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.FileShareConfig parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.filestore.v1beta1.FileShareConfig 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.FileShareConfig 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.FileShareConfig 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.FileShareConfig 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; + } + /** + * + * + *
+   * File share configuration for the instance.
+   * 
+ * + * Protobuf type {@code google.cloud.filestore.v1beta1.FileShareConfig} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.filestore.v1beta1.FileShareConfig) + com.google.cloud.filestore.v1beta1.FileShareConfigOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.filestore.v1beta1.CloudFilestoreServiceProto + .internal_static_google_cloud_filestore_v1beta1_FileShareConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.filestore.v1beta1.CloudFilestoreServiceProto + .internal_static_google_cloud_filestore_v1beta1_FileShareConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.filestore.v1beta1.FileShareConfig.class, + com.google.cloud.filestore.v1beta1.FileShareConfig.Builder.class); + } + + // Construct using com.google.cloud.filestore.v1beta1.FileShareConfig.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getNfsExportOptionsFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + capacityGb_ = 0L; + + if (nfsExportOptionsBuilder_ == null) { + nfsExportOptions_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + nfsExportOptionsBuilder_.clear(); + } + sourceCase_ = 0; + source_ = 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_FileShareConfig_descriptor; + } + + @java.lang.Override + public com.google.cloud.filestore.v1beta1.FileShareConfig getDefaultInstanceForType() { + return com.google.cloud.filestore.v1beta1.FileShareConfig.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.filestore.v1beta1.FileShareConfig build() { + com.google.cloud.filestore.v1beta1.FileShareConfig result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.filestore.v1beta1.FileShareConfig buildPartial() { + com.google.cloud.filestore.v1beta1.FileShareConfig result = + new com.google.cloud.filestore.v1beta1.FileShareConfig(this); + int from_bitField0_ = bitField0_; + result.name_ = name_; + result.capacityGb_ = capacityGb_; + if (sourceCase_ == 9) { + result.source_ = source_; + } + 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.sourceCase_ = sourceCase_; + 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.FileShareConfig) { + return mergeFrom((com.google.cloud.filestore.v1beta1.FileShareConfig) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.filestore.v1beta1.FileShareConfig other) { + if (other == com.google.cloud.filestore.v1beta1.FileShareConfig.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + 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_); + } + } + } + switch (other.getSourceCase()) { + case SOURCE_BACKUP: + { + sourceCase_ = 9; + source_ = other.source_; + onChanged(); + break; + } + case SOURCE_NOT_SET: + { + break; + } + } + this.mergeUnknownFields(other.unknownFields); + 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 { + com.google.cloud.filestore.v1beta1.FileShareConfig parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.filestore.v1beta1.FileShareConfig) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int sourceCase_ = 0; + private java.lang.Object source_; + + public SourceCase getSourceCase() { + return SourceCase.forNumber(sourceCase_); + } + + public Builder clearSource() { + sourceCase_ = 0; + source_ = null; + onChanged(); + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * The name of the file share (must be 16 characters or less).
+     * 
+ * + * string name = 1; + * + * @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; + } + } + /** + * + * + *
+     * The name of the file share (must be 16 characters or less).
+     * 
+ * + * string name = 1; + * + * @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; + } + } + /** + * + * + *
+     * The name of the file share (must be 16 characters or less).
+     * 
+ * + * string name = 1; + * + * @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; + } + /** + * + * + *
+     * The name of the file share (must be 16 characters or less).
+     * 
+ * + * string name = 1; + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * The name of the file share (must be 16 characters or less).
+     * 
+ * + * string name = 1; + * + * @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 long capacityGb_; + /** + * + * + *
+     * File share capacity in gigabytes (GB).
+     * Cloud Filestore defines 1 GB as 1024^3 bytes.
+     * 
+ * + * int64 capacity_gb = 2; + * + * @return The capacityGb. + */ + @java.lang.Override + public long getCapacityGb() { + return capacityGb_; + } + /** + * + * + *
+     * File share capacity in gigabytes (GB).
+     * Cloud Filestore defines 1 GB as 1024^3 bytes.
+     * 
+ * + * int64 capacity_gb = 2; + * + * @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).
+     * Cloud Filestore defines 1 GB as 1024^3 bytes.
+     * 
+ * + * int64 capacity_gb = 2; + * + * @return This builder for chaining. + */ + public Builder clearCapacityGb() { + + capacityGb_ = 0L; + onChanged(); + return this; + } + + /** + * + * + *
+     * The resource name of the backup, in the format
+     * projects/{project_id}/locations/{location_id}/backups/{backup_id}, that
+     * this file share has been restored from.
+     * 
+ * + * string source_backup = 9 [(.google.api.resource_reference) = { ... } + * + * @return Whether the sourceBackup field is set. + */ + @java.lang.Override + public boolean hasSourceBackup() { + return sourceCase_ == 9; + } + /** + * + * + *
+     * The resource name of the backup, in the format
+     * projects/{project_id}/locations/{location_id}/backups/{backup_id}, that
+     * this file share has been restored from.
+     * 
+ * + * string source_backup = 9 [(.google.api.resource_reference) = { ... } + * + * @return The sourceBackup. + */ + @java.lang.Override + public java.lang.String getSourceBackup() { + java.lang.Object ref = ""; + if (sourceCase_ == 9) { + ref = source_; + } + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (sourceCase_ == 9) { + source_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The resource name of the backup, in the format
+     * projects/{project_id}/locations/{location_id}/backups/{backup_id}, that
+     * this file share has been restored from.
+     * 
+ * + * string source_backup = 9 [(.google.api.resource_reference) = { ... } + * + * @return The bytes for sourceBackup. + */ + @java.lang.Override + public com.google.protobuf.ByteString getSourceBackupBytes() { + java.lang.Object ref = ""; + if (sourceCase_ == 9) { + ref = source_; + } + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + if (sourceCase_ == 9) { + source_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The resource name of the backup, in the format
+     * projects/{project_id}/locations/{location_id}/backups/{backup_id}, that
+     * this file share has been restored from.
+     * 
+ * + * string source_backup = 9 [(.google.api.resource_reference) = { ... } + * + * @param value The sourceBackup to set. + * @return This builder for chaining. + */ + public Builder setSourceBackup(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + sourceCase_ = 9; + source_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The resource name of the backup, in the format
+     * projects/{project_id}/locations/{location_id}/backups/{backup_id}, that
+     * this file share has been restored from.
+     * 
+ * + * string source_backup = 9 [(.google.api.resource_reference) = { ... } + * + * @return This builder for chaining. + */ + public Builder clearSourceBackup() { + if (sourceCase_ == 9) { + sourceCase_ = 0; + source_ = null; + onChanged(); + } + return this; + } + /** + * + * + *
+     * The resource name of the backup, in the format
+     * projects/{project_id}/locations/{location_id}/backups/{backup_id}, that
+     * this file share has been restored from.
+     * 
+ * + * string source_backup = 9 [(.google.api.resource_reference) = { ... } + * + * @param value The bytes for sourceBackup to set. + * @return This builder for chaining. + */ + public Builder setSourceBackupBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + sourceCase_ = 9; + source_ = value; + 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 = 8; + * + */ + 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 = 8; + * + */ + 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 = 8; + * + */ + 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 = 8; + * + */ + 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 = 8; + * + */ + 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 = 8; + * + */ + 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 = 8; + * + */ + 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 = 8; + * + */ + 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 = 8; + * + */ + 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 = 8; + * + */ + 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 = 8; + * + */ + 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 = 8; + * + */ + 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 = 8; + * + */ + 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 = 8; + * + */ + 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 = 8; + * + */ + 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 = 8; + * + */ + 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 = 8; + * + */ + 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 = 8; + * + */ + 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_; + } + + @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.FileShareConfig) + } + + // @@protoc_insertion_point(class_scope:google.cloud.filestore.v1beta1.FileShareConfig) + private static final com.google.cloud.filestore.v1beta1.FileShareConfig DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.filestore.v1beta1.FileShareConfig(); + } + + public static com.google.cloud.filestore.v1beta1.FileShareConfig getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public FileShareConfig parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new FileShareConfig(input, extensionRegistry); + } + }; + + 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.FileShareConfig getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/FileShareConfigOrBuilder.java b/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/FileShareConfigOrBuilder.java new file mode 100644 index 00000000..14ae00fb --- /dev/null +++ b/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/FileShareConfigOrBuilder.java @@ -0,0 +1,167 @@ +/* + * 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 FileShareConfigOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.filestore.v1beta1.FileShareConfig) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The name of the file share (must be 16 characters or less).
+   * 
+ * + * string name = 1; + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * The name of the file share (must be 16 characters or less).
+   * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * File share capacity in gigabytes (GB).
+   * Cloud Filestore defines 1 GB as 1024^3 bytes.
+   * 
+ * + * int64 capacity_gb = 2; + * + * @return The capacityGb. + */ + long getCapacityGb(); + + /** + * + * + *
+   * The resource name of the backup, in the format
+   * projects/{project_id}/locations/{location_id}/backups/{backup_id}, that
+   * this file share has been restored from.
+   * 
+ * + * string source_backup = 9 [(.google.api.resource_reference) = { ... } + * + * @return Whether the sourceBackup field is set. + */ + boolean hasSourceBackup(); + /** + * + * + *
+   * The resource name of the backup, in the format
+   * projects/{project_id}/locations/{location_id}/backups/{backup_id}, that
+   * this file share has been restored from.
+   * 
+ * + * string source_backup = 9 [(.google.api.resource_reference) = { ... } + * + * @return The sourceBackup. + */ + java.lang.String getSourceBackup(); + /** + * + * + *
+   * The resource name of the backup, in the format
+   * projects/{project_id}/locations/{location_id}/backups/{backup_id}, that
+   * this file share has been restored from.
+   * 
+ * + * string source_backup = 9 [(.google.api.resource_reference) = { ... } + * + * @return The bytes for sourceBackup. + */ + com.google.protobuf.ByteString getSourceBackupBytes(); + + /** + * + * + *
+   * Nfs Export Options.
+   * There is a limit of 10 export options per file share.
+   * 
+ * + * repeated .google.cloud.filestore.v1beta1.NfsExportOptions nfs_export_options = 8; + */ + 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 = 8; + */ + 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 = 8; + */ + 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 = 8; + */ + 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 = 8; + */ + com.google.cloud.filestore.v1beta1.NfsExportOptionsOrBuilder getNfsExportOptionsOrBuilder( + int index); + + public com.google.cloud.filestore.v1beta1.FileShareConfig.SourceCase getSourceCase(); +} diff --git a/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/GetBackupRequest.java b/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/GetBackupRequest.java new file mode 100644 index 00000000..e0f423a8 --- /dev/null +++ b/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/GetBackupRequest.java @@ -0,0 +1,657 @@ +/* + * 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; + +/** + * + * + *
+ * GetBackupRequest gets the state of a backup.
+ * 
+ * + * Protobuf type {@code google.cloud.filestore.v1beta1.GetBackupRequest} + */ +public final class GetBackupRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.filestore.v1beta1.GetBackupRequest) + GetBackupRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use GetBackupRequest.newBuilder() to construct. + private GetBackupRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GetBackupRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GetBackupRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private GetBackupRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.filestore.v1beta1.CloudFilestoreServiceProto + .internal_static_google_cloud_filestore_v1beta1_GetBackupRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.filestore.v1beta1.CloudFilestoreServiceProto + .internal_static_google_cloud_filestore_v1beta1_GetBackupRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.filestore.v1beta1.GetBackupRequest.class, + com.google.cloud.filestore.v1beta1.GetBackupRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Required. The backup resource name, in the format
+   * projects/{project_id}/locations/{location}/backups/{backup_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 backup resource name, in the format
+   * projects/{project_id}/locations/{location}/backups/{backup_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 (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + size += unknownFields.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.GetBackupRequest)) { + return super.equals(obj); + } + com.google.cloud.filestore.v1beta1.GetBackupRequest other = + (com.google.cloud.filestore.v1beta1.GetBackupRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!unknownFields.equals(other.unknownFields)) 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) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.filestore.v1beta1.GetBackupRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.filestore.v1beta1.GetBackupRequest 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.GetBackupRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.filestore.v1beta1.GetBackupRequest 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.GetBackupRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.filestore.v1beta1.GetBackupRequest 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.GetBackupRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.filestore.v1beta1.GetBackupRequest 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.GetBackupRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.filestore.v1beta1.GetBackupRequest 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.GetBackupRequest 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.GetBackupRequest 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.GetBackupRequest 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; + } + /** + * + * + *
+   * GetBackupRequest gets the state of a backup.
+   * 
+ * + * Protobuf type {@code google.cloud.filestore.v1beta1.GetBackupRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.filestore.v1beta1.GetBackupRequest) + com.google.cloud.filestore.v1beta1.GetBackupRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.filestore.v1beta1.CloudFilestoreServiceProto + .internal_static_google_cloud_filestore_v1beta1_GetBackupRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.filestore.v1beta1.CloudFilestoreServiceProto + .internal_static_google_cloud_filestore_v1beta1_GetBackupRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.filestore.v1beta1.GetBackupRequest.class, + com.google.cloud.filestore.v1beta1.GetBackupRequest.Builder.class); + } + + // Construct using com.google.cloud.filestore.v1beta1.GetBackupRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @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_GetBackupRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.filestore.v1beta1.GetBackupRequest getDefaultInstanceForType() { + return com.google.cloud.filestore.v1beta1.GetBackupRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.filestore.v1beta1.GetBackupRequest build() { + com.google.cloud.filestore.v1beta1.GetBackupRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.filestore.v1beta1.GetBackupRequest buildPartial() { + com.google.cloud.filestore.v1beta1.GetBackupRequest result = + new com.google.cloud.filestore.v1beta1.GetBackupRequest(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.GetBackupRequest) { + return mergeFrom((com.google.cloud.filestore.v1beta1.GetBackupRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.filestore.v1beta1.GetBackupRequest other) { + if (other == com.google.cloud.filestore.v1beta1.GetBackupRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + 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 { + com.google.cloud.filestore.v1beta1.GetBackupRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.filestore.v1beta1.GetBackupRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. The backup resource name, in the format
+     * projects/{project_id}/locations/{location}/backups/{backup_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 backup resource name, in the format
+     * projects/{project_id}/locations/{location}/backups/{backup_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 backup resource name, in the format
+     * projects/{project_id}/locations/{location}/backups/{backup_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 backup resource name, in the format
+     * projects/{project_id}/locations/{location}/backups/{backup_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 backup resource name, in the format
+     * projects/{project_id}/locations/{location}/backups/{backup_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.GetBackupRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.filestore.v1beta1.GetBackupRequest) + private static final com.google.cloud.filestore.v1beta1.GetBackupRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.filestore.v1beta1.GetBackupRequest(); + } + + public static com.google.cloud.filestore.v1beta1.GetBackupRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetBackupRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new GetBackupRequest(input, extensionRegistry); + } + }; + + 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.GetBackupRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/GetBackupRequestOrBuilder.java b/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/GetBackupRequestOrBuilder.java new file mode 100644 index 00000000..4b085544 --- /dev/null +++ b/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/GetBackupRequestOrBuilder.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 GetBackupRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.filestore.v1beta1.GetBackupRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The backup resource name, in the format
+   * projects/{project_id}/locations/{location}/backups/{backup_id}.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. The backup resource name, in the format
+   * projects/{project_id}/locations/{location}/backups/{backup_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/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/GetInstanceRequest.java b/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/GetInstanceRequest.java new file mode 100644 index 00000000..ea8aa160 --- /dev/null +++ b/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/GetInstanceRequest.java @@ -0,0 +1,658 @@ +/* + * 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; + +/** + * + * + *
+ * GetInstanceRequest gets the state of an instance.
+ * 
+ * + * Protobuf type {@code google.cloud.filestore.v1beta1.GetInstanceRequest} + */ +public final class GetInstanceRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.filestore.v1beta1.GetInstanceRequest) + GetInstanceRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use GetInstanceRequest.newBuilder() to construct. + private GetInstanceRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GetInstanceRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GetInstanceRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private GetInstanceRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.filestore.v1beta1.CloudFilestoreServiceProto + .internal_static_google_cloud_filestore_v1beta1_GetInstanceRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.filestore.v1beta1.CloudFilestoreServiceProto + .internal_static_google_cloud_filestore_v1beta1_GetInstanceRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.filestore.v1beta1.GetInstanceRequest.class, + com.google.cloud.filestore.v1beta1.GetInstanceRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Required. The instance resource name, in the format
+   * projects/{project_id}/locations/{location}/instances/{instance_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 instance resource name, in the format
+   * projects/{project_id}/locations/{location}/instances/{instance_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 (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + size += unknownFields.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.GetInstanceRequest)) { + return super.equals(obj); + } + com.google.cloud.filestore.v1beta1.GetInstanceRequest other = + (com.google.cloud.filestore.v1beta1.GetInstanceRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!unknownFields.equals(other.unknownFields)) 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) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.filestore.v1beta1.GetInstanceRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.filestore.v1beta1.GetInstanceRequest 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.GetInstanceRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.filestore.v1beta1.GetInstanceRequest 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.GetInstanceRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.filestore.v1beta1.GetInstanceRequest 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.GetInstanceRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.filestore.v1beta1.GetInstanceRequest 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.GetInstanceRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.filestore.v1beta1.GetInstanceRequest 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.GetInstanceRequest 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.GetInstanceRequest 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.GetInstanceRequest 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; + } + /** + * + * + *
+   * GetInstanceRequest gets the state of an instance.
+   * 
+ * + * Protobuf type {@code google.cloud.filestore.v1beta1.GetInstanceRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.filestore.v1beta1.GetInstanceRequest) + com.google.cloud.filestore.v1beta1.GetInstanceRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.filestore.v1beta1.CloudFilestoreServiceProto + .internal_static_google_cloud_filestore_v1beta1_GetInstanceRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.filestore.v1beta1.CloudFilestoreServiceProto + .internal_static_google_cloud_filestore_v1beta1_GetInstanceRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.filestore.v1beta1.GetInstanceRequest.class, + com.google.cloud.filestore.v1beta1.GetInstanceRequest.Builder.class); + } + + // Construct using com.google.cloud.filestore.v1beta1.GetInstanceRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @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_GetInstanceRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.filestore.v1beta1.GetInstanceRequest getDefaultInstanceForType() { + return com.google.cloud.filestore.v1beta1.GetInstanceRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.filestore.v1beta1.GetInstanceRequest build() { + com.google.cloud.filestore.v1beta1.GetInstanceRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.filestore.v1beta1.GetInstanceRequest buildPartial() { + com.google.cloud.filestore.v1beta1.GetInstanceRequest result = + new com.google.cloud.filestore.v1beta1.GetInstanceRequest(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.GetInstanceRequest) { + return mergeFrom((com.google.cloud.filestore.v1beta1.GetInstanceRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.filestore.v1beta1.GetInstanceRequest other) { + if (other == com.google.cloud.filestore.v1beta1.GetInstanceRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + 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 { + com.google.cloud.filestore.v1beta1.GetInstanceRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.filestore.v1beta1.GetInstanceRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. The instance resource name, in the format
+     * projects/{project_id}/locations/{location}/instances/{instance_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 instance resource name, in the format
+     * projects/{project_id}/locations/{location}/instances/{instance_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 instance resource name, in the format
+     * projects/{project_id}/locations/{location}/instances/{instance_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 instance resource name, in the format
+     * projects/{project_id}/locations/{location}/instances/{instance_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 instance resource name, in the format
+     * projects/{project_id}/locations/{location}/instances/{instance_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.GetInstanceRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.filestore.v1beta1.GetInstanceRequest) + private static final com.google.cloud.filestore.v1beta1.GetInstanceRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.filestore.v1beta1.GetInstanceRequest(); + } + + public static com.google.cloud.filestore.v1beta1.GetInstanceRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetInstanceRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new GetInstanceRequest(input, extensionRegistry); + } + }; + + 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.GetInstanceRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/GetInstanceRequestOrBuilder.java b/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/GetInstanceRequestOrBuilder.java new file mode 100644 index 00000000..5db5208e --- /dev/null +++ b/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/GetInstanceRequestOrBuilder.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 GetInstanceRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.filestore.v1beta1.GetInstanceRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The instance resource name, in the format
+   * projects/{project_id}/locations/{location}/instances/{instance_id}.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. The instance resource name, in the format
+   * projects/{project_id}/locations/{location}/instances/{instance_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/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/Instance.java b/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/Instance.java new file mode 100644 index 00000000..6594a23d --- /dev/null +++ b/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/Instance.java @@ -0,0 +1,3944 @@ +/* + * 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 Cloud Filestore instance.
+ * 
+ * + * Protobuf type {@code google.cloud.filestore.v1beta1.Instance} + */ +public final class Instance extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.filestore.v1beta1.Instance) + InstanceOrBuilder { + private static final long serialVersionUID = 0L; + // Use Instance.newBuilder() to construct. + private Instance(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Instance() { + name_ = ""; + description_ = ""; + state_ = 0; + statusMessage_ = ""; + tier_ = 0; + fileShares_ = java.util.Collections.emptyList(); + networks_ = java.util.Collections.emptyList(); + etag_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Instance(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private Instance( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + description_ = s; + break; + } + case 40: + { + int rawValue = input.readEnum(); + + state_ = rawValue; + break; + } + case 50: + { + java.lang.String s = input.readStringRequireUtf8(); + + statusMessage_ = s; + break; + } + case 58: + { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (createTime_ != null) { + subBuilder = createTime_.toBuilder(); + } + createTime_ = + input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(createTime_); + createTime_ = subBuilder.buildPartial(); + } + + break; + } + case 64: + { + int rawValue = input.readEnum(); + + tier_ = rawValue; + break; + } + case 74: + { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + labels_ = + com.google.protobuf.MapField.newMapField(LabelsDefaultEntryHolder.defaultEntry); + mutable_bitField0_ |= 0x00000001; + } + com.google.protobuf.MapEntry labels__ = + input.readMessage( + LabelsDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); + labels_.getMutableMap().put(labels__.getKey(), labels__.getValue()); + break; + } + case 82: + { + if (!((mutable_bitField0_ & 0x00000002) != 0)) { + fileShares_ = + new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000002; + } + fileShares_.add( + input.readMessage( + com.google.cloud.filestore.v1beta1.FileShareConfig.parser(), + extensionRegistry)); + break; + } + case 90: + { + if (!((mutable_bitField0_ & 0x00000004) != 0)) { + networks_ = + new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000004; + } + networks_.add( + input.readMessage( + com.google.cloud.filestore.v1beta1.NetworkConfig.parser(), + extensionRegistry)); + break; + } + case 98: + { + java.lang.String s = input.readStringRequireUtf8(); + + etag_ = s; + break; + } + case 106: + { + com.google.protobuf.BoolValue.Builder subBuilder = null; + if (satisfiesPzs_ != null) { + subBuilder = satisfiesPzs_.toBuilder(); + } + satisfiesPzs_ = + input.readMessage(com.google.protobuf.BoolValue.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(satisfiesPzs_); + satisfiesPzs_ = subBuilder.buildPartial(); + } + + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000002) != 0)) { + fileShares_ = java.util.Collections.unmodifiableList(fileShares_); + } + if (((mutable_bitField0_ & 0x00000004) != 0)) { + networks_ = java.util.Collections.unmodifiableList(networks_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.filestore.v1beta1.CloudFilestoreServiceProto + .internal_static_google_cloud_filestore_v1beta1_Instance_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 9: + 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_Instance_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.filestore.v1beta1.Instance.class, + com.google.cloud.filestore.v1beta1.Instance.Builder.class); + } + + /** + * + * + *
+   * The instance state.
+   * 
+ * + * Protobuf enum {@code google.cloud.filestore.v1beta1.Instance.State} + */ + public enum State implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * State not set.
+     * 
+ * + * STATE_UNSPECIFIED = 0; + */ + STATE_UNSPECIFIED(0), + /** + * + * + *
+     * The instance is being created.
+     * 
+ * + * CREATING = 1; + */ + CREATING(1), + /** + * + * + *
+     * The instance is available for use.
+     * 
+ * + * READY = 2; + */ + READY(2), + /** + * + * + *
+     * Work is being done on the instance. You can get further details from the
+     * `statusMessage` field of the `Instance` resource.
+     * 
+ * + * REPAIRING = 3; + */ + REPAIRING(3), + /** + * + * + *
+     * The instance is shutting down.
+     * 
+ * + * DELETING = 4; + */ + DELETING(4), + /** + * + * + *
+     * The instance is experiencing an issue and might be unusable. You can get
+     * further details from the `statusMessage` field of the `Instance`
+     * resource.
+     * 
+ * + * ERROR = 6; + */ + ERROR(6), + /** + * + * + *
+     * The instance is restoring a snapshot or backup to an existing file share
+     * and may be unusable during this time.
+     * 
+ * + * RESTORING = 7; + */ + RESTORING(7), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * State not set.
+     * 
+ * + * STATE_UNSPECIFIED = 0; + */ + public static final int STATE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * The instance is being created.
+     * 
+ * + * CREATING = 1; + */ + public static final int CREATING_VALUE = 1; + /** + * + * + *
+     * The instance is available for use.
+     * 
+ * + * READY = 2; + */ + public static final int READY_VALUE = 2; + /** + * + * + *
+     * Work is being done on the instance. You can get further details from the
+     * `statusMessage` field of the `Instance` resource.
+     * 
+ * + * REPAIRING = 3; + */ + public static final int REPAIRING_VALUE = 3; + /** + * + * + *
+     * The instance is shutting down.
+     * 
+ * + * DELETING = 4; + */ + public static final int DELETING_VALUE = 4; + /** + * + * + *
+     * The instance is experiencing an issue and might be unusable. You can get
+     * further details from the `statusMessage` field of the `Instance`
+     * resource.
+     * 
+ * + * ERROR = 6; + */ + public static final int ERROR_VALUE = 6; + /** + * + * + *
+     * The instance is restoring a snapshot or backup to an existing file share
+     * and may be unusable during this time.
+     * 
+ * + * RESTORING = 7; + */ + public static final int RESTORING_VALUE = 7; + + 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 2: + return READY; + case 3: + return REPAIRING; + case 4: + return DELETING; + case 6: + return ERROR; + case 7: + return RESTORING; + 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.Instance.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.Instance.State) + } + + /** + * + * + *
+   * Available service tiers.
+   * 
+ * + * Protobuf enum {@code google.cloud.filestore.v1beta1.Instance.Tier} + */ + public enum Tier implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Not set.
+     * 
+ * + * TIER_UNSPECIFIED = 0; + */ + TIER_UNSPECIFIED(0), + /** + * + * + *
+     * STANDARD tier. BASIC_HDD is the preferred term for this tier.
+     * 
+ * + * STANDARD = 1; + */ + STANDARD(1), + /** + * + * + *
+     * PREMIUM tier. BASIC_SSD is the preferred term for this tier.
+     * 
+ * + * PREMIUM = 2; + */ + PREMIUM(2), + /** + * + * + *
+     * BASIC instances offer a maximum capacity of 63.9 TB.
+     * BASIC_HDD is an alias for STANDARD Tier, offering economical
+     * performance backed by HDD.
+     * 
+ * + * BASIC_HDD = 3; + */ + BASIC_HDD(3), + /** + * + * + *
+     * BASIC instances offer a maximum capacity of 63.9 TB.
+     * BASIC_SSD is an alias for PREMIUM Tier, and offers improved
+     * performance backed by SSD.
+     * 
+ * + * BASIC_SSD = 4; + */ + BASIC_SSD(4), + /** + * + * + *
+     * HIGH_SCALE instances offer expanded capacity and performance scaling
+     * capabilities.
+     * 
+ * + * HIGH_SCALE_SSD = 6; + */ + HIGH_SCALE_SSD(6), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * Not set.
+     * 
+ * + * TIER_UNSPECIFIED = 0; + */ + public static final int TIER_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * STANDARD tier. BASIC_HDD is the preferred term for this tier.
+     * 
+ * + * STANDARD = 1; + */ + public static final int STANDARD_VALUE = 1; + /** + * + * + *
+     * PREMIUM tier. BASIC_SSD is the preferred term for this tier.
+     * 
+ * + * PREMIUM = 2; + */ + public static final int PREMIUM_VALUE = 2; + /** + * + * + *
+     * BASIC instances offer a maximum capacity of 63.9 TB.
+     * BASIC_HDD is an alias for STANDARD Tier, offering economical
+     * performance backed by HDD.
+     * 
+ * + * BASIC_HDD = 3; + */ + public static final int BASIC_HDD_VALUE = 3; + /** + * + * + *
+     * BASIC instances offer a maximum capacity of 63.9 TB.
+     * BASIC_SSD is an alias for PREMIUM Tier, and offers improved
+     * performance backed by SSD.
+     * 
+ * + * BASIC_SSD = 4; + */ + public static final int BASIC_SSD_VALUE = 4; + /** + * + * + *
+     * HIGH_SCALE instances offer expanded capacity and performance scaling
+     * capabilities.
+     * 
+ * + * HIGH_SCALE_SSD = 6; + */ + public static final int HIGH_SCALE_SSD_VALUE = 6; + + 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 Tier 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 Tier forNumber(int value) { + switch (value) { + case 0: + return TIER_UNSPECIFIED; + case 1: + return STANDARD; + case 2: + return PREMIUM; + case 3: + return BASIC_HDD; + case 4: + return BASIC_SSD; + case 6: + return HIGH_SCALE_SSD; + 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 Tier findValueByNumber(int number) { + return Tier.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(1); + } + + private static final Tier[] VALUES = values(); + + public static Tier 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 Tier(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.filestore.v1beta1.Instance.Tier) + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Output only. The resource name of the instance, in the format
+   * projects/{project_id}/locations/{location_id}/instances/{instance_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 instance, in the format
+   * projects/{project_id}/locations/{location_id}/instances/{instance_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 DESCRIPTION_FIELD_NUMBER = 2; + private volatile java.lang.Object description_; + /** + * + * + *
+   * The description of the instance (2048 characters or less).
+   * 
+ * + * string description = 2; + * + * @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; + } + } + /** + * + * + *
+   * The description of the instance (2048 characters or less).
+   * 
+ * + * string description = 2; + * + * @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 STATE_FIELD_NUMBER = 5; + private int state_; + /** + * + * + *
+   * Output only. The instance state.
+   * 
+ * + * + * .google.cloud.filestore.v1beta1.Instance.State state = 5 [(.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 instance state.
+   * 
+ * + * + * .google.cloud.filestore.v1beta1.Instance.State state = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The state. + */ + @java.lang.Override + public com.google.cloud.filestore.v1beta1.Instance.State getState() { + @SuppressWarnings("deprecation") + com.google.cloud.filestore.v1beta1.Instance.State result = + com.google.cloud.filestore.v1beta1.Instance.State.valueOf(state_); + return result == null ? com.google.cloud.filestore.v1beta1.Instance.State.UNRECOGNIZED : result; + } + + public static final int STATUS_MESSAGE_FIELD_NUMBER = 6; + private volatile java.lang.Object statusMessage_; + /** + * + * + *
+   * Output only. Additional information about the instance state, if available.
+   * 
+ * + * string status_message = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The statusMessage. + */ + @java.lang.Override + public java.lang.String getStatusMessage() { + java.lang.Object ref = statusMessage_; + 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(); + statusMessage_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. Additional information about the instance state, if available.
+   * 
+ * + * string status_message = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for statusMessage. + */ + @java.lang.Override + public com.google.protobuf.ByteString getStatusMessageBytes() { + java.lang.Object ref = statusMessage_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + statusMessage_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CREATE_TIME_FIELD_NUMBER = 7; + private com.google.protobuf.Timestamp createTime_; + /** + * + * + *
+   * Output only. The time when the instance 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 instance 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 instance 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 TIER_FIELD_NUMBER = 8; + private int tier_; + /** + * + * + *
+   * The service tier of the instance.
+   * 
+ * + * .google.cloud.filestore.v1beta1.Instance.Tier tier = 8; + * + * @return The enum numeric value on the wire for tier. + */ + @java.lang.Override + public int getTierValue() { + return tier_; + } + /** + * + * + *
+   * The service tier of the instance.
+   * 
+ * + * .google.cloud.filestore.v1beta1.Instance.Tier tier = 8; + * + * @return The tier. + */ + @java.lang.Override + public com.google.cloud.filestore.v1beta1.Instance.Tier getTier() { + @SuppressWarnings("deprecation") + com.google.cloud.filestore.v1beta1.Instance.Tier result = + com.google.cloud.filestore.v1beta1.Instance.Tier.valueOf(tier_); + return result == null ? com.google.cloud.filestore.v1beta1.Instance.Tier.UNRECOGNIZED : result; + } + + public static final int LABELS_FIELD_NUMBER = 9; + + 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_Instance_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 = 9; + */ + @java.lang.Override + public boolean containsLabels(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + 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 = 9; + */ + @java.lang.Override + public java.util.Map getLabelsMap() { + return internalGetLabels().getMap(); + } + /** + * + * + *
+   * Resource labels to represent user provided metadata.
+   * 
+ * + * map<string, string> labels = 9; + */ + @java.lang.Override + public java.lang.String getLabelsOrDefault(java.lang.String key, java.lang.String defaultValue) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + 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 = 9; + */ + @java.lang.Override + public java.lang.String getLabelsOrThrow(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = internalGetLabels().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public static final int FILE_SHARES_FIELD_NUMBER = 10; + private java.util.List fileShares_; + /** + * + * + *
+   * File system shares on the instance.
+   * For this version, only a single file share is supported.
+   * 
+ * + * repeated .google.cloud.filestore.v1beta1.FileShareConfig file_shares = 10; + */ + @java.lang.Override + public java.util.List getFileSharesList() { + return fileShares_; + } + /** + * + * + *
+   * File system shares on the instance.
+   * For this version, only a single file share is supported.
+   * 
+ * + * repeated .google.cloud.filestore.v1beta1.FileShareConfig file_shares = 10; + */ + @java.lang.Override + public java.util.List + getFileSharesOrBuilderList() { + return fileShares_; + } + /** + * + * + *
+   * File system shares on the instance.
+   * For this version, only a single file share is supported.
+   * 
+ * + * repeated .google.cloud.filestore.v1beta1.FileShareConfig file_shares = 10; + */ + @java.lang.Override + public int getFileSharesCount() { + return fileShares_.size(); + } + /** + * + * + *
+   * File system shares on the instance.
+   * For this version, only a single file share is supported.
+   * 
+ * + * repeated .google.cloud.filestore.v1beta1.FileShareConfig file_shares = 10; + */ + @java.lang.Override + public com.google.cloud.filestore.v1beta1.FileShareConfig getFileShares(int index) { + return fileShares_.get(index); + } + /** + * + * + *
+   * File system shares on the instance.
+   * For this version, only a single file share is supported.
+   * 
+ * + * repeated .google.cloud.filestore.v1beta1.FileShareConfig file_shares = 10; + */ + @java.lang.Override + public com.google.cloud.filestore.v1beta1.FileShareConfigOrBuilder getFileSharesOrBuilder( + int index) { + return fileShares_.get(index); + } + + public static final int NETWORKS_FIELD_NUMBER = 11; + private java.util.List networks_; + /** + * + * + *
+   * VPC networks to which the instance is connected.
+   * For this version, only a single network is supported.
+   * 
+ * + * repeated .google.cloud.filestore.v1beta1.NetworkConfig networks = 11; + */ + @java.lang.Override + public java.util.List getNetworksList() { + return networks_; + } + /** + * + * + *
+   * VPC networks to which the instance is connected.
+   * For this version, only a single network is supported.
+   * 
+ * + * repeated .google.cloud.filestore.v1beta1.NetworkConfig networks = 11; + */ + @java.lang.Override + public java.util.List + getNetworksOrBuilderList() { + return networks_; + } + /** + * + * + *
+   * VPC networks to which the instance is connected.
+   * For this version, only a single network is supported.
+   * 
+ * + * repeated .google.cloud.filestore.v1beta1.NetworkConfig networks = 11; + */ + @java.lang.Override + public int getNetworksCount() { + return networks_.size(); + } + /** + * + * + *
+   * VPC networks to which the instance is connected.
+   * For this version, only a single network is supported.
+   * 
+ * + * repeated .google.cloud.filestore.v1beta1.NetworkConfig networks = 11; + */ + @java.lang.Override + public com.google.cloud.filestore.v1beta1.NetworkConfig getNetworks(int index) { + return networks_.get(index); + } + /** + * + * + *
+   * VPC networks to which the instance is connected.
+   * For this version, only a single network is supported.
+   * 
+ * + * repeated .google.cloud.filestore.v1beta1.NetworkConfig networks = 11; + */ + @java.lang.Override + public com.google.cloud.filestore.v1beta1.NetworkConfigOrBuilder getNetworksOrBuilder(int index) { + return networks_.get(index); + } + + public static final int ETAG_FIELD_NUMBER = 12; + private volatile java.lang.Object etag_; + /** + * + * + *
+   * Server-specified ETag for the instance resource to prevent simultaneous
+   * updates from overwriting each other.
+   * 
+ * + * string etag = 12; + * + * @return The etag. + */ + @java.lang.Override + public java.lang.String getEtag() { + java.lang.Object ref = etag_; + 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(); + etag_ = s; + return s; + } + } + /** + * + * + *
+   * Server-specified ETag for the instance resource to prevent simultaneous
+   * updates from overwriting each other.
+   * 
+ * + * string etag = 12; + * + * @return The bytes for etag. + */ + @java.lang.Override + public com.google.protobuf.ByteString getEtagBytes() { + java.lang.Object ref = etag_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + etag_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SATISFIES_PZS_FIELD_NUMBER = 13; + private com.google.protobuf.BoolValue satisfiesPzs_; + /** + * + * + *
+   * Output only. Reserved for future use.
+   * 
+ * + * + * .google.protobuf.BoolValue satisfies_pzs = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the satisfiesPzs field is set. + */ + @java.lang.Override + public boolean hasSatisfiesPzs() { + return satisfiesPzs_ != null; + } + /** + * + * + *
+   * Output only. Reserved for future use.
+   * 
+ * + * + * .google.protobuf.BoolValue satisfies_pzs = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The satisfiesPzs. + */ + @java.lang.Override + public com.google.protobuf.BoolValue getSatisfiesPzs() { + return satisfiesPzs_ == null + ? com.google.protobuf.BoolValue.getDefaultInstance() + : satisfiesPzs_; + } + /** + * + * + *
+   * Output only. Reserved for future use.
+   * 
+ * + * + * .google.protobuf.BoolValue satisfies_pzs = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.BoolValueOrBuilder getSatisfiesPzsOrBuilder() { + return getSatisfiesPzs(); + } + + 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 (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (!getDescriptionBytes().isEmpty()) { + 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 (!getStatusMessageBytes().isEmpty()) { + 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 (!getEtagBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 12, etag_); + } + if (satisfiesPzs_ != null) { + output.writeMessage(13, getSatisfiesPzs()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (!getDescriptionBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, description_); + } + if (state_ != com.google.cloud.filestore.v1beta1.Instance.State.STATE_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(5, state_); + } + if (!getStatusMessageBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, statusMessage_); + } + if (createTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(7, getCreateTime()); + } + if (tier_ != com.google.cloud.filestore.v1beta1.Instance.Tier.TIER_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(8, tier_); + } + 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(9, labels__); + } + for (int i = 0; i < fileShares_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(10, fileShares_.get(i)); + } + for (int i = 0; i < networks_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(11, networks_.get(i)); + } + if (!getEtagBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(12, etag_); + } + if (satisfiesPzs_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(13, getSatisfiesPzs()); + } + size += unknownFields.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.Instance)) { + return super.equals(obj); + } + com.google.cloud.filestore.v1beta1.Instance other = + (com.google.cloud.filestore.v1beta1.Instance) obj; + + if (!getName().equals(other.getName())) return false; + if (!getDescription().equals(other.getDescription())) return false; + if (state_ != other.state_) return false; + if (!getStatusMessage().equals(other.getStatusMessage())) return false; + if (hasCreateTime() != other.hasCreateTime()) return false; + if (hasCreateTime()) { + if (!getCreateTime().equals(other.getCreateTime())) return false; + } + if (tier_ != other.tier_) return false; + if (!internalGetLabels().equals(other.internalGetLabels())) return false; + if (!getFileSharesList().equals(other.getFileSharesList())) return false; + if (!getNetworksList().equals(other.getNetworksList())) return false; + if (!getEtag().equals(other.getEtag())) return false; + if (hasSatisfiesPzs() != other.hasSatisfiesPzs()) return false; + if (hasSatisfiesPzs()) { + if (!getSatisfiesPzs().equals(other.getSatisfiesPzs())) return false; + } + if (!unknownFields.equals(other.unknownFields)) 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) + DESCRIPTION_FIELD_NUMBER; + hash = (53 * hash) + getDescription().hashCode(); + hash = (37 * hash) + STATE_FIELD_NUMBER; + hash = (53 * hash) + state_; + hash = (37 * hash) + STATUS_MESSAGE_FIELD_NUMBER; + hash = (53 * hash) + getStatusMessage().hashCode(); + if (hasCreateTime()) { + hash = (37 * hash) + CREATE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getCreateTime().hashCode(); + } + hash = (37 * hash) + TIER_FIELD_NUMBER; + hash = (53 * hash) + tier_; + if (!internalGetLabels().getMap().isEmpty()) { + hash = (37 * hash) + LABELS_FIELD_NUMBER; + hash = (53 * hash) + internalGetLabels().hashCode(); + } + if (getFileSharesCount() > 0) { + hash = (37 * hash) + FILE_SHARES_FIELD_NUMBER; + hash = (53 * hash) + getFileSharesList().hashCode(); + } + if (getNetworksCount() > 0) { + hash = (37 * hash) + NETWORKS_FIELD_NUMBER; + hash = (53 * hash) + getNetworksList().hashCode(); + } + hash = (37 * hash) + ETAG_FIELD_NUMBER; + hash = (53 * hash) + getEtag().hashCode(); + if (hasSatisfiesPzs()) { + hash = (37 * hash) + SATISFIES_PZS_FIELD_NUMBER; + hash = (53 * hash) + getSatisfiesPzs().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.filestore.v1beta1.Instance parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.filestore.v1beta1.Instance 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.Instance parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.filestore.v1beta1.Instance 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.Instance parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.filestore.v1beta1.Instance 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.Instance parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.filestore.v1beta1.Instance 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.Instance parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.filestore.v1beta1.Instance 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.Instance 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.Instance 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.Instance 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 Cloud Filestore instance.
+   * 
+ * + * Protobuf type {@code google.cloud.filestore.v1beta1.Instance} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.filestore.v1beta1.Instance) + com.google.cloud.filestore.v1beta1.InstanceOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.filestore.v1beta1.CloudFilestoreServiceProto + .internal_static_google_cloud_filestore_v1beta1_Instance_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 9: + return internalGetLabels(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMutableMapField(int number) { + switch (number) { + case 9: + 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_Instance_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.filestore.v1beta1.Instance.class, + com.google.cloud.filestore.v1beta1.Instance.Builder.class); + } + + // Construct using com.google.cloud.filestore.v1beta1.Instance.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getFileSharesFieldBuilder(); + getNetworksFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + description_ = ""; + + state_ = 0; + + statusMessage_ = ""; + + if (createTimeBuilder_ == null) { + createTime_ = null; + } else { + createTime_ = null; + createTimeBuilder_ = null; + } + tier_ = 0; + + internalGetMutableLabels().clear(); + if (fileSharesBuilder_ == null) { + fileShares_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + } else { + fileSharesBuilder_.clear(); + } + if (networksBuilder_ == null) { + networks_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000004); + } else { + networksBuilder_.clear(); + } + etag_ = ""; + + if (satisfiesPzsBuilder_ == null) { + satisfiesPzs_ = null; + } else { + satisfiesPzs_ = null; + satisfiesPzsBuilder_ = 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_Instance_descriptor; + } + + @java.lang.Override + public com.google.cloud.filestore.v1beta1.Instance getDefaultInstanceForType() { + return com.google.cloud.filestore.v1beta1.Instance.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.filestore.v1beta1.Instance build() { + com.google.cloud.filestore.v1beta1.Instance result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.filestore.v1beta1.Instance buildPartial() { + com.google.cloud.filestore.v1beta1.Instance result = + new com.google.cloud.filestore.v1beta1.Instance(this); + int from_bitField0_ = bitField0_; + result.name_ = name_; + result.description_ = description_; + result.state_ = state_; + result.statusMessage_ = statusMessage_; + if (createTimeBuilder_ == null) { + result.createTime_ = createTime_; + } else { + result.createTime_ = createTimeBuilder_.build(); + } + result.tier_ = tier_; + result.labels_ = internalGetLabels(); + result.labels_.makeImmutable(); + if (fileSharesBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0)) { + fileShares_ = java.util.Collections.unmodifiableList(fileShares_); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.fileShares_ = fileShares_; + } else { + result.fileShares_ = fileSharesBuilder_.build(); + } + if (networksBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0)) { + networks_ = java.util.Collections.unmodifiableList(networks_); + bitField0_ = (bitField0_ & ~0x00000004); + } + result.networks_ = networks_; + } else { + result.networks_ = networksBuilder_.build(); + } + result.etag_ = etag_; + if (satisfiesPzsBuilder_ == null) { + result.satisfiesPzs_ = satisfiesPzs_; + } else { + result.satisfiesPzs_ = satisfiesPzsBuilder_.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.Instance) { + return mergeFrom((com.google.cloud.filestore.v1beta1.Instance) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.filestore.v1beta1.Instance other) { + if (other == com.google.cloud.filestore.v1beta1.Instance.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (!other.getDescription().isEmpty()) { + description_ = other.description_; + onChanged(); + } + if (other.state_ != 0) { + setStateValue(other.getStateValue()); + } + if (!other.getStatusMessage().isEmpty()) { + statusMessage_ = other.statusMessage_; + onChanged(); + } + if (other.hasCreateTime()) { + mergeCreateTime(other.getCreateTime()); + } + if (other.tier_ != 0) { + setTierValue(other.getTierValue()); + } + internalGetMutableLabels().mergeFrom(other.internalGetLabels()); + if (fileSharesBuilder_ == null) { + if (!other.fileShares_.isEmpty()) { + if (fileShares_.isEmpty()) { + fileShares_ = other.fileShares_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureFileSharesIsMutable(); + fileShares_.addAll(other.fileShares_); + } + onChanged(); + } + } else { + if (!other.fileShares_.isEmpty()) { + if (fileSharesBuilder_.isEmpty()) { + fileSharesBuilder_.dispose(); + fileSharesBuilder_ = null; + fileShares_ = other.fileShares_; + bitField0_ = (bitField0_ & ~0x00000002); + fileSharesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getFileSharesFieldBuilder() + : null; + } else { + fileSharesBuilder_.addAllMessages(other.fileShares_); + } + } + } + if (networksBuilder_ == null) { + if (!other.networks_.isEmpty()) { + if (networks_.isEmpty()) { + networks_ = other.networks_; + bitField0_ = (bitField0_ & ~0x00000004); + } else { + ensureNetworksIsMutable(); + networks_.addAll(other.networks_); + } + onChanged(); + } + } else { + if (!other.networks_.isEmpty()) { + if (networksBuilder_.isEmpty()) { + networksBuilder_.dispose(); + networksBuilder_ = null; + networks_ = other.networks_; + bitField0_ = (bitField0_ & ~0x00000004); + networksBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getNetworksFieldBuilder() + : null; + } else { + networksBuilder_.addAllMessages(other.networks_); + } + } + } + if (!other.getEtag().isEmpty()) { + etag_ = other.etag_; + onChanged(); + } + if (other.hasSatisfiesPzs()) { + mergeSatisfiesPzs(other.getSatisfiesPzs()); + } + this.mergeUnknownFields(other.unknownFields); + 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 { + com.google.cloud.filestore.v1beta1.Instance parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.filestore.v1beta1.Instance) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Output only. The resource name of the instance, in the format
+     * projects/{project_id}/locations/{location_id}/instances/{instance_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 instance, in the format
+     * projects/{project_id}/locations/{location_id}/instances/{instance_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 instance, in the format
+     * projects/{project_id}/locations/{location_id}/instances/{instance_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 instance, in the format
+     * projects/{project_id}/locations/{location_id}/instances/{instance_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 instance, in the format
+     * projects/{project_id}/locations/{location_id}/instances/{instance_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 description_ = ""; + /** + * + * + *
+     * The description of the instance (2048 characters or less).
+     * 
+ * + * string description = 2; + * + * @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; + } + } + /** + * + * + *
+     * The description of the instance (2048 characters or less).
+     * 
+ * + * string description = 2; + * + * @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; + } + } + /** + * + * + *
+     * The description of the instance (2048 characters or less).
+     * 
+ * + * string description = 2; + * + * @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; + } + /** + * + * + *
+     * The description of the instance (2048 characters or less).
+     * 
+ * + * string description = 2; + * + * @return This builder for chaining. + */ + public Builder clearDescription() { + + description_ = getDefaultInstance().getDescription(); + onChanged(); + return this; + } + /** + * + * + *
+     * The description of the instance (2048 characters or less).
+     * 
+ * + * string description = 2; + * + * @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 int state_ = 0; + /** + * + * + *
+     * Output only. The instance state.
+     * 
+ * + * + * .google.cloud.filestore.v1beta1.Instance.State state = 5 [(.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 instance state.
+     * 
+ * + * + * .google.cloud.filestore.v1beta1.Instance.State state = 5 [(.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 instance state.
+     * 
+ * + * + * .google.cloud.filestore.v1beta1.Instance.State state = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The state. + */ + @java.lang.Override + public com.google.cloud.filestore.v1beta1.Instance.State getState() { + @SuppressWarnings("deprecation") + com.google.cloud.filestore.v1beta1.Instance.State result = + com.google.cloud.filestore.v1beta1.Instance.State.valueOf(state_); + return result == null + ? com.google.cloud.filestore.v1beta1.Instance.State.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * Output only. The instance state.
+     * 
+ * + * + * .google.cloud.filestore.v1beta1.Instance.State state = 5 [(.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.Instance.State value) { + if (value == null) { + throw new NullPointerException(); + } + + state_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The instance state.
+     * 
+ * + * + * .google.cloud.filestore.v1beta1.Instance.State state = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return This builder for chaining. + */ + public Builder clearState() { + + state_ = 0; + onChanged(); + return this; + } + + private java.lang.Object statusMessage_ = ""; + /** + * + * + *
+     * Output only. Additional information about the instance state, if available.
+     * 
+ * + * string status_message = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The statusMessage. + */ + public java.lang.String getStatusMessage() { + java.lang.Object ref = statusMessage_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + statusMessage_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. Additional information about the instance state, if available.
+     * 
+ * + * string status_message = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for statusMessage. + */ + public com.google.protobuf.ByteString getStatusMessageBytes() { + java.lang.Object ref = statusMessage_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + statusMessage_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. Additional information about the instance state, if available.
+     * 
+ * + * string status_message = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The statusMessage to set. + * @return This builder for chaining. + */ + public Builder setStatusMessage(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + statusMessage_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Additional information about the instance state, if available.
+     * 
+ * + * string status_message = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearStatusMessage() { + + statusMessage_ = getDefaultInstance().getStatusMessage(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Additional information about the instance state, if available.
+     * 
+ * + * string status_message = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for statusMessage to set. + * @return This builder for chaining. + */ + public Builder setStatusMessageBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + statusMessage_ = value; + 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 instance 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 instance 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 instance 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 instance 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 instance 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 instance 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 instance 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 instance 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 instance 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 int tier_ = 0; + /** + * + * + *
+     * The service tier of the instance.
+     * 
+ * + * .google.cloud.filestore.v1beta1.Instance.Tier tier = 8; + * + * @return The enum numeric value on the wire for tier. + */ + @java.lang.Override + public int getTierValue() { + return tier_; + } + /** + * + * + *
+     * The service tier of the instance.
+     * 
+ * + * .google.cloud.filestore.v1beta1.Instance.Tier tier = 8; + * + * @param value The enum numeric value on the wire for tier to set. + * @return This builder for chaining. + */ + public Builder setTierValue(int value) { + + tier_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The service tier of the instance.
+     * 
+ * + * .google.cloud.filestore.v1beta1.Instance.Tier tier = 8; + * + * @return The tier. + */ + @java.lang.Override + public com.google.cloud.filestore.v1beta1.Instance.Tier getTier() { + @SuppressWarnings("deprecation") + com.google.cloud.filestore.v1beta1.Instance.Tier result = + com.google.cloud.filestore.v1beta1.Instance.Tier.valueOf(tier_); + return result == null + ? com.google.cloud.filestore.v1beta1.Instance.Tier.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * The service tier of the instance.
+     * 
+ * + * .google.cloud.filestore.v1beta1.Instance.Tier tier = 8; + * + * @param value The tier to set. + * @return This builder for chaining. + */ + public Builder setTier(com.google.cloud.filestore.v1beta1.Instance.Tier value) { + if (value == null) { + throw new NullPointerException(); + } + + tier_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * The service tier of the instance.
+     * 
+ * + * .google.cloud.filestore.v1beta1.Instance.Tier tier = 8; + * + * @return This builder for chaining. + */ + public Builder clearTier() { + + tier_ = 0; + onChanged(); + return this; + } + + 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 = 9; + */ + @java.lang.Override + public boolean containsLabels(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + 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 = 9; + */ + @java.lang.Override + public java.util.Map getLabelsMap() { + return internalGetLabels().getMap(); + } + /** + * + * + *
+     * Resource labels to represent user provided metadata.
+     * 
+ * + * map<string, string> labels = 9; + */ + @java.lang.Override + public java.lang.String getLabelsOrDefault( + java.lang.String key, java.lang.String defaultValue) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + 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 = 9; + */ + @java.lang.Override + public java.lang.String getLabelsOrThrow(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + 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 = 9; + */ + public Builder removeLabels(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + 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 = 9; + */ + public Builder putLabels(java.lang.String key, java.lang.String value) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + if (value == null) { + throw new java.lang.NullPointerException(); + } + internalGetMutableLabels().getMutableMap().put(key, value); + return this; + } + /** + * + * + *
+     * Resource labels to represent user provided metadata.
+     * 
+ * + * map<string, string> labels = 9; + */ + public Builder putAllLabels(java.util.Map values) { + internalGetMutableLabels().getMutableMap().putAll(values); + return this; + } + + private java.util.List fileShares_ = + java.util.Collections.emptyList(); + + private void ensureFileSharesIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + fileShares_ = + new java.util.ArrayList( + fileShares_); + bitField0_ |= 0x00000002; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.filestore.v1beta1.FileShareConfig, + com.google.cloud.filestore.v1beta1.FileShareConfig.Builder, + com.google.cloud.filestore.v1beta1.FileShareConfigOrBuilder> + fileSharesBuilder_; + + /** + * + * + *
+     * File system shares on the instance.
+     * For this version, only a single file share is supported.
+     * 
+ * + * repeated .google.cloud.filestore.v1beta1.FileShareConfig file_shares = 10; + */ + public java.util.List getFileSharesList() { + if (fileSharesBuilder_ == null) { + return java.util.Collections.unmodifiableList(fileShares_); + } else { + return fileSharesBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * File system shares on the instance.
+     * For this version, only a single file share is supported.
+     * 
+ * + * repeated .google.cloud.filestore.v1beta1.FileShareConfig file_shares = 10; + */ + public int getFileSharesCount() { + if (fileSharesBuilder_ == null) { + return fileShares_.size(); + } else { + return fileSharesBuilder_.getCount(); + } + } + /** + * + * + *
+     * File system shares on the instance.
+     * For this version, only a single file share is supported.
+     * 
+ * + * repeated .google.cloud.filestore.v1beta1.FileShareConfig file_shares = 10; + */ + public com.google.cloud.filestore.v1beta1.FileShareConfig getFileShares(int index) { + if (fileSharesBuilder_ == null) { + return fileShares_.get(index); + } else { + return fileSharesBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * File system shares on the instance.
+     * For this version, only a single file share is supported.
+     * 
+ * + * repeated .google.cloud.filestore.v1beta1.FileShareConfig file_shares = 10; + */ + public Builder setFileShares( + int index, com.google.cloud.filestore.v1beta1.FileShareConfig value) { + if (fileSharesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureFileSharesIsMutable(); + fileShares_.set(index, value); + onChanged(); + } else { + fileSharesBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * File system shares on the instance.
+     * For this version, only a single file share is supported.
+     * 
+ * + * repeated .google.cloud.filestore.v1beta1.FileShareConfig file_shares = 10; + */ + public Builder setFileShares( + int index, com.google.cloud.filestore.v1beta1.FileShareConfig.Builder builderForValue) { + if (fileSharesBuilder_ == null) { + ensureFileSharesIsMutable(); + fileShares_.set(index, builderForValue.build()); + onChanged(); + } else { + fileSharesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * File system shares on the instance.
+     * For this version, only a single file share is supported.
+     * 
+ * + * repeated .google.cloud.filestore.v1beta1.FileShareConfig file_shares = 10; + */ + public Builder addFileShares(com.google.cloud.filestore.v1beta1.FileShareConfig value) { + if (fileSharesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureFileSharesIsMutable(); + fileShares_.add(value); + onChanged(); + } else { + fileSharesBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * File system shares on the instance.
+     * For this version, only a single file share is supported.
+     * 
+ * + * repeated .google.cloud.filestore.v1beta1.FileShareConfig file_shares = 10; + */ + public Builder addFileShares( + int index, com.google.cloud.filestore.v1beta1.FileShareConfig value) { + if (fileSharesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureFileSharesIsMutable(); + fileShares_.add(index, value); + onChanged(); + } else { + fileSharesBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * File system shares on the instance.
+     * For this version, only a single file share is supported.
+     * 
+ * + * repeated .google.cloud.filestore.v1beta1.FileShareConfig file_shares = 10; + */ + public Builder addFileShares( + com.google.cloud.filestore.v1beta1.FileShareConfig.Builder builderForValue) { + if (fileSharesBuilder_ == null) { + ensureFileSharesIsMutable(); + fileShares_.add(builderForValue.build()); + onChanged(); + } else { + fileSharesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * File system shares on the instance.
+     * For this version, only a single file share is supported.
+     * 
+ * + * repeated .google.cloud.filestore.v1beta1.FileShareConfig file_shares = 10; + */ + public Builder addFileShares( + int index, com.google.cloud.filestore.v1beta1.FileShareConfig.Builder builderForValue) { + if (fileSharesBuilder_ == null) { + ensureFileSharesIsMutable(); + fileShares_.add(index, builderForValue.build()); + onChanged(); + } else { + fileSharesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * File system shares on the instance.
+     * For this version, only a single file share is supported.
+     * 
+ * + * repeated .google.cloud.filestore.v1beta1.FileShareConfig file_shares = 10; + */ + public Builder addAllFileShares( + java.lang.Iterable values) { + if (fileSharesBuilder_ == null) { + ensureFileSharesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, fileShares_); + onChanged(); + } else { + fileSharesBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * File system shares on the instance.
+     * For this version, only a single file share is supported.
+     * 
+ * + * repeated .google.cloud.filestore.v1beta1.FileShareConfig file_shares = 10; + */ + public Builder clearFileShares() { + if (fileSharesBuilder_ == null) { + fileShares_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + } else { + fileSharesBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * File system shares on the instance.
+     * For this version, only a single file share is supported.
+     * 
+ * + * repeated .google.cloud.filestore.v1beta1.FileShareConfig file_shares = 10; + */ + public Builder removeFileShares(int index) { + if (fileSharesBuilder_ == null) { + ensureFileSharesIsMutable(); + fileShares_.remove(index); + onChanged(); + } else { + fileSharesBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * File system shares on the instance.
+     * For this version, only a single file share is supported.
+     * 
+ * + * repeated .google.cloud.filestore.v1beta1.FileShareConfig file_shares = 10; + */ + public com.google.cloud.filestore.v1beta1.FileShareConfig.Builder getFileSharesBuilder( + int index) { + return getFileSharesFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * File system shares on the instance.
+     * For this version, only a single file share is supported.
+     * 
+ * + * repeated .google.cloud.filestore.v1beta1.FileShareConfig file_shares = 10; + */ + public com.google.cloud.filestore.v1beta1.FileShareConfigOrBuilder getFileSharesOrBuilder( + int index) { + if (fileSharesBuilder_ == null) { + return fileShares_.get(index); + } else { + return fileSharesBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * File system shares on the instance.
+     * For this version, only a single file share is supported.
+     * 
+ * + * repeated .google.cloud.filestore.v1beta1.FileShareConfig file_shares = 10; + */ + public java.util.List + getFileSharesOrBuilderList() { + if (fileSharesBuilder_ != null) { + return fileSharesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(fileShares_); + } + } + /** + * + * + *
+     * File system shares on the instance.
+     * For this version, only a single file share is supported.
+     * 
+ * + * repeated .google.cloud.filestore.v1beta1.FileShareConfig file_shares = 10; + */ + public com.google.cloud.filestore.v1beta1.FileShareConfig.Builder addFileSharesBuilder() { + return getFileSharesFieldBuilder() + .addBuilder(com.google.cloud.filestore.v1beta1.FileShareConfig.getDefaultInstance()); + } + /** + * + * + *
+     * File system shares on the instance.
+     * For this version, only a single file share is supported.
+     * 
+ * + * repeated .google.cloud.filestore.v1beta1.FileShareConfig file_shares = 10; + */ + public com.google.cloud.filestore.v1beta1.FileShareConfig.Builder addFileSharesBuilder( + int index) { + return getFileSharesFieldBuilder() + .addBuilder( + index, com.google.cloud.filestore.v1beta1.FileShareConfig.getDefaultInstance()); + } + /** + * + * + *
+     * File system shares on the instance.
+     * For this version, only a single file share is supported.
+     * 
+ * + * repeated .google.cloud.filestore.v1beta1.FileShareConfig file_shares = 10; + */ + public java.util.List + getFileSharesBuilderList() { + return getFileSharesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.filestore.v1beta1.FileShareConfig, + com.google.cloud.filestore.v1beta1.FileShareConfig.Builder, + com.google.cloud.filestore.v1beta1.FileShareConfigOrBuilder> + getFileSharesFieldBuilder() { + if (fileSharesBuilder_ == null) { + fileSharesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.filestore.v1beta1.FileShareConfig, + com.google.cloud.filestore.v1beta1.FileShareConfig.Builder, + com.google.cloud.filestore.v1beta1.FileShareConfigOrBuilder>( + fileShares_, ((bitField0_ & 0x00000002) != 0), getParentForChildren(), isClean()); + fileShares_ = null; + } + return fileSharesBuilder_; + } + + private java.util.List networks_ = + java.util.Collections.emptyList(); + + private void ensureNetworksIsMutable() { + if (!((bitField0_ & 0x00000004) != 0)) { + networks_ = + new java.util.ArrayList(networks_); + bitField0_ |= 0x00000004; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.filestore.v1beta1.NetworkConfig, + com.google.cloud.filestore.v1beta1.NetworkConfig.Builder, + com.google.cloud.filestore.v1beta1.NetworkConfigOrBuilder> + networksBuilder_; + + /** + * + * + *
+     * VPC networks to which the instance is connected.
+     * For this version, only a single network is supported.
+     * 
+ * + * repeated .google.cloud.filestore.v1beta1.NetworkConfig networks = 11; + */ + public java.util.List getNetworksList() { + if (networksBuilder_ == null) { + return java.util.Collections.unmodifiableList(networks_); + } else { + return networksBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * VPC networks to which the instance is connected.
+     * For this version, only a single network is supported.
+     * 
+ * + * repeated .google.cloud.filestore.v1beta1.NetworkConfig networks = 11; + */ + public int getNetworksCount() { + if (networksBuilder_ == null) { + return networks_.size(); + } else { + return networksBuilder_.getCount(); + } + } + /** + * + * + *
+     * VPC networks to which the instance is connected.
+     * For this version, only a single network is supported.
+     * 
+ * + * repeated .google.cloud.filestore.v1beta1.NetworkConfig networks = 11; + */ + public com.google.cloud.filestore.v1beta1.NetworkConfig getNetworks(int index) { + if (networksBuilder_ == null) { + return networks_.get(index); + } else { + return networksBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * VPC networks to which the instance is connected.
+     * For this version, only a single network is supported.
+     * 
+ * + * repeated .google.cloud.filestore.v1beta1.NetworkConfig networks = 11; + */ + public Builder setNetworks(int index, com.google.cloud.filestore.v1beta1.NetworkConfig value) { + if (networksBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureNetworksIsMutable(); + networks_.set(index, value); + onChanged(); + } else { + networksBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * VPC networks to which the instance is connected.
+     * For this version, only a single network is supported.
+     * 
+ * + * repeated .google.cloud.filestore.v1beta1.NetworkConfig networks = 11; + */ + public Builder setNetworks( + int index, com.google.cloud.filestore.v1beta1.NetworkConfig.Builder builderForValue) { + if (networksBuilder_ == null) { + ensureNetworksIsMutable(); + networks_.set(index, builderForValue.build()); + onChanged(); + } else { + networksBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * VPC networks to which the instance is connected.
+     * For this version, only a single network is supported.
+     * 
+ * + * repeated .google.cloud.filestore.v1beta1.NetworkConfig networks = 11; + */ + public Builder addNetworks(com.google.cloud.filestore.v1beta1.NetworkConfig value) { + if (networksBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureNetworksIsMutable(); + networks_.add(value); + onChanged(); + } else { + networksBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * VPC networks to which the instance is connected.
+     * For this version, only a single network is supported.
+     * 
+ * + * repeated .google.cloud.filestore.v1beta1.NetworkConfig networks = 11; + */ + public Builder addNetworks(int index, com.google.cloud.filestore.v1beta1.NetworkConfig value) { + if (networksBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureNetworksIsMutable(); + networks_.add(index, value); + onChanged(); + } else { + networksBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * VPC networks to which the instance is connected.
+     * For this version, only a single network is supported.
+     * 
+ * + * repeated .google.cloud.filestore.v1beta1.NetworkConfig networks = 11; + */ + public Builder addNetworks( + com.google.cloud.filestore.v1beta1.NetworkConfig.Builder builderForValue) { + if (networksBuilder_ == null) { + ensureNetworksIsMutable(); + networks_.add(builderForValue.build()); + onChanged(); + } else { + networksBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * VPC networks to which the instance is connected.
+     * For this version, only a single network is supported.
+     * 
+ * + * repeated .google.cloud.filestore.v1beta1.NetworkConfig networks = 11; + */ + public Builder addNetworks( + int index, com.google.cloud.filestore.v1beta1.NetworkConfig.Builder builderForValue) { + if (networksBuilder_ == null) { + ensureNetworksIsMutable(); + networks_.add(index, builderForValue.build()); + onChanged(); + } else { + networksBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * VPC networks to which the instance is connected.
+     * For this version, only a single network is supported.
+     * 
+ * + * repeated .google.cloud.filestore.v1beta1.NetworkConfig networks = 11; + */ + public Builder addAllNetworks( + java.lang.Iterable values) { + if (networksBuilder_ == null) { + ensureNetworksIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, networks_); + onChanged(); + } else { + networksBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * VPC networks to which the instance is connected.
+     * For this version, only a single network is supported.
+     * 
+ * + * repeated .google.cloud.filestore.v1beta1.NetworkConfig networks = 11; + */ + public Builder clearNetworks() { + if (networksBuilder_ == null) { + networks_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + } else { + networksBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * VPC networks to which the instance is connected.
+     * For this version, only a single network is supported.
+     * 
+ * + * repeated .google.cloud.filestore.v1beta1.NetworkConfig networks = 11; + */ + public Builder removeNetworks(int index) { + if (networksBuilder_ == null) { + ensureNetworksIsMutable(); + networks_.remove(index); + onChanged(); + } else { + networksBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * VPC networks to which the instance is connected.
+     * For this version, only a single network is supported.
+     * 
+ * + * repeated .google.cloud.filestore.v1beta1.NetworkConfig networks = 11; + */ + public com.google.cloud.filestore.v1beta1.NetworkConfig.Builder getNetworksBuilder(int index) { + return getNetworksFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * VPC networks to which the instance is connected.
+     * For this version, only a single network is supported.
+     * 
+ * + * repeated .google.cloud.filestore.v1beta1.NetworkConfig networks = 11; + */ + public com.google.cloud.filestore.v1beta1.NetworkConfigOrBuilder getNetworksOrBuilder( + int index) { + if (networksBuilder_ == null) { + return networks_.get(index); + } else { + return networksBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * VPC networks to which the instance is connected.
+     * For this version, only a single network is supported.
+     * 
+ * + * repeated .google.cloud.filestore.v1beta1.NetworkConfig networks = 11; + */ + public java.util.List + getNetworksOrBuilderList() { + if (networksBuilder_ != null) { + return networksBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(networks_); + } + } + /** + * + * + *
+     * VPC networks to which the instance is connected.
+     * For this version, only a single network is supported.
+     * 
+ * + * repeated .google.cloud.filestore.v1beta1.NetworkConfig networks = 11; + */ + public com.google.cloud.filestore.v1beta1.NetworkConfig.Builder addNetworksBuilder() { + return getNetworksFieldBuilder() + .addBuilder(com.google.cloud.filestore.v1beta1.NetworkConfig.getDefaultInstance()); + } + /** + * + * + *
+     * VPC networks to which the instance is connected.
+     * For this version, only a single network is supported.
+     * 
+ * + * repeated .google.cloud.filestore.v1beta1.NetworkConfig networks = 11; + */ + public com.google.cloud.filestore.v1beta1.NetworkConfig.Builder addNetworksBuilder(int index) { + return getNetworksFieldBuilder() + .addBuilder(index, com.google.cloud.filestore.v1beta1.NetworkConfig.getDefaultInstance()); + } + /** + * + * + *
+     * VPC networks to which the instance is connected.
+     * For this version, only a single network is supported.
+     * 
+ * + * repeated .google.cloud.filestore.v1beta1.NetworkConfig networks = 11; + */ + public java.util.List + getNetworksBuilderList() { + return getNetworksFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.filestore.v1beta1.NetworkConfig, + com.google.cloud.filestore.v1beta1.NetworkConfig.Builder, + com.google.cloud.filestore.v1beta1.NetworkConfigOrBuilder> + getNetworksFieldBuilder() { + if (networksBuilder_ == null) { + networksBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.filestore.v1beta1.NetworkConfig, + com.google.cloud.filestore.v1beta1.NetworkConfig.Builder, + com.google.cloud.filestore.v1beta1.NetworkConfigOrBuilder>( + networks_, ((bitField0_ & 0x00000004) != 0), getParentForChildren(), isClean()); + networks_ = null; + } + return networksBuilder_; + } + + private java.lang.Object etag_ = ""; + /** + * + * + *
+     * Server-specified ETag for the instance resource to prevent simultaneous
+     * updates from overwriting each other.
+     * 
+ * + * string etag = 12; + * + * @return The etag. + */ + public java.lang.String getEtag() { + java.lang.Object ref = etag_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + etag_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Server-specified ETag for the instance resource to prevent simultaneous
+     * updates from overwriting each other.
+     * 
+ * + * string etag = 12; + * + * @return The bytes for etag. + */ + public com.google.protobuf.ByteString getEtagBytes() { + java.lang.Object ref = etag_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + etag_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Server-specified ETag for the instance resource to prevent simultaneous
+     * updates from overwriting each other.
+     * 
+ * + * string etag = 12; + * + * @param value The etag to set. + * @return This builder for chaining. + */ + public Builder setEtag(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + etag_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Server-specified ETag for the instance resource to prevent simultaneous
+     * updates from overwriting each other.
+     * 
+ * + * string etag = 12; + * + * @return This builder for chaining. + */ + public Builder clearEtag() { + + etag_ = getDefaultInstance().getEtag(); + onChanged(); + return this; + } + /** + * + * + *
+     * Server-specified ETag for the instance resource to prevent simultaneous
+     * updates from overwriting each other.
+     * 
+ * + * string etag = 12; + * + * @param value The bytes for etag to set. + * @return This builder for chaining. + */ + public Builder setEtagBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + etag_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.BoolValue satisfiesPzs_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder> + satisfiesPzsBuilder_; + /** + * + * + *
+     * Output only. Reserved for future use.
+     * 
+ * + * + * .google.protobuf.BoolValue satisfies_pzs = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the satisfiesPzs field is set. + */ + public boolean hasSatisfiesPzs() { + return satisfiesPzsBuilder_ != null || satisfiesPzs_ != null; + } + /** + * + * + *
+     * Output only. Reserved for future use.
+     * 
+ * + * + * .google.protobuf.BoolValue satisfies_pzs = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The satisfiesPzs. + */ + public com.google.protobuf.BoolValue getSatisfiesPzs() { + if (satisfiesPzsBuilder_ == null) { + return satisfiesPzs_ == null + ? com.google.protobuf.BoolValue.getDefaultInstance() + : satisfiesPzs_; + } else { + return satisfiesPzsBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Output only. Reserved for future use.
+     * 
+ * + * + * .google.protobuf.BoolValue satisfies_pzs = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setSatisfiesPzs(com.google.protobuf.BoolValue value) { + if (satisfiesPzsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + satisfiesPzs_ = value; + onChanged(); + } else { + satisfiesPzsBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Output only. Reserved for future use.
+     * 
+ * + * + * .google.protobuf.BoolValue satisfies_pzs = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setSatisfiesPzs(com.google.protobuf.BoolValue.Builder builderForValue) { + if (satisfiesPzsBuilder_ == null) { + satisfiesPzs_ = builderForValue.build(); + onChanged(); + } else { + satisfiesPzsBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Output only. Reserved for future use.
+     * 
+ * + * + * .google.protobuf.BoolValue satisfies_pzs = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeSatisfiesPzs(com.google.protobuf.BoolValue value) { + if (satisfiesPzsBuilder_ == null) { + if (satisfiesPzs_ != null) { + satisfiesPzs_ = + com.google.protobuf.BoolValue.newBuilder(satisfiesPzs_) + .mergeFrom(value) + .buildPartial(); + } else { + satisfiesPzs_ = value; + } + onChanged(); + } else { + satisfiesPzsBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Output only. Reserved for future use.
+     * 
+ * + * + * .google.protobuf.BoolValue satisfies_pzs = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearSatisfiesPzs() { + if (satisfiesPzsBuilder_ == null) { + satisfiesPzs_ = null; + onChanged(); + } else { + satisfiesPzs_ = null; + satisfiesPzsBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Output only. Reserved for future use.
+     * 
+ * + * + * .google.protobuf.BoolValue satisfies_pzs = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.BoolValue.Builder getSatisfiesPzsBuilder() { + + onChanged(); + return getSatisfiesPzsFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. Reserved for future use.
+     * 
+ * + * + * .google.protobuf.BoolValue satisfies_pzs = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.BoolValueOrBuilder getSatisfiesPzsOrBuilder() { + if (satisfiesPzsBuilder_ != null) { + return satisfiesPzsBuilder_.getMessageOrBuilder(); + } else { + return satisfiesPzs_ == null + ? com.google.protobuf.BoolValue.getDefaultInstance() + : satisfiesPzs_; + } + } + /** + * + * + *
+     * Output only. Reserved for future use.
+     * 
+ * + * + * .google.protobuf.BoolValue satisfies_pzs = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder> + getSatisfiesPzsFieldBuilder() { + if (satisfiesPzsBuilder_ == null) { + satisfiesPzsBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.BoolValue, + com.google.protobuf.BoolValue.Builder, + com.google.protobuf.BoolValueOrBuilder>( + getSatisfiesPzs(), getParentForChildren(), isClean()); + satisfiesPzs_ = null; + } + return satisfiesPzsBuilder_; + } + + @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.Instance) + } + + // @@protoc_insertion_point(class_scope:google.cloud.filestore.v1beta1.Instance) + private static final com.google.cloud.filestore.v1beta1.Instance DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.filestore.v1beta1.Instance(); + } + + public static com.google.cloud.filestore.v1beta1.Instance getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Instance parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Instance(input, extensionRegistry); + } + }; + + 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.Instance getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/InstanceName.java b/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/InstanceName.java new file mode 100644 index 00000000..b1240eb1 --- /dev/null +++ b/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/InstanceName.java @@ -0,0 +1,223 @@ +/* + * Copyright 2021 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 InstanceName implements ResourceName { + private static final PathTemplate PROJECT_LOCATION_INSTANCE = + PathTemplate.createWithoutUrlEncoding( + "projects/{project}/locations/{location}/instances/{instance}"); + private volatile Map fieldValuesMap; + private final String project; + private final String location; + private final String instance; + + @Deprecated + protected InstanceName() { + project = null; + location = null; + instance = null; + } + + private InstanceName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + location = Preconditions.checkNotNull(builder.getLocation()); + instance = Preconditions.checkNotNull(builder.getInstance()); + } + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getInstance() { + return instance; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static InstanceName of(String project, String location, String instance) { + return newBuilder().setProject(project).setLocation(location).setInstance(instance).build(); + } + + public static String format(String project, String location, String instance) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setInstance(instance) + .build() + .toString(); + } + + public static InstanceName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PROJECT_LOCATION_INSTANCE.validatedMatch( + formattedString, "InstanceName.parse: formattedString not in valid format"); + return of(matchMap.get("project"), matchMap.get("location"), matchMap.get("instance")); + } + + 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 (InstanceName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PROJECT_LOCATION_INSTANCE.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); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return PROJECT_LOCATION_INSTANCE.instantiate( + "project", project, "location", location, "instance", instance); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null || getClass() == o.getClass()) { + InstanceName that = ((InstanceName) o); + return Objects.equals(this.project, that.project) + && Objects.equals(this.location, that.location) + && Objects.equals(this.instance, that.instance); + } + 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); + return h; + } + + /** Builder for projects/{project}/locations/{location}/instances/{instance}. */ + public static class Builder { + private String project; + private String location; + private String instance; + + protected Builder() {} + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getInstance() { + return instance; + } + + 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; + } + + private Builder(InstanceName instanceName) { + this.project = instanceName.project; + this.location = instanceName.location; + this.instance = instanceName.instance; + } + + public InstanceName build() { + return new InstanceName(this); + } + } +} diff --git a/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/InstanceOrBuilder.java b/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/InstanceOrBuilder.java new file mode 100644 index 00000000..5efb7a0e --- /dev/null +++ b/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/InstanceOrBuilder.java @@ -0,0 +1,430 @@ +/* + * 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 InstanceOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.filestore.v1beta1.Instance) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Output only. The resource name of the instance, in the format
+   * projects/{project_id}/locations/{location_id}/instances/{instance_id}.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Output only. The resource name of the instance, in the format
+   * projects/{project_id}/locations/{location_id}/instances/{instance_id}.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * The description of the instance (2048 characters or less).
+   * 
+ * + * string description = 2; + * + * @return The description. + */ + java.lang.String getDescription(); + /** + * + * + *
+   * The description of the instance (2048 characters or less).
+   * 
+ * + * string description = 2; + * + * @return The bytes for description. + */ + com.google.protobuf.ByteString getDescriptionBytes(); + + /** + * + * + *
+   * Output only. The instance state.
+   * 
+ * + * + * .google.cloud.filestore.v1beta1.Instance.State state = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for state. + */ + int getStateValue(); + /** + * + * + *
+   * Output only. The instance state.
+   * 
+ * + * + * .google.cloud.filestore.v1beta1.Instance.State state = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The state. + */ + com.google.cloud.filestore.v1beta1.Instance.State getState(); + + /** + * + * + *
+   * Output only. Additional information about the instance state, if available.
+   * 
+ * + * string status_message = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The statusMessage. + */ + java.lang.String getStatusMessage(); + /** + * + * + *
+   * Output only. Additional information about the instance state, if available.
+   * 
+ * + * string status_message = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for statusMessage. + */ + com.google.protobuf.ByteString getStatusMessageBytes(); + + /** + * + * + *
+   * Output only. The time when the instance 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 instance 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 instance was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder(); + + /** + * + * + *
+   * The service tier of the instance.
+   * 
+ * + * .google.cloud.filestore.v1beta1.Instance.Tier tier = 8; + * + * @return The enum numeric value on the wire for tier. + */ + int getTierValue(); + /** + * + * + *
+   * The service tier of the instance.
+   * 
+ * + * .google.cloud.filestore.v1beta1.Instance.Tier tier = 8; + * + * @return The tier. + */ + com.google.cloud.filestore.v1beta1.Instance.Tier getTier(); + + /** + * + * + *
+   * Resource labels to represent user provided metadata.
+   * 
+ * + * map<string, string> labels = 9; + */ + int getLabelsCount(); + /** + * + * + *
+   * Resource labels to represent user provided metadata.
+   * 
+ * + * map<string, string> labels = 9; + */ + 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 = 9; + */ + java.util.Map getLabelsMap(); + /** + * + * + *
+   * Resource labels to represent user provided metadata.
+   * 
+ * + * map<string, string> labels = 9; + */ + java.lang.String getLabelsOrDefault(java.lang.String key, java.lang.String defaultValue); + /** + * + * + *
+   * Resource labels to represent user provided metadata.
+   * 
+ * + * map<string, string> labels = 9; + */ + java.lang.String getLabelsOrThrow(java.lang.String key); + + /** + * + * + *
+   * File system shares on the instance.
+   * For this version, only a single file share is supported.
+   * 
+ * + * repeated .google.cloud.filestore.v1beta1.FileShareConfig file_shares = 10; + */ + java.util.List getFileSharesList(); + /** + * + * + *
+   * File system shares on the instance.
+   * For this version, only a single file share is supported.
+   * 
+ * + * repeated .google.cloud.filestore.v1beta1.FileShareConfig file_shares = 10; + */ + com.google.cloud.filestore.v1beta1.FileShareConfig getFileShares(int index); + /** + * + * + *
+   * File system shares on the instance.
+   * For this version, only a single file share is supported.
+   * 
+ * + * repeated .google.cloud.filestore.v1beta1.FileShareConfig file_shares = 10; + */ + int getFileSharesCount(); + /** + * + * + *
+   * File system shares on the instance.
+   * For this version, only a single file share is supported.
+   * 
+ * + * repeated .google.cloud.filestore.v1beta1.FileShareConfig file_shares = 10; + */ + java.util.List + getFileSharesOrBuilderList(); + /** + * + * + *
+   * File system shares on the instance.
+   * For this version, only a single file share is supported.
+   * 
+ * + * repeated .google.cloud.filestore.v1beta1.FileShareConfig file_shares = 10; + */ + com.google.cloud.filestore.v1beta1.FileShareConfigOrBuilder getFileSharesOrBuilder(int index); + + /** + * + * + *
+   * VPC networks to which the instance is connected.
+   * For this version, only a single network is supported.
+   * 
+ * + * repeated .google.cloud.filestore.v1beta1.NetworkConfig networks = 11; + */ + java.util.List getNetworksList(); + /** + * + * + *
+   * VPC networks to which the instance is connected.
+   * For this version, only a single network is supported.
+   * 
+ * + * repeated .google.cloud.filestore.v1beta1.NetworkConfig networks = 11; + */ + com.google.cloud.filestore.v1beta1.NetworkConfig getNetworks(int index); + /** + * + * + *
+   * VPC networks to which the instance is connected.
+   * For this version, only a single network is supported.
+   * 
+ * + * repeated .google.cloud.filestore.v1beta1.NetworkConfig networks = 11; + */ + int getNetworksCount(); + /** + * + * + *
+   * VPC networks to which the instance is connected.
+   * For this version, only a single network is supported.
+   * 
+ * + * repeated .google.cloud.filestore.v1beta1.NetworkConfig networks = 11; + */ + java.util.List + getNetworksOrBuilderList(); + /** + * + * + *
+   * VPC networks to which the instance is connected.
+   * For this version, only a single network is supported.
+   * 
+ * + * repeated .google.cloud.filestore.v1beta1.NetworkConfig networks = 11; + */ + com.google.cloud.filestore.v1beta1.NetworkConfigOrBuilder getNetworksOrBuilder(int index); + + /** + * + * + *
+   * Server-specified ETag for the instance resource to prevent simultaneous
+   * updates from overwriting each other.
+   * 
+ * + * string etag = 12; + * + * @return The etag. + */ + java.lang.String getEtag(); + /** + * + * + *
+   * Server-specified ETag for the instance resource to prevent simultaneous
+   * updates from overwriting each other.
+   * 
+ * + * string etag = 12; + * + * @return The bytes for etag. + */ + com.google.protobuf.ByteString getEtagBytes(); + + /** + * + * + *
+   * Output only. Reserved for future use.
+   * 
+ * + * + * .google.protobuf.BoolValue satisfies_pzs = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the satisfiesPzs field is set. + */ + boolean hasSatisfiesPzs(); + /** + * + * + *
+   * Output only. Reserved for future use.
+   * 
+ * + * + * .google.protobuf.BoolValue satisfies_pzs = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The satisfiesPzs. + */ + com.google.protobuf.BoolValue getSatisfiesPzs(); + /** + * + * + *
+   * Output only. Reserved for future use.
+   * 
+ * + * + * .google.protobuf.BoolValue satisfies_pzs = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.BoolValueOrBuilder getSatisfiesPzsOrBuilder(); +} diff --git a/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/ListBackupsRequest.java b/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/ListBackupsRequest.java new file mode 100644 index 00000000..618f0e58 --- /dev/null +++ b/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/ListBackupsRequest.java @@ -0,0 +1,1320 @@ +/* + * 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; + +/** + * + * + *
+ * ListBackupsRequest lists backups.
+ * 
+ * + * Protobuf type {@code google.cloud.filestore.v1beta1.ListBackupsRequest} + */ +public final class ListBackupsRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.filestore.v1beta1.ListBackupsRequest) + ListBackupsRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListBackupsRequest.newBuilder() to construct. + private ListBackupsRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListBackupsRequest() { + parent_ = ""; + pageToken_ = ""; + orderBy_ = ""; + filter_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListBackupsRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ListBackupsRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + parent_ = s; + break; + } + case 16: + { + pageSize_ = input.readInt32(); + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + + pageToken_ = s; + break; + } + case 34: + { + java.lang.String s = input.readStringRequireUtf8(); + + orderBy_ = s; + break; + } + case 42: + { + java.lang.String s = input.readStringRequireUtf8(); + + filter_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.filestore.v1beta1.CloudFilestoreServiceProto + .internal_static_google_cloud_filestore_v1beta1_ListBackupsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.filestore.v1beta1.CloudFilestoreServiceProto + .internal_static_google_cloud_filestore_v1beta1_ListBackupsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.filestore.v1beta1.ListBackupsRequest.class, + com.google.cloud.filestore.v1beta1.ListBackupsRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object 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.
+   * 
+ * + * + * 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 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.
+   * 
+ * + * + * 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 (!getParentBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (pageSize_ != 0) { + output.writeInt32(2, pageSize_); + } + if (!getPageTokenBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, pageToken_); + } + if (!getOrderByBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, orderBy_); + } + if (!getFilterBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, filter_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getParentBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (pageSize_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(2, pageSize_); + } + if (!getPageTokenBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, pageToken_); + } + if (!getOrderByBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, orderBy_); + } + if (!getFilterBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, filter_); + } + size += unknownFields.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.ListBackupsRequest)) { + return super.equals(obj); + } + com.google.cloud.filestore.v1beta1.ListBackupsRequest other = + (com.google.cloud.filestore.v1beta1.ListBackupsRequest) 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 (!unknownFields.equals(other.unknownFields)) 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) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.filestore.v1beta1.ListBackupsRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.filestore.v1beta1.ListBackupsRequest 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.ListBackupsRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.filestore.v1beta1.ListBackupsRequest 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.ListBackupsRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.filestore.v1beta1.ListBackupsRequest 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.ListBackupsRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.filestore.v1beta1.ListBackupsRequest 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.ListBackupsRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.filestore.v1beta1.ListBackupsRequest 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.ListBackupsRequest 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.ListBackupsRequest 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.ListBackupsRequest 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; + } + /** + * + * + *
+   * ListBackupsRequest lists backups.
+   * 
+ * + * Protobuf type {@code google.cloud.filestore.v1beta1.ListBackupsRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.filestore.v1beta1.ListBackupsRequest) + com.google.cloud.filestore.v1beta1.ListBackupsRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.filestore.v1beta1.CloudFilestoreServiceProto + .internal_static_google_cloud_filestore_v1beta1_ListBackupsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.filestore.v1beta1.CloudFilestoreServiceProto + .internal_static_google_cloud_filestore_v1beta1_ListBackupsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.filestore.v1beta1.ListBackupsRequest.class, + com.google.cloud.filestore.v1beta1.ListBackupsRequest.Builder.class); + } + + // Construct using com.google.cloud.filestore.v1beta1.ListBackupsRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @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_ListBackupsRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.filestore.v1beta1.ListBackupsRequest getDefaultInstanceForType() { + return com.google.cloud.filestore.v1beta1.ListBackupsRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.filestore.v1beta1.ListBackupsRequest build() { + com.google.cloud.filestore.v1beta1.ListBackupsRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.filestore.v1beta1.ListBackupsRequest buildPartial() { + com.google.cloud.filestore.v1beta1.ListBackupsRequest result = + new com.google.cloud.filestore.v1beta1.ListBackupsRequest(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.ListBackupsRequest) { + return mergeFrom((com.google.cloud.filestore.v1beta1.ListBackupsRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.filestore.v1beta1.ListBackupsRequest other) { + if (other == com.google.cloud.filestore.v1beta1.ListBackupsRequest.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.unknownFields); + 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 { + com.google.cloud.filestore.v1beta1.ListBackupsRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.filestore.v1beta1.ListBackupsRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object 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.
+     * 
+ * + * + * 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 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.
+     * 
+ * + * + * 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 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.
+     * 
+ * + * + * 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 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.
+     * 
+ * + * + * 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 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.
+     * 
+ * + * + * 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.ListBackupsRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.filestore.v1beta1.ListBackupsRequest) + private static final com.google.cloud.filestore.v1beta1.ListBackupsRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.filestore.v1beta1.ListBackupsRequest(); + } + + public static com.google.cloud.filestore.v1beta1.ListBackupsRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListBackupsRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListBackupsRequest(input, extensionRegistry); + } + }; + + 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.ListBackupsRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/ListBackupsRequestOrBuilder.java b/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/ListBackupsRequestOrBuilder.java new file mode 100644 index 00000000..ab086f15 --- /dev/null +++ b/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/ListBackupsRequestOrBuilder.java @@ -0,0 +1,154 @@ +/* + * 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 ListBackupsRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.filestore.v1beta1.ListBackupsRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * 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.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + 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,
+   * for example **us-west1**.
+   * To retrieve backup information for all locations, use "-" for the
+   * {location} value.
+   * 
+ * + * + * 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/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/ListBackupsResponse.java b/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/ListBackupsResponse.java new file mode 100644 index 00000000..60862ea1 --- /dev/null +++ b/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/ListBackupsResponse.java @@ -0,0 +1,1527 @@ +/* + * 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; + +/** + * + * + *
+ * ListBackupsResponse is the result of ListBackupsRequest.
+ * 
+ * + * Protobuf type {@code google.cloud.filestore.v1beta1.ListBackupsResponse} + */ +public final class ListBackupsResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.filestore.v1beta1.ListBackupsResponse) + ListBackupsResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListBackupsResponse.newBuilder() to construct. + private ListBackupsResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListBackupsResponse() { + backups_ = 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 ListBackupsResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ListBackupsResponse( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + backups_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + backups_.add( + input.readMessage( + com.google.cloud.filestore.v1beta1.Backup.parser(), extensionRegistry)); + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + nextPageToken_ = s; + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000002) != 0)) { + unreachable_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000002; + } + unreachable_.add(s); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + backups_ = java.util.Collections.unmodifiableList(backups_); + } + if (((mutable_bitField0_ & 0x00000002) != 0)) { + unreachable_ = unreachable_.getUnmodifiableView(); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.filestore.v1beta1.CloudFilestoreServiceProto + .internal_static_google_cloud_filestore_v1beta1_ListBackupsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.filestore.v1beta1.CloudFilestoreServiceProto + .internal_static_google_cloud_filestore_v1beta1_ListBackupsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.filestore.v1beta1.ListBackupsResponse.class, + com.google.cloud.filestore.v1beta1.ListBackupsResponse.Builder.class); + } + + public static final int BACKUPS_FIELD_NUMBER = 1; + private java.util.List backups_; + /** + * + * + *
+   * A list of backups in the project for the specified location.
+   * If the {location} value in the request is "-", the response contains a list
+   * of backups from all locations. If any location is unreachable, the
+   * response will only return backups in reachable locations and the
+   * "unreachable" field will be populated with a list of unreachable
+   * locations.
+   * 
+ * + * repeated .google.cloud.filestore.v1beta1.Backup backups = 1; + */ + @java.lang.Override + public java.util.List getBackupsList() { + return backups_; + } + /** + * + * + *
+   * A list of backups in the project for the specified location.
+   * If the {location} value in the request is "-", the response contains a list
+   * of backups from all locations. If any location is unreachable, the
+   * response will only return backups in reachable locations and the
+   * "unreachable" field will be populated with a list of unreachable
+   * locations.
+   * 
+ * + * repeated .google.cloud.filestore.v1beta1.Backup backups = 1; + */ + @java.lang.Override + public java.util.List + getBackupsOrBuilderList() { + return backups_; + } + /** + * + * + *
+   * A list of backups in the project for the specified location.
+   * If the {location} value in the request is "-", the response contains a list
+   * of backups from all locations. If any location is unreachable, the
+   * response will only return backups in reachable locations and the
+   * "unreachable" field will be populated with a list of unreachable
+   * locations.
+   * 
+ * + * repeated .google.cloud.filestore.v1beta1.Backup backups = 1; + */ + @java.lang.Override + public int getBackupsCount() { + return backups_.size(); + } + /** + * + * + *
+   * A list of backups in the project for the specified location.
+   * If the {location} value in the request is "-", the response contains a list
+   * of backups from all locations. If any location is unreachable, the
+   * response will only return backups in reachable locations and the
+   * "unreachable" field will be populated with a list of unreachable
+   * locations.
+   * 
+ * + * repeated .google.cloud.filestore.v1beta1.Backup backups = 1; + */ + @java.lang.Override + public com.google.cloud.filestore.v1beta1.Backup getBackups(int index) { + return backups_.get(index); + } + /** + * + * + *
+   * A list of backups in the project for the specified location.
+   * If the {location} value in the request is "-", the response contains a list
+   * of backups from all locations. If any location is unreachable, the
+   * response will only return backups in reachable locations and the
+   * "unreachable" field will be populated with a list of unreachable
+   * locations.
+   * 
+ * + * repeated .google.cloud.filestore.v1beta1.Backup backups = 1; + */ + @java.lang.Override + public com.google.cloud.filestore.v1beta1.BackupOrBuilder getBackupsOrBuilder(int index) { + return backups_.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 < backups_.size(); i++) { + output.writeMessage(1, backups_.get(i)); + } + if (!getNextPageTokenBytes().isEmpty()) { + 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)); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < backups_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, backups_.get(i)); + } + if (!getNextPageTokenBytes().isEmpty()) { + 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 += unknownFields.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.ListBackupsResponse)) { + return super.equals(obj); + } + com.google.cloud.filestore.v1beta1.ListBackupsResponse other = + (com.google.cloud.filestore.v1beta1.ListBackupsResponse) obj; + + if (!getBackupsList().equals(other.getBackupsList())) return false; + if (!getNextPageToken().equals(other.getNextPageToken())) return false; + if (!getUnreachableList().equals(other.getUnreachableList())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getBackupsCount() > 0) { + hash = (37 * hash) + BACKUPS_FIELD_NUMBER; + hash = (53 * hash) + getBackupsList().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) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.filestore.v1beta1.ListBackupsResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.filestore.v1beta1.ListBackupsResponse 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.ListBackupsResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.filestore.v1beta1.ListBackupsResponse 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.ListBackupsResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.filestore.v1beta1.ListBackupsResponse 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.ListBackupsResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.filestore.v1beta1.ListBackupsResponse 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.ListBackupsResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.filestore.v1beta1.ListBackupsResponse 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.ListBackupsResponse 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.ListBackupsResponse 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.ListBackupsResponse 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; + } + /** + * + * + *
+   * ListBackupsResponse is the result of ListBackupsRequest.
+   * 
+ * + * Protobuf type {@code google.cloud.filestore.v1beta1.ListBackupsResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.filestore.v1beta1.ListBackupsResponse) + com.google.cloud.filestore.v1beta1.ListBackupsResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.filestore.v1beta1.CloudFilestoreServiceProto + .internal_static_google_cloud_filestore_v1beta1_ListBackupsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.filestore.v1beta1.CloudFilestoreServiceProto + .internal_static_google_cloud_filestore_v1beta1_ListBackupsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.filestore.v1beta1.ListBackupsResponse.class, + com.google.cloud.filestore.v1beta1.ListBackupsResponse.Builder.class); + } + + // Construct using com.google.cloud.filestore.v1beta1.ListBackupsResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getBackupsFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (backupsBuilder_ == null) { + backups_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + backupsBuilder_.clear(); + } + 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_ListBackupsResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.filestore.v1beta1.ListBackupsResponse getDefaultInstanceForType() { + return com.google.cloud.filestore.v1beta1.ListBackupsResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.filestore.v1beta1.ListBackupsResponse build() { + com.google.cloud.filestore.v1beta1.ListBackupsResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.filestore.v1beta1.ListBackupsResponse buildPartial() { + com.google.cloud.filestore.v1beta1.ListBackupsResponse result = + new com.google.cloud.filestore.v1beta1.ListBackupsResponse(this); + int from_bitField0_ = bitField0_; + if (backupsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + backups_ = java.util.Collections.unmodifiableList(backups_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.backups_ = backups_; + } else { + result.backups_ = backupsBuilder_.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.ListBackupsResponse) { + return mergeFrom((com.google.cloud.filestore.v1beta1.ListBackupsResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.filestore.v1beta1.ListBackupsResponse other) { + if (other == com.google.cloud.filestore.v1beta1.ListBackupsResponse.getDefaultInstance()) + return this; + if (backupsBuilder_ == null) { + if (!other.backups_.isEmpty()) { + if (backups_.isEmpty()) { + backups_ = other.backups_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureBackupsIsMutable(); + backups_.addAll(other.backups_); + } + onChanged(); + } + } else { + if (!other.backups_.isEmpty()) { + if (backupsBuilder_.isEmpty()) { + backupsBuilder_.dispose(); + backupsBuilder_ = null; + backups_ = other.backups_; + bitField0_ = (bitField0_ & ~0x00000001); + backupsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getBackupsFieldBuilder() + : null; + } else { + backupsBuilder_.addAllMessages(other.backups_); + } + } + } + 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.unknownFields); + 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 { + com.google.cloud.filestore.v1beta1.ListBackupsResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.filestore.v1beta1.ListBackupsResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.util.List backups_ = + java.util.Collections.emptyList(); + + private void ensureBackupsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + backups_ = new java.util.ArrayList(backups_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.filestore.v1beta1.Backup, + com.google.cloud.filestore.v1beta1.Backup.Builder, + com.google.cloud.filestore.v1beta1.BackupOrBuilder> + backupsBuilder_; + + /** + * + * + *
+     * A list of backups in the project for the specified location.
+     * If the {location} value in the request is "-", the response contains a list
+     * of backups from all locations. If any location is unreachable, the
+     * response will only return backups in reachable locations and the
+     * "unreachable" field will be populated with a list of unreachable
+     * locations.
+     * 
+ * + * repeated .google.cloud.filestore.v1beta1.Backup backups = 1; + */ + public java.util.List getBackupsList() { + if (backupsBuilder_ == null) { + return java.util.Collections.unmodifiableList(backups_); + } else { + return backupsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * A list of backups in the project for the specified location.
+     * If the {location} value in the request is "-", the response contains a list
+     * of backups from all locations. If any location is unreachable, the
+     * response will only return backups in reachable locations and the
+     * "unreachable" field will be populated with a list of unreachable
+     * locations.
+     * 
+ * + * repeated .google.cloud.filestore.v1beta1.Backup backups = 1; + */ + public int getBackupsCount() { + if (backupsBuilder_ == null) { + return backups_.size(); + } else { + return backupsBuilder_.getCount(); + } + } + /** + * + * + *
+     * A list of backups in the project for the specified location.
+     * If the {location} value in the request is "-", the response contains a list
+     * of backups from all locations. If any location is unreachable, the
+     * response will only return backups in reachable locations and the
+     * "unreachable" field will be populated with a list of unreachable
+     * locations.
+     * 
+ * + * repeated .google.cloud.filestore.v1beta1.Backup backups = 1; + */ + public com.google.cloud.filestore.v1beta1.Backup getBackups(int index) { + if (backupsBuilder_ == null) { + return backups_.get(index); + } else { + return backupsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * A list of backups in the project for the specified location.
+     * If the {location} value in the request is "-", the response contains a list
+     * of backups from all locations. If any location is unreachable, the
+     * response will only return backups in reachable locations and the
+     * "unreachable" field will be populated with a list of unreachable
+     * locations.
+     * 
+ * + * repeated .google.cloud.filestore.v1beta1.Backup backups = 1; + */ + public Builder setBackups(int index, com.google.cloud.filestore.v1beta1.Backup value) { + if (backupsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureBackupsIsMutable(); + backups_.set(index, value); + onChanged(); + } else { + backupsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * A list of backups in the project for the specified location.
+     * If the {location} value in the request is "-", the response contains a list
+     * of backups from all locations. If any location is unreachable, the
+     * response will only return backups in reachable locations and the
+     * "unreachable" field will be populated with a list of unreachable
+     * locations.
+     * 
+ * + * repeated .google.cloud.filestore.v1beta1.Backup backups = 1; + */ + public Builder setBackups( + int index, com.google.cloud.filestore.v1beta1.Backup.Builder builderForValue) { + if (backupsBuilder_ == null) { + ensureBackupsIsMutable(); + backups_.set(index, builderForValue.build()); + onChanged(); + } else { + backupsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * A list of backups in the project for the specified location.
+     * If the {location} value in the request is "-", the response contains a list
+     * of backups from all locations. If any location is unreachable, the
+     * response will only return backups in reachable locations and the
+     * "unreachable" field will be populated with a list of unreachable
+     * locations.
+     * 
+ * + * repeated .google.cloud.filestore.v1beta1.Backup backups = 1; + */ + public Builder addBackups(com.google.cloud.filestore.v1beta1.Backup value) { + if (backupsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureBackupsIsMutable(); + backups_.add(value); + onChanged(); + } else { + backupsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * A list of backups in the project for the specified location.
+     * If the {location} value in the request is "-", the response contains a list
+     * of backups from all locations. If any location is unreachable, the
+     * response will only return backups in reachable locations and the
+     * "unreachable" field will be populated with a list of unreachable
+     * locations.
+     * 
+ * + * repeated .google.cloud.filestore.v1beta1.Backup backups = 1; + */ + public Builder addBackups(int index, com.google.cloud.filestore.v1beta1.Backup value) { + if (backupsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureBackupsIsMutable(); + backups_.add(index, value); + onChanged(); + } else { + backupsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * A list of backups in the project for the specified location.
+     * If the {location} value in the request is "-", the response contains a list
+     * of backups from all locations. If any location is unreachable, the
+     * response will only return backups in reachable locations and the
+     * "unreachable" field will be populated with a list of unreachable
+     * locations.
+     * 
+ * + * repeated .google.cloud.filestore.v1beta1.Backup backups = 1; + */ + public Builder addBackups(com.google.cloud.filestore.v1beta1.Backup.Builder builderForValue) { + if (backupsBuilder_ == null) { + ensureBackupsIsMutable(); + backups_.add(builderForValue.build()); + onChanged(); + } else { + backupsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * A list of backups in the project for the specified location.
+     * If the {location} value in the request is "-", the response contains a list
+     * of backups from all locations. If any location is unreachable, the
+     * response will only return backups in reachable locations and the
+     * "unreachable" field will be populated with a list of unreachable
+     * locations.
+     * 
+ * + * repeated .google.cloud.filestore.v1beta1.Backup backups = 1; + */ + public Builder addBackups( + int index, com.google.cloud.filestore.v1beta1.Backup.Builder builderForValue) { + if (backupsBuilder_ == null) { + ensureBackupsIsMutable(); + backups_.add(index, builderForValue.build()); + onChanged(); + } else { + backupsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * A list of backups in the project for the specified location.
+     * If the {location} value in the request is "-", the response contains a list
+     * of backups from all locations. If any location is unreachable, the
+     * response will only return backups in reachable locations and the
+     * "unreachable" field will be populated with a list of unreachable
+     * locations.
+     * 
+ * + * repeated .google.cloud.filestore.v1beta1.Backup backups = 1; + */ + public Builder addAllBackups( + java.lang.Iterable values) { + if (backupsBuilder_ == null) { + ensureBackupsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, backups_); + onChanged(); + } else { + backupsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * A list of backups in the project for the specified location.
+     * If the {location} value in the request is "-", the response contains a list
+     * of backups from all locations. If any location is unreachable, the
+     * response will only return backups in reachable locations and the
+     * "unreachable" field will be populated with a list of unreachable
+     * locations.
+     * 
+ * + * repeated .google.cloud.filestore.v1beta1.Backup backups = 1; + */ + public Builder clearBackups() { + if (backupsBuilder_ == null) { + backups_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + backupsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * A list of backups in the project for the specified location.
+     * If the {location} value in the request is "-", the response contains a list
+     * of backups from all locations. If any location is unreachable, the
+     * response will only return backups in reachable locations and the
+     * "unreachable" field will be populated with a list of unreachable
+     * locations.
+     * 
+ * + * repeated .google.cloud.filestore.v1beta1.Backup backups = 1; + */ + public Builder removeBackups(int index) { + if (backupsBuilder_ == null) { + ensureBackupsIsMutable(); + backups_.remove(index); + onChanged(); + } else { + backupsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * A list of backups in the project for the specified location.
+     * If the {location} value in the request is "-", the response contains a list
+     * of backups from all locations. If any location is unreachable, the
+     * response will only return backups in reachable locations and the
+     * "unreachable" field will be populated with a list of unreachable
+     * locations.
+     * 
+ * + * repeated .google.cloud.filestore.v1beta1.Backup backups = 1; + */ + public com.google.cloud.filestore.v1beta1.Backup.Builder getBackupsBuilder(int index) { + return getBackupsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * A list of backups in the project for the specified location.
+     * If the {location} value in the request is "-", the response contains a list
+     * of backups from all locations. If any location is unreachable, the
+     * response will only return backups in reachable locations and the
+     * "unreachable" field will be populated with a list of unreachable
+     * locations.
+     * 
+ * + * repeated .google.cloud.filestore.v1beta1.Backup backups = 1; + */ + public com.google.cloud.filestore.v1beta1.BackupOrBuilder getBackupsOrBuilder(int index) { + if (backupsBuilder_ == null) { + return backups_.get(index); + } else { + return backupsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * A list of backups in the project for the specified location.
+     * If the {location} value in the request is "-", the response contains a list
+     * of backups from all locations. If any location is unreachable, the
+     * response will only return backups in reachable locations and the
+     * "unreachable" field will be populated with a list of unreachable
+     * locations.
+     * 
+ * + * repeated .google.cloud.filestore.v1beta1.Backup backups = 1; + */ + public java.util.List + getBackupsOrBuilderList() { + if (backupsBuilder_ != null) { + return backupsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(backups_); + } + } + /** + * + * + *
+     * A list of backups in the project for the specified location.
+     * If the {location} value in the request is "-", the response contains a list
+     * of backups from all locations. If any location is unreachable, the
+     * response will only return backups in reachable locations and the
+     * "unreachable" field will be populated with a list of unreachable
+     * locations.
+     * 
+ * + * repeated .google.cloud.filestore.v1beta1.Backup backups = 1; + */ + public com.google.cloud.filestore.v1beta1.Backup.Builder addBackupsBuilder() { + return getBackupsFieldBuilder() + .addBuilder(com.google.cloud.filestore.v1beta1.Backup.getDefaultInstance()); + } + /** + * + * + *
+     * A list of backups in the project for the specified location.
+     * If the {location} value in the request is "-", the response contains a list
+     * of backups from all locations. If any location is unreachable, the
+     * response will only return backups in reachable locations and the
+     * "unreachable" field will be populated with a list of unreachable
+     * locations.
+     * 
+ * + * repeated .google.cloud.filestore.v1beta1.Backup backups = 1; + */ + public com.google.cloud.filestore.v1beta1.Backup.Builder addBackupsBuilder(int index) { + return getBackupsFieldBuilder() + .addBuilder(index, com.google.cloud.filestore.v1beta1.Backup.getDefaultInstance()); + } + /** + * + * + *
+     * A list of backups in the project for the specified location.
+     * If the {location} value in the request is "-", the response contains a list
+     * of backups from all locations. If any location is unreachable, the
+     * response will only return backups in reachable locations and the
+     * "unreachable" field will be populated with a list of unreachable
+     * locations.
+     * 
+ * + * repeated .google.cloud.filestore.v1beta1.Backup backups = 1; + */ + public java.util.List + getBackupsBuilderList() { + return getBackupsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.filestore.v1beta1.Backup, + com.google.cloud.filestore.v1beta1.Backup.Builder, + com.google.cloud.filestore.v1beta1.BackupOrBuilder> + getBackupsFieldBuilder() { + if (backupsBuilder_ == null) { + backupsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.filestore.v1beta1.Backup, + com.google.cloud.filestore.v1beta1.Backup.Builder, + com.google.cloud.filestore.v1beta1.BackupOrBuilder>( + backups_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + backups_ = null; + } + return backupsBuilder_; + } + + 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.ListBackupsResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.filestore.v1beta1.ListBackupsResponse) + private static final com.google.cloud.filestore.v1beta1.ListBackupsResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.filestore.v1beta1.ListBackupsResponse(); + } + + public static com.google.cloud.filestore.v1beta1.ListBackupsResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListBackupsResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListBackupsResponse(input, extensionRegistry); + } + }; + + 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.ListBackupsResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/ListBackupsResponseOrBuilder.java b/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/ListBackupsResponseOrBuilder.java new file mode 100644 index 00000000..bc44d488 --- /dev/null +++ b/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/ListBackupsResponseOrBuilder.java @@ -0,0 +1,180 @@ +/* + * 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 ListBackupsResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.filestore.v1beta1.ListBackupsResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * A list of backups in the project for the specified location.
+   * If the {location} value in the request is "-", the response contains a list
+   * of backups from all locations. If any location is unreachable, the
+   * response will only return backups in reachable locations and the
+   * "unreachable" field will be populated with a list of unreachable
+   * locations.
+   * 
+ * + * repeated .google.cloud.filestore.v1beta1.Backup backups = 1; + */ + java.util.List getBackupsList(); + /** + * + * + *
+   * A list of backups in the project for the specified location.
+   * If the {location} value in the request is "-", the response contains a list
+   * of backups from all locations. If any location is unreachable, the
+   * response will only return backups in reachable locations and the
+   * "unreachable" field will be populated with a list of unreachable
+   * locations.
+   * 
+ * + * repeated .google.cloud.filestore.v1beta1.Backup backups = 1; + */ + com.google.cloud.filestore.v1beta1.Backup getBackups(int index); + /** + * + * + *
+   * A list of backups in the project for the specified location.
+   * If the {location} value in the request is "-", the response contains a list
+   * of backups from all locations. If any location is unreachable, the
+   * response will only return backups in reachable locations and the
+   * "unreachable" field will be populated with a list of unreachable
+   * locations.
+   * 
+ * + * repeated .google.cloud.filestore.v1beta1.Backup backups = 1; + */ + int getBackupsCount(); + /** + * + * + *
+   * A list of backups in the project for the specified location.
+   * If the {location} value in the request is "-", the response contains a list
+   * of backups from all locations. If any location is unreachable, the
+   * response will only return backups in reachable locations and the
+   * "unreachable" field will be populated with a list of unreachable
+   * locations.
+   * 
+ * + * repeated .google.cloud.filestore.v1beta1.Backup backups = 1; + */ + java.util.List + getBackupsOrBuilderList(); + /** + * + * + *
+   * A list of backups in the project for the specified location.
+   * If the {location} value in the request is "-", the response contains a list
+   * of backups from all locations. If any location is unreachable, the
+   * response will only return backups in reachable locations and the
+   * "unreachable" field will be populated with a list of unreachable
+   * locations.
+   * 
+ * + * repeated .google.cloud.filestore.v1beta1.Backup backups = 1; + */ + com.google.cloud.filestore.v1beta1.BackupOrBuilder getBackupsOrBuilder(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/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/ListInstancesRequest.java b/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/ListInstancesRequest.java new file mode 100644 index 00000000..f237c954 --- /dev/null +++ b/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/ListInstancesRequest.java @@ -0,0 +1,1313 @@ +/* + * 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; + +/** + * + * + *
+ * ListInstancesRequest lists instances.
+ * 
+ * + * Protobuf type {@code google.cloud.filestore.v1beta1.ListInstancesRequest} + */ +public final class ListInstancesRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.filestore.v1beta1.ListInstancesRequest) + ListInstancesRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListInstancesRequest.newBuilder() to construct. + private ListInstancesRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListInstancesRequest() { + parent_ = ""; + pageToken_ = ""; + orderBy_ = ""; + filter_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListInstancesRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ListInstancesRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + parent_ = s; + break; + } + case 16: + { + pageSize_ = input.readInt32(); + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + + pageToken_ = s; + break; + } + case 34: + { + java.lang.String s = input.readStringRequireUtf8(); + + orderBy_ = s; + break; + } + case 42: + { + java.lang.String s = input.readStringRequireUtf8(); + + filter_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.filestore.v1beta1.CloudFilestoreServiceProto + .internal_static_google_cloud_filestore_v1beta1_ListInstancesRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.filestore.v1beta1.CloudFilestoreServiceProto + .internal_static_google_cloud_filestore_v1beta1_ListInstancesRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.filestore.v1beta1.ListInstancesRequest.class, + com.google.cloud.filestore.v1beta1.ListInstancesRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + * + * + *
+   * Required. The project and location for which to retrieve instance information,
+   * in the format projects/{project_id}/locations/{location}. In Cloud
+   * Filestore, locations map to GCP zones, for example **us-west1-b**. To
+   * retrieve instance information for all locations, use "-" for the {location}
+   * value.
+   * 
+ * + * + * 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 project and location for which to retrieve instance information,
+   * in the format projects/{project_id}/locations/{location}. In Cloud
+   * Filestore, locations map to GCP zones, for example **us-west1-b**. To
+   * retrieve instance information for all locations, use "-" for the {location}
+   * value.
+   * 
+ * + * + * 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 (!getParentBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (pageSize_ != 0) { + output.writeInt32(2, pageSize_); + } + if (!getPageTokenBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, pageToken_); + } + if (!getOrderByBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, orderBy_); + } + if (!getFilterBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, filter_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getParentBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (pageSize_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(2, pageSize_); + } + if (!getPageTokenBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, pageToken_); + } + if (!getOrderByBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, orderBy_); + } + if (!getFilterBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, filter_); + } + size += unknownFields.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.ListInstancesRequest)) { + return super.equals(obj); + } + com.google.cloud.filestore.v1beta1.ListInstancesRequest other = + (com.google.cloud.filestore.v1beta1.ListInstancesRequest) 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 (!unknownFields.equals(other.unknownFields)) 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) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.filestore.v1beta1.ListInstancesRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.filestore.v1beta1.ListInstancesRequest 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.ListInstancesRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.filestore.v1beta1.ListInstancesRequest 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.ListInstancesRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.filestore.v1beta1.ListInstancesRequest 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.ListInstancesRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.filestore.v1beta1.ListInstancesRequest 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.ListInstancesRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.filestore.v1beta1.ListInstancesRequest 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.ListInstancesRequest 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.ListInstancesRequest 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.ListInstancesRequest 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; + } + /** + * + * + *
+   * ListInstancesRequest lists instances.
+   * 
+ * + * Protobuf type {@code google.cloud.filestore.v1beta1.ListInstancesRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.filestore.v1beta1.ListInstancesRequest) + com.google.cloud.filestore.v1beta1.ListInstancesRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.filestore.v1beta1.CloudFilestoreServiceProto + .internal_static_google_cloud_filestore_v1beta1_ListInstancesRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.filestore.v1beta1.CloudFilestoreServiceProto + .internal_static_google_cloud_filestore_v1beta1_ListInstancesRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.filestore.v1beta1.ListInstancesRequest.class, + com.google.cloud.filestore.v1beta1.ListInstancesRequest.Builder.class); + } + + // Construct using com.google.cloud.filestore.v1beta1.ListInstancesRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @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_ListInstancesRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.filestore.v1beta1.ListInstancesRequest getDefaultInstanceForType() { + return com.google.cloud.filestore.v1beta1.ListInstancesRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.filestore.v1beta1.ListInstancesRequest build() { + com.google.cloud.filestore.v1beta1.ListInstancesRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.filestore.v1beta1.ListInstancesRequest buildPartial() { + com.google.cloud.filestore.v1beta1.ListInstancesRequest result = + new com.google.cloud.filestore.v1beta1.ListInstancesRequest(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.ListInstancesRequest) { + return mergeFrom((com.google.cloud.filestore.v1beta1.ListInstancesRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.filestore.v1beta1.ListInstancesRequest other) { + if (other == com.google.cloud.filestore.v1beta1.ListInstancesRequest.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.unknownFields); + 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 { + com.google.cloud.filestore.v1beta1.ListInstancesRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.filestore.v1beta1.ListInstancesRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. The project and location for which to retrieve instance information,
+     * in the format projects/{project_id}/locations/{location}. In Cloud
+     * Filestore, locations map to GCP zones, for example **us-west1-b**. To
+     * retrieve instance information for all locations, use "-" for the {location}
+     * value.
+     * 
+ * + * + * 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 project and location for which to retrieve instance information,
+     * in the format projects/{project_id}/locations/{location}. In Cloud
+     * Filestore, locations map to GCP zones, for example **us-west1-b**. To
+     * retrieve instance information for all locations, use "-" for the {location}
+     * value.
+     * 
+ * + * + * 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 project and location for which to retrieve instance information,
+     * in the format projects/{project_id}/locations/{location}. In Cloud
+     * Filestore, locations map to GCP zones, for example **us-west1-b**. To
+     * retrieve instance information for all locations, use "-" for the {location}
+     * value.
+     * 
+ * + * + * 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 project and location for which to retrieve instance information,
+     * in the format projects/{project_id}/locations/{location}. In Cloud
+     * Filestore, locations map to GCP zones, for example **us-west1-b**. To
+     * retrieve instance information for all locations, use "-" for the {location}
+     * value.
+     * 
+ * + * + * 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 project and location for which to retrieve instance information,
+     * in the format projects/{project_id}/locations/{location}. In Cloud
+     * Filestore, locations map to GCP zones, for example **us-west1-b**. To
+     * retrieve instance information for all locations, use "-" for the {location}
+     * value.
+     * 
+ * + * + * 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.ListInstancesRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.filestore.v1beta1.ListInstancesRequest) + private static final com.google.cloud.filestore.v1beta1.ListInstancesRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.filestore.v1beta1.ListInstancesRequest(); + } + + public static com.google.cloud.filestore.v1beta1.ListInstancesRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListInstancesRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListInstancesRequest(input, extensionRegistry); + } + }; + + 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.ListInstancesRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/ListInstancesRequestOrBuilder.java b/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/ListInstancesRequestOrBuilder.java new file mode 100644 index 00000000..ba3a4c3b --- /dev/null +++ b/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/ListInstancesRequestOrBuilder.java @@ -0,0 +1,152 @@ +/* + * 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 ListInstancesRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.filestore.v1beta1.ListInstancesRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The project and location for which to retrieve instance information,
+   * in the format projects/{project_id}/locations/{location}. In Cloud
+   * Filestore, locations map to GCP zones, for example **us-west1-b**. To
+   * retrieve instance information for all locations, use "-" for the {location}
+   * value.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. The project and location for which to retrieve instance information,
+   * in the format projects/{project_id}/locations/{location}. In Cloud
+   * Filestore, locations map to GCP zones, for example **us-west1-b**. To
+   * retrieve instance information for all locations, use "-" for the {location}
+   * value.
+   * 
+ * + * + * 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/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/ListInstancesResponse.java b/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/ListInstancesResponse.java new file mode 100644 index 00000000..fed6d616 --- /dev/null +++ b/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/ListInstancesResponse.java @@ -0,0 +1,1506 @@ +/* + * 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; + +/** + * + * + *
+ * ListInstancesResponse is the result of ListInstancesRequest.
+ * 
+ * + * Protobuf type {@code google.cloud.filestore.v1beta1.ListInstancesResponse} + */ +public final class ListInstancesResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.filestore.v1beta1.ListInstancesResponse) + ListInstancesResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListInstancesResponse.newBuilder() to construct. + private ListInstancesResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListInstancesResponse() { + instances_ = 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 ListInstancesResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ListInstancesResponse( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + instances_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + instances_.add( + input.readMessage( + com.google.cloud.filestore.v1beta1.Instance.parser(), extensionRegistry)); + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + nextPageToken_ = s; + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000002) != 0)) { + unreachable_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000002; + } + unreachable_.add(s); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + instances_ = java.util.Collections.unmodifiableList(instances_); + } + if (((mutable_bitField0_ & 0x00000002) != 0)) { + unreachable_ = unreachable_.getUnmodifiableView(); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.filestore.v1beta1.CloudFilestoreServiceProto + .internal_static_google_cloud_filestore_v1beta1_ListInstancesResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.filestore.v1beta1.CloudFilestoreServiceProto + .internal_static_google_cloud_filestore_v1beta1_ListInstancesResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.filestore.v1beta1.ListInstancesResponse.class, + com.google.cloud.filestore.v1beta1.ListInstancesResponse.Builder.class); + } + + public static final int INSTANCES_FIELD_NUMBER = 1; + private java.util.List instances_; + /** + * + * + *
+   * A list of instances in the project for the specified location.
+   * If the {location} value in the request is "-", the response contains a list
+   * of instances from all locations. If any location is unreachable, the
+   * response will only return instances in reachable locations and the
+   * "unreachable" field will be populated with a list of unreachable locations.
+   * 
+ * + * repeated .google.cloud.filestore.v1beta1.Instance instances = 1; + */ + @java.lang.Override + public java.util.List getInstancesList() { + return instances_; + } + /** + * + * + *
+   * A list of instances in the project for the specified location.
+   * If the {location} value in the request is "-", the response contains a list
+   * of instances from all locations. If any location is unreachable, the
+   * response will only return instances in reachable locations and the
+   * "unreachable" field will be populated with a list of unreachable locations.
+   * 
+ * + * repeated .google.cloud.filestore.v1beta1.Instance instances = 1; + */ + @java.lang.Override + public java.util.List + getInstancesOrBuilderList() { + return instances_; + } + /** + * + * + *
+   * A list of instances in the project for the specified location.
+   * If the {location} value in the request is "-", the response contains a list
+   * of instances from all locations. If any location is unreachable, the
+   * response will only return instances in reachable locations and the
+   * "unreachable" field will be populated with a list of unreachable locations.
+   * 
+ * + * repeated .google.cloud.filestore.v1beta1.Instance instances = 1; + */ + @java.lang.Override + public int getInstancesCount() { + return instances_.size(); + } + /** + * + * + *
+   * A list of instances in the project for the specified location.
+   * If the {location} value in the request is "-", the response contains a list
+   * of instances from all locations. If any location is unreachable, the
+   * response will only return instances in reachable locations and the
+   * "unreachable" field will be populated with a list of unreachable locations.
+   * 
+ * + * repeated .google.cloud.filestore.v1beta1.Instance instances = 1; + */ + @java.lang.Override + public com.google.cloud.filestore.v1beta1.Instance getInstances(int index) { + return instances_.get(index); + } + /** + * + * + *
+   * A list of instances in the project for the specified location.
+   * If the {location} value in the request is "-", the response contains a list
+   * of instances from all locations. If any location is unreachable, the
+   * response will only return instances in reachable locations and the
+   * "unreachable" field will be populated with a list of unreachable locations.
+   * 
+ * + * repeated .google.cloud.filestore.v1beta1.Instance instances = 1; + */ + @java.lang.Override + public com.google.cloud.filestore.v1beta1.InstanceOrBuilder getInstancesOrBuilder(int index) { + return instances_.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 < instances_.size(); i++) { + output.writeMessage(1, instances_.get(i)); + } + if (!getNextPageTokenBytes().isEmpty()) { + 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)); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < instances_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, instances_.get(i)); + } + if (!getNextPageTokenBytes().isEmpty()) { + 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 += unknownFields.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.ListInstancesResponse)) { + return super.equals(obj); + } + com.google.cloud.filestore.v1beta1.ListInstancesResponse other = + (com.google.cloud.filestore.v1beta1.ListInstancesResponse) obj; + + if (!getInstancesList().equals(other.getInstancesList())) return false; + if (!getNextPageToken().equals(other.getNextPageToken())) return false; + if (!getUnreachableList().equals(other.getUnreachableList())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getInstancesCount() > 0) { + hash = (37 * hash) + INSTANCES_FIELD_NUMBER; + hash = (53 * hash) + getInstancesList().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) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.filestore.v1beta1.ListInstancesResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.filestore.v1beta1.ListInstancesResponse 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.ListInstancesResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.filestore.v1beta1.ListInstancesResponse 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.ListInstancesResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.filestore.v1beta1.ListInstancesResponse 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.ListInstancesResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.filestore.v1beta1.ListInstancesResponse 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.ListInstancesResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.filestore.v1beta1.ListInstancesResponse 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.ListInstancesResponse 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.ListInstancesResponse 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.ListInstancesResponse 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; + } + /** + * + * + *
+   * ListInstancesResponse is the result of ListInstancesRequest.
+   * 
+ * + * Protobuf type {@code google.cloud.filestore.v1beta1.ListInstancesResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.filestore.v1beta1.ListInstancesResponse) + com.google.cloud.filestore.v1beta1.ListInstancesResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.filestore.v1beta1.CloudFilestoreServiceProto + .internal_static_google_cloud_filestore_v1beta1_ListInstancesResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.filestore.v1beta1.CloudFilestoreServiceProto + .internal_static_google_cloud_filestore_v1beta1_ListInstancesResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.filestore.v1beta1.ListInstancesResponse.class, + com.google.cloud.filestore.v1beta1.ListInstancesResponse.Builder.class); + } + + // Construct using com.google.cloud.filestore.v1beta1.ListInstancesResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getInstancesFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (instancesBuilder_ == null) { + instances_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + instancesBuilder_.clear(); + } + 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_ListInstancesResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.filestore.v1beta1.ListInstancesResponse getDefaultInstanceForType() { + return com.google.cloud.filestore.v1beta1.ListInstancesResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.filestore.v1beta1.ListInstancesResponse build() { + com.google.cloud.filestore.v1beta1.ListInstancesResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.filestore.v1beta1.ListInstancesResponse buildPartial() { + com.google.cloud.filestore.v1beta1.ListInstancesResponse result = + new com.google.cloud.filestore.v1beta1.ListInstancesResponse(this); + int from_bitField0_ = bitField0_; + if (instancesBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + instances_ = java.util.Collections.unmodifiableList(instances_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.instances_ = instances_; + } else { + result.instances_ = instancesBuilder_.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.ListInstancesResponse) { + return mergeFrom((com.google.cloud.filestore.v1beta1.ListInstancesResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.filestore.v1beta1.ListInstancesResponse other) { + if (other == com.google.cloud.filestore.v1beta1.ListInstancesResponse.getDefaultInstance()) + return this; + if (instancesBuilder_ == null) { + if (!other.instances_.isEmpty()) { + if (instances_.isEmpty()) { + instances_ = other.instances_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureInstancesIsMutable(); + instances_.addAll(other.instances_); + } + onChanged(); + } + } else { + if (!other.instances_.isEmpty()) { + if (instancesBuilder_.isEmpty()) { + instancesBuilder_.dispose(); + instancesBuilder_ = null; + instances_ = other.instances_; + bitField0_ = (bitField0_ & ~0x00000001); + instancesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getInstancesFieldBuilder() + : null; + } else { + instancesBuilder_.addAllMessages(other.instances_); + } + } + } + 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.unknownFields); + 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 { + com.google.cloud.filestore.v1beta1.ListInstancesResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.filestore.v1beta1.ListInstancesResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.util.List instances_ = + java.util.Collections.emptyList(); + + private void ensureInstancesIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + instances_ = + new java.util.ArrayList(instances_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.filestore.v1beta1.Instance, + com.google.cloud.filestore.v1beta1.Instance.Builder, + com.google.cloud.filestore.v1beta1.InstanceOrBuilder> + instancesBuilder_; + + /** + * + * + *
+     * A list of instances in the project for the specified location.
+     * If the {location} value in the request is "-", the response contains a list
+     * of instances from all locations. If any location is unreachable, the
+     * response will only return instances in reachable locations and the
+     * "unreachable" field will be populated with a list of unreachable locations.
+     * 
+ * + * repeated .google.cloud.filestore.v1beta1.Instance instances = 1; + */ + public java.util.List getInstancesList() { + if (instancesBuilder_ == null) { + return java.util.Collections.unmodifiableList(instances_); + } else { + return instancesBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * A list of instances in the project for the specified location.
+     * If the {location} value in the request is "-", the response contains a list
+     * of instances from all locations. If any location is unreachable, the
+     * response will only return instances in reachable locations and the
+     * "unreachable" field will be populated with a list of unreachable locations.
+     * 
+ * + * repeated .google.cloud.filestore.v1beta1.Instance instances = 1; + */ + public int getInstancesCount() { + if (instancesBuilder_ == null) { + return instances_.size(); + } else { + return instancesBuilder_.getCount(); + } + } + /** + * + * + *
+     * A list of instances in the project for the specified location.
+     * If the {location} value in the request is "-", the response contains a list
+     * of instances from all locations. If any location is unreachable, the
+     * response will only return instances in reachable locations and the
+     * "unreachable" field will be populated with a list of unreachable locations.
+     * 
+ * + * repeated .google.cloud.filestore.v1beta1.Instance instances = 1; + */ + public com.google.cloud.filestore.v1beta1.Instance getInstances(int index) { + if (instancesBuilder_ == null) { + return instances_.get(index); + } else { + return instancesBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * A list of instances in the project for the specified location.
+     * If the {location} value in the request is "-", the response contains a list
+     * of instances from all locations. If any location is unreachable, the
+     * response will only return instances in reachable locations and the
+     * "unreachable" field will be populated with a list of unreachable locations.
+     * 
+ * + * repeated .google.cloud.filestore.v1beta1.Instance instances = 1; + */ + public Builder setInstances(int index, com.google.cloud.filestore.v1beta1.Instance value) { + if (instancesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureInstancesIsMutable(); + instances_.set(index, value); + onChanged(); + } else { + instancesBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * A list of instances in the project for the specified location.
+     * If the {location} value in the request is "-", the response contains a list
+     * of instances from all locations. If any location is unreachable, the
+     * response will only return instances in reachable locations and the
+     * "unreachable" field will be populated with a list of unreachable locations.
+     * 
+ * + * repeated .google.cloud.filestore.v1beta1.Instance instances = 1; + */ + public Builder setInstances( + int index, com.google.cloud.filestore.v1beta1.Instance.Builder builderForValue) { + if (instancesBuilder_ == null) { + ensureInstancesIsMutable(); + instances_.set(index, builderForValue.build()); + onChanged(); + } else { + instancesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * A list of instances in the project for the specified location.
+     * If the {location} value in the request is "-", the response contains a list
+     * of instances from all locations. If any location is unreachable, the
+     * response will only return instances in reachable locations and the
+     * "unreachable" field will be populated with a list of unreachable locations.
+     * 
+ * + * repeated .google.cloud.filestore.v1beta1.Instance instances = 1; + */ + public Builder addInstances(com.google.cloud.filestore.v1beta1.Instance value) { + if (instancesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureInstancesIsMutable(); + instances_.add(value); + onChanged(); + } else { + instancesBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * A list of instances in the project for the specified location.
+     * If the {location} value in the request is "-", the response contains a list
+     * of instances from all locations. If any location is unreachable, the
+     * response will only return instances in reachable locations and the
+     * "unreachable" field will be populated with a list of unreachable locations.
+     * 
+ * + * repeated .google.cloud.filestore.v1beta1.Instance instances = 1; + */ + public Builder addInstances(int index, com.google.cloud.filestore.v1beta1.Instance value) { + if (instancesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureInstancesIsMutable(); + instances_.add(index, value); + onChanged(); + } else { + instancesBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * A list of instances in the project for the specified location.
+     * If the {location} value in the request is "-", the response contains a list
+     * of instances from all locations. If any location is unreachable, the
+     * response will only return instances in reachable locations and the
+     * "unreachable" field will be populated with a list of unreachable locations.
+     * 
+ * + * repeated .google.cloud.filestore.v1beta1.Instance instances = 1; + */ + public Builder addInstances( + com.google.cloud.filestore.v1beta1.Instance.Builder builderForValue) { + if (instancesBuilder_ == null) { + ensureInstancesIsMutable(); + instances_.add(builderForValue.build()); + onChanged(); + } else { + instancesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * A list of instances in the project for the specified location.
+     * If the {location} value in the request is "-", the response contains a list
+     * of instances from all locations. If any location is unreachable, the
+     * response will only return instances in reachable locations and the
+     * "unreachable" field will be populated with a list of unreachable locations.
+     * 
+ * + * repeated .google.cloud.filestore.v1beta1.Instance instances = 1; + */ + public Builder addInstances( + int index, com.google.cloud.filestore.v1beta1.Instance.Builder builderForValue) { + if (instancesBuilder_ == null) { + ensureInstancesIsMutable(); + instances_.add(index, builderForValue.build()); + onChanged(); + } else { + instancesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * A list of instances in the project for the specified location.
+     * If the {location} value in the request is "-", the response contains a list
+     * of instances from all locations. If any location is unreachable, the
+     * response will only return instances in reachable locations and the
+     * "unreachable" field will be populated with a list of unreachable locations.
+     * 
+ * + * repeated .google.cloud.filestore.v1beta1.Instance instances = 1; + */ + public Builder addAllInstances( + java.lang.Iterable values) { + if (instancesBuilder_ == null) { + ensureInstancesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, instances_); + onChanged(); + } else { + instancesBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * A list of instances in the project for the specified location.
+     * If the {location} value in the request is "-", the response contains a list
+     * of instances from all locations. If any location is unreachable, the
+     * response will only return instances in reachable locations and the
+     * "unreachable" field will be populated with a list of unreachable locations.
+     * 
+ * + * repeated .google.cloud.filestore.v1beta1.Instance instances = 1; + */ + public Builder clearInstances() { + if (instancesBuilder_ == null) { + instances_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + instancesBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * A list of instances in the project for the specified location.
+     * If the {location} value in the request is "-", the response contains a list
+     * of instances from all locations. If any location is unreachable, the
+     * response will only return instances in reachable locations and the
+     * "unreachable" field will be populated with a list of unreachable locations.
+     * 
+ * + * repeated .google.cloud.filestore.v1beta1.Instance instances = 1; + */ + public Builder removeInstances(int index) { + if (instancesBuilder_ == null) { + ensureInstancesIsMutable(); + instances_.remove(index); + onChanged(); + } else { + instancesBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * A list of instances in the project for the specified location.
+     * If the {location} value in the request is "-", the response contains a list
+     * of instances from all locations. If any location is unreachable, the
+     * response will only return instances in reachable locations and the
+     * "unreachable" field will be populated with a list of unreachable locations.
+     * 
+ * + * repeated .google.cloud.filestore.v1beta1.Instance instances = 1; + */ + public com.google.cloud.filestore.v1beta1.Instance.Builder getInstancesBuilder(int index) { + return getInstancesFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * A list of instances in the project for the specified location.
+     * If the {location} value in the request is "-", the response contains a list
+     * of instances from all locations. If any location is unreachable, the
+     * response will only return instances in reachable locations and the
+     * "unreachable" field will be populated with a list of unreachable locations.
+     * 
+ * + * repeated .google.cloud.filestore.v1beta1.Instance instances = 1; + */ + public com.google.cloud.filestore.v1beta1.InstanceOrBuilder getInstancesOrBuilder(int index) { + if (instancesBuilder_ == null) { + return instances_.get(index); + } else { + return instancesBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * A list of instances in the project for the specified location.
+     * If the {location} value in the request is "-", the response contains a list
+     * of instances from all locations. If any location is unreachable, the
+     * response will only return instances in reachable locations and the
+     * "unreachable" field will be populated with a list of unreachable locations.
+     * 
+ * + * repeated .google.cloud.filestore.v1beta1.Instance instances = 1; + */ + public java.util.List + getInstancesOrBuilderList() { + if (instancesBuilder_ != null) { + return instancesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(instances_); + } + } + /** + * + * + *
+     * A list of instances in the project for the specified location.
+     * If the {location} value in the request is "-", the response contains a list
+     * of instances from all locations. If any location is unreachable, the
+     * response will only return instances in reachable locations and the
+     * "unreachable" field will be populated with a list of unreachable locations.
+     * 
+ * + * repeated .google.cloud.filestore.v1beta1.Instance instances = 1; + */ + public com.google.cloud.filestore.v1beta1.Instance.Builder addInstancesBuilder() { + return getInstancesFieldBuilder() + .addBuilder(com.google.cloud.filestore.v1beta1.Instance.getDefaultInstance()); + } + /** + * + * + *
+     * A list of instances in the project for the specified location.
+     * If the {location} value in the request is "-", the response contains a list
+     * of instances from all locations. If any location is unreachable, the
+     * response will only return instances in reachable locations and the
+     * "unreachable" field will be populated with a list of unreachable locations.
+     * 
+ * + * repeated .google.cloud.filestore.v1beta1.Instance instances = 1; + */ + public com.google.cloud.filestore.v1beta1.Instance.Builder addInstancesBuilder(int index) { + return getInstancesFieldBuilder() + .addBuilder(index, com.google.cloud.filestore.v1beta1.Instance.getDefaultInstance()); + } + /** + * + * + *
+     * A list of instances in the project for the specified location.
+     * If the {location} value in the request is "-", the response contains a list
+     * of instances from all locations. If any location is unreachable, the
+     * response will only return instances in reachable locations and the
+     * "unreachable" field will be populated with a list of unreachable locations.
+     * 
+ * + * repeated .google.cloud.filestore.v1beta1.Instance instances = 1; + */ + public java.util.List + getInstancesBuilderList() { + return getInstancesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.filestore.v1beta1.Instance, + com.google.cloud.filestore.v1beta1.Instance.Builder, + com.google.cloud.filestore.v1beta1.InstanceOrBuilder> + getInstancesFieldBuilder() { + if (instancesBuilder_ == null) { + instancesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.filestore.v1beta1.Instance, + com.google.cloud.filestore.v1beta1.Instance.Builder, + com.google.cloud.filestore.v1beta1.InstanceOrBuilder>( + instances_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + instances_ = null; + } + return instancesBuilder_; + } + + 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.ListInstancesResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.filestore.v1beta1.ListInstancesResponse) + private static final com.google.cloud.filestore.v1beta1.ListInstancesResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.filestore.v1beta1.ListInstancesResponse(); + } + + public static com.google.cloud.filestore.v1beta1.ListInstancesResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListInstancesResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListInstancesResponse(input, extensionRegistry); + } + }; + + 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.ListInstancesResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/ListInstancesResponseOrBuilder.java b/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/ListInstancesResponseOrBuilder.java new file mode 100644 index 00000000..9dcd17ae --- /dev/null +++ b/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/ListInstancesResponseOrBuilder.java @@ -0,0 +1,175 @@ +/* + * 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 ListInstancesResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.filestore.v1beta1.ListInstancesResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * A list of instances in the project for the specified location.
+   * If the {location} value in the request is "-", the response contains a list
+   * of instances from all locations. If any location is unreachable, the
+   * response will only return instances in reachable locations and the
+   * "unreachable" field will be populated with a list of unreachable locations.
+   * 
+ * + * repeated .google.cloud.filestore.v1beta1.Instance instances = 1; + */ + java.util.List getInstancesList(); + /** + * + * + *
+   * A list of instances in the project for the specified location.
+   * If the {location} value in the request is "-", the response contains a list
+   * of instances from all locations. If any location is unreachable, the
+   * response will only return instances in reachable locations and the
+   * "unreachable" field will be populated with a list of unreachable locations.
+   * 
+ * + * repeated .google.cloud.filestore.v1beta1.Instance instances = 1; + */ + com.google.cloud.filestore.v1beta1.Instance getInstances(int index); + /** + * + * + *
+   * A list of instances in the project for the specified location.
+   * If the {location} value in the request is "-", the response contains a list
+   * of instances from all locations. If any location is unreachable, the
+   * response will only return instances in reachable locations and the
+   * "unreachable" field will be populated with a list of unreachable locations.
+   * 
+ * + * repeated .google.cloud.filestore.v1beta1.Instance instances = 1; + */ + int getInstancesCount(); + /** + * + * + *
+   * A list of instances in the project for the specified location.
+   * If the {location} value in the request is "-", the response contains a list
+   * of instances from all locations. If any location is unreachable, the
+   * response will only return instances in reachable locations and the
+   * "unreachable" field will be populated with a list of unreachable locations.
+   * 
+ * + * repeated .google.cloud.filestore.v1beta1.Instance instances = 1; + */ + java.util.List + getInstancesOrBuilderList(); + /** + * + * + *
+   * A list of instances in the project for the specified location.
+   * If the {location} value in the request is "-", the response contains a list
+   * of instances from all locations. If any location is unreachable, the
+   * response will only return instances in reachable locations and the
+   * "unreachable" field will be populated with a list of unreachable locations.
+   * 
+ * + * repeated .google.cloud.filestore.v1beta1.Instance instances = 1; + */ + com.google.cloud.filestore.v1beta1.InstanceOrBuilder getInstancesOrBuilder(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/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/LocationName.java b/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/LocationName.java new file mode 100644 index 00000000..ffc03ec3 --- /dev/null +++ b/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/LocationName.java @@ -0,0 +1,192 @@ +/* + * Copyright 2021 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 LocationName implements ResourceName { + private static final PathTemplate PROJECT_LOCATION = + PathTemplate.createWithoutUrlEncoding("projects/{project}/locations/{location}"); + private volatile Map fieldValuesMap; + private final String project; + private final String location; + + @Deprecated + protected LocationName() { + project = null; + location = null; + } + + private LocationName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + location = Preconditions.checkNotNull(builder.getLocation()); + } + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static LocationName of(String project, String location) { + return newBuilder().setProject(project).setLocation(location).build(); + } + + public static String format(String project, String location) { + return newBuilder().setProject(project).setLocation(location).build().toString(); + } + + public static LocationName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PROJECT_LOCATION.validatedMatch( + formattedString, "LocationName.parse: formattedString not in valid format"); + return of(matchMap.get("project"), matchMap.get("location")); + } + + 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 (LocationName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PROJECT_LOCATION.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); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return PROJECT_LOCATION.instantiate("project", project, "location", location); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null || getClass() == o.getClass()) { + LocationName that = ((LocationName) o); + return Objects.equals(this.project, that.project) + && Objects.equals(this.location, that.location); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(project); + h *= 1000003; + h ^= Objects.hashCode(location); + return h; + } + + /** Builder for projects/{project}/locations/{location}. */ + public static class Builder { + private String project; + private String location; + + protected Builder() {} + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setLocation(String location) { + this.location = location; + return this; + } + + private Builder(LocationName locationName) { + this.project = locationName.project; + this.location = locationName.location; + } + + public LocationName build() { + return new LocationName(this); + } + } +} diff --git a/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/NetworkConfig.java b/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/NetworkConfig.java new file mode 100644 index 00000000..706973a4 --- /dev/null +++ b/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/NetworkConfig.java @@ -0,0 +1,1736 @@ +/* + * 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; + +/** + * + * + *
+ * Network configuration for the instance.
+ * 
+ * + * Protobuf type {@code google.cloud.filestore.v1beta1.NetworkConfig} + */ +public final class NetworkConfig extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.filestore.v1beta1.NetworkConfig) + NetworkConfigOrBuilder { + private static final long serialVersionUID = 0L; + // Use NetworkConfig.newBuilder() to construct. + private NetworkConfig(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private NetworkConfig() { + network_ = ""; + modes_ = java.util.Collections.emptyList(); + reservedIpRange_ = ""; + ipAddresses_ = com.google.protobuf.LazyStringArrayList.EMPTY; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new NetworkConfig(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private NetworkConfig( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + network_ = s; + break; + } + case 24: + { + int rawValue = input.readEnum(); + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + modes_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + modes_.add(rawValue); + break; + } + case 26: + { + int length = input.readRawVarint32(); + int oldLimit = input.pushLimit(length); + while (input.getBytesUntilLimit() > 0) { + int rawValue = input.readEnum(); + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + modes_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + modes_.add(rawValue); + } + input.popLimit(oldLimit); + break; + } + case 34: + { + java.lang.String s = input.readStringRequireUtf8(); + + reservedIpRange_ = s; + break; + } + case 42: + { + java.lang.String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000002) != 0)) { + ipAddresses_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000002; + } + ipAddresses_.add(s); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + modes_ = java.util.Collections.unmodifiableList(modes_); + } + if (((mutable_bitField0_ & 0x00000002) != 0)) { + ipAddresses_ = ipAddresses_.getUnmodifiableView(); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.filestore.v1beta1.CloudFilestoreServiceProto + .internal_static_google_cloud_filestore_v1beta1_NetworkConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.filestore.v1beta1.CloudFilestoreServiceProto + .internal_static_google_cloud_filestore_v1beta1_NetworkConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.filestore.v1beta1.NetworkConfig.class, + com.google.cloud.filestore.v1beta1.NetworkConfig.Builder.class); + } + + /** + * + * + *
+   * Internet protocol versions supported by Cloud Filestore.
+   * 
+ * + * Protobuf enum {@code google.cloud.filestore.v1beta1.NetworkConfig.AddressMode} + */ + public enum AddressMode implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Internet protocol not set.
+     * 
+ * + * ADDRESS_MODE_UNSPECIFIED = 0; + */ + ADDRESS_MODE_UNSPECIFIED(0), + /** + * + * + *
+     * Use the IPv4 internet protocol.
+     * 
+ * + * MODE_IPV4 = 1; + */ + MODE_IPV4(1), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * Internet protocol not set.
+     * 
+ * + * ADDRESS_MODE_UNSPECIFIED = 0; + */ + public static final int ADDRESS_MODE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * Use the IPv4 internet protocol.
+     * 
+ * + * MODE_IPV4 = 1; + */ + public static final int MODE_IPV4_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 AddressMode 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 AddressMode forNumber(int value) { + switch (value) { + case 0: + return ADDRESS_MODE_UNSPECIFIED; + case 1: + return MODE_IPV4; + 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 AddressMode findValueByNumber(int number) { + return AddressMode.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(0); + } + + private static final AddressMode[] VALUES = values(); + + public static AddressMode 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 AddressMode(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.filestore.v1beta1.NetworkConfig.AddressMode) + } + + public static final int NETWORK_FIELD_NUMBER = 1; + private volatile java.lang.Object network_; + /** + * + * + *
+   * The name of the Google Compute Engine
+   * [VPC network](/compute/docs/networks-and-firewalls#networks) to which the
+   * instance is connected.
+   * 
+ * + * string network = 1; + * + * @return The network. + */ + @java.lang.Override + public java.lang.String getNetwork() { + java.lang.Object ref = network_; + 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(); + network_ = s; + return s; + } + } + /** + * + * + *
+   * The name of the Google Compute Engine
+   * [VPC network](/compute/docs/networks-and-firewalls#networks) to which the
+   * instance is connected.
+   * 
+ * + * string network = 1; + * + * @return The bytes for network. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNetworkBytes() { + java.lang.Object ref = network_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + network_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int MODES_FIELD_NUMBER = 3; + private java.util.List modes_; + private static final com.google.protobuf.Internal.ListAdapter.Converter< + java.lang.Integer, com.google.cloud.filestore.v1beta1.NetworkConfig.AddressMode> + modes_converter_ = + new com.google.protobuf.Internal.ListAdapter.Converter< + java.lang.Integer, com.google.cloud.filestore.v1beta1.NetworkConfig.AddressMode>() { + public com.google.cloud.filestore.v1beta1.NetworkConfig.AddressMode convert( + java.lang.Integer from) { + @SuppressWarnings("deprecation") + com.google.cloud.filestore.v1beta1.NetworkConfig.AddressMode result = + com.google.cloud.filestore.v1beta1.NetworkConfig.AddressMode.valueOf(from); + return result == null + ? com.google.cloud.filestore.v1beta1.NetworkConfig.AddressMode.UNRECOGNIZED + : result; + } + }; + /** + * + * + *
+   * Internet protocol versions for which the instance has IP addresses
+   * assigned. For this version, only MODE_IPV4 is supported.
+   * 
+ * + * repeated .google.cloud.filestore.v1beta1.NetworkConfig.AddressMode modes = 3; + * + * @return A list containing the modes. + */ + @java.lang.Override + public java.util.List + getModesList() { + return new com.google.protobuf.Internal.ListAdapter< + java.lang.Integer, com.google.cloud.filestore.v1beta1.NetworkConfig.AddressMode>( + modes_, modes_converter_); + } + /** + * + * + *
+   * Internet protocol versions for which the instance has IP addresses
+   * assigned. For this version, only MODE_IPV4 is supported.
+   * 
+ * + * repeated .google.cloud.filestore.v1beta1.NetworkConfig.AddressMode modes = 3; + * + * @return The count of modes. + */ + @java.lang.Override + public int getModesCount() { + return modes_.size(); + } + /** + * + * + *
+   * Internet protocol versions for which the instance has IP addresses
+   * assigned. For this version, only MODE_IPV4 is supported.
+   * 
+ * + * repeated .google.cloud.filestore.v1beta1.NetworkConfig.AddressMode modes = 3; + * + * @param index The index of the element to return. + * @return The modes at the given index. + */ + @java.lang.Override + public com.google.cloud.filestore.v1beta1.NetworkConfig.AddressMode getModes(int index) { + return modes_converter_.convert(modes_.get(index)); + } + /** + * + * + *
+   * Internet protocol versions for which the instance has IP addresses
+   * assigned. For this version, only MODE_IPV4 is supported.
+   * 
+ * + * repeated .google.cloud.filestore.v1beta1.NetworkConfig.AddressMode modes = 3; + * + * @return A list containing the enum numeric values on the wire for modes. + */ + @java.lang.Override + public java.util.List getModesValueList() { + return modes_; + } + /** + * + * + *
+   * Internet protocol versions for which the instance has IP addresses
+   * assigned. For this version, only MODE_IPV4 is supported.
+   * 
+ * + * repeated .google.cloud.filestore.v1beta1.NetworkConfig.AddressMode modes = 3; + * + * @param index The index of the value to return. + * @return The enum numeric value on the wire of modes at the given index. + */ + @java.lang.Override + public int getModesValue(int index) { + return modes_.get(index); + } + + private int modesMemoizedSerializedSize; + + public static final int RESERVED_IP_RANGE_FIELD_NUMBER = 4; + private volatile java.lang.Object reservedIpRange_; + /** + * + * + *
+   * A /29 CIDR block for Basic or a /23 CIDR block for High Scale in one of the
+   * [internal IP address
+   * ranges](https://www.arin.net/knowledge/address_filters.html) 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.
+   * 
+ * + * string reserved_ip_range = 4; + * + * @return The reservedIpRange. + */ + @java.lang.Override + public java.lang.String getReservedIpRange() { + java.lang.Object ref = reservedIpRange_; + 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(); + reservedIpRange_ = s; + return s; + } + } + /** + * + * + *
+   * A /29 CIDR block for Basic or a /23 CIDR block for High Scale in one of the
+   * [internal IP address
+   * ranges](https://www.arin.net/knowledge/address_filters.html) 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.
+   * 
+ * + * string reserved_ip_range = 4; + * + * @return The bytes for reservedIpRange. + */ + @java.lang.Override + public com.google.protobuf.ByteString getReservedIpRangeBytes() { + java.lang.Object ref = reservedIpRange_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + reservedIpRange_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int IP_ADDRESSES_FIELD_NUMBER = 5; + private com.google.protobuf.LazyStringList ipAddresses_; + /** + * + * + *
+   * Output only. IPv4 addresses in the format
+   * {octet 1}.{octet 2}.{octet 3}.{octet 4} or IPv6 addresses in the format
+   * {block 1}:{block 2}:{block 3}:{block 4}:{block 5}:{block 6}:{block
+   * 7}:{block 8}.
+   * 
+ * + * repeated string ip_addresses = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return A list containing the ipAddresses. + */ + public com.google.protobuf.ProtocolStringList getIpAddressesList() { + return ipAddresses_; + } + /** + * + * + *
+   * Output only. IPv4 addresses in the format
+   * {octet 1}.{octet 2}.{octet 3}.{octet 4} or IPv6 addresses in the format
+   * {block 1}:{block 2}:{block 3}:{block 4}:{block 5}:{block 6}:{block
+   * 7}:{block 8}.
+   * 
+ * + * repeated string ip_addresses = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The count of ipAddresses. + */ + public int getIpAddressesCount() { + return ipAddresses_.size(); + } + /** + * + * + *
+   * Output only. IPv4 addresses in the format
+   * {octet 1}.{octet 2}.{octet 3}.{octet 4} or IPv6 addresses in the format
+   * {block 1}:{block 2}:{block 3}:{block 4}:{block 5}:{block 6}:{block
+   * 7}:{block 8}.
+   * 
+ * + * repeated string ip_addresses = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param index The index of the element to return. + * @return The ipAddresses at the given index. + */ + public java.lang.String getIpAddresses(int index) { + return ipAddresses_.get(index); + } + /** + * + * + *
+   * Output only. IPv4 addresses in the format
+   * {octet 1}.{octet 2}.{octet 3}.{octet 4} or IPv6 addresses in the format
+   * {block 1}:{block 2}:{block 3}:{block 4}:{block 5}:{block 6}:{block
+   * 7}:{block 8}.
+   * 
+ * + * repeated string ip_addresses = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param index The index of the value to return. + * @return The bytes of the ipAddresses at the given index. + */ + public com.google.protobuf.ByteString getIpAddressesBytes(int index) { + return ipAddresses_.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 { + getSerializedSize(); + if (!getNetworkBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, network_); + } + if (getModesList().size() > 0) { + output.writeUInt32NoTag(26); + output.writeUInt32NoTag(modesMemoizedSerializedSize); + } + for (int i = 0; i < modes_.size(); i++) { + output.writeEnumNoTag(modes_.get(i)); + } + if (!getReservedIpRangeBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, reservedIpRange_); + } + for (int i = 0; i < ipAddresses_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, ipAddresses_.getRaw(i)); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getNetworkBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, network_); + } + { + int dataSize = 0; + for (int i = 0; i < modes_.size(); i++) { + dataSize += com.google.protobuf.CodedOutputStream.computeEnumSizeNoTag(modes_.get(i)); + } + size += dataSize; + if (!getModesList().isEmpty()) { + size += 1; + size += com.google.protobuf.CodedOutputStream.computeUInt32SizeNoTag(dataSize); + } + modesMemoizedSerializedSize = dataSize; + } + if (!getReservedIpRangeBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, reservedIpRange_); + } + { + int dataSize = 0; + for (int i = 0; i < ipAddresses_.size(); i++) { + dataSize += computeStringSizeNoTag(ipAddresses_.getRaw(i)); + } + size += dataSize; + size += 1 * getIpAddressesList().size(); + } + size += unknownFields.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.NetworkConfig)) { + return super.equals(obj); + } + com.google.cloud.filestore.v1beta1.NetworkConfig other = + (com.google.cloud.filestore.v1beta1.NetworkConfig) obj; + + if (!getNetwork().equals(other.getNetwork())) return false; + if (!modes_.equals(other.modes_)) return false; + if (!getReservedIpRange().equals(other.getReservedIpRange())) return false; + if (!getIpAddressesList().equals(other.getIpAddressesList())) return false; + if (!unknownFields.equals(other.unknownFields)) 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) + NETWORK_FIELD_NUMBER; + hash = (53 * hash) + getNetwork().hashCode(); + if (getModesCount() > 0) { + hash = (37 * hash) + MODES_FIELD_NUMBER; + hash = (53 * hash) + modes_.hashCode(); + } + hash = (37 * hash) + RESERVED_IP_RANGE_FIELD_NUMBER; + hash = (53 * hash) + getReservedIpRange().hashCode(); + if (getIpAddressesCount() > 0) { + hash = (37 * hash) + IP_ADDRESSES_FIELD_NUMBER; + hash = (53 * hash) + getIpAddressesList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.filestore.v1beta1.NetworkConfig parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.filestore.v1beta1.NetworkConfig 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.NetworkConfig parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.filestore.v1beta1.NetworkConfig 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.NetworkConfig parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.filestore.v1beta1.NetworkConfig 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.NetworkConfig parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.filestore.v1beta1.NetworkConfig 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.NetworkConfig parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.filestore.v1beta1.NetworkConfig 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.NetworkConfig 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.NetworkConfig 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.NetworkConfig 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; + } + /** + * + * + *
+   * Network configuration for the instance.
+   * 
+ * + * Protobuf type {@code google.cloud.filestore.v1beta1.NetworkConfig} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.filestore.v1beta1.NetworkConfig) + com.google.cloud.filestore.v1beta1.NetworkConfigOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.filestore.v1beta1.CloudFilestoreServiceProto + .internal_static_google_cloud_filestore_v1beta1_NetworkConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.filestore.v1beta1.CloudFilestoreServiceProto + .internal_static_google_cloud_filestore_v1beta1_NetworkConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.filestore.v1beta1.NetworkConfig.class, + com.google.cloud.filestore.v1beta1.NetworkConfig.Builder.class); + } + + // Construct using com.google.cloud.filestore.v1beta1.NetworkConfig.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + network_ = ""; + + modes_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + reservedIpRange_ = ""; + + ipAddresses_ = 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_NetworkConfig_descriptor; + } + + @java.lang.Override + public com.google.cloud.filestore.v1beta1.NetworkConfig getDefaultInstanceForType() { + return com.google.cloud.filestore.v1beta1.NetworkConfig.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.filestore.v1beta1.NetworkConfig build() { + com.google.cloud.filestore.v1beta1.NetworkConfig result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.filestore.v1beta1.NetworkConfig buildPartial() { + com.google.cloud.filestore.v1beta1.NetworkConfig result = + new com.google.cloud.filestore.v1beta1.NetworkConfig(this); + int from_bitField0_ = bitField0_; + result.network_ = network_; + if (((bitField0_ & 0x00000001) != 0)) { + modes_ = java.util.Collections.unmodifiableList(modes_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.modes_ = modes_; + result.reservedIpRange_ = reservedIpRange_; + if (((bitField0_ & 0x00000002) != 0)) { + ipAddresses_ = ipAddresses_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.ipAddresses_ = ipAddresses_; + 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.NetworkConfig) { + return mergeFrom((com.google.cloud.filestore.v1beta1.NetworkConfig) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.filestore.v1beta1.NetworkConfig other) { + if (other == com.google.cloud.filestore.v1beta1.NetworkConfig.getDefaultInstance()) + return this; + if (!other.getNetwork().isEmpty()) { + network_ = other.network_; + onChanged(); + } + if (!other.modes_.isEmpty()) { + if (modes_.isEmpty()) { + modes_ = other.modes_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureModesIsMutable(); + modes_.addAll(other.modes_); + } + onChanged(); + } + if (!other.getReservedIpRange().isEmpty()) { + reservedIpRange_ = other.reservedIpRange_; + onChanged(); + } + if (!other.ipAddresses_.isEmpty()) { + if (ipAddresses_.isEmpty()) { + ipAddresses_ = other.ipAddresses_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureIpAddressesIsMutable(); + ipAddresses_.addAll(other.ipAddresses_); + } + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + 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 { + com.google.cloud.filestore.v1beta1.NetworkConfig parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.filestore.v1beta1.NetworkConfig) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.lang.Object network_ = ""; + /** + * + * + *
+     * The name of the Google Compute Engine
+     * [VPC network](/compute/docs/networks-and-firewalls#networks) to which the
+     * instance is connected.
+     * 
+ * + * string network = 1; + * + * @return The network. + */ + public java.lang.String getNetwork() { + java.lang.Object ref = network_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + network_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The name of the Google Compute Engine
+     * [VPC network](/compute/docs/networks-and-firewalls#networks) to which the
+     * instance is connected.
+     * 
+ * + * string network = 1; + * + * @return The bytes for network. + */ + public com.google.protobuf.ByteString getNetworkBytes() { + java.lang.Object ref = network_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + network_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The name of the Google Compute Engine
+     * [VPC network](/compute/docs/networks-and-firewalls#networks) to which the
+     * instance is connected.
+     * 
+ * + * string network = 1; + * + * @param value The network to set. + * @return This builder for chaining. + */ + public Builder setNetwork(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + network_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The name of the Google Compute Engine
+     * [VPC network](/compute/docs/networks-and-firewalls#networks) to which the
+     * instance is connected.
+     * 
+ * + * string network = 1; + * + * @return This builder for chaining. + */ + public Builder clearNetwork() { + + network_ = getDefaultInstance().getNetwork(); + onChanged(); + return this; + } + /** + * + * + *
+     * The name of the Google Compute Engine
+     * [VPC network](/compute/docs/networks-and-firewalls#networks) to which the
+     * instance is connected.
+     * 
+ * + * string network = 1; + * + * @param value The bytes for network to set. + * @return This builder for chaining. + */ + public Builder setNetworkBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + network_ = value; + onChanged(); + return this; + } + + private java.util.List modes_ = java.util.Collections.emptyList(); + + private void ensureModesIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + modes_ = new java.util.ArrayList(modes_); + bitField0_ |= 0x00000001; + } + } + /** + * + * + *
+     * Internet protocol versions for which the instance has IP addresses
+     * assigned. For this version, only MODE_IPV4 is supported.
+     * 
+ * + * repeated .google.cloud.filestore.v1beta1.NetworkConfig.AddressMode modes = 3; + * + * @return A list containing the modes. + */ + public java.util.List + getModesList() { + return new com.google.protobuf.Internal.ListAdapter< + java.lang.Integer, com.google.cloud.filestore.v1beta1.NetworkConfig.AddressMode>( + modes_, modes_converter_); + } + /** + * + * + *
+     * Internet protocol versions for which the instance has IP addresses
+     * assigned. For this version, only MODE_IPV4 is supported.
+     * 
+ * + * repeated .google.cloud.filestore.v1beta1.NetworkConfig.AddressMode modes = 3; + * + * @return The count of modes. + */ + public int getModesCount() { + return modes_.size(); + } + /** + * + * + *
+     * Internet protocol versions for which the instance has IP addresses
+     * assigned. For this version, only MODE_IPV4 is supported.
+     * 
+ * + * repeated .google.cloud.filestore.v1beta1.NetworkConfig.AddressMode modes = 3; + * + * @param index The index of the element to return. + * @return The modes at the given index. + */ + public com.google.cloud.filestore.v1beta1.NetworkConfig.AddressMode getModes(int index) { + return modes_converter_.convert(modes_.get(index)); + } + /** + * + * + *
+     * Internet protocol versions for which the instance has IP addresses
+     * assigned. For this version, only MODE_IPV4 is supported.
+     * 
+ * + * repeated .google.cloud.filestore.v1beta1.NetworkConfig.AddressMode modes = 3; + * + * @param index The index to set the value at. + * @param value The modes to set. + * @return This builder for chaining. + */ + public Builder setModes( + int index, com.google.cloud.filestore.v1beta1.NetworkConfig.AddressMode value) { + if (value == null) { + throw new NullPointerException(); + } + ensureModesIsMutable(); + modes_.set(index, value.getNumber()); + onChanged(); + return this; + } + /** + * + * + *
+     * Internet protocol versions for which the instance has IP addresses
+     * assigned. For this version, only MODE_IPV4 is supported.
+     * 
+ * + * repeated .google.cloud.filestore.v1beta1.NetworkConfig.AddressMode modes = 3; + * + * @param value The modes to add. + * @return This builder for chaining. + */ + public Builder addModes(com.google.cloud.filestore.v1beta1.NetworkConfig.AddressMode value) { + if (value == null) { + throw new NullPointerException(); + } + ensureModesIsMutable(); + modes_.add(value.getNumber()); + onChanged(); + return this; + } + /** + * + * + *
+     * Internet protocol versions for which the instance has IP addresses
+     * assigned. For this version, only MODE_IPV4 is supported.
+     * 
+ * + * repeated .google.cloud.filestore.v1beta1.NetworkConfig.AddressMode modes = 3; + * + * @param values The modes to add. + * @return This builder for chaining. + */ + public Builder addAllModes( + java.lang.Iterable + values) { + ensureModesIsMutable(); + for (com.google.cloud.filestore.v1beta1.NetworkConfig.AddressMode value : values) { + modes_.add(value.getNumber()); + } + onChanged(); + return this; + } + /** + * + * + *
+     * Internet protocol versions for which the instance has IP addresses
+     * assigned. For this version, only MODE_IPV4 is supported.
+     * 
+ * + * repeated .google.cloud.filestore.v1beta1.NetworkConfig.AddressMode modes = 3; + * + * @return This builder for chaining. + */ + public Builder clearModes() { + modes_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Internet protocol versions for which the instance has IP addresses
+     * assigned. For this version, only MODE_IPV4 is supported.
+     * 
+ * + * repeated .google.cloud.filestore.v1beta1.NetworkConfig.AddressMode modes = 3; + * + * @return A list containing the enum numeric values on the wire for modes. + */ + public java.util.List getModesValueList() { + return java.util.Collections.unmodifiableList(modes_); + } + /** + * + * + *
+     * Internet protocol versions for which the instance has IP addresses
+     * assigned. For this version, only MODE_IPV4 is supported.
+     * 
+ * + * repeated .google.cloud.filestore.v1beta1.NetworkConfig.AddressMode modes = 3; + * + * @param index The index of the value to return. + * @return The enum numeric value on the wire of modes at the given index. + */ + public int getModesValue(int index) { + return modes_.get(index); + } + /** + * + * + *
+     * Internet protocol versions for which the instance has IP addresses
+     * assigned. For this version, only MODE_IPV4 is supported.
+     * 
+ * + * repeated .google.cloud.filestore.v1beta1.NetworkConfig.AddressMode modes = 3; + * + * @param index The index of the value to return. + * @return The enum numeric value on the wire of modes at the given index. + * @return This builder for chaining. + */ + public Builder setModesValue(int index, int value) { + ensureModesIsMutable(); + modes_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * Internet protocol versions for which the instance has IP addresses
+     * assigned. For this version, only MODE_IPV4 is supported.
+     * 
+ * + * repeated .google.cloud.filestore.v1beta1.NetworkConfig.AddressMode modes = 3; + * + * @param value The enum numeric value on the wire for modes to add. + * @return This builder for chaining. + */ + public Builder addModesValue(int value) { + ensureModesIsMutable(); + modes_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+     * Internet protocol versions for which the instance has IP addresses
+     * assigned. For this version, only MODE_IPV4 is supported.
+     * 
+ * + * repeated .google.cloud.filestore.v1beta1.NetworkConfig.AddressMode modes = 3; + * + * @param values The enum numeric values on the wire for modes to add. + * @return This builder for chaining. + */ + public Builder addAllModesValue(java.lang.Iterable values) { + ensureModesIsMutable(); + for (int value : values) { + modes_.add(value); + } + onChanged(); + return this; + } + + private java.lang.Object reservedIpRange_ = ""; + /** + * + * + *
+     * A /29 CIDR block for Basic or a /23 CIDR block for High Scale in one of the
+     * [internal IP address
+     * ranges](https://www.arin.net/knowledge/address_filters.html) 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.
+     * 
+ * + * string reserved_ip_range = 4; + * + * @return The reservedIpRange. + */ + public java.lang.String getReservedIpRange() { + java.lang.Object ref = reservedIpRange_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + reservedIpRange_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * A /29 CIDR block for Basic or a /23 CIDR block for High Scale in one of the
+     * [internal IP address
+     * ranges](https://www.arin.net/knowledge/address_filters.html) 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.
+     * 
+ * + * string reserved_ip_range = 4; + * + * @return The bytes for reservedIpRange. + */ + public com.google.protobuf.ByteString getReservedIpRangeBytes() { + java.lang.Object ref = reservedIpRange_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + reservedIpRange_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * A /29 CIDR block for Basic or a /23 CIDR block for High Scale in one of the
+     * [internal IP address
+     * ranges](https://www.arin.net/knowledge/address_filters.html) 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.
+     * 
+ * + * string reserved_ip_range = 4; + * + * @param value The reservedIpRange to set. + * @return This builder for chaining. + */ + public Builder setReservedIpRange(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + reservedIpRange_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * A /29 CIDR block for Basic or a /23 CIDR block for High Scale in one of the
+     * [internal IP address
+     * ranges](https://www.arin.net/knowledge/address_filters.html) 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.
+     * 
+ * + * string reserved_ip_range = 4; + * + * @return This builder for chaining. + */ + public Builder clearReservedIpRange() { + + reservedIpRange_ = getDefaultInstance().getReservedIpRange(); + onChanged(); + return this; + } + /** + * + * + *
+     * A /29 CIDR block for Basic or a /23 CIDR block for High Scale in one of the
+     * [internal IP address
+     * ranges](https://www.arin.net/knowledge/address_filters.html) 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.
+     * 
+ * + * string reserved_ip_range = 4; + * + * @param value The bytes for reservedIpRange to set. + * @return This builder for chaining. + */ + public Builder setReservedIpRangeBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + reservedIpRange_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringList ipAddresses_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureIpAddressesIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + ipAddresses_ = new com.google.protobuf.LazyStringArrayList(ipAddresses_); + bitField0_ |= 0x00000002; + } + } + /** + * + * + *
+     * Output only. IPv4 addresses in the format
+     * {octet 1}.{octet 2}.{octet 3}.{octet 4} or IPv6 addresses in the format
+     * {block 1}:{block 2}:{block 3}:{block 4}:{block 5}:{block 6}:{block
+     * 7}:{block 8}.
+     * 
+ * + * repeated string ip_addresses = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return A list containing the ipAddresses. + */ + public com.google.protobuf.ProtocolStringList getIpAddressesList() { + return ipAddresses_.getUnmodifiableView(); + } + /** + * + * + *
+     * Output only. IPv4 addresses in the format
+     * {octet 1}.{octet 2}.{octet 3}.{octet 4} or IPv6 addresses in the format
+     * {block 1}:{block 2}:{block 3}:{block 4}:{block 5}:{block 6}:{block
+     * 7}:{block 8}.
+     * 
+ * + * repeated string ip_addresses = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The count of ipAddresses. + */ + public int getIpAddressesCount() { + return ipAddresses_.size(); + } + /** + * + * + *
+     * Output only. IPv4 addresses in the format
+     * {octet 1}.{octet 2}.{octet 3}.{octet 4} or IPv6 addresses in the format
+     * {block 1}:{block 2}:{block 3}:{block 4}:{block 5}:{block 6}:{block
+     * 7}:{block 8}.
+     * 
+ * + * repeated string ip_addresses = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param index The index of the element to return. + * @return The ipAddresses at the given index. + */ + public java.lang.String getIpAddresses(int index) { + return ipAddresses_.get(index); + } + /** + * + * + *
+     * Output only. IPv4 addresses in the format
+     * {octet 1}.{octet 2}.{octet 3}.{octet 4} or IPv6 addresses in the format
+     * {block 1}:{block 2}:{block 3}:{block 4}:{block 5}:{block 6}:{block
+     * 7}:{block 8}.
+     * 
+ * + * repeated string ip_addresses = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param index The index of the value to return. + * @return The bytes of the ipAddresses at the given index. + */ + public com.google.protobuf.ByteString getIpAddressesBytes(int index) { + return ipAddresses_.getByteString(index); + } + /** + * + * + *
+     * Output only. IPv4 addresses in the format
+     * {octet 1}.{octet 2}.{octet 3}.{octet 4} or IPv6 addresses in the format
+     * {block 1}:{block 2}:{block 3}:{block 4}:{block 5}:{block 6}:{block
+     * 7}:{block 8}.
+     * 
+ * + * repeated string ip_addresses = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param index The index to set the value at. + * @param value The ipAddresses to set. + * @return This builder for chaining. + */ + public Builder setIpAddresses(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureIpAddressesIsMutable(); + ipAddresses_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. IPv4 addresses in the format
+     * {octet 1}.{octet 2}.{octet 3}.{octet 4} or IPv6 addresses in the format
+     * {block 1}:{block 2}:{block 3}:{block 4}:{block 5}:{block 6}:{block
+     * 7}:{block 8}.
+     * 
+ * + * repeated string ip_addresses = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The ipAddresses to add. + * @return This builder for chaining. + */ + public Builder addIpAddresses(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureIpAddressesIsMutable(); + ipAddresses_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. IPv4 addresses in the format
+     * {octet 1}.{octet 2}.{octet 3}.{octet 4} or IPv6 addresses in the format
+     * {block 1}:{block 2}:{block 3}:{block 4}:{block 5}:{block 6}:{block
+     * 7}:{block 8}.
+     * 
+ * + * repeated string ip_addresses = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param values The ipAddresses to add. + * @return This builder for chaining. + */ + public Builder addAllIpAddresses(java.lang.Iterable values) { + ensureIpAddressesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, ipAddresses_); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. IPv4 addresses in the format
+     * {octet 1}.{octet 2}.{octet 3}.{octet 4} or IPv6 addresses in the format
+     * {block 1}:{block 2}:{block 3}:{block 4}:{block 5}:{block 6}:{block
+     * 7}:{block 8}.
+     * 
+ * + * repeated string ip_addresses = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearIpAddresses() { + ipAddresses_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. IPv4 addresses in the format
+     * {octet 1}.{octet 2}.{octet 3}.{octet 4} or IPv6 addresses in the format
+     * {block 1}:{block 2}:{block 3}:{block 4}:{block 5}:{block 6}:{block
+     * 7}:{block 8}.
+     * 
+ * + * repeated string ip_addresses = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes of the ipAddresses to add. + * @return This builder for chaining. + */ + public Builder addIpAddressesBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureIpAddressesIsMutable(); + ipAddresses_.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.NetworkConfig) + } + + // @@protoc_insertion_point(class_scope:google.cloud.filestore.v1beta1.NetworkConfig) + private static final com.google.cloud.filestore.v1beta1.NetworkConfig DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.filestore.v1beta1.NetworkConfig(); + } + + public static com.google.cloud.filestore.v1beta1.NetworkConfig getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public NetworkConfig parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new NetworkConfig(input, extensionRegistry); + } + }; + + 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.NetworkConfig getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/NetworkConfigOrBuilder.java b/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/NetworkConfigOrBuilder.java new file mode 100644 index 00000000..d651f55e --- /dev/null +++ b/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/NetworkConfigOrBuilder.java @@ -0,0 +1,222 @@ +/* + * 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 NetworkConfigOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.filestore.v1beta1.NetworkConfig) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The name of the Google Compute Engine
+   * [VPC network](/compute/docs/networks-and-firewalls#networks) to which the
+   * instance is connected.
+   * 
+ * + * string network = 1; + * + * @return The network. + */ + java.lang.String getNetwork(); + /** + * + * + *
+   * The name of the Google Compute Engine
+   * [VPC network](/compute/docs/networks-and-firewalls#networks) to which the
+   * instance is connected.
+   * 
+ * + * string network = 1; + * + * @return The bytes for network. + */ + com.google.protobuf.ByteString getNetworkBytes(); + + /** + * + * + *
+   * Internet protocol versions for which the instance has IP addresses
+   * assigned. For this version, only MODE_IPV4 is supported.
+   * 
+ * + * repeated .google.cloud.filestore.v1beta1.NetworkConfig.AddressMode modes = 3; + * + * @return A list containing the modes. + */ + java.util.List getModesList(); + /** + * + * + *
+   * Internet protocol versions for which the instance has IP addresses
+   * assigned. For this version, only MODE_IPV4 is supported.
+   * 
+ * + * repeated .google.cloud.filestore.v1beta1.NetworkConfig.AddressMode modes = 3; + * + * @return The count of modes. + */ + int getModesCount(); + /** + * + * + *
+   * Internet protocol versions for which the instance has IP addresses
+   * assigned. For this version, only MODE_IPV4 is supported.
+   * 
+ * + * repeated .google.cloud.filestore.v1beta1.NetworkConfig.AddressMode modes = 3; + * + * @param index The index of the element to return. + * @return The modes at the given index. + */ + com.google.cloud.filestore.v1beta1.NetworkConfig.AddressMode getModes(int index); + /** + * + * + *
+   * Internet protocol versions for which the instance has IP addresses
+   * assigned. For this version, only MODE_IPV4 is supported.
+   * 
+ * + * repeated .google.cloud.filestore.v1beta1.NetworkConfig.AddressMode modes = 3; + * + * @return A list containing the enum numeric values on the wire for modes. + */ + java.util.List getModesValueList(); + /** + * + * + *
+   * Internet protocol versions for which the instance has IP addresses
+   * assigned. For this version, only MODE_IPV4 is supported.
+   * 
+ * + * repeated .google.cloud.filestore.v1beta1.NetworkConfig.AddressMode modes = 3; + * + * @param index The index of the value to return. + * @return The enum numeric value on the wire of modes at the given index. + */ + 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
+   * ranges](https://www.arin.net/knowledge/address_filters.html) 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.
+   * 
+ * + * string reserved_ip_range = 4; + * + * @return The reservedIpRange. + */ + 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
+   * ranges](https://www.arin.net/knowledge/address_filters.html) 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.
+   * 
+ * + * string reserved_ip_range = 4; + * + * @return The bytes for reservedIpRange. + */ + com.google.protobuf.ByteString getReservedIpRangeBytes(); + + /** + * + * + *
+   * Output only. IPv4 addresses in the format
+   * {octet 1}.{octet 2}.{octet 3}.{octet 4} or IPv6 addresses in the format
+   * {block 1}:{block 2}:{block 3}:{block 4}:{block 5}:{block 6}:{block
+   * 7}:{block 8}.
+   * 
+ * + * repeated string ip_addresses = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return A list containing the ipAddresses. + */ + java.util.List getIpAddressesList(); + /** + * + * + *
+   * Output only. IPv4 addresses in the format
+   * {octet 1}.{octet 2}.{octet 3}.{octet 4} or IPv6 addresses in the format
+   * {block 1}:{block 2}:{block 3}:{block 4}:{block 5}:{block 6}:{block
+   * 7}:{block 8}.
+   * 
+ * + * repeated string ip_addresses = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The count of ipAddresses. + */ + int getIpAddressesCount(); + /** + * + * + *
+   * Output only. IPv4 addresses in the format
+   * {octet 1}.{octet 2}.{octet 3}.{octet 4} or IPv6 addresses in the format
+   * {block 1}:{block 2}:{block 3}:{block 4}:{block 5}:{block 6}:{block
+   * 7}:{block 8}.
+   * 
+ * + * repeated string ip_addresses = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param index The index of the element to return. + * @return The ipAddresses at the given index. + */ + java.lang.String getIpAddresses(int index); + /** + * + * + *
+   * Output only. IPv4 addresses in the format
+   * {octet 1}.{octet 2}.{octet 3}.{octet 4} or IPv6 addresses in the format
+   * {block 1}:{block 2}:{block 3}:{block 4}:{block 5}:{block 6}:{block
+   * 7}:{block 8}.
+   * 
+ * + * repeated string ip_addresses = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param index The index of the value to return. + * @return The bytes of the ipAddresses at the given index. + */ + com.google.protobuf.ByteString getIpAddressesBytes(int index); +} diff --git a/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/NfsExportOptions.java b/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/NfsExportOptions.java new file mode 100644 index 00000000..ce4b8114 --- /dev/null +++ b/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/NfsExportOptions.java @@ -0,0 +1,1696 @@ +/* + * 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; + +/** + * + * + *
+ * NFS export options specifications.
+ * 
+ * + * Protobuf type {@code google.cloud.filestore.v1beta1.NfsExportOptions} + */ +public final class NfsExportOptions extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.filestore.v1beta1.NfsExportOptions) + NfsExportOptionsOrBuilder { + private static final long serialVersionUID = 0L; + // Use NfsExportOptions.newBuilder() to construct. + private NfsExportOptions(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private NfsExportOptions() { + ipRanges_ = com.google.protobuf.LazyStringArrayList.EMPTY; + accessMode_ = 0; + squashMode_ = 0; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new NfsExportOptions(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private NfsExportOptions( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + ipRanges_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000001; + } + ipRanges_.add(s); + break; + } + case 16: + { + int rawValue = input.readEnum(); + + accessMode_ = rawValue; + break; + } + case 24: + { + int rawValue = input.readEnum(); + + squashMode_ = rawValue; + break; + } + case 32: + { + anonUid_ = input.readInt64(); + break; + } + case 40: + { + anonGid_ = input.readInt64(); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + ipRanges_ = ipRanges_.getUnmodifiableView(); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.filestore.v1beta1.CloudFilestoreServiceProto + .internal_static_google_cloud_filestore_v1beta1_NfsExportOptions_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.filestore.v1beta1.CloudFilestoreServiceProto + .internal_static_google_cloud_filestore_v1beta1_NfsExportOptions_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.filestore.v1beta1.NfsExportOptions.class, + com.google.cloud.filestore.v1beta1.NfsExportOptions.Builder.class); + } + + /** + * + * + *
+   * The access mode.
+   * 
+ * + * Protobuf enum {@code google.cloud.filestore.v1beta1.NfsExportOptions.AccessMode} + */ + public enum AccessMode implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * AccessMode not set.
+     * 
+ * + * ACCESS_MODE_UNSPECIFIED = 0; + */ + ACCESS_MODE_UNSPECIFIED(0), + /** + * + * + *
+     * The client can only read the file share.
+     * 
+ * + * READ_ONLY = 1; + */ + READ_ONLY(1), + /** + * + * + *
+     * The client can read and write the file share (default).
+     * 
+ * + * READ_WRITE = 2; + */ + READ_WRITE(2), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * AccessMode not set.
+     * 
+ * + * ACCESS_MODE_UNSPECIFIED = 0; + */ + public static final int ACCESS_MODE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * The client can only read the file share.
+     * 
+ * + * READ_ONLY = 1; + */ + public static final int READ_ONLY_VALUE = 1; + /** + * + * + *
+     * The client can read and write the file share (default).
+     * 
+ * + * READ_WRITE = 2; + */ + public static final int READ_WRITE_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 AccessMode 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 AccessMode forNumber(int value) { + switch (value) { + case 0: + return ACCESS_MODE_UNSPECIFIED; + case 1: + return READ_ONLY; + case 2: + return READ_WRITE; + 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 AccessMode findValueByNumber(int number) { + return AccessMode.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.NfsExportOptions.getDescriptor() + .getEnumTypes() + .get(0); + } + + private static final AccessMode[] VALUES = values(); + + public static AccessMode 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 AccessMode(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.filestore.v1beta1.NfsExportOptions.AccessMode) + } + + /** + * + * + *
+   * The squash mode.
+   * 
+ * + * Protobuf enum {@code google.cloud.filestore.v1beta1.NfsExportOptions.SquashMode} + */ + public enum SquashMode implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * SquashMode not set.
+     * 
+ * + * SQUASH_MODE_UNSPECIFIED = 0; + */ + SQUASH_MODE_UNSPECIFIED(0), + /** + * + * + *
+     * The Root user has root access to the file share (default).
+     * 
+ * + * NO_ROOT_SQUASH = 1; + */ + NO_ROOT_SQUASH(1), + /** + * + * + *
+     * The Root user has squashed access to the anonymous uid/gid.
+     * 
+ * + * ROOT_SQUASH = 2; + */ + ROOT_SQUASH(2), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * SquashMode not set.
+     * 
+ * + * SQUASH_MODE_UNSPECIFIED = 0; + */ + public static final int SQUASH_MODE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * The Root user has root access to the file share (default).
+     * 
+ * + * NO_ROOT_SQUASH = 1; + */ + public static final int NO_ROOT_SQUASH_VALUE = 1; + /** + * + * + *
+     * The Root user has squashed access to the anonymous uid/gid.
+     * 
+ * + * ROOT_SQUASH = 2; + */ + public static final int ROOT_SQUASH_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 SquashMode 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 SquashMode forNumber(int value) { + switch (value) { + case 0: + return SQUASH_MODE_UNSPECIFIED; + case 1: + return NO_ROOT_SQUASH; + case 2: + return ROOT_SQUASH; + 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 SquashMode findValueByNumber(int number) { + return SquashMode.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.NfsExportOptions.getDescriptor() + .getEnumTypes() + .get(1); + } + + private static final SquashMode[] VALUES = values(); + + public static SquashMode 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 SquashMode(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.filestore.v1beta1.NfsExportOptions.SquashMode) + } + + public static final int IP_RANGES_FIELD_NUMBER = 1; + private com.google.protobuf.LazyStringList ipRanges_; + /** + * + * + *
+   * List of either an IPv4 addresses in the format
+   * {octet 1}.{octet 2}.{octet 3}.{octet 4} or CIDR ranges in the format
+   * {octet 1}.{octet 2}.{octet 3}.{octet 4}/{mask size} which may mount the
+   * file share.
+   * Overlapping IP ranges are not allowed, both within and across
+   * NfsExportOptions. An error will be returned.
+   * The limit is 64 IP ranges/addresses for each FileShareConfig among all
+   * NfsExportOptions.
+   * 
+ * + * repeated string ip_ranges = 1; + * + * @return A list containing the ipRanges. + */ + public com.google.protobuf.ProtocolStringList getIpRangesList() { + return ipRanges_; + } + /** + * + * + *
+   * List of either an IPv4 addresses in the format
+   * {octet 1}.{octet 2}.{octet 3}.{octet 4} or CIDR ranges in the format
+   * {octet 1}.{octet 2}.{octet 3}.{octet 4}/{mask size} which may mount the
+   * file share.
+   * Overlapping IP ranges are not allowed, both within and across
+   * NfsExportOptions. An error will be returned.
+   * The limit is 64 IP ranges/addresses for each FileShareConfig among all
+   * NfsExportOptions.
+   * 
+ * + * repeated string ip_ranges = 1; + * + * @return The count of ipRanges. + */ + public int getIpRangesCount() { + return ipRanges_.size(); + } + /** + * + * + *
+   * List of either an IPv4 addresses in the format
+   * {octet 1}.{octet 2}.{octet 3}.{octet 4} or CIDR ranges in the format
+   * {octet 1}.{octet 2}.{octet 3}.{octet 4}/{mask size} which may mount the
+   * file share.
+   * Overlapping IP ranges are not allowed, both within and across
+   * NfsExportOptions. An error will be returned.
+   * The limit is 64 IP ranges/addresses for each FileShareConfig among all
+   * NfsExportOptions.
+   * 
+ * + * repeated string ip_ranges = 1; + * + * @param index The index of the element to return. + * @return The ipRanges at the given index. + */ + public java.lang.String getIpRanges(int index) { + return ipRanges_.get(index); + } + /** + * + * + *
+   * List of either an IPv4 addresses in the format
+   * {octet 1}.{octet 2}.{octet 3}.{octet 4} or CIDR ranges in the format
+   * {octet 1}.{octet 2}.{octet 3}.{octet 4}/{mask size} which may mount the
+   * file share.
+   * Overlapping IP ranges are not allowed, both within and across
+   * NfsExportOptions. An error will be returned.
+   * The limit is 64 IP ranges/addresses for each FileShareConfig among all
+   * NfsExportOptions.
+   * 
+ * + * repeated string ip_ranges = 1; + * + * @param index The index of the value to return. + * @return The bytes of the ipRanges at the given index. + */ + public com.google.protobuf.ByteString getIpRangesBytes(int index) { + return ipRanges_.getByteString(index); + } + + public static final int ACCESS_MODE_FIELD_NUMBER = 2; + private int accessMode_; + /** + * + * + *
+   * Either READ_ONLY, for allowing only read requests on the exported
+   * directory, or READ_WRITE, for allowing both read and write requests.
+   * The default is READ_WRITE.
+   * 
+ * + * .google.cloud.filestore.v1beta1.NfsExportOptions.AccessMode access_mode = 2; + * + * @return The enum numeric value on the wire for accessMode. + */ + @java.lang.Override + public int getAccessModeValue() { + return accessMode_; + } + /** + * + * + *
+   * Either READ_ONLY, for allowing only read requests on the exported
+   * directory, or READ_WRITE, for allowing both read and write requests.
+   * The default is READ_WRITE.
+   * 
+ * + * .google.cloud.filestore.v1beta1.NfsExportOptions.AccessMode access_mode = 2; + * + * @return The accessMode. + */ + @java.lang.Override + public com.google.cloud.filestore.v1beta1.NfsExportOptions.AccessMode getAccessMode() { + @SuppressWarnings("deprecation") + com.google.cloud.filestore.v1beta1.NfsExportOptions.AccessMode result = + com.google.cloud.filestore.v1beta1.NfsExportOptions.AccessMode.valueOf(accessMode_); + return result == null + ? com.google.cloud.filestore.v1beta1.NfsExportOptions.AccessMode.UNRECOGNIZED + : result; + } + + public static final int SQUASH_MODE_FIELD_NUMBER = 3; + private int squashMode_; + /** + * + * + *
+   * Either NO_ROOT_SQUASH, for allowing root access on the exported directory,
+   * or ROOT_SQUASH, for not allowing root access. The default is
+   * NO_ROOT_SQUASH.
+   * 
+ * + * .google.cloud.filestore.v1beta1.NfsExportOptions.SquashMode squash_mode = 3; + * + * @return The enum numeric value on the wire for squashMode. + */ + @java.lang.Override + public int getSquashModeValue() { + return squashMode_; + } + /** + * + * + *
+   * Either NO_ROOT_SQUASH, for allowing root access on the exported directory,
+   * or ROOT_SQUASH, for not allowing root access. The default is
+   * NO_ROOT_SQUASH.
+   * 
+ * + * .google.cloud.filestore.v1beta1.NfsExportOptions.SquashMode squash_mode = 3; + * + * @return The squashMode. + */ + @java.lang.Override + public com.google.cloud.filestore.v1beta1.NfsExportOptions.SquashMode getSquashMode() { + @SuppressWarnings("deprecation") + com.google.cloud.filestore.v1beta1.NfsExportOptions.SquashMode result = + com.google.cloud.filestore.v1beta1.NfsExportOptions.SquashMode.valueOf(squashMode_); + return result == null + ? com.google.cloud.filestore.v1beta1.NfsExportOptions.SquashMode.UNRECOGNIZED + : result; + } + + public static final int ANON_UID_FIELD_NUMBER = 4; + private long anonUid_; + /** + * + * + *
+   * An integer representing the anonymous user id with a default value of
+   * 65534.
+   * Anon_uid may only be set with squash_mode of ROOT_SQUASH.  An error will be
+   * returned if this field is specified for other squash_mode settings.
+   * 
+ * + * int64 anon_uid = 4; + * + * @return The anonUid. + */ + @java.lang.Override + public long getAnonUid() { + return anonUid_; + } + + public static final int ANON_GID_FIELD_NUMBER = 5; + private long anonGid_; + /** + * + * + *
+   * An integer representing the anonymous group id with a default value of
+   * 65534.
+   * Anon_gid may only be set with squash_mode of ROOT_SQUASH.  An error will be
+   * returned if this field is specified for other squash_mode settings.
+   * 
+ * + * int64 anon_gid = 5; + * + * @return The anonGid. + */ + @java.lang.Override + public long getAnonGid() { + return anonGid_; + } + + 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 < ipRanges_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, ipRanges_.getRaw(i)); + } + if (accessMode_ + != com.google.cloud.filestore.v1beta1.NfsExportOptions.AccessMode.ACCESS_MODE_UNSPECIFIED + .getNumber()) { + output.writeEnum(2, accessMode_); + } + if (squashMode_ + != com.google.cloud.filestore.v1beta1.NfsExportOptions.SquashMode.SQUASH_MODE_UNSPECIFIED + .getNumber()) { + output.writeEnum(3, squashMode_); + } + if (anonUid_ != 0L) { + output.writeInt64(4, anonUid_); + } + if (anonGid_ != 0L) { + output.writeInt64(5, anonGid_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + { + int dataSize = 0; + for (int i = 0; i < ipRanges_.size(); i++) { + dataSize += computeStringSizeNoTag(ipRanges_.getRaw(i)); + } + size += dataSize; + size += 1 * getIpRangesList().size(); + } + if (accessMode_ + != com.google.cloud.filestore.v1beta1.NfsExportOptions.AccessMode.ACCESS_MODE_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(2, accessMode_); + } + if (squashMode_ + != com.google.cloud.filestore.v1beta1.NfsExportOptions.SquashMode.SQUASH_MODE_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(3, squashMode_); + } + if (anonUid_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(4, anonUid_); + } + if (anonGid_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(5, anonGid_); + } + size += unknownFields.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.NfsExportOptions)) { + return super.equals(obj); + } + com.google.cloud.filestore.v1beta1.NfsExportOptions other = + (com.google.cloud.filestore.v1beta1.NfsExportOptions) obj; + + if (!getIpRangesList().equals(other.getIpRangesList())) return false; + if (accessMode_ != other.accessMode_) return false; + if (squashMode_ != other.squashMode_) return false; + if (getAnonUid() != other.getAnonUid()) return false; + if (getAnonGid() != other.getAnonGid()) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getIpRangesCount() > 0) { + hash = (37 * hash) + IP_RANGES_FIELD_NUMBER; + hash = (53 * hash) + getIpRangesList().hashCode(); + } + hash = (37 * hash) + ACCESS_MODE_FIELD_NUMBER; + hash = (53 * hash) + accessMode_; + hash = (37 * hash) + SQUASH_MODE_FIELD_NUMBER; + hash = (53 * hash) + squashMode_; + hash = (37 * hash) + ANON_UID_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getAnonUid()); + hash = (37 * hash) + ANON_GID_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getAnonGid()); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.filestore.v1beta1.NfsExportOptions parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.filestore.v1beta1.NfsExportOptions 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.NfsExportOptions parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.filestore.v1beta1.NfsExportOptions 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.NfsExportOptions parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.filestore.v1beta1.NfsExportOptions 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.NfsExportOptions parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.filestore.v1beta1.NfsExportOptions 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.NfsExportOptions parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.filestore.v1beta1.NfsExportOptions 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.NfsExportOptions 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.NfsExportOptions 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.NfsExportOptions 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; + } + /** + * + * + *
+   * NFS export options specifications.
+   * 
+ * + * Protobuf type {@code google.cloud.filestore.v1beta1.NfsExportOptions} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.filestore.v1beta1.NfsExportOptions) + com.google.cloud.filestore.v1beta1.NfsExportOptionsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.filestore.v1beta1.CloudFilestoreServiceProto + .internal_static_google_cloud_filestore_v1beta1_NfsExportOptions_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.filestore.v1beta1.CloudFilestoreServiceProto + .internal_static_google_cloud_filestore_v1beta1_NfsExportOptions_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.filestore.v1beta1.NfsExportOptions.class, + com.google.cloud.filestore.v1beta1.NfsExportOptions.Builder.class); + } + + // Construct using com.google.cloud.filestore.v1beta1.NfsExportOptions.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + ipRanges_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + accessMode_ = 0; + + squashMode_ = 0; + + anonUid_ = 0L; + + anonGid_ = 0L; + + 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_NfsExportOptions_descriptor; + } + + @java.lang.Override + public com.google.cloud.filestore.v1beta1.NfsExportOptions getDefaultInstanceForType() { + return com.google.cloud.filestore.v1beta1.NfsExportOptions.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.filestore.v1beta1.NfsExportOptions build() { + com.google.cloud.filestore.v1beta1.NfsExportOptions result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.filestore.v1beta1.NfsExportOptions buildPartial() { + com.google.cloud.filestore.v1beta1.NfsExportOptions result = + new com.google.cloud.filestore.v1beta1.NfsExportOptions(this); + int from_bitField0_ = bitField0_; + if (((bitField0_ & 0x00000001) != 0)) { + ipRanges_ = ipRanges_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.ipRanges_ = ipRanges_; + result.accessMode_ = accessMode_; + result.squashMode_ = squashMode_; + result.anonUid_ = anonUid_; + result.anonGid_ = anonGid_; + 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.NfsExportOptions) { + return mergeFrom((com.google.cloud.filestore.v1beta1.NfsExportOptions) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.filestore.v1beta1.NfsExportOptions other) { + if (other == com.google.cloud.filestore.v1beta1.NfsExportOptions.getDefaultInstance()) + return this; + if (!other.ipRanges_.isEmpty()) { + if (ipRanges_.isEmpty()) { + ipRanges_ = other.ipRanges_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureIpRangesIsMutable(); + ipRanges_.addAll(other.ipRanges_); + } + onChanged(); + } + if (other.accessMode_ != 0) { + setAccessModeValue(other.getAccessModeValue()); + } + if (other.squashMode_ != 0) { + setSquashModeValue(other.getSquashModeValue()); + } + if (other.getAnonUid() != 0L) { + setAnonUid(other.getAnonUid()); + } + if (other.getAnonGid() != 0L) { + setAnonGid(other.getAnonGid()); + } + this.mergeUnknownFields(other.unknownFields); + 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 { + com.google.cloud.filestore.v1beta1.NfsExportOptions parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.filestore.v1beta1.NfsExportOptions) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private com.google.protobuf.LazyStringList ipRanges_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureIpRangesIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + ipRanges_ = new com.google.protobuf.LazyStringArrayList(ipRanges_); + bitField0_ |= 0x00000001; + } + } + /** + * + * + *
+     * List of either an IPv4 addresses in the format
+     * {octet 1}.{octet 2}.{octet 3}.{octet 4} or CIDR ranges in the format
+     * {octet 1}.{octet 2}.{octet 3}.{octet 4}/{mask size} which may mount the
+     * file share.
+     * Overlapping IP ranges are not allowed, both within and across
+     * NfsExportOptions. An error will be returned.
+     * The limit is 64 IP ranges/addresses for each FileShareConfig among all
+     * NfsExportOptions.
+     * 
+ * + * repeated string ip_ranges = 1; + * + * @return A list containing the ipRanges. + */ + public com.google.protobuf.ProtocolStringList getIpRangesList() { + return ipRanges_.getUnmodifiableView(); + } + /** + * + * + *
+     * List of either an IPv4 addresses in the format
+     * {octet 1}.{octet 2}.{octet 3}.{octet 4} or CIDR ranges in the format
+     * {octet 1}.{octet 2}.{octet 3}.{octet 4}/{mask size} which may mount the
+     * file share.
+     * Overlapping IP ranges are not allowed, both within and across
+     * NfsExportOptions. An error will be returned.
+     * The limit is 64 IP ranges/addresses for each FileShareConfig among all
+     * NfsExportOptions.
+     * 
+ * + * repeated string ip_ranges = 1; + * + * @return The count of ipRanges. + */ + public int getIpRangesCount() { + return ipRanges_.size(); + } + /** + * + * + *
+     * List of either an IPv4 addresses in the format
+     * {octet 1}.{octet 2}.{octet 3}.{octet 4} or CIDR ranges in the format
+     * {octet 1}.{octet 2}.{octet 3}.{octet 4}/{mask size} which may mount the
+     * file share.
+     * Overlapping IP ranges are not allowed, both within and across
+     * NfsExportOptions. An error will be returned.
+     * The limit is 64 IP ranges/addresses for each FileShareConfig among all
+     * NfsExportOptions.
+     * 
+ * + * repeated string ip_ranges = 1; + * + * @param index The index of the element to return. + * @return The ipRanges at the given index. + */ + public java.lang.String getIpRanges(int index) { + return ipRanges_.get(index); + } + /** + * + * + *
+     * List of either an IPv4 addresses in the format
+     * {octet 1}.{octet 2}.{octet 3}.{octet 4} or CIDR ranges in the format
+     * {octet 1}.{octet 2}.{octet 3}.{octet 4}/{mask size} which may mount the
+     * file share.
+     * Overlapping IP ranges are not allowed, both within and across
+     * NfsExportOptions. An error will be returned.
+     * The limit is 64 IP ranges/addresses for each FileShareConfig among all
+     * NfsExportOptions.
+     * 
+ * + * repeated string ip_ranges = 1; + * + * @param index The index of the value to return. + * @return The bytes of the ipRanges at the given index. + */ + public com.google.protobuf.ByteString getIpRangesBytes(int index) { + return ipRanges_.getByteString(index); + } + /** + * + * + *
+     * List of either an IPv4 addresses in the format
+     * {octet 1}.{octet 2}.{octet 3}.{octet 4} or CIDR ranges in the format
+     * {octet 1}.{octet 2}.{octet 3}.{octet 4}/{mask size} which may mount the
+     * file share.
+     * Overlapping IP ranges are not allowed, both within and across
+     * NfsExportOptions. An error will be returned.
+     * The limit is 64 IP ranges/addresses for each FileShareConfig among all
+     * NfsExportOptions.
+     * 
+ * + * repeated string ip_ranges = 1; + * + * @param index The index to set the value at. + * @param value The ipRanges to set. + * @return This builder for chaining. + */ + public Builder setIpRanges(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureIpRangesIsMutable(); + ipRanges_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * List of either an IPv4 addresses in the format
+     * {octet 1}.{octet 2}.{octet 3}.{octet 4} or CIDR ranges in the format
+     * {octet 1}.{octet 2}.{octet 3}.{octet 4}/{mask size} which may mount the
+     * file share.
+     * Overlapping IP ranges are not allowed, both within and across
+     * NfsExportOptions. An error will be returned.
+     * The limit is 64 IP ranges/addresses for each FileShareConfig among all
+     * NfsExportOptions.
+     * 
+ * + * repeated string ip_ranges = 1; + * + * @param value The ipRanges to add. + * @return This builder for chaining. + */ + public Builder addIpRanges(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureIpRangesIsMutable(); + ipRanges_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+     * List of either an IPv4 addresses in the format
+     * {octet 1}.{octet 2}.{octet 3}.{octet 4} or CIDR ranges in the format
+     * {octet 1}.{octet 2}.{octet 3}.{octet 4}/{mask size} which may mount the
+     * file share.
+     * Overlapping IP ranges are not allowed, both within and across
+     * NfsExportOptions. An error will be returned.
+     * The limit is 64 IP ranges/addresses for each FileShareConfig among all
+     * NfsExportOptions.
+     * 
+ * + * repeated string ip_ranges = 1; + * + * @param values The ipRanges to add. + * @return This builder for chaining. + */ + public Builder addAllIpRanges(java.lang.Iterable values) { + ensureIpRangesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, ipRanges_); + onChanged(); + return this; + } + /** + * + * + *
+     * List of either an IPv4 addresses in the format
+     * {octet 1}.{octet 2}.{octet 3}.{octet 4} or CIDR ranges in the format
+     * {octet 1}.{octet 2}.{octet 3}.{octet 4}/{mask size} which may mount the
+     * file share.
+     * Overlapping IP ranges are not allowed, both within and across
+     * NfsExportOptions. An error will be returned.
+     * The limit is 64 IP ranges/addresses for each FileShareConfig among all
+     * NfsExportOptions.
+     * 
+ * + * repeated string ip_ranges = 1; + * + * @return This builder for chaining. + */ + public Builder clearIpRanges() { + ipRanges_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * List of either an IPv4 addresses in the format
+     * {octet 1}.{octet 2}.{octet 3}.{octet 4} or CIDR ranges in the format
+     * {octet 1}.{octet 2}.{octet 3}.{octet 4}/{mask size} which may mount the
+     * file share.
+     * Overlapping IP ranges are not allowed, both within and across
+     * NfsExportOptions. An error will be returned.
+     * The limit is 64 IP ranges/addresses for each FileShareConfig among all
+     * NfsExportOptions.
+     * 
+ * + * repeated string ip_ranges = 1; + * + * @param value The bytes of the ipRanges to add. + * @return This builder for chaining. + */ + public Builder addIpRangesBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureIpRangesIsMutable(); + ipRanges_.add(value); + onChanged(); + return this; + } + + private int accessMode_ = 0; + /** + * + * + *
+     * Either READ_ONLY, for allowing only read requests on the exported
+     * directory, or READ_WRITE, for allowing both read and write requests.
+     * The default is READ_WRITE.
+     * 
+ * + * .google.cloud.filestore.v1beta1.NfsExportOptions.AccessMode access_mode = 2; + * + * @return The enum numeric value on the wire for accessMode. + */ + @java.lang.Override + public int getAccessModeValue() { + return accessMode_; + } + /** + * + * + *
+     * Either READ_ONLY, for allowing only read requests on the exported
+     * directory, or READ_WRITE, for allowing both read and write requests.
+     * The default is READ_WRITE.
+     * 
+ * + * .google.cloud.filestore.v1beta1.NfsExportOptions.AccessMode access_mode = 2; + * + * @param value The enum numeric value on the wire for accessMode to set. + * @return This builder for chaining. + */ + public Builder setAccessModeValue(int value) { + + accessMode_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Either READ_ONLY, for allowing only read requests on the exported
+     * directory, or READ_WRITE, for allowing both read and write requests.
+     * The default is READ_WRITE.
+     * 
+ * + * .google.cloud.filestore.v1beta1.NfsExportOptions.AccessMode access_mode = 2; + * + * @return The accessMode. + */ + @java.lang.Override + public com.google.cloud.filestore.v1beta1.NfsExportOptions.AccessMode getAccessMode() { + @SuppressWarnings("deprecation") + com.google.cloud.filestore.v1beta1.NfsExportOptions.AccessMode result = + com.google.cloud.filestore.v1beta1.NfsExportOptions.AccessMode.valueOf(accessMode_); + return result == null + ? com.google.cloud.filestore.v1beta1.NfsExportOptions.AccessMode.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * Either READ_ONLY, for allowing only read requests on the exported
+     * directory, or READ_WRITE, for allowing both read and write requests.
+     * The default is READ_WRITE.
+     * 
+ * + * .google.cloud.filestore.v1beta1.NfsExportOptions.AccessMode access_mode = 2; + * + * @param value The accessMode to set. + * @return This builder for chaining. + */ + public Builder setAccessMode( + com.google.cloud.filestore.v1beta1.NfsExportOptions.AccessMode value) { + if (value == null) { + throw new NullPointerException(); + } + + accessMode_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Either READ_ONLY, for allowing only read requests on the exported
+     * directory, or READ_WRITE, for allowing both read and write requests.
+     * The default is READ_WRITE.
+     * 
+ * + * .google.cloud.filestore.v1beta1.NfsExportOptions.AccessMode access_mode = 2; + * + * @return This builder for chaining. + */ + public Builder clearAccessMode() { + + accessMode_ = 0; + onChanged(); + return this; + } + + private int squashMode_ = 0; + /** + * + * + *
+     * Either NO_ROOT_SQUASH, for allowing root access on the exported directory,
+     * or ROOT_SQUASH, for not allowing root access. The default is
+     * NO_ROOT_SQUASH.
+     * 
+ * + * .google.cloud.filestore.v1beta1.NfsExportOptions.SquashMode squash_mode = 3; + * + * @return The enum numeric value on the wire for squashMode. + */ + @java.lang.Override + public int getSquashModeValue() { + return squashMode_; + } + /** + * + * + *
+     * Either NO_ROOT_SQUASH, for allowing root access on the exported directory,
+     * or ROOT_SQUASH, for not allowing root access. The default is
+     * NO_ROOT_SQUASH.
+     * 
+ * + * .google.cloud.filestore.v1beta1.NfsExportOptions.SquashMode squash_mode = 3; + * + * @param value The enum numeric value on the wire for squashMode to set. + * @return This builder for chaining. + */ + public Builder setSquashModeValue(int value) { + + squashMode_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Either NO_ROOT_SQUASH, for allowing root access on the exported directory,
+     * or ROOT_SQUASH, for not allowing root access. The default is
+     * NO_ROOT_SQUASH.
+     * 
+ * + * .google.cloud.filestore.v1beta1.NfsExportOptions.SquashMode squash_mode = 3; + * + * @return The squashMode. + */ + @java.lang.Override + public com.google.cloud.filestore.v1beta1.NfsExportOptions.SquashMode getSquashMode() { + @SuppressWarnings("deprecation") + com.google.cloud.filestore.v1beta1.NfsExportOptions.SquashMode result = + com.google.cloud.filestore.v1beta1.NfsExportOptions.SquashMode.valueOf(squashMode_); + return result == null + ? com.google.cloud.filestore.v1beta1.NfsExportOptions.SquashMode.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * Either NO_ROOT_SQUASH, for allowing root access on the exported directory,
+     * or ROOT_SQUASH, for not allowing root access. The default is
+     * NO_ROOT_SQUASH.
+     * 
+ * + * .google.cloud.filestore.v1beta1.NfsExportOptions.SquashMode squash_mode = 3; + * + * @param value The squashMode to set. + * @return This builder for chaining. + */ + public Builder setSquashMode( + com.google.cloud.filestore.v1beta1.NfsExportOptions.SquashMode value) { + if (value == null) { + throw new NullPointerException(); + } + + squashMode_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Either NO_ROOT_SQUASH, for allowing root access on the exported directory,
+     * or ROOT_SQUASH, for not allowing root access. The default is
+     * NO_ROOT_SQUASH.
+     * 
+ * + * .google.cloud.filestore.v1beta1.NfsExportOptions.SquashMode squash_mode = 3; + * + * @return This builder for chaining. + */ + public Builder clearSquashMode() { + + squashMode_ = 0; + onChanged(); + return this; + } + + private long anonUid_; + /** + * + * + *
+     * An integer representing the anonymous user id with a default value of
+     * 65534.
+     * Anon_uid may only be set with squash_mode of ROOT_SQUASH.  An error will be
+     * returned if this field is specified for other squash_mode settings.
+     * 
+ * + * int64 anon_uid = 4; + * + * @return The anonUid. + */ + @java.lang.Override + public long getAnonUid() { + return anonUid_; + } + /** + * + * + *
+     * An integer representing the anonymous user id with a default value of
+     * 65534.
+     * Anon_uid may only be set with squash_mode of ROOT_SQUASH.  An error will be
+     * returned if this field is specified for other squash_mode settings.
+     * 
+ * + * int64 anon_uid = 4; + * + * @param value The anonUid to set. + * @return This builder for chaining. + */ + public Builder setAnonUid(long value) { + + anonUid_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * An integer representing the anonymous user id with a default value of
+     * 65534.
+     * Anon_uid may only be set with squash_mode of ROOT_SQUASH.  An error will be
+     * returned if this field is specified for other squash_mode settings.
+     * 
+ * + * int64 anon_uid = 4; + * + * @return This builder for chaining. + */ + public Builder clearAnonUid() { + + anonUid_ = 0L; + onChanged(); + return this; + } + + private long anonGid_; + /** + * + * + *
+     * An integer representing the anonymous group id with a default value of
+     * 65534.
+     * Anon_gid may only be set with squash_mode of ROOT_SQUASH.  An error will be
+     * returned if this field is specified for other squash_mode settings.
+     * 
+ * + * int64 anon_gid = 5; + * + * @return The anonGid. + */ + @java.lang.Override + public long getAnonGid() { + return anonGid_; + } + /** + * + * + *
+     * An integer representing the anonymous group id with a default value of
+     * 65534.
+     * Anon_gid may only be set with squash_mode of ROOT_SQUASH.  An error will be
+     * returned if this field is specified for other squash_mode settings.
+     * 
+ * + * int64 anon_gid = 5; + * + * @param value The anonGid to set. + * @return This builder for chaining. + */ + public Builder setAnonGid(long value) { + + anonGid_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * An integer representing the anonymous group id with a default value of
+     * 65534.
+     * Anon_gid may only be set with squash_mode of ROOT_SQUASH.  An error will be
+     * returned if this field is specified for other squash_mode settings.
+     * 
+ * + * int64 anon_gid = 5; + * + * @return This builder for chaining. + */ + public Builder clearAnonGid() { + + anonGid_ = 0L; + 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.NfsExportOptions) + } + + // @@protoc_insertion_point(class_scope:google.cloud.filestore.v1beta1.NfsExportOptions) + private static final com.google.cloud.filestore.v1beta1.NfsExportOptions DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.filestore.v1beta1.NfsExportOptions(); + } + + public static com.google.cloud.filestore.v1beta1.NfsExportOptions getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public NfsExportOptions parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new NfsExportOptions(input, extensionRegistry); + } + }; + + 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.NfsExportOptions getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/NfsExportOptionsOrBuilder.java b/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/NfsExportOptionsOrBuilder.java new file mode 100644 index 00000000..9159dd3d --- /dev/null +++ b/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/NfsExportOptionsOrBuilder.java @@ -0,0 +1,194 @@ +/* + * 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 NfsExportOptionsOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.filestore.v1beta1.NfsExportOptions) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * List of either an IPv4 addresses in the format
+   * {octet 1}.{octet 2}.{octet 3}.{octet 4} or CIDR ranges in the format
+   * {octet 1}.{octet 2}.{octet 3}.{octet 4}/{mask size} which may mount the
+   * file share.
+   * Overlapping IP ranges are not allowed, both within and across
+   * NfsExportOptions. An error will be returned.
+   * The limit is 64 IP ranges/addresses for each FileShareConfig among all
+   * NfsExportOptions.
+   * 
+ * + * repeated string ip_ranges = 1; + * + * @return A list containing the ipRanges. + */ + java.util.List getIpRangesList(); + /** + * + * + *
+   * List of either an IPv4 addresses in the format
+   * {octet 1}.{octet 2}.{octet 3}.{octet 4} or CIDR ranges in the format
+   * {octet 1}.{octet 2}.{octet 3}.{octet 4}/{mask size} which may mount the
+   * file share.
+   * Overlapping IP ranges are not allowed, both within and across
+   * NfsExportOptions. An error will be returned.
+   * The limit is 64 IP ranges/addresses for each FileShareConfig among all
+   * NfsExportOptions.
+   * 
+ * + * repeated string ip_ranges = 1; + * + * @return The count of ipRanges. + */ + int getIpRangesCount(); + /** + * + * + *
+   * List of either an IPv4 addresses in the format
+   * {octet 1}.{octet 2}.{octet 3}.{octet 4} or CIDR ranges in the format
+   * {octet 1}.{octet 2}.{octet 3}.{octet 4}/{mask size} which may mount the
+   * file share.
+   * Overlapping IP ranges are not allowed, both within and across
+   * NfsExportOptions. An error will be returned.
+   * The limit is 64 IP ranges/addresses for each FileShareConfig among all
+   * NfsExportOptions.
+   * 
+ * + * repeated string ip_ranges = 1; + * + * @param index The index of the element to return. + * @return The ipRanges at the given index. + */ + java.lang.String getIpRanges(int index); + /** + * + * + *
+   * List of either an IPv4 addresses in the format
+   * {octet 1}.{octet 2}.{octet 3}.{octet 4} or CIDR ranges in the format
+   * {octet 1}.{octet 2}.{octet 3}.{octet 4}/{mask size} which may mount the
+   * file share.
+   * Overlapping IP ranges are not allowed, both within and across
+   * NfsExportOptions. An error will be returned.
+   * The limit is 64 IP ranges/addresses for each FileShareConfig among all
+   * NfsExportOptions.
+   * 
+ * + * repeated string ip_ranges = 1; + * + * @param index The index of the value to return. + * @return The bytes of the ipRanges at the given index. + */ + com.google.protobuf.ByteString getIpRangesBytes(int index); + + /** + * + * + *
+   * Either READ_ONLY, for allowing only read requests on the exported
+   * directory, or READ_WRITE, for allowing both read and write requests.
+   * The default is READ_WRITE.
+   * 
+ * + * .google.cloud.filestore.v1beta1.NfsExportOptions.AccessMode access_mode = 2; + * + * @return The enum numeric value on the wire for accessMode. + */ + int getAccessModeValue(); + /** + * + * + *
+   * Either READ_ONLY, for allowing only read requests on the exported
+   * directory, or READ_WRITE, for allowing both read and write requests.
+   * The default is READ_WRITE.
+   * 
+ * + * .google.cloud.filestore.v1beta1.NfsExportOptions.AccessMode access_mode = 2; + * + * @return The accessMode. + */ + com.google.cloud.filestore.v1beta1.NfsExportOptions.AccessMode getAccessMode(); + + /** + * + * + *
+   * Either NO_ROOT_SQUASH, for allowing root access on the exported directory,
+   * or ROOT_SQUASH, for not allowing root access. The default is
+   * NO_ROOT_SQUASH.
+   * 
+ * + * .google.cloud.filestore.v1beta1.NfsExportOptions.SquashMode squash_mode = 3; + * + * @return The enum numeric value on the wire for squashMode. + */ + int getSquashModeValue(); + /** + * + * + *
+   * Either NO_ROOT_SQUASH, for allowing root access on the exported directory,
+   * or ROOT_SQUASH, for not allowing root access. The default is
+   * NO_ROOT_SQUASH.
+   * 
+ * + * .google.cloud.filestore.v1beta1.NfsExportOptions.SquashMode squash_mode = 3; + * + * @return The squashMode. + */ + com.google.cloud.filestore.v1beta1.NfsExportOptions.SquashMode getSquashMode(); + + /** + * + * + *
+   * An integer representing the anonymous user id with a default value of
+   * 65534.
+   * Anon_uid may only be set with squash_mode of ROOT_SQUASH.  An error will be
+   * returned if this field is specified for other squash_mode settings.
+   * 
+ * + * int64 anon_uid = 4; + * + * @return The anonUid. + */ + long getAnonUid(); + + /** + * + * + *
+   * An integer representing the anonymous group id with a default value of
+   * 65534.
+   * Anon_gid may only be set with squash_mode of ROOT_SQUASH.  An error will be
+   * returned if this field is specified for other squash_mode settings.
+   * 
+ * + * int64 anon_gid = 5; + * + * @return The anonGid. + */ + long getAnonGid(); +} diff --git a/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/RestoreInstanceRequest.java b/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/RestoreInstanceRequest.java new file mode 100644 index 00000000..254cfd21 --- /dev/null +++ b/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/RestoreInstanceRequest.java @@ -0,0 +1,1411 @@ +/* + * 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; + +/** + * + * + *
+ * RestoreInstanceRequest restores an existing instances's file share from a
+ * snapshot or backup.
+ * 
+ * + * Protobuf type {@code google.cloud.filestore.v1beta1.RestoreInstanceRequest} + */ +public final class RestoreInstanceRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.filestore.v1beta1.RestoreInstanceRequest) + RestoreInstanceRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use RestoreInstanceRequest.newBuilder() to construct. + private RestoreInstanceRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private RestoreInstanceRequest() { + name_ = ""; + fileShare_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new RestoreInstanceRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private RestoreInstanceRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + fileShare_ = s; + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + sourceCase_ = 3; + source_ = s; + break; + } + case 34: + { + java.lang.String s = input.readStringRequireUtf8(); + sourceCase_ = 4; + source_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.filestore.v1beta1.CloudFilestoreServiceProto + .internal_static_google_cloud_filestore_v1beta1_RestoreInstanceRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.filestore.v1beta1.CloudFilestoreServiceProto + .internal_static_google_cloud_filestore_v1beta1_RestoreInstanceRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.filestore.v1beta1.RestoreInstanceRequest.class, + com.google.cloud.filestore.v1beta1.RestoreInstanceRequest.Builder.class); + } + + private int sourceCase_ = 0; + private java.lang.Object source_; + + public enum SourceCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + SOURCE_SNAPSHOT(3), + SOURCE_BACKUP(4), + SOURCE_NOT_SET(0); + private final int value; + + private SourceCase(int value) { + this.value = value; + } + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static SourceCase valueOf(int value) { + return forNumber(value); + } + + public static SourceCase forNumber(int value) { + switch (value) { + case 3: + return SOURCE_SNAPSHOT; + case 4: + return SOURCE_BACKUP; + case 0: + return SOURCE_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public SourceCase getSourceCase() { + return SourceCase.forNumber(sourceCase_); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Required. The resource name of the instance, in the format
+   * projects/{project_id}/locations/{location_id}/instances/{instance_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 resource name of the instance, in the format
+   * projects/{project_id}/locations/{location_id}/instances/{instance_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; + } + } + + public static final int FILE_SHARE_FIELD_NUMBER = 2; + private volatile java.lang.Object fileShare_; + /** + * + * + *
+   * Required. Name of the file share in the Cloud Filestore instance that the snapshot
+   * is being restored to.
+   * 
+ * + * string file_share = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The fileShare. + */ + @java.lang.Override + public java.lang.String getFileShare() { + java.lang.Object ref = fileShare_; + 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(); + fileShare_ = s; + return s; + } + } + /** + * + * + *
+   * Required. Name of the file share in the Cloud Filestore instance that the snapshot
+   * is being restored to.
+   * 
+ * + * string file_share = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for fileShare. + */ + @java.lang.Override + public com.google.protobuf.ByteString getFileShareBytes() { + java.lang.Object ref = fileShare_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + fileShare_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SOURCE_SNAPSHOT_FIELD_NUMBER = 3; + /** + * + * + *
+   * The resource name of the snapshot, in the format
+   * projects/{project_id}/locations/{location_id}/snapshots/{snapshot_id}.
+   * 
+ * + * string source_snapshot = 3 [(.google.api.resource_reference) = { ... } + * + * @return Whether the sourceSnapshot field is set. + */ + public boolean hasSourceSnapshot() { + return sourceCase_ == 3; + } + /** + * + * + *
+   * The resource name of the snapshot, in the format
+   * projects/{project_id}/locations/{location_id}/snapshots/{snapshot_id}.
+   * 
+ * + * string source_snapshot = 3 [(.google.api.resource_reference) = { ... } + * + * @return The sourceSnapshot. + */ + public java.lang.String getSourceSnapshot() { + java.lang.Object ref = ""; + if (sourceCase_ == 3) { + ref = source_; + } + 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(); + if (sourceCase_ == 3) { + source_ = s; + } + return s; + } + } + /** + * + * + *
+   * The resource name of the snapshot, in the format
+   * projects/{project_id}/locations/{location_id}/snapshots/{snapshot_id}.
+   * 
+ * + * string source_snapshot = 3 [(.google.api.resource_reference) = { ... } + * + * @return The bytes for sourceSnapshot. + */ + public com.google.protobuf.ByteString getSourceSnapshotBytes() { + java.lang.Object ref = ""; + if (sourceCase_ == 3) { + ref = source_; + } + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + if (sourceCase_ == 3) { + source_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SOURCE_BACKUP_FIELD_NUMBER = 4; + /** + * + * + *
+   * The resource name of the backup, in the format
+   * projects/{project_id}/locations/{location_id}/backups/{backup_id}.
+   * 
+ * + * string source_backup = 4 [(.google.api.resource_reference) = { ... } + * + * @return Whether the sourceBackup field is set. + */ + public boolean hasSourceBackup() { + return sourceCase_ == 4; + } + /** + * + * + *
+   * The resource name of the backup, in the format
+   * projects/{project_id}/locations/{location_id}/backups/{backup_id}.
+   * 
+ * + * string source_backup = 4 [(.google.api.resource_reference) = { ... } + * + * @return The sourceBackup. + */ + public java.lang.String getSourceBackup() { + java.lang.Object ref = ""; + if (sourceCase_ == 4) { + ref = source_; + } + 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(); + if (sourceCase_ == 4) { + source_ = s; + } + return s; + } + } + /** + * + * + *
+   * The resource name of the backup, in the format
+   * projects/{project_id}/locations/{location_id}/backups/{backup_id}.
+   * 
+ * + * string source_backup = 4 [(.google.api.resource_reference) = { ... } + * + * @return The bytes for sourceBackup. + */ + public com.google.protobuf.ByteString getSourceBackupBytes() { + java.lang.Object ref = ""; + if (sourceCase_ == 4) { + ref = source_; + } + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + if (sourceCase_ == 4) { + source_ = 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 (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (!getFileShareBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, fileShare_); + } + if (sourceCase_ == 3) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, source_); + } + if (sourceCase_ == 4) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, source_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (!getFileShareBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, fileShare_); + } + if (sourceCase_ == 3) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, source_); + } + if (sourceCase_ == 4) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, source_); + } + size += unknownFields.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.RestoreInstanceRequest)) { + return super.equals(obj); + } + com.google.cloud.filestore.v1beta1.RestoreInstanceRequest other = + (com.google.cloud.filestore.v1beta1.RestoreInstanceRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!getFileShare().equals(other.getFileShare())) return false; + if (!getSourceCase().equals(other.getSourceCase())) return false; + switch (sourceCase_) { + case 3: + if (!getSourceSnapshot().equals(other.getSourceSnapshot())) return false; + break; + case 4: + if (!getSourceBackup().equals(other.getSourceBackup())) return false; + break; + case 0: + default: + } + if (!unknownFields.equals(other.unknownFields)) 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) + FILE_SHARE_FIELD_NUMBER; + hash = (53 * hash) + getFileShare().hashCode(); + switch (sourceCase_) { + case 3: + hash = (37 * hash) + SOURCE_SNAPSHOT_FIELD_NUMBER; + hash = (53 * hash) + getSourceSnapshot().hashCode(); + break; + case 4: + hash = (37 * hash) + SOURCE_BACKUP_FIELD_NUMBER; + hash = (53 * hash) + getSourceBackup().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.filestore.v1beta1.RestoreInstanceRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.filestore.v1beta1.RestoreInstanceRequest 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.RestoreInstanceRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.filestore.v1beta1.RestoreInstanceRequest 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.RestoreInstanceRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.filestore.v1beta1.RestoreInstanceRequest 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.RestoreInstanceRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.filestore.v1beta1.RestoreInstanceRequest 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.RestoreInstanceRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.filestore.v1beta1.RestoreInstanceRequest 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.RestoreInstanceRequest 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.RestoreInstanceRequest 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.RestoreInstanceRequest 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; + } + /** + * + * + *
+   * RestoreInstanceRequest restores an existing instances's file share from a
+   * snapshot or backup.
+   * 
+ * + * Protobuf type {@code google.cloud.filestore.v1beta1.RestoreInstanceRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.filestore.v1beta1.RestoreInstanceRequest) + com.google.cloud.filestore.v1beta1.RestoreInstanceRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.filestore.v1beta1.CloudFilestoreServiceProto + .internal_static_google_cloud_filestore_v1beta1_RestoreInstanceRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.filestore.v1beta1.CloudFilestoreServiceProto + .internal_static_google_cloud_filestore_v1beta1_RestoreInstanceRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.filestore.v1beta1.RestoreInstanceRequest.class, + com.google.cloud.filestore.v1beta1.RestoreInstanceRequest.Builder.class); + } + + // Construct using com.google.cloud.filestore.v1beta1.RestoreInstanceRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + fileShare_ = ""; + + sourceCase_ = 0; + source_ = 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_RestoreInstanceRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.filestore.v1beta1.RestoreInstanceRequest getDefaultInstanceForType() { + return com.google.cloud.filestore.v1beta1.RestoreInstanceRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.filestore.v1beta1.RestoreInstanceRequest build() { + com.google.cloud.filestore.v1beta1.RestoreInstanceRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.filestore.v1beta1.RestoreInstanceRequest buildPartial() { + com.google.cloud.filestore.v1beta1.RestoreInstanceRequest result = + new com.google.cloud.filestore.v1beta1.RestoreInstanceRequest(this); + result.name_ = name_; + result.fileShare_ = fileShare_; + if (sourceCase_ == 3) { + result.source_ = source_; + } + if (sourceCase_ == 4) { + result.source_ = source_; + } + result.sourceCase_ = sourceCase_; + 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.RestoreInstanceRequest) { + return mergeFrom((com.google.cloud.filestore.v1beta1.RestoreInstanceRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.filestore.v1beta1.RestoreInstanceRequest other) { + if (other == com.google.cloud.filestore.v1beta1.RestoreInstanceRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (!other.getFileShare().isEmpty()) { + fileShare_ = other.fileShare_; + onChanged(); + } + switch (other.getSourceCase()) { + case SOURCE_SNAPSHOT: + { + sourceCase_ = 3; + source_ = other.source_; + onChanged(); + break; + } + case SOURCE_BACKUP: + { + sourceCase_ = 4; + source_ = other.source_; + onChanged(); + break; + } + case SOURCE_NOT_SET: + { + break; + } + } + this.mergeUnknownFields(other.unknownFields); + 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 { + com.google.cloud.filestore.v1beta1.RestoreInstanceRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.filestore.v1beta1.RestoreInstanceRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int sourceCase_ = 0; + private java.lang.Object source_; + + public SourceCase getSourceCase() { + return SourceCase.forNumber(sourceCase_); + } + + public Builder clearSource() { + sourceCase_ = 0; + source_ = null; + onChanged(); + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. The resource name of the instance, in the format
+     * projects/{project_id}/locations/{location_id}/instances/{instance_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 resource name of the instance, in the format
+     * projects/{project_id}/locations/{location_id}/instances/{instance_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 resource name of the instance, in the format
+     * projects/{project_id}/locations/{location_id}/instances/{instance_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 resource name of the instance, in the format
+     * projects/{project_id}/locations/{location_id}/instances/{instance_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 resource name of the instance, in the format
+     * projects/{project_id}/locations/{location_id}/instances/{instance_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; + } + + private java.lang.Object fileShare_ = ""; + /** + * + * + *
+     * Required. Name of the file share in the Cloud Filestore instance that the snapshot
+     * is being restored to.
+     * 
+ * + * string file_share = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The fileShare. + */ + public java.lang.String getFileShare() { + java.lang.Object ref = fileShare_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + fileShare_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. Name of the file share in the Cloud Filestore instance that the snapshot
+     * is being restored to.
+     * 
+ * + * string file_share = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for fileShare. + */ + public com.google.protobuf.ByteString getFileShareBytes() { + java.lang.Object ref = fileShare_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + fileShare_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. Name of the file share in the Cloud Filestore instance that the snapshot
+     * is being restored to.
+     * 
+ * + * string file_share = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The fileShare to set. + * @return This builder for chaining. + */ + public Builder setFileShare(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + fileShare_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Name of the file share in the Cloud Filestore instance that the snapshot
+     * is being restored to.
+     * 
+ * + * string file_share = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearFileShare() { + + fileShare_ = getDefaultInstance().getFileShare(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Name of the file share in the Cloud Filestore instance that the snapshot
+     * is being restored to.
+     * 
+ * + * string file_share = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for fileShare to set. + * @return This builder for chaining. + */ + public Builder setFileShareBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + fileShare_ = value; + onChanged(); + return this; + } + + /** + * + * + *
+     * The resource name of the snapshot, in the format
+     * projects/{project_id}/locations/{location_id}/snapshots/{snapshot_id}.
+     * 
+ * + * string source_snapshot = 3 [(.google.api.resource_reference) = { ... } + * + * @return Whether the sourceSnapshot field is set. + */ + @java.lang.Override + public boolean hasSourceSnapshot() { + return sourceCase_ == 3; + } + /** + * + * + *
+     * The resource name of the snapshot, in the format
+     * projects/{project_id}/locations/{location_id}/snapshots/{snapshot_id}.
+     * 
+ * + * string source_snapshot = 3 [(.google.api.resource_reference) = { ... } + * + * @return The sourceSnapshot. + */ + @java.lang.Override + public java.lang.String getSourceSnapshot() { + java.lang.Object ref = ""; + if (sourceCase_ == 3) { + ref = source_; + } + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (sourceCase_ == 3) { + source_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The resource name of the snapshot, in the format
+     * projects/{project_id}/locations/{location_id}/snapshots/{snapshot_id}.
+     * 
+ * + * string source_snapshot = 3 [(.google.api.resource_reference) = { ... } + * + * @return The bytes for sourceSnapshot. + */ + @java.lang.Override + public com.google.protobuf.ByteString getSourceSnapshotBytes() { + java.lang.Object ref = ""; + if (sourceCase_ == 3) { + ref = source_; + } + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + if (sourceCase_ == 3) { + source_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The resource name of the snapshot, in the format
+     * projects/{project_id}/locations/{location_id}/snapshots/{snapshot_id}.
+     * 
+ * + * string source_snapshot = 3 [(.google.api.resource_reference) = { ... } + * + * @param value The sourceSnapshot to set. + * @return This builder for chaining. + */ + public Builder setSourceSnapshot(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + sourceCase_ = 3; + source_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The resource name of the snapshot, in the format
+     * projects/{project_id}/locations/{location_id}/snapshots/{snapshot_id}.
+     * 
+ * + * string source_snapshot = 3 [(.google.api.resource_reference) = { ... } + * + * @return This builder for chaining. + */ + public Builder clearSourceSnapshot() { + if (sourceCase_ == 3) { + sourceCase_ = 0; + source_ = null; + onChanged(); + } + return this; + } + /** + * + * + *
+     * The resource name of the snapshot, in the format
+     * projects/{project_id}/locations/{location_id}/snapshots/{snapshot_id}.
+     * 
+ * + * string source_snapshot = 3 [(.google.api.resource_reference) = { ... } + * + * @param value The bytes for sourceSnapshot to set. + * @return This builder for chaining. + */ + public Builder setSourceSnapshotBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + sourceCase_ = 3; + source_ = value; + onChanged(); + return this; + } + + /** + * + * + *
+     * The resource name of the backup, in the format
+     * projects/{project_id}/locations/{location_id}/backups/{backup_id}.
+     * 
+ * + * string source_backup = 4 [(.google.api.resource_reference) = { ... } + * + * @return Whether the sourceBackup field is set. + */ + @java.lang.Override + public boolean hasSourceBackup() { + return sourceCase_ == 4; + } + /** + * + * + *
+     * The resource name of the backup, in the format
+     * projects/{project_id}/locations/{location_id}/backups/{backup_id}.
+     * 
+ * + * string source_backup = 4 [(.google.api.resource_reference) = { ... } + * + * @return The sourceBackup. + */ + @java.lang.Override + public java.lang.String getSourceBackup() { + java.lang.Object ref = ""; + if (sourceCase_ == 4) { + ref = source_; + } + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (sourceCase_ == 4) { + source_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The resource name of the backup, in the format
+     * projects/{project_id}/locations/{location_id}/backups/{backup_id}.
+     * 
+ * + * string source_backup = 4 [(.google.api.resource_reference) = { ... } + * + * @return The bytes for sourceBackup. + */ + @java.lang.Override + public com.google.protobuf.ByteString getSourceBackupBytes() { + java.lang.Object ref = ""; + if (sourceCase_ == 4) { + ref = source_; + } + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + if (sourceCase_ == 4) { + source_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The resource name of the backup, in the format
+     * projects/{project_id}/locations/{location_id}/backups/{backup_id}.
+     * 
+ * + * string source_backup = 4 [(.google.api.resource_reference) = { ... } + * + * @param value The sourceBackup to set. + * @return This builder for chaining. + */ + public Builder setSourceBackup(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + sourceCase_ = 4; + source_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The resource name of the backup, in the format
+     * projects/{project_id}/locations/{location_id}/backups/{backup_id}.
+     * 
+ * + * string source_backup = 4 [(.google.api.resource_reference) = { ... } + * + * @return This builder for chaining. + */ + public Builder clearSourceBackup() { + if (sourceCase_ == 4) { + sourceCase_ = 0; + source_ = null; + onChanged(); + } + return this; + } + /** + * + * + *
+     * The resource name of the backup, in the format
+     * projects/{project_id}/locations/{location_id}/backups/{backup_id}.
+     * 
+ * + * string source_backup = 4 [(.google.api.resource_reference) = { ... } + * + * @param value The bytes for sourceBackup to set. + * @return This builder for chaining. + */ + public Builder setSourceBackupBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + sourceCase_ = 4; + source_ = 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.RestoreInstanceRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.filestore.v1beta1.RestoreInstanceRequest) + private static final com.google.cloud.filestore.v1beta1.RestoreInstanceRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.filestore.v1beta1.RestoreInstanceRequest(); + } + + public static com.google.cloud.filestore.v1beta1.RestoreInstanceRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public RestoreInstanceRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new RestoreInstanceRequest(input, extensionRegistry); + } + }; + + 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.RestoreInstanceRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/RestoreInstanceRequestOrBuilder.java b/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/RestoreInstanceRequestOrBuilder.java new file mode 100644 index 00000000..ba194cb0 --- /dev/null +++ b/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/RestoreInstanceRequestOrBuilder.java @@ -0,0 +1,165 @@ +/* + * 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 RestoreInstanceRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.filestore.v1beta1.RestoreInstanceRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The resource name of the instance, in the format
+   * projects/{project_id}/locations/{location_id}/instances/{instance_id}.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. The resource name of the instance, in the format
+   * projects/{project_id}/locations/{location_id}/instances/{instance_id}.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Required. Name of the file share in the Cloud Filestore instance that the snapshot
+   * is being restored to.
+   * 
+ * + * string file_share = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The fileShare. + */ + java.lang.String getFileShare(); + /** + * + * + *
+   * Required. Name of the file share in the Cloud Filestore instance that the snapshot
+   * is being restored to.
+   * 
+ * + * string file_share = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for fileShare. + */ + com.google.protobuf.ByteString getFileShareBytes(); + + /** + * + * + *
+   * The resource name of the snapshot, in the format
+   * projects/{project_id}/locations/{location_id}/snapshots/{snapshot_id}.
+   * 
+ * + * string source_snapshot = 3 [(.google.api.resource_reference) = { ... } + * + * @return Whether the sourceSnapshot field is set. + */ + boolean hasSourceSnapshot(); + /** + * + * + *
+   * The resource name of the snapshot, in the format
+   * projects/{project_id}/locations/{location_id}/snapshots/{snapshot_id}.
+   * 
+ * + * string source_snapshot = 3 [(.google.api.resource_reference) = { ... } + * + * @return The sourceSnapshot. + */ + java.lang.String getSourceSnapshot(); + /** + * + * + *
+   * The resource name of the snapshot, in the format
+   * projects/{project_id}/locations/{location_id}/snapshots/{snapshot_id}.
+   * 
+ * + * string source_snapshot = 3 [(.google.api.resource_reference) = { ... } + * + * @return The bytes for sourceSnapshot. + */ + com.google.protobuf.ByteString getSourceSnapshotBytes(); + + /** + * + * + *
+   * The resource name of the backup, in the format
+   * projects/{project_id}/locations/{location_id}/backups/{backup_id}.
+   * 
+ * + * string source_backup = 4 [(.google.api.resource_reference) = { ... } + * + * @return Whether the sourceBackup field is set. + */ + boolean hasSourceBackup(); + /** + * + * + *
+   * The resource name of the backup, in the format
+   * projects/{project_id}/locations/{location_id}/backups/{backup_id}.
+   * 
+ * + * string source_backup = 4 [(.google.api.resource_reference) = { ... } + * + * @return The sourceBackup. + */ + java.lang.String getSourceBackup(); + /** + * + * + *
+   * The resource name of the backup, in the format
+   * projects/{project_id}/locations/{location_id}/backups/{backup_id}.
+   * 
+ * + * string source_backup = 4 [(.google.api.resource_reference) = { ... } + * + * @return The bytes for sourceBackup. + */ + com.google.protobuf.ByteString getSourceBackupBytes(); + + public com.google.cloud.filestore.v1beta1.RestoreInstanceRequest.SourceCase getSourceCase(); +} diff --git a/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/SnapshotName.java b/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/SnapshotName.java new file mode 100644 index 00000000..75a5f898 --- /dev/null +++ b/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/SnapshotName.java @@ -0,0 +1,223 @@ +/* + * Copyright 2021 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 SnapshotName implements ResourceName { + private static final PathTemplate PROJECT_LOCATION_SNAPSHOT = + PathTemplate.createWithoutUrlEncoding( + "projects/{project}/locations/{location}/snapshots/{snapshot}"); + private volatile Map fieldValuesMap; + private final String project; + private final String location; + private final String snapshot; + + @Deprecated + protected SnapshotName() { + project = null; + location = null; + snapshot = null; + } + + private SnapshotName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + location = Preconditions.checkNotNull(builder.getLocation()); + snapshot = Preconditions.checkNotNull(builder.getSnapshot()); + } + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getSnapshot() { + return snapshot; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static SnapshotName of(String project, String location, String snapshot) { + return newBuilder().setProject(project).setLocation(location).setSnapshot(snapshot).build(); + } + + public static String format(String project, String location, String snapshot) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setSnapshot(snapshot) + .build() + .toString(); + } + + public static SnapshotName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PROJECT_LOCATION_SNAPSHOT.validatedMatch( + formattedString, "SnapshotName.parse: formattedString not in valid format"); + return of(matchMap.get("project"), matchMap.get("location"), matchMap.get("snapshot")); + } + + 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 (SnapshotName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PROJECT_LOCATION_SNAPSHOT.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 (snapshot != null) { + fieldMapBuilder.put("snapshot", snapshot); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return PROJECT_LOCATION_SNAPSHOT.instantiate( + "project", project, "location", location, "snapshot", snapshot); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null || getClass() == o.getClass()) { + SnapshotName that = ((SnapshotName) o); + return Objects.equals(this.project, that.project) + && Objects.equals(this.location, that.location) + && Objects.equals(this.snapshot, that.snapshot); + } + 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(snapshot); + return h; + } + + /** Builder for projects/{project}/locations/{location}/snapshots/{snapshot}. */ + public static class Builder { + private String project; + private String location; + private String snapshot; + + protected Builder() {} + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getSnapshot() { + return snapshot; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setLocation(String location) { + this.location = location; + return this; + } + + public Builder setSnapshot(String snapshot) { + this.snapshot = snapshot; + return this; + } + + private Builder(SnapshotName snapshotName) { + this.project = snapshotName.project; + this.location = snapshotName.location; + this.snapshot = snapshotName.snapshot; + } + + public SnapshotName build() { + return new SnapshotName(this); + } + } +} diff --git a/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/UpdateBackupRequest.java b/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/UpdateBackupRequest.java new file mode 100644 index 00000000..a8c4d064 --- /dev/null +++ b/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/UpdateBackupRequest.java @@ -0,0 +1,1066 @@ +/* + * 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; + +/** + * + * + *
+ * UpdateBackupRequest updates description and/or labels for a backup.
+ * 
+ * + * Protobuf type {@code google.cloud.filestore.v1beta1.UpdateBackupRequest} + */ +public final class UpdateBackupRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.filestore.v1beta1.UpdateBackupRequest) + UpdateBackupRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use UpdateBackupRequest.newBuilder() to construct. + private UpdateBackupRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private UpdateBackupRequest() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new UpdateBackupRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private UpdateBackupRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.cloud.filestore.v1beta1.Backup.Builder subBuilder = null; + if (backup_ != null) { + subBuilder = backup_.toBuilder(); + } + backup_ = + input.readMessage( + com.google.cloud.filestore.v1beta1.Backup.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(backup_); + backup_ = subBuilder.buildPartial(); + } + + break; + } + case 18: + { + com.google.protobuf.FieldMask.Builder subBuilder = null; + if (updateMask_ != null) { + subBuilder = updateMask_.toBuilder(); + } + updateMask_ = + input.readMessage(com.google.protobuf.FieldMask.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(updateMask_); + updateMask_ = subBuilder.buildPartial(); + } + + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.filestore.v1beta1.CloudFilestoreServiceProto + .internal_static_google_cloud_filestore_v1beta1_UpdateBackupRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.filestore.v1beta1.CloudFilestoreServiceProto + .internal_static_google_cloud_filestore_v1beta1_UpdateBackupRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.filestore.v1beta1.UpdateBackupRequest.class, + com.google.cloud.filestore.v1beta1.UpdateBackupRequest.Builder.class); + } + + public static final int BACKUP_FIELD_NUMBER = 1; + private com.google.cloud.filestore.v1beta1.Backup backup_; + /** + * + * + *
+   * Required. A [backup resource]
+   * (/cloud-filestore/reference/rest/v1beta1/projects.locations.backups)
+   * 
+ * + * + * .google.cloud.filestore.v1beta1.Backup backup = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the backup field is set. + */ + @java.lang.Override + public boolean hasBackup() { + return backup_ != null; + } + /** + * + * + *
+   * Required. A [backup resource]
+   * (/cloud-filestore/reference/rest/v1beta1/projects.locations.backups)
+   * 
+ * + * + * .google.cloud.filestore.v1beta1.Backup backup = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The backup. + */ + @java.lang.Override + public com.google.cloud.filestore.v1beta1.Backup getBackup() { + return backup_ == null + ? com.google.cloud.filestore.v1beta1.Backup.getDefaultInstance() + : backup_; + } + /** + * + * + *
+   * Required. A [backup resource]
+   * (/cloud-filestore/reference/rest/v1beta1/projects.locations.backups)
+   * 
+ * + * + * .google.cloud.filestore.v1beta1.Backup backup = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.filestore.v1beta1.BackupOrBuilder getBackupOrBuilder() { + return getBackup(); + } + + 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.
+   * 
+ * + * .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.
+   * 
+ * + * .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.
+   * 
+ * + * .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 (backup_ != null) { + output.writeMessage(1, getBackup()); + } + if (updateMask_ != null) { + output.writeMessage(2, getUpdateMask()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (backup_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getBackup()); + } + if (updateMask_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getUpdateMask()); + } + size += unknownFields.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.UpdateBackupRequest)) { + return super.equals(obj); + } + com.google.cloud.filestore.v1beta1.UpdateBackupRequest other = + (com.google.cloud.filestore.v1beta1.UpdateBackupRequest) obj; + + if (hasBackup() != other.hasBackup()) return false; + if (hasBackup()) { + if (!getBackup().equals(other.getBackup())) return false; + } + if (hasUpdateMask() != other.hasUpdateMask()) return false; + if (hasUpdateMask()) { + if (!getUpdateMask().equals(other.getUpdateMask())) return false; + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasBackup()) { + hash = (37 * hash) + BACKUP_FIELD_NUMBER; + hash = (53 * hash) + getBackup().hashCode(); + } + if (hasUpdateMask()) { + hash = (37 * hash) + UPDATE_MASK_FIELD_NUMBER; + hash = (53 * hash) + getUpdateMask().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.filestore.v1beta1.UpdateBackupRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.filestore.v1beta1.UpdateBackupRequest 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.UpdateBackupRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.filestore.v1beta1.UpdateBackupRequest 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.UpdateBackupRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.filestore.v1beta1.UpdateBackupRequest 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.UpdateBackupRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.filestore.v1beta1.UpdateBackupRequest 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.UpdateBackupRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.filestore.v1beta1.UpdateBackupRequest 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.UpdateBackupRequest 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.UpdateBackupRequest 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.UpdateBackupRequest 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; + } + /** + * + * + *
+   * UpdateBackupRequest updates description and/or labels for a backup.
+   * 
+ * + * Protobuf type {@code google.cloud.filestore.v1beta1.UpdateBackupRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.filestore.v1beta1.UpdateBackupRequest) + com.google.cloud.filestore.v1beta1.UpdateBackupRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.filestore.v1beta1.CloudFilestoreServiceProto + .internal_static_google_cloud_filestore_v1beta1_UpdateBackupRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.filestore.v1beta1.CloudFilestoreServiceProto + .internal_static_google_cloud_filestore_v1beta1_UpdateBackupRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.filestore.v1beta1.UpdateBackupRequest.class, + com.google.cloud.filestore.v1beta1.UpdateBackupRequest.Builder.class); + } + + // Construct using com.google.cloud.filestore.v1beta1.UpdateBackupRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (backupBuilder_ == null) { + backup_ = null; + } else { + backup_ = null; + backupBuilder_ = 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_UpdateBackupRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.filestore.v1beta1.UpdateBackupRequest getDefaultInstanceForType() { + return com.google.cloud.filestore.v1beta1.UpdateBackupRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.filestore.v1beta1.UpdateBackupRequest build() { + com.google.cloud.filestore.v1beta1.UpdateBackupRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.filestore.v1beta1.UpdateBackupRequest buildPartial() { + com.google.cloud.filestore.v1beta1.UpdateBackupRequest result = + new com.google.cloud.filestore.v1beta1.UpdateBackupRequest(this); + if (backupBuilder_ == null) { + result.backup_ = backup_; + } else { + result.backup_ = backupBuilder_.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.UpdateBackupRequest) { + return mergeFrom((com.google.cloud.filestore.v1beta1.UpdateBackupRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.filestore.v1beta1.UpdateBackupRequest other) { + if (other == com.google.cloud.filestore.v1beta1.UpdateBackupRequest.getDefaultInstance()) + return this; + if (other.hasBackup()) { + mergeBackup(other.getBackup()); + } + if (other.hasUpdateMask()) { + mergeUpdateMask(other.getUpdateMask()); + } + this.mergeUnknownFields(other.unknownFields); + 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 { + com.google.cloud.filestore.v1beta1.UpdateBackupRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.filestore.v1beta1.UpdateBackupRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.cloud.filestore.v1beta1.Backup backup_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.filestore.v1beta1.Backup, + com.google.cloud.filestore.v1beta1.Backup.Builder, + com.google.cloud.filestore.v1beta1.BackupOrBuilder> + backupBuilder_; + /** + * + * + *
+     * Required. A [backup resource]
+     * (/cloud-filestore/reference/rest/v1beta1/projects.locations.backups)
+     * 
+ * + * + * .google.cloud.filestore.v1beta1.Backup backup = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the backup field is set. + */ + public boolean hasBackup() { + return backupBuilder_ != null || backup_ != null; + } + /** + * + * + *
+     * Required. A [backup resource]
+     * (/cloud-filestore/reference/rest/v1beta1/projects.locations.backups)
+     * 
+ * + * + * .google.cloud.filestore.v1beta1.Backup backup = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The backup. + */ + public com.google.cloud.filestore.v1beta1.Backup getBackup() { + if (backupBuilder_ == null) { + return backup_ == null + ? com.google.cloud.filestore.v1beta1.Backup.getDefaultInstance() + : backup_; + } else { + return backupBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. A [backup resource]
+     * (/cloud-filestore/reference/rest/v1beta1/projects.locations.backups)
+     * 
+ * + * + * .google.cloud.filestore.v1beta1.Backup backup = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setBackup(com.google.cloud.filestore.v1beta1.Backup value) { + if (backupBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + backup_ = value; + onChanged(); + } else { + backupBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Required. A [backup resource]
+     * (/cloud-filestore/reference/rest/v1beta1/projects.locations.backups)
+     * 
+ * + * + * .google.cloud.filestore.v1beta1.Backup backup = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setBackup(com.google.cloud.filestore.v1beta1.Backup.Builder builderForValue) { + if (backupBuilder_ == null) { + backup_ = builderForValue.build(); + onChanged(); + } else { + backupBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Required. A [backup resource]
+     * (/cloud-filestore/reference/rest/v1beta1/projects.locations.backups)
+     * 
+ * + * + * .google.cloud.filestore.v1beta1.Backup backup = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeBackup(com.google.cloud.filestore.v1beta1.Backup value) { + if (backupBuilder_ == null) { + if (backup_ != null) { + backup_ = + com.google.cloud.filestore.v1beta1.Backup.newBuilder(backup_) + .mergeFrom(value) + .buildPartial(); + } else { + backup_ = value; + } + onChanged(); + } else { + backupBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Required. A [backup resource]
+     * (/cloud-filestore/reference/rest/v1beta1/projects.locations.backups)
+     * 
+ * + * + * .google.cloud.filestore.v1beta1.Backup backup = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearBackup() { + if (backupBuilder_ == null) { + backup_ = null; + onChanged(); + } else { + backup_ = null; + backupBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Required. A [backup resource]
+     * (/cloud-filestore/reference/rest/v1beta1/projects.locations.backups)
+     * 
+ * + * + * .google.cloud.filestore.v1beta1.Backup backup = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.filestore.v1beta1.Backup.Builder getBackupBuilder() { + + onChanged(); + return getBackupFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. A [backup resource]
+     * (/cloud-filestore/reference/rest/v1beta1/projects.locations.backups)
+     * 
+ * + * + * .google.cloud.filestore.v1beta1.Backup backup = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.filestore.v1beta1.BackupOrBuilder getBackupOrBuilder() { + if (backupBuilder_ != null) { + return backupBuilder_.getMessageOrBuilder(); + } else { + return backup_ == null + ? com.google.cloud.filestore.v1beta1.Backup.getDefaultInstance() + : backup_; + } + } + /** + * + * + *
+     * Required. A [backup resource]
+     * (/cloud-filestore/reference/rest/v1beta1/projects.locations.backups)
+     * 
+ * + * + * .google.cloud.filestore.v1beta1.Backup backup = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.filestore.v1beta1.Backup, + com.google.cloud.filestore.v1beta1.Backup.Builder, + com.google.cloud.filestore.v1beta1.BackupOrBuilder> + getBackupFieldBuilder() { + if (backupBuilder_ == null) { + backupBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.filestore.v1beta1.Backup, + com.google.cloud.filestore.v1beta1.Backup.Builder, + com.google.cloud.filestore.v1beta1.BackupOrBuilder>( + getBackup(), getParentForChildren(), isClean()); + backup_ = null; + } + return backupBuilder_; + } + + 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 = 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.
+     * 
+ * + * .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.
+     * 
+ * + * .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.
+     * 
+ * + * .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.
+     * 
+ * + * .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.
+     * 
+ * + * .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.
+     * 
+ * + * .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.
+     * 
+ * + * .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.
+     * 
+ * + * .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.UpdateBackupRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.filestore.v1beta1.UpdateBackupRequest) + private static final com.google.cloud.filestore.v1beta1.UpdateBackupRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.filestore.v1beta1.UpdateBackupRequest(); + } + + public static com.google.cloud.filestore.v1beta1.UpdateBackupRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public UpdateBackupRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new UpdateBackupRequest(input, extensionRegistry); + } + }; + + 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.UpdateBackupRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/UpdateBackupRequestOrBuilder.java b/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/UpdateBackupRequestOrBuilder.java new file mode 100644 index 00000000..4821390e --- /dev/null +++ b/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/UpdateBackupRequestOrBuilder.java @@ -0,0 +1,110 @@ +/* + * 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 UpdateBackupRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.filestore.v1beta1.UpdateBackupRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. A [backup resource]
+   * (/cloud-filestore/reference/rest/v1beta1/projects.locations.backups)
+   * 
+ * + * + * .google.cloud.filestore.v1beta1.Backup backup = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the backup field is set. + */ + boolean hasBackup(); + /** + * + * + *
+   * Required. A [backup resource]
+   * (/cloud-filestore/reference/rest/v1beta1/projects.locations.backups)
+   * 
+ * + * + * .google.cloud.filestore.v1beta1.Backup backup = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The backup. + */ + com.google.cloud.filestore.v1beta1.Backup getBackup(); + /** + * + * + *
+   * Required. A [backup resource]
+   * (/cloud-filestore/reference/rest/v1beta1/projects.locations.backups)
+   * 
+ * + * + * .google.cloud.filestore.v1beta1.Backup backup = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.filestore.v1beta1.BackupOrBuilder getBackupOrBuilder(); + + /** + * + * + *
+   * Required. Mask of fields to update.  At least one path must be supplied in this
+   * field.
+   * 
+ * + * .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.
+   * 
+ * + * .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.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder(); +} diff --git a/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/UpdateInstanceRequest.java b/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/UpdateInstanceRequest.java new file mode 100644 index 00000000..c5603882 --- /dev/null +++ b/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/UpdateInstanceRequest.java @@ -0,0 +1,1103 @@ +/* + * 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; + +/** + * + * + *
+ * UpdateInstanceRequest updates the settings of an instance.
+ * 
+ * + * Protobuf type {@code google.cloud.filestore.v1beta1.UpdateInstanceRequest} + */ +public final class UpdateInstanceRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.filestore.v1beta1.UpdateInstanceRequest) + UpdateInstanceRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use UpdateInstanceRequest.newBuilder() to construct. + private UpdateInstanceRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private UpdateInstanceRequest() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new UpdateInstanceRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private UpdateInstanceRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.protobuf.FieldMask.Builder subBuilder = null; + if (updateMask_ != null) { + subBuilder = updateMask_.toBuilder(); + } + updateMask_ = + input.readMessage(com.google.protobuf.FieldMask.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(updateMask_); + updateMask_ = subBuilder.buildPartial(); + } + + break; + } + case 18: + { + com.google.cloud.filestore.v1beta1.Instance.Builder subBuilder = null; + if (instance_ != null) { + subBuilder = instance_.toBuilder(); + } + instance_ = + input.readMessage( + com.google.cloud.filestore.v1beta1.Instance.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(instance_); + instance_ = subBuilder.buildPartial(); + } + + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.filestore.v1beta1.CloudFilestoreServiceProto + .internal_static_google_cloud_filestore_v1beta1_UpdateInstanceRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.filestore.v1beta1.CloudFilestoreServiceProto + .internal_static_google_cloud_filestore_v1beta1_UpdateInstanceRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.filestore.v1beta1.UpdateInstanceRequest.class, + com.google.cloud.filestore.v1beta1.UpdateInstanceRequest.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.  The elements of the repeated paths field may only include these
+   * fields:
+   * * "description"
+   * * "file_shares"
+   * * "labels"
+   * 
+ * + * .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.  The elements of the repeated paths field may only include these
+   * fields:
+   * * "description"
+   * * "file_shares"
+   * * "labels"
+   * 
+ * + * .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.  The elements of the repeated paths field may only include these
+   * fields:
+   * * "description"
+   * * "file_shares"
+   * * "labels"
+   * 
+ * + * .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 INSTANCE_FIELD_NUMBER = 2; + private com.google.cloud.filestore.v1beta1.Instance instance_; + /** + * + * + *
+   * Required. Only fields specified in update_mask are updated.
+   * 
+ * + * + * .google.cloud.filestore.v1beta1.Instance instance = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the instance field is set. + */ + @java.lang.Override + public boolean hasInstance() { + return instance_ != null; + } + /** + * + * + *
+   * Required. Only fields specified in update_mask are updated.
+   * 
+ * + * + * .google.cloud.filestore.v1beta1.Instance instance = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The instance. + */ + @java.lang.Override + public com.google.cloud.filestore.v1beta1.Instance getInstance() { + return instance_ == null + ? com.google.cloud.filestore.v1beta1.Instance.getDefaultInstance() + : instance_; + } + /** + * + * + *
+   * Required. Only fields specified in update_mask are updated.
+   * 
+ * + * + * .google.cloud.filestore.v1beta1.Instance instance = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.filestore.v1beta1.InstanceOrBuilder getInstanceOrBuilder() { + return getInstance(); + } + + 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 (instance_ != null) { + output.writeMessage(2, getInstance()); + } + unknownFields.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 (instance_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getInstance()); + } + size += unknownFields.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.UpdateInstanceRequest)) { + return super.equals(obj); + } + com.google.cloud.filestore.v1beta1.UpdateInstanceRequest other = + (com.google.cloud.filestore.v1beta1.UpdateInstanceRequest) obj; + + if (hasUpdateMask() != other.hasUpdateMask()) return false; + if (hasUpdateMask()) { + if (!getUpdateMask().equals(other.getUpdateMask())) return false; + } + if (hasInstance() != other.hasInstance()) return false; + if (hasInstance()) { + if (!getInstance().equals(other.getInstance())) return false; + } + if (!unknownFields.equals(other.unknownFields)) 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 (hasInstance()) { + hash = (37 * hash) + INSTANCE_FIELD_NUMBER; + hash = (53 * hash) + getInstance().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.filestore.v1beta1.UpdateInstanceRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.filestore.v1beta1.UpdateInstanceRequest 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.UpdateInstanceRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.filestore.v1beta1.UpdateInstanceRequest 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.UpdateInstanceRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.filestore.v1beta1.UpdateInstanceRequest 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.UpdateInstanceRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.filestore.v1beta1.UpdateInstanceRequest 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.UpdateInstanceRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.filestore.v1beta1.UpdateInstanceRequest 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.UpdateInstanceRequest 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.UpdateInstanceRequest 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.UpdateInstanceRequest 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; + } + /** + * + * + *
+   * UpdateInstanceRequest updates the settings of an instance.
+   * 
+ * + * Protobuf type {@code google.cloud.filestore.v1beta1.UpdateInstanceRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.filestore.v1beta1.UpdateInstanceRequest) + com.google.cloud.filestore.v1beta1.UpdateInstanceRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.filestore.v1beta1.CloudFilestoreServiceProto + .internal_static_google_cloud_filestore_v1beta1_UpdateInstanceRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.filestore.v1beta1.CloudFilestoreServiceProto + .internal_static_google_cloud_filestore_v1beta1_UpdateInstanceRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.filestore.v1beta1.UpdateInstanceRequest.class, + com.google.cloud.filestore.v1beta1.UpdateInstanceRequest.Builder.class); + } + + // Construct using com.google.cloud.filestore.v1beta1.UpdateInstanceRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (updateMaskBuilder_ == null) { + updateMask_ = null; + } else { + updateMask_ = null; + updateMaskBuilder_ = null; + } + if (instanceBuilder_ == null) { + instance_ = null; + } else { + instance_ = null; + instanceBuilder_ = 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_UpdateInstanceRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.filestore.v1beta1.UpdateInstanceRequest getDefaultInstanceForType() { + return com.google.cloud.filestore.v1beta1.UpdateInstanceRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.filestore.v1beta1.UpdateInstanceRequest build() { + com.google.cloud.filestore.v1beta1.UpdateInstanceRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.filestore.v1beta1.UpdateInstanceRequest buildPartial() { + com.google.cloud.filestore.v1beta1.UpdateInstanceRequest result = + new com.google.cloud.filestore.v1beta1.UpdateInstanceRequest(this); + if (updateMaskBuilder_ == null) { + result.updateMask_ = updateMask_; + } else { + result.updateMask_ = updateMaskBuilder_.build(); + } + if (instanceBuilder_ == null) { + result.instance_ = instance_; + } else { + result.instance_ = instanceBuilder_.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.UpdateInstanceRequest) { + return mergeFrom((com.google.cloud.filestore.v1beta1.UpdateInstanceRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.filestore.v1beta1.UpdateInstanceRequest other) { + if (other == com.google.cloud.filestore.v1beta1.UpdateInstanceRequest.getDefaultInstance()) + return this; + if (other.hasUpdateMask()) { + mergeUpdateMask(other.getUpdateMask()); + } + if (other.hasInstance()) { + mergeInstance(other.getInstance()); + } + this.mergeUnknownFields(other.unknownFields); + 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 { + com.google.cloud.filestore.v1beta1.UpdateInstanceRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.filestore.v1beta1.UpdateInstanceRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + 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.  The elements of the repeated paths field may only include these
+     * fields:
+     * * "description"
+     * * "file_shares"
+     * * "labels"
+     * 
+ * + * .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.  The elements of the repeated paths field may only include these
+     * fields:
+     * * "description"
+     * * "file_shares"
+     * * "labels"
+     * 
+ * + * .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.  The elements of the repeated paths field may only include these
+     * fields:
+     * * "description"
+     * * "file_shares"
+     * * "labels"
+     * 
+ * + * .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.  The elements of the repeated paths field may only include these
+     * fields:
+     * * "description"
+     * * "file_shares"
+     * * "labels"
+     * 
+ * + * .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.  The elements of the repeated paths field may only include these
+     * fields:
+     * * "description"
+     * * "file_shares"
+     * * "labels"
+     * 
+ * + * .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.  The elements of the repeated paths field may only include these
+     * fields:
+     * * "description"
+     * * "file_shares"
+     * * "labels"
+     * 
+ * + * .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.  The elements of the repeated paths field may only include these
+     * fields:
+     * * "description"
+     * * "file_shares"
+     * * "labels"
+     * 
+ * + * .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.  The elements of the repeated paths field may only include these
+     * fields:
+     * * "description"
+     * * "file_shares"
+     * * "labels"
+     * 
+ * + * .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.  The elements of the repeated paths field may only include these
+     * fields:
+     * * "description"
+     * * "file_shares"
+     * * "labels"
+     * 
+ * + * .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.Instance instance_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.filestore.v1beta1.Instance, + com.google.cloud.filestore.v1beta1.Instance.Builder, + com.google.cloud.filestore.v1beta1.InstanceOrBuilder> + instanceBuilder_; + /** + * + * + *
+     * Required. Only fields specified in update_mask are updated.
+     * 
+ * + * + * .google.cloud.filestore.v1beta1.Instance instance = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the instance field is set. + */ + public boolean hasInstance() { + return instanceBuilder_ != null || instance_ != null; + } + /** + * + * + *
+     * Required. Only fields specified in update_mask are updated.
+     * 
+ * + * + * .google.cloud.filestore.v1beta1.Instance instance = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The instance. + */ + public com.google.cloud.filestore.v1beta1.Instance getInstance() { + if (instanceBuilder_ == null) { + return instance_ == null + ? com.google.cloud.filestore.v1beta1.Instance.getDefaultInstance() + : instance_; + } else { + return instanceBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. Only fields specified in update_mask are updated.
+     * 
+ * + * + * .google.cloud.filestore.v1beta1.Instance instance = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setInstance(com.google.cloud.filestore.v1beta1.Instance value) { + if (instanceBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + instance_ = value; + onChanged(); + } else { + instanceBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Required. Only fields specified in update_mask are updated.
+     * 
+ * + * + * .google.cloud.filestore.v1beta1.Instance instance = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setInstance( + com.google.cloud.filestore.v1beta1.Instance.Builder builderForValue) { + if (instanceBuilder_ == null) { + instance_ = builderForValue.build(); + onChanged(); + } else { + instanceBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Required. Only fields specified in update_mask are updated.
+     * 
+ * + * + * .google.cloud.filestore.v1beta1.Instance instance = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeInstance(com.google.cloud.filestore.v1beta1.Instance value) { + if (instanceBuilder_ == null) { + if (instance_ != null) { + instance_ = + com.google.cloud.filestore.v1beta1.Instance.newBuilder(instance_) + .mergeFrom(value) + .buildPartial(); + } else { + instance_ = value; + } + onChanged(); + } else { + instanceBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Required. Only fields specified in update_mask are updated.
+     * 
+ * + * + * .google.cloud.filestore.v1beta1.Instance instance = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearInstance() { + if (instanceBuilder_ == null) { + instance_ = null; + onChanged(); + } else { + instance_ = null; + instanceBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Required. Only fields specified in update_mask are updated.
+     * 
+ * + * + * .google.cloud.filestore.v1beta1.Instance instance = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.filestore.v1beta1.Instance.Builder getInstanceBuilder() { + + onChanged(); + return getInstanceFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. Only fields specified in update_mask are updated.
+     * 
+ * + * + * .google.cloud.filestore.v1beta1.Instance instance = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.filestore.v1beta1.InstanceOrBuilder getInstanceOrBuilder() { + if (instanceBuilder_ != null) { + return instanceBuilder_.getMessageOrBuilder(); + } else { + return instance_ == null + ? com.google.cloud.filestore.v1beta1.Instance.getDefaultInstance() + : instance_; + } + } + /** + * + * + *
+     * Required. Only fields specified in update_mask are updated.
+     * 
+ * + * + * .google.cloud.filestore.v1beta1.Instance instance = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.filestore.v1beta1.Instance, + com.google.cloud.filestore.v1beta1.Instance.Builder, + com.google.cloud.filestore.v1beta1.InstanceOrBuilder> + getInstanceFieldBuilder() { + if (instanceBuilder_ == null) { + instanceBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.filestore.v1beta1.Instance, + com.google.cloud.filestore.v1beta1.Instance.Builder, + com.google.cloud.filestore.v1beta1.InstanceOrBuilder>( + getInstance(), getParentForChildren(), isClean()); + instance_ = null; + } + return instanceBuilder_; + } + + @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.UpdateInstanceRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.filestore.v1beta1.UpdateInstanceRequest) + private static final com.google.cloud.filestore.v1beta1.UpdateInstanceRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.filestore.v1beta1.UpdateInstanceRequest(); + } + + public static com.google.cloud.filestore.v1beta1.UpdateInstanceRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public UpdateInstanceRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new UpdateInstanceRequest(input, extensionRegistry); + } + }; + + 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.UpdateInstanceRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/UpdateInstanceRequestOrBuilder.java b/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/UpdateInstanceRequestOrBuilder.java new file mode 100644 index 00000000..ab4b44b8 --- /dev/null +++ b/proto-google-cloud-filestore-v1beta1/src/main/java/com/google/cloud/filestore/v1beta1/UpdateInstanceRequestOrBuilder.java @@ -0,0 +1,119 @@ +/* + * 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 UpdateInstanceRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.filestore.v1beta1.UpdateInstanceRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * 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"
+   * * "file_shares"
+   * * "labels"
+   * 
+ * + * .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.  The elements of the repeated paths field may only include these
+   * fields:
+   * * "description"
+   * * "file_shares"
+   * * "labels"
+   * 
+ * + * .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.  The elements of the repeated paths field may only include these
+   * fields:
+   * * "description"
+   * * "file_shares"
+   * * "labels"
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder(); + + /** + * + * + *
+   * Required. Only fields specified in update_mask are updated.
+   * 
+ * + * + * .google.cloud.filestore.v1beta1.Instance instance = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the instance field is set. + */ + boolean hasInstance(); + /** + * + * + *
+   * Required. Only fields specified in update_mask are updated.
+   * 
+ * + * + * .google.cloud.filestore.v1beta1.Instance instance = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The instance. + */ + com.google.cloud.filestore.v1beta1.Instance getInstance(); + /** + * + * + *
+   * Required. Only fields specified in update_mask are updated.
+   * 
+ * + * + * .google.cloud.filestore.v1beta1.Instance instance = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.filestore.v1beta1.InstanceOrBuilder getInstanceOrBuilder(); +} diff --git a/proto-google-cloud-filestore-v1beta1/src/main/proto/google/cloud/filestore/v1beta1/cloud_filestore_service.proto b/proto-google-cloud-filestore-v1beta1/src/main/proto/google/cloud/filestore/v1beta1/cloud_filestore_service.proto new file mode 100644 index 00000000..77b246c7 --- /dev/null +++ b/proto-google-cloud-filestore-v1beta1/src/main/proto/google/cloud/filestore/v1beta1/cloud_filestore_service.proto @@ -0,0 +1,732 @@ +// Copyright 2021 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 +// +// http://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. + +syntax = "proto3"; + +package google.cloud.filestore.v1beta1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/longrunning/operations.proto"; +import "google/protobuf/field_mask.proto"; +import "google/protobuf/timestamp.proto"; +import "google/protobuf/wrappers.proto"; + +option csharp_namespace = "Google.Cloud.Filestore.V1Beta1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/filestore/v1beta1;filestore"; +option java_multiple_files = true; +option java_outer_classname = "CloudFilestoreServiceProto"; +option java_package = "com.google.cloud.filestore.v1beta1"; +option php_namespace = "Google\\Cloud\\Filestore\\V1beta1"; + +option (google.api.resource_definition) = { + type: "file.googleapis.com/Snapshot" + pattern: "projects/{project}/locations/{location}/snapshots/{snapshot}" +}; + +// Configures and manages Cloud Filestore resources. +// +// Cloud Filestore Manager v1beta1. +// +// The `file.googleapis.com` service implements the Cloud 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: +// `/projects/{project_id}/locations/{location_id}/instances/{instance_id}` +// backups are resources of the form: +// `/projects/{project_id}/locations/{location_id}/backup/{backup_id}` +// +// Note that location_id can represent a GCP `zone` or `region` depending on the +// resource. +// for example: +// A zonal Filestore instance: +// * `projects/my-project/locations/us-central1-c/instances/my-basic-tier-filer` +// A regional Filestore instance: +// * `projects/my-project/locations/us-central1/instances/my-enterprise-filer` +service CloudFilestoreManager { + option (google.api.default_host) = "file.googleapis.com"; + option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform"; + + // Lists all instances in a project for either a specified location + // or for all locations. + rpc ListInstances(ListInstancesRequest) returns (ListInstancesResponse) { + option (google.api.http) = { + get: "/v1beta1/{parent=projects/*/locations/*}/instances" + }; + option (google.api.method_signature) = "parent"; + } + + // Gets the details of a specific instance. + rpc GetInstance(GetInstanceRequest) returns (Instance) { + option (google.api.http) = { + get: "/v1beta1/{name=projects/*/locations/*/instances/*}" + }; + option (google.api.method_signature) = "name"; + } + + // 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). + rpc CreateInstance(CreateInstanceRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1beta1/{parent=projects/*/locations/*}/instances" + body: "instance" + }; + option (google.api.method_signature) = "parent,instance,instance_id"; + option (google.longrunning.operation_info) = { + response_type: "Instance" + metadata_type: "google.cloud.common.OperationMetadata" + }; + } + + // Updates the settings of a specific instance. + rpc UpdateInstance(UpdateInstanceRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v1beta1/{instance.name=projects/*/locations/*/instances/*}" + body: "instance" + }; + option (google.api.method_signature) = "instance,update_mask"; + option (google.longrunning.operation_info) = { + response_type: "Instance" + metadata_type: "google.cloud.common.OperationMetadata" + }; + } + + // 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). + rpc RestoreInstance(RestoreInstanceRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1beta1/{name=projects/*/locations/*/instances/*}:restore" + 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) = { + delete: "/v1beta1/{name=projects/*/locations/*/instances/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + 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) { + option (google.api.http) = { + get: "/v1beta1/{parent=projects/*/locations/*}/backups" + }; + option (google.api.method_signature) = "parent"; + } + + // Gets the details of a specific backup. + rpc GetBackup(GetBackupRequest) returns (Backup) { + option (google.api.http) = { + get: "/v1beta1/{name=projects/*/locations/*/backups/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Creates a backup. + rpc CreateBackup(CreateBackupRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1beta1/{parent=projects/*/locations/*}/backups" + body: "backup" + }; + option (google.api.method_signature) = "parent,backup,backup_id"; + option (google.longrunning.operation_info) = { + response_type: "Backup" + metadata_type: "google.cloud.common.OperationMetadata" + }; + } + + // Deletes a backup. + rpc DeleteBackup(DeleteBackupRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1beta1/{name=projects/*/locations/*/backups/*}" + }; + 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 backup. + rpc UpdateBackup(UpdateBackupRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v1beta1/{backup.name=projects/*/locations/*/backups/*}" + body: "backup" + }; + option (google.api.method_signature) = "backup,update_mask"; + option (google.longrunning.operation_info) = { + response_type: "Backup" + metadata_type: "google.cloud.common.OperationMetadata" + }; + } +} + +// Network configuration for the instance. +message NetworkConfig { + // Internet protocol versions supported by Cloud Filestore. + enum AddressMode { + // Internet protocol not set. + ADDRESS_MODE_UNSPECIFIED = 0; + + // Use the IPv4 internet protocol. + MODE_IPV4 = 1; + } + + // The name of the Google Compute Engine + // [VPC network](/compute/docs/networks-and-firewalls#networks) to which the + // instance is connected. + string network = 1; + + // Internet protocol versions for which the instance has IP addresses + // 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 + // ranges](https://www.arin.net/knowledge/address_filters.html) 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. + string reserved_ip_range = 4; + + // Output only. IPv4 addresses in the format + // {octet 1}.{octet 2}.{octet 3}.{octet 4} or IPv6 addresses in the format + // {block 1}:{block 2}:{block 3}:{block 4}:{block 5}:{block 6}:{block + // 7}:{block 8}. + repeated string ip_addresses = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// File share configuration for the instance. +message FileShareConfig { + // The name of the file share (must be 16 characters or less). + string name = 1; + + // File share capacity in gigabytes (GB). + // Cloud 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 + // share is created from scratch. + oneof source { + // The resource name of the backup, in the format + // projects/{project_id}/locations/{location_id}/backups/{backup_id}, that + // this file share has been restored from. + string source_backup = 9 [(google.api.resource_reference) = { + type: "file.googleapis.com/Backup" + }]; + } + + // Nfs Export Options. + // There is a limit of 10 export options per file share. + repeated NfsExportOptions nfs_export_options = 8; +} + +// NFS export options specifications. +message NfsExportOptions { + // The access mode. + enum AccessMode { + // AccessMode not set. + ACCESS_MODE_UNSPECIFIED = 0; + + // The client can only read the file share. + READ_ONLY = 1; + + // The client can read and write the file share (default). + READ_WRITE = 2; + } + + // The squash mode. + enum SquashMode { + // SquashMode not set. + SQUASH_MODE_UNSPECIFIED = 0; + + // The Root user has root access to the file share (default). + NO_ROOT_SQUASH = 1; + + // The Root user has squashed access to the anonymous uid/gid. + ROOT_SQUASH = 2; + } + + // List of either an IPv4 addresses in the format + // {octet 1}.{octet 2}.{octet 3}.{octet 4} or CIDR ranges in the format + // {octet 1}.{octet 2}.{octet 3}.{octet 4}/{mask size} which may mount the + // file share. + // Overlapping IP ranges are not allowed, both within and across + // NfsExportOptions. An error will be returned. + // The limit is 64 IP ranges/addresses for each FileShareConfig among all + // NfsExportOptions. + repeated string ip_ranges = 1; + + // Either READ_ONLY, for allowing only read requests on the exported + // directory, or READ_WRITE, for allowing both read and write requests. + // The default is READ_WRITE. + AccessMode access_mode = 2; + + // Either NO_ROOT_SQUASH, for allowing root access on the exported directory, + // or ROOT_SQUASH, for not allowing root access. The default is + // NO_ROOT_SQUASH. + SquashMode squash_mode = 3; + + // An integer representing the anonymous user id with a default value of + // 65534. + // Anon_uid may only be set with squash_mode of ROOT_SQUASH. An error will be + // returned if this field is specified for other squash_mode settings. + int64 anon_uid = 4; + + // An integer representing the anonymous group id with a default value of + // 65534. + // Anon_gid may only be set with squash_mode of ROOT_SQUASH. An error will be + // returned if this field is specified for other squash_mode settings. + int64 anon_gid = 5; +} + +// A Cloud Filestore instance. +message Instance { + option (google.api.resource) = { + type: "file.googleapis.com/Instance" + pattern: "projects/{project}/locations/{location}/instances/{instance}" + }; + + // The instance state. + enum State { + // State not set. + STATE_UNSPECIFIED = 0; + + // The instance is being created. + CREATING = 1; + + // The instance is available for use. + READY = 2; + + // Work is being done on the instance. You can get further details from the + // `statusMessage` field of the `Instance` resource. + REPAIRING = 3; + + // The instance is shutting down. + DELETING = 4; + + // The instance is experiencing an issue and might be unusable. You can get + // further details from the `statusMessage` field of the `Instance` + // resource. + ERROR = 6; + + // The instance is restoring a snapshot or backup to an existing file share + // and may be unusable during this time. + RESTORING = 7; + } + + // Available service tiers. + enum Tier { + // Not set. + TIER_UNSPECIFIED = 0; + + // STANDARD tier. BASIC_HDD is the preferred term for this tier. + STANDARD = 1; + + // PREMIUM tier. BASIC_SSD is the preferred term for this tier. + PREMIUM = 2; + + // BASIC instances offer a maximum capacity of 63.9 TB. + // BASIC_HDD is an alias for STANDARD Tier, offering economical + // performance backed by HDD. + BASIC_HDD = 3; + + // BASIC instances offer a maximum capacity of 63.9 TB. + // BASIC_SSD is an alias for PREMIUM Tier, and offers improved + // performance backed by SSD. + BASIC_SSD = 4; + + // HIGH_SCALE instances offer expanded capacity and performance scaling + // capabilities. + HIGH_SCALE_SSD = 6; + } + + // Output only. The resource name of the instance, in the format + // projects/{project_id}/locations/{location_id}/instances/{instance_id}. + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The description of the instance (2048 characters or less). + string description = 2; + + // Output only. The instance state. + State state = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Additional information about the instance state, if available. + string status_message = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time when the instance was created. + google.protobuf.Timestamp create_time = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The service tier of the instance. + Tier tier = 8; + + // Resource labels to represent user provided metadata. + map labels = 9; + + // File system shares on the instance. + // For this version, only a single file share is supported. + repeated FileShareConfig file_shares = 10; + + // VPC networks to which the instance is connected. + // For this version, only a single network is supported. + repeated NetworkConfig networks = 11; + + // Server-specified ETag for the instance resource to prevent simultaneous + // updates from overwriting each other. + string etag = 12; + + // Output only. Reserved for future use. + google.protobuf.BoolValue satisfies_pzs = 13 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// CreateInstanceRequest creates an instance. +message CreateInstanceRequest { + // 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**. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; + + // Required. The ID of the instance to create. + // 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. + string instance_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. A [instance resource] + // (/cloud-filestore/reference/rest/v1beta1/projects.locations.instances) + Instance instance = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// GetInstanceRequest gets the state of an instance. +message GetInstanceRequest { + // Required. The instance resource name, in the format + // projects/{project_id}/locations/{location}/instances/{instance_id}. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "file.googleapis.com/Instance" + } + ]; +} + +// UpdateInstanceRequest updates the settings of an instance. +message UpdateInstanceRequest { + // 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" + // * "file_shares" + // * "labels" + google.protobuf.FieldMask update_mask = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. Only fields specified in update_mask are updated. + Instance instance = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// RestoreInstanceRequest restores an existing instances's file share from a +// snapshot or backup. +message RestoreInstanceRequest { + // Required. The resource name of the instance, in the format + // projects/{project_id}/locations/{location_id}/instances/{instance_id}. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "file.googleapis.com/Instance" + } + ]; + + // Required. Name of the file share in the Cloud Filestore instance that the snapshot + // is being restored to. + string file_share = 2 [(google.api.field_behavior) = REQUIRED]; + + oneof source { + // The resource name of the snapshot, in the format + // projects/{project_id}/locations/{location_id}/snapshots/{snapshot_id}. + string source_snapshot = 3 [(google.api.resource_reference) = { + type: "file.googleapis.com/Snapshot" + }]; + + // The resource name of the backup, in the format + // projects/{project_id}/locations/{location_id}/backups/{backup_id}. + string source_backup = 4 [(google.api.resource_reference) = { + type: "file.googleapis.com/Backup" + }]; + } +} + +// DeleteInstanceRequest deletes an instance. +message DeleteInstanceRequest { + // Required. The instance resource name, in the format + // projects/{project_id}/locations/{location}/instances/{instance_id} + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "file.googleapis.com/Instance" + } + ]; +} + +// ListInstancesRequest lists instances. +message ListInstancesRequest { + // Required. The project and location for which to retrieve instance information, + // in the format projects/{project_id}/locations/{location}. In Cloud + // Filestore, locations map to GCP zones, for example **us-west1-b**. To + // retrieve instance information for all locations, use "-" for the {location} + // value. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; + + // 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; +} + +// ListInstancesResponse is the result of ListInstancesRequest. +message ListInstancesResponse { + // A list of instances in the project for the specified location. + // + // If the {location} value in the request is "-", the response contains a list + // of instances from all locations. If any location is unreachable, the + // response will only return instances in reachable locations and the + // "unreachable" field will be populated with a list of unreachable locations. + repeated Instance instances = 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; +} + +// A Cloud Filestore backup. +message Backup { + option (google.api.resource) = { + type: "file.googleapis.com/Backup" + pattern: "projects/{project}/locations/{location}/backups/{backup}" + }; + + // The backup state. + enum State { + // State not set. + STATE_UNSPECIFIED = 0; + + // Backup is being created. + CREATING = 1; + + // Backup has been taken and the operation is being finalized. At this + // point, changes to the file share will not be reflected in the backup. + FINALIZING = 2; + + // Backup is available for use. + READY = 3; + + // Backup is being deleted. + DELETING = 4; + } + + // Output only. The resource name of the backup, in the format + // projects/{project_id}/locations/{location_id}/backups/{backup_id}. + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // A description of the backup with 2048 characters or less. + // Requests with longer descriptions will be rejected. + string description = 2; + + // Output only. The backup state. + State state = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time when the backup was created. + google.protobuf.Timestamp create_time = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Resource labels to represent user provided metadata. + map labels = 5; + + // Output only. Capacity of the source file share when the backup was created. + int64 capacity_gb = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The size of the storage used by the backup. As backups share storage, + // 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 + // 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 + // backup is created from. + string source_file_share = 9; + + // Output only. The service tier of the source Cloud Filestore instance that this backup + // is created from. + Instance.Tier source_instance_tier = 10 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Amount of bytes that will be downloaded if the backup is restored + int64 download_bytes = 11 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Reserved for future use. + google.protobuf.BoolValue satisfies_pzs = 12 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// CreateBackupRequest creates a backup. +message CreateBackupRequest { + // 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**. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; + + // Required. A [backup resource] + // (/cloud-filestore/reference/rest/v1beta1/projects.locations.backups) + Backup backup = 2 [(google.api.field_behavior) = REQUIRED]; + + // 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. + string backup_id = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// DeleteBackupRequest deletes a backup. +message DeleteBackupRequest { + // Required. The backup resource name, in the format + // projects/{project_id}/locations/{location}/backups/{backup_id} + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "file.googleapis.com/Backup" + } + ]; +} + +// UpdateBackupRequest updates description and/or labels for a backup. +message UpdateBackupRequest { + // Required. A [backup resource] + // (/cloud-filestore/reference/rest/v1beta1/projects.locations.backups) + Backup backup = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. Mask of fields to update. At least one path must be supplied in this + // field. + google.protobuf.FieldMask update_mask = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// GetBackupRequest gets the state of a backup. +message GetBackupRequest { + // Required. The backup resource name, in the format + // projects/{project_id}/locations/{location}/backups/{backup_id}. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "file.googleapis.com/Backup" + } + ]; +} + +// ListBackupsRequest lists backups. +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, + // for example **us-west1**. + // To retrieve backup information for all locations, use "-" for the + // {location} value. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; + + // 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; +} + +// ListBackupsResponse is the result of ListBackupsRequest. +message ListBackupsResponse { + // A list of backups in the project for the specified location. + // + // If the {location} value in the request is "-", the response contains a list + // of backups from all locations. If any location is unreachable, the + // response will only return backups in reachable locations and the + // "unreachable" field will be populated with a list of unreachable + // locations. + repeated Backup backups = 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; +} diff --git a/renovate.json b/renovate.json new file mode 100644 index 00000000..213b7a27 --- /dev/null +++ b/renovate.json @@ -0,0 +1,73 @@ +{ + "extends": [ + ":separateMajorReleases", + ":combinePatchMinorReleases", + ":ignoreUnstable", + ":prImmediately", + ":updateNotScheduled", + ":automergeDisabled", + ":ignoreModulesAndTests", + ":maintainLockFilesDisabled", + ":autodetectPinVersions" + ], + "packageRules": [ + { + "packagePatterns": [ + "^com.google.guava:" + ], + "versionScheme": "docker" + }, + { + "packagePatterns": [ + "*" + ], + "semanticCommitType": "deps", + "semanticCommitScope": null + }, + { + "packagePatterns": [ + "^org.apache.maven", + "^org.jacoco:", + "^org.codehaus.mojo:", + "^org.sonatype.plugins:", + "^com.coveo:", + "^com.google.cloud:google-cloud-shared-config" + ], + "semanticCommitType": "build", + "semanticCommitScope": "deps" + }, + { + "packagePatterns": [ + "^com.google.cloud:google-cloud-filestore", + "^com.google.cloud:libraries-bom", + "^com.google.cloud.samples:shared-configuration" + ], + "semanticCommitType": "chore", + "semanticCommitScope": "deps" + }, + { + "packagePatterns": [ + "^junit:junit", + "^com.google.truth:truth", + "^org.mockito:mockito-core", + "^org.objenesis:objenesis" + ], + "semanticCommitType": "test", + "semanticCommitScope": "deps" + }, + { + "packagePatterns": [ + "^com.google.cloud:google-cloud-" + ], + "ignoreUnstable": false + }, + { + "packagePatterns": [ + "^com.fasterxml.jackson.core" + ], + "groupName": "jackson dependencies" + } + ], + "semanticCommits": true, + "masterIssue": true +} diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml new file mode 100644 index 00000000..b24442fc --- /dev/null +++ b/samples/install-without-bom/pom.xml @@ -0,0 +1,84 @@ + + + 4.0.0 + com.google.cloud + filestore-install-without-bom + jar + Google Cloud Filestore API Install Without Bom + https://github.com/googleapis/java-filestore + + + + com.google.cloud.samples + shared-configuration + 1.0.12 + + + + 1.8 + 1.8 + UTF-8 + + + + + + + com.google.cloud + google-cloud-filestore + 0.0.0 + + + + + junit + junit + 4.13 + test + + + com.google.truth + truth + 1.0.1 + test + + + + + + + + org.codehaus.mojo + build-helper-maven-plugin + 3.1.0 + + + add-snippets-source + + add-source + + + + ../snippets/src/main/java + + + + + add-snippets-tests + + add-test-source + + + + ../snippets/src/test/java + + + + + + + + diff --git a/samples/pom.xml b/samples/pom.xml new file mode 100644 index 00000000..d5ff8e71 --- /dev/null +++ b/samples/pom.xml @@ -0,0 +1,56 @@ + + + 4.0.0 + com.google.cloud + google-cloud-filestore-samples + 0.0.1-SNAPSHOT + pom + Google Cloud Filestore API Samples Parent + https://github.com/googleapis/java-filestore + + Java idiomatic client for Google Cloud Platform services. + + + + + com.google.cloud.samples + shared-configuration + 1.0.18 + + + + 1.8 + 1.8 + UTF-8 + + + + install-without-bom + snapshot + snippets + + + + + + org.apache.maven.plugins + maven-deploy-plugin + 2.8.2 + + true + + + + org.sonatype.plugins + nexus-staging-maven-plugin + 1.6.8 + + true + + + + + diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml new file mode 100644 index 00000000..eb6b8690 --- /dev/null +++ b/samples/snapshot/pom.xml @@ -0,0 +1,83 @@ + + + 4.0.0 + com.google.cloud + filestore-snapshot + jar + Google Cloud Filestore API Snapshot Samples + https://github.com/googleapis/java-filestore + + + + com.google.cloud.samples + shared-configuration + 1.0.12 + + + + 1.8 + 1.8 + UTF-8 + + + + + + com.google.cloud + google-cloud-filestore + 0.0.0 + + + + + junit + junit + 4.13 + test + + + com.google.truth + truth + 1.0.1 + test + + + + + + + + org.codehaus.mojo + build-helper-maven-plugin + 3.1.0 + + + add-snippets-source + + add-source + + + + ../snippets/src/main/java + + + + + add-snippets-tests + + add-test-source + + + + ../snippets/src/test/java + + + + + + + + \ No newline at end of file diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml new file mode 100644 index 00000000..9c53a75a --- /dev/null +++ b/samples/snippets/pom.xml @@ -0,0 +1,47 @@ + + + 4.0.0 + com.google.cloud + filestore-snippets + jar + Google Cloud Filestore API Snippets + https://github.com/googleapis/java-filestore + + + + com.google.cloud.samples + shared-configuration + 1.0.12 + + + + 1.8 + 1.8 + UTF-8 + + + + + + com.google.cloud + google-cloud-filestore + 0.0.0 + + + + junit + junit + 4.13 + test + + + com.google.truth + truth + 1.0.1 + test + + + diff --git a/versions.txt b/versions.txt new file mode 100644 index 00000000..70ba12c3 --- /dev/null +++ b/versions.txt @@ -0,0 +1,8 @@ +# Format: +# module:released-version:current-version + +google-cloud-filestore:0.0.0:0.0.1-SNAPSHOT +grpc-google-cloud-filestore-v1beta1:0.0.0:0.0.1-SNAPSHOT +grpc-google-cloud-filestore-v1:0.0.0:0.0.1-SNAPSHOT +proto-google-cloud-filestore-v1:0.0.0:0.0.1-SNAPSHOT +proto-google-cloud-filestore-v1beta1:0.0.0:0.0.1-SNAPSHOT