From e859b29ccf4e68b1ab62cffdd4cf197011ba9878 Mon Sep 17 00:00:00 2001 From: cloud-java-bot <122572305+cloud-java-bot@users.noreply.github.com> Date: Tue, 16 Jul 2024 06:04:17 -0400 Subject: [PATCH] chore: Update generation configuration at Thu Jul 11 11:15:38 UTC 2024 (#3208) This pull request is generated with proto changes between [googleapis/googleapis@6f289d7](https://togithub.com/googleapis/googleapis/commit/6f289d775912966eb0cf04bda91e5e355c998d30) (exclusive) and [googleapis/googleapis@19577ed](https://togithub.com/googleapis/googleapis/commit/19577edb4d439db98d2fb1f6f48f2e1b29fba099) (inclusive). BEGIN_COMMIT_OVERRIDE BEGIN_NESTED_COMMIT chore: update the libraries_bom version to 26.43.0 END_NESTED_COMMIT BEGIN_NESTED_COMMIT feat(spanner): Add support for Cloud Spanner Scheduled Backups PiperOrigin-RevId: 649277844 Source Link: [googleapis/googleapis@fd7efa2](https://togithub.com/googleapis/googleapis/commit/fd7efa2da3860e813485e63661d3bdd21fc9ba82) END_NESTED_COMMIT BEGIN_NESTED_COMMIT feat: add field order_by in spanner.proto feat: add field lock_hint in spanner.proto PiperOrigin-RevId: 636759139 Source Link: [googleapis/googleapis@eeed69d](https://togithub.com/googleapis/googleapis/commit/eeed69d446a90eb4a4a2d1762c49d637075390c1) END_NESTED_COMMIT BEGIN_NESTED_COMMIT feat: Add QueryCancellationAction message in executor protos PiperOrigin-RevId: 633451546 Source Link: [googleapis/googleapis@e3a34df](https://togithub.com/googleapis/googleapis/commit/e3a34df5b36e38a1ee0b1544ed4ae3b99cdf0f91) END_NESTED_COMMIT BEGIN_NESTED_COMMIT chore: update copyright year for auto-generated protos PiperOrigin-RevId: 631538781 Source Link: [googleapis/googleapis@3597f7d](https://togithub.com/googleapis/googleapis/commit/3597f7db2191c00b100400991ef96e52d62f5841) END_NESTED_COMMIT BEGIN_NESTED_COMMIT feat: Add support for multi region encryption config docs: fix linting for several doc comments PiperOrigin-RevId: 630422337 Source Link: [googleapis/googleapis@65db386](https://togithub.com/googleapis/googleapis/commit/65db386b43905c561686b58344c5b620a10ed808) END_NESTED_COMMIT BEGIN_NESTED_COMMIT feat: add `RESOURCE_EXHAUSTED` to the list of retryable error codes PiperOrigin-RevId: 628281023 Source Link: [googleapis/googleapis@60536a2](https://togithub.com/googleapis/googleapis/commit/60536a2a263b6d33b0b1adb5b10c10e34ccf4528) END_NESTED_COMMIT BEGIN_NESTED_COMMIT feat(spanner): adding `EXPECTED_FULFILLMENT_PERIOD` to the indicate instance creation times (with `FULFILLMENT_PERIOD_NORMAL` or `FULFILLMENT_PERIOD_EXTENDED` ENUM) with the extended instance creation time triggered by On-Demand Capacity Feature PiperOrigin-RevId: 621488048 Source Link: [googleapis/googleapis@0aa0992](https://togithub.com/googleapis/googleapis/commit/0aa0992a5430c211a73c9b861d65e1e8a7a91a9e) END_NESTED_COMMIT BEGIN_NESTED_COMMIT feat: Add SessionPoolOptions, SpannerOptions protos in executor protos PiperOrigin-RevId: 621265883 Source Link: [googleapis/googleapis@fed9845](https://togithub.com/googleapis/googleapis/commit/fed9845c564d6acf8d03beee69b36666c8bd7fa4) END_NESTED_COMMIT END_COMMIT_OVERRIDE --- .repo-metadata.json | 15 +- README.md | 12 +- generation_config.yaml | 4 +- .../reflect-config.json | 180 ++ .../database/v1/DatabaseAdminClient.java | 914 ++++++- .../database/v1/DatabaseAdminSettings.java | 70 + .../admin/database/v1/gapic_metadata.json | 15 + .../database/v1/stub/DatabaseAdminStub.java | 34 + .../v1/stub/DatabaseAdminStubSettings.java | 209 +- .../v1/stub/GrpcDatabaseAdminStub.java | 190 ++ .../v1/stub/HttpJsonDatabaseAdminStub.java | 342 ++- .../reflect-config.json | 180 ++ .../v1/DatabaseAdminClientHttpJsonTest.java | 486 ++++ .../database/v1/DatabaseAdminClientTest.java | 423 +++ .../database/v1/MockDatabaseAdminImpl.java | 113 + .../admin/database/v1/DatabaseAdminGrpc.java | 614 +++++ .../spanner/admin/database/v1/Backup.java | 394 +++ .../admin/database/v1/BackupOrBuilder.java | 87 + .../admin/database/v1/BackupProto.java | 182 +- .../admin/database/v1/BackupSchedule.java | 2335 +++++++++++++++++ .../admin/database/v1/BackupScheduleName.java | 261 ++ .../database/v1/BackupScheduleOrBuilder.java | 287 ++ .../database/v1/BackupScheduleProto.java | 237 ++ .../admin/database/v1/BackupScheduleSpec.java | 820 ++++++ .../v1/BackupScheduleSpecOrBuilder.java | 63 + .../v1/CreateBackupScheduleRequest.java | 1152 ++++++++ .../CreateBackupScheduleRequestOrBuilder.java | 125 + .../admin/database/v1/CrontabSpec.java | 1269 +++++++++ .../database/v1/CrontabSpecOrBuilder.java | 159 ++ .../v1/DeleteBackupScheduleRequest.java | 663 +++++ .../DeleteBackupScheduleRequestOrBuilder.java | 59 + .../admin/database/v1/FullBackupSpec.java | 436 +++ .../database/v1/FullBackupSpecOrBuilder.java | 25 + .../database/v1/GetBackupScheduleRequest.java | 660 +++++ .../v1/GetBackupScheduleRequestOrBuilder.java | 59 + .../v1/ListBackupSchedulesRequest.java | 970 +++++++ .../ListBackupSchedulesRequestOrBuilder.java | 106 + .../v1/ListBackupSchedulesResponse.java | 1158 ++++++++ .../ListBackupSchedulesResponseOrBuilder.java | 108 + .../v1/SpannerDatabaseAdminProto.java | 549 ++-- .../v1/UpdateBackupScheduleRequest.java | 1107 ++++++++ .../UpdateBackupScheduleRequestOrBuilder.java | 123 + .../spanner/admin/database/v1/backup.proto | 17 + .../admin/database/v1/backup_schedule.proto | 227 ++ .../database/v1/spanner_database_admin.proto | 60 + renovate.json | 4 +- 46 files changed, 17097 insertions(+), 406 deletions(-) create mode 100644 proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/BackupSchedule.java create mode 100644 proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/BackupScheduleName.java create mode 100644 proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/BackupScheduleOrBuilder.java create mode 100644 proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/BackupScheduleProto.java create mode 100644 proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/BackupScheduleSpec.java create mode 100644 proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/BackupScheduleSpecOrBuilder.java create mode 100644 proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/CreateBackupScheduleRequest.java create mode 100644 proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/CreateBackupScheduleRequestOrBuilder.java create mode 100644 proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/CrontabSpec.java create mode 100644 proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/CrontabSpecOrBuilder.java create mode 100644 proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/DeleteBackupScheduleRequest.java create mode 100644 proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/DeleteBackupScheduleRequestOrBuilder.java create mode 100644 proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/FullBackupSpec.java create mode 100644 proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/FullBackupSpecOrBuilder.java create mode 100644 proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/GetBackupScheduleRequest.java create mode 100644 proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/GetBackupScheduleRequestOrBuilder.java create mode 100644 proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/ListBackupSchedulesRequest.java create mode 100644 proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/ListBackupSchedulesRequestOrBuilder.java create mode 100644 proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/ListBackupSchedulesResponse.java create mode 100644 proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/ListBackupSchedulesResponseOrBuilder.java create mode 100644 proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/UpdateBackupScheduleRequest.java create mode 100644 proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/UpdateBackupScheduleRequestOrBuilder.java create mode 100644 proto-google-cloud-spanner-admin-database-v1/src/main/proto/google/spanner/admin/database/v1/backup_schedule.proto diff --git a/.repo-metadata.json b/.repo-metadata.json index 80355fa2aff..5a0cd00cfe6 100644 --- a/.repo-metadata.json +++ b/.repo-metadata.json @@ -2,21 +2,20 @@ "api_shortname": "spanner", "name_pretty": "Cloud Spanner", "product_documentation": "https://cloud.google.com/spanner/docs/", + "api_description": "is a fully managed, mission-critical, relational database service that offers transactional consistency at global scale, \\nschemas, SQL (ANSI 2011 with extensions), and automatic, synchronous replication \\nfor high availability.\\n\\nBe sure to activate the Cloud Spanner API on the Developer's Console to\\nuse Cloud Spanner from your project.", "client_documentation": "https://cloud.google.com/java/docs/reference/google-cloud-spanner/latest/history", - "api_description": "is a fully managed, mission-critical, \nrelational database service that offers transactional consistency at global scale, \nschemas, SQL (ANSI 2011 with extensions), and automatic, synchronous replication \nfor high availability.\n\nBe sure to activate the Cloud Spanner API on the Developer's Console to\nuse Cloud Spanner from your project.", - "issue_tracker": "https://issuetracker.google.com/issues?q=componentid:190851%2B%20status:open", "release_level": "stable", + "transport": "both", "language": "java", - "min_java_version": 8, "repo": "googleapis/java-spanner", "repo_short": "java-spanner", "distribution_name": "com.google.cloud:google-cloud-spanner", "api_id": "spanner.googleapis.com", - "transport": "grpc", + "library_type": "GAPIC_COMBO", "requires_billing": true, "codeowner_team": "@googleapis/api-spanner-java", - "library_type": "GAPIC_COMBO", "excluded_poms": "google-cloud-spanner-bom", - "recommended_package": "com.google.cloud.spanner" -} - + "issue_tracker": "https://issuetracker.google.com/issues?q=componentid:190851%2B%20status:open", + "recommended_package": "com.google.cloud.spanner", + "min_java_version": 8 +} \ No newline at end of file diff --git a/README.md b/README.md index 3663b2c6f9c..95846aead8e 100644 --- a/README.md +++ b/README.md @@ -50,7 +50,7 @@ If you are using Maven without the BOM, add this to your dependencies: If you are using Gradle 5.x or later, add this to your dependencies: ```Groovy -implementation platform('com.google.cloud:libraries-bom:26.42.0') +implementation platform('com.google.cloud:libraries-bom:26.43.0') implementation 'com.google.cloud:google-cloud-spanner' ``` @@ -93,13 +93,7 @@ to add `google-cloud-spanner` as a dependency in your code. ## About Cloud Spanner -[Cloud Spanner][product-docs] is a fully managed, mission-critical, -relational database service that offers transactional consistency at global scale, -schemas, SQL (ANSI 2011 with extensions), and automatic, synchronous replication -for high availability. - -Be sure to activate the Cloud Spanner API on the Developer's Console to -use Cloud Spanner from your project. +[Cloud Spanner][product-docs] is a fully managed, mission-critical, relational database service that offers transactional consistency at global scale, \nschemas, SQL (ANSI 2011 with extensions), and automatic, synchronous replication \nfor high availability.\n\nBe sure to activate the Cloud Spanner API on the Developer's Console to\nuse Cloud Spanner from your project. See the [Cloud Spanner client library docs][javadocs] to learn how to use this Cloud Spanner Client Library. @@ -627,7 +621,7 @@ To get help, follow the instructions in the [shared Troubleshooting document][tr ## Transport -Cloud Spanner uses gRPC for the transport layer. +Cloud Spanner uses both gRPC and HTTP/JSON for the transport layer. ## Supported Java Versions diff --git a/generation_config.yaml b/generation_config.yaml index 8f89fb578b3..5db47f1db7c 100644 --- a/generation_config.yaml +++ b/generation_config.yaml @@ -1,6 +1,6 @@ gapic_generator_version: 2.42.0 -googleapis_commitish: 6f289d775912966eb0cf04bda91e5e355c998d30 -libraries_bom_version: 26.38.0 +googleapis_commitish: 19577edb4d439db98d2fb1f6f48f2e1b29fba099 +libraries_bom_version: 26.43.0 libraries: - api_shortname: spanner name_pretty: Cloud Spanner diff --git a/google-cloud-spanner-executor/src/main/resources/META-INF/native-image/com.google.cloud.spanner.executor.v1/reflect-config.json b/google-cloud-spanner-executor/src/main/resources/META-INF/native-image/com.google.cloud.spanner.executor.v1/reflect-config.json index 1bbd31bc982..f0594591386 100644 --- a/google-cloud-spanner-executor/src/main/resources/META-INF/native-image/com.google.cloud.spanner.executor.v1/reflect-config.json +++ b/google-cloud-spanner-executor/src/main/resources/META-INF/native-image/com.google.cloud.spanner.executor.v1/reflect-config.json @@ -1709,6 +1709,42 @@ "allDeclaredClasses": true, "allPublicClasses": true }, + { + "name": "com.google.spanner.admin.database.v1.BackupSchedule", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.spanner.admin.database.v1.BackupSchedule$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.spanner.admin.database.v1.BackupScheduleSpec", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.spanner.admin.database.v1.BackupScheduleSpec$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, { "name": "com.google.spanner.admin.database.v1.CopyBackupEncryptionConfig", "queryAllDeclaredConstructors": true, @@ -1835,6 +1871,24 @@ "allDeclaredClasses": true, "allPublicClasses": true }, + { + "name": "com.google.spanner.admin.database.v1.CreateBackupScheduleRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.spanner.admin.database.v1.CreateBackupScheduleRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, { "name": "com.google.spanner.admin.database.v1.CreateDatabaseMetadata", "queryAllDeclaredConstructors": true, @@ -1871,6 +1925,24 @@ "allDeclaredClasses": true, "allPublicClasses": true }, + { + "name": "com.google.spanner.admin.database.v1.CrontabSpec", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.spanner.admin.database.v1.CrontabSpec$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, { "name": "com.google.spanner.admin.database.v1.Database", "queryAllDeclaredConstructors": true, @@ -1961,6 +2033,24 @@ "allDeclaredClasses": true, "allPublicClasses": true }, + { + "name": "com.google.spanner.admin.database.v1.DeleteBackupScheduleRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.spanner.admin.database.v1.DeleteBackupScheduleRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, { "name": "com.google.spanner.admin.database.v1.DropDatabaseRequest", "queryAllDeclaredConstructors": true, @@ -2024,6 +2114,24 @@ "allDeclaredClasses": true, "allPublicClasses": true }, + { + "name": "com.google.spanner.admin.database.v1.FullBackupSpec", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.spanner.admin.database.v1.FullBackupSpec$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, { "name": "com.google.spanner.admin.database.v1.GetBackupRequest", "queryAllDeclaredConstructors": true, @@ -2042,6 +2150,24 @@ "allDeclaredClasses": true, "allPublicClasses": true }, + { + "name": "com.google.spanner.admin.database.v1.GetBackupScheduleRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.spanner.admin.database.v1.GetBackupScheduleRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, { "name": "com.google.spanner.admin.database.v1.GetDatabaseDdlRequest", "queryAllDeclaredConstructors": true, @@ -2132,6 +2258,42 @@ "allDeclaredClasses": true, "allPublicClasses": true }, + { + "name": "com.google.spanner.admin.database.v1.ListBackupSchedulesRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.spanner.admin.database.v1.ListBackupSchedulesRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.spanner.admin.database.v1.ListBackupSchedulesResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.spanner.admin.database.v1.ListBackupSchedulesResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, { "name": "com.google.spanner.admin.database.v1.ListBackupsRequest", "queryAllDeclaredConstructors": true, @@ -2420,6 +2582,24 @@ "allDeclaredClasses": true, "allPublicClasses": true }, + { + "name": "com.google.spanner.admin.database.v1.UpdateBackupScheduleRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.spanner.admin.database.v1.UpdateBackupScheduleRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, { "name": "com.google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata", "queryAllDeclaredConstructors": true, diff --git a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/admin/database/v1/DatabaseAdminClient.java b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/admin/database/v1/DatabaseAdminClient.java index e518198549b..dd00f6750c7 100644 --- a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/admin/database/v1/DatabaseAdminClient.java +++ b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/admin/database/v1/DatabaseAdminClient.java @@ -43,24 +43,31 @@ import com.google.protobuf.Timestamp; import com.google.spanner.admin.database.v1.Backup; import com.google.spanner.admin.database.v1.BackupName; +import com.google.spanner.admin.database.v1.BackupSchedule; +import com.google.spanner.admin.database.v1.BackupScheduleName; import com.google.spanner.admin.database.v1.CopyBackupMetadata; import com.google.spanner.admin.database.v1.CopyBackupRequest; import com.google.spanner.admin.database.v1.CreateBackupMetadata; import com.google.spanner.admin.database.v1.CreateBackupRequest; +import com.google.spanner.admin.database.v1.CreateBackupScheduleRequest; import com.google.spanner.admin.database.v1.CreateDatabaseMetadata; import com.google.spanner.admin.database.v1.CreateDatabaseRequest; import com.google.spanner.admin.database.v1.Database; import com.google.spanner.admin.database.v1.DatabaseName; import com.google.spanner.admin.database.v1.DatabaseRole; import com.google.spanner.admin.database.v1.DeleteBackupRequest; +import com.google.spanner.admin.database.v1.DeleteBackupScheduleRequest; import com.google.spanner.admin.database.v1.DropDatabaseRequest; import com.google.spanner.admin.database.v1.GetBackupRequest; +import com.google.spanner.admin.database.v1.GetBackupScheduleRequest; import com.google.spanner.admin.database.v1.GetDatabaseDdlRequest; import com.google.spanner.admin.database.v1.GetDatabaseDdlResponse; import com.google.spanner.admin.database.v1.GetDatabaseRequest; import com.google.spanner.admin.database.v1.InstanceName; import com.google.spanner.admin.database.v1.ListBackupOperationsRequest; import com.google.spanner.admin.database.v1.ListBackupOperationsResponse; +import com.google.spanner.admin.database.v1.ListBackupSchedulesRequest; +import com.google.spanner.admin.database.v1.ListBackupSchedulesResponse; import com.google.spanner.admin.database.v1.ListBackupsRequest; import com.google.spanner.admin.database.v1.ListBackupsResponse; import com.google.spanner.admin.database.v1.ListDatabaseOperationsRequest; @@ -72,6 +79,7 @@ import com.google.spanner.admin.database.v1.RestoreDatabaseMetadata; import com.google.spanner.admin.database.v1.RestoreDatabaseRequest; import com.google.spanner.admin.database.v1.UpdateBackupRequest; +import com.google.spanner.admin.database.v1.UpdateBackupScheduleRequest; import com.google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata; import com.google.spanner.admin.database.v1.UpdateDatabaseDdlRequest; import com.google.spanner.admin.database.v1.UpdateDatabaseMetadata; @@ -515,6 +523,101 @@ * * * + * + *

CreateBackupSchedule + *

Creates a new backup schedule. + * + *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ * + *

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

+ * + *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ * + * + * + * + *

GetBackupSchedule + *

Gets backup schedule for the input schedule name. + * + *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ * + *

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

+ * + *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ * + * + * + * + *

UpdateBackupSchedule + *

Updates a backup schedule. + * + *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ * + *

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

+ * + *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ * + * + * + * + *

DeleteBackupSchedule + *

Deletes a backup schedule. + * + *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ * + *

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

+ * + *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ * + * + * + * + *

ListBackupSchedules + *

Lists all the backup schedules for the database. + * + *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ * + *

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

+ * + *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ * + * + * * * *

See the individual methods for example code. @@ -4215,62 +4318,707 @@ public final ListDatabaseRolesPagedResponse listDatabaseRoles(ListDatabaseRolesR return stub.listDatabaseRolesCallable(); } - @Override - public final void close() { - stub.close(); + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a new backup schedule. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) {
+   *   DatabaseName parent = DatabaseName.of("[PROJECT]", "[INSTANCE]", "[DATABASE]");
+   *   BackupSchedule backupSchedule = BackupSchedule.newBuilder().build();
+   *   String backupScheduleId = "backupScheduleId1704974708";
+   *   BackupSchedule response =
+   *       databaseAdminClient.createBackupSchedule(parent, backupSchedule, backupScheduleId);
+   * }
+   * }
+ * + * @param parent Required. The name of the database that this backup schedule applies to. + * @param backupSchedule Required. The backup schedule to create. + * @param backupScheduleId Required. The Id to use for the backup schedule. The + * `backup_schedule_id` appended to `parent` forms the full backup schedule name of the form + * `projects/<project>/instances/<instance>/databases/<database>/backupSchedules/<backup_schedule_id>`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final BackupSchedule createBackupSchedule( + DatabaseName parent, BackupSchedule backupSchedule, String backupScheduleId) { + CreateBackupScheduleRequest request = + CreateBackupScheduleRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .setBackupSchedule(backupSchedule) + .setBackupScheduleId(backupScheduleId) + .build(); + return createBackupSchedule(request); } - @Override - public void shutdown() { - stub.shutdown(); + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a new backup schedule. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) {
+   *   String parent = DatabaseName.of("[PROJECT]", "[INSTANCE]", "[DATABASE]").toString();
+   *   BackupSchedule backupSchedule = BackupSchedule.newBuilder().build();
+   *   String backupScheduleId = "backupScheduleId1704974708";
+   *   BackupSchedule response =
+   *       databaseAdminClient.createBackupSchedule(parent, backupSchedule, backupScheduleId);
+   * }
+   * }
+ * + * @param parent Required. The name of the database that this backup schedule applies to. + * @param backupSchedule Required. The backup schedule to create. + * @param backupScheduleId Required. The Id to use for the backup schedule. The + * `backup_schedule_id` appended to `parent` forms the full backup schedule name of the form + * `projects/<project>/instances/<instance>/databases/<database>/backupSchedules/<backup_schedule_id>`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final BackupSchedule createBackupSchedule( + String parent, BackupSchedule backupSchedule, String backupScheduleId) { + CreateBackupScheduleRequest request = + CreateBackupScheduleRequest.newBuilder() + .setParent(parent) + .setBackupSchedule(backupSchedule) + .setBackupScheduleId(backupScheduleId) + .build(); + return createBackupSchedule(request); } - @Override - public boolean isShutdown() { - return stub.isShutdown(); + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a new backup schedule. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) {
+   *   CreateBackupScheduleRequest request =
+   *       CreateBackupScheduleRequest.newBuilder()
+   *           .setParent(DatabaseName.of("[PROJECT]", "[INSTANCE]", "[DATABASE]").toString())
+   *           .setBackupScheduleId("backupScheduleId1704974708")
+   *           .setBackupSchedule(BackupSchedule.newBuilder().build())
+   *           .build();
+   *   BackupSchedule response = databaseAdminClient.createBackupSchedule(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 BackupSchedule createBackupSchedule(CreateBackupScheduleRequest request) { + return createBackupScheduleCallable().call(request); } - @Override - public boolean isTerminated() { - return stub.isTerminated(); + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a new backup schedule. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) {
+   *   CreateBackupScheduleRequest request =
+   *       CreateBackupScheduleRequest.newBuilder()
+   *           .setParent(DatabaseName.of("[PROJECT]", "[INSTANCE]", "[DATABASE]").toString())
+   *           .setBackupScheduleId("backupScheduleId1704974708")
+   *           .setBackupSchedule(BackupSchedule.newBuilder().build())
+   *           .build();
+   *   ApiFuture future =
+   *       databaseAdminClient.createBackupScheduleCallable().futureCall(request);
+   *   // Do something.
+   *   BackupSchedule response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable + createBackupScheduleCallable() { + return stub.createBackupScheduleCallable(); } - @Override - public void shutdownNow() { - stub.shutdownNow(); + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets backup schedule for the input schedule name. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) {
+   *   BackupScheduleName name =
+   *       BackupScheduleName.of("[PROJECT]", "[INSTANCE]", "[DATABASE]", "[SCHEDULE]");
+   *   BackupSchedule response = databaseAdminClient.getBackupSchedule(name);
+   * }
+   * }
+ * + * @param name Required. The name of the schedule to retrieve. Values are of the form + * `projects/<project>/instances/<instance>/databases/<database>/backupSchedules/<backup_schedule_id>`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final BackupSchedule getBackupSchedule(BackupScheduleName name) { + GetBackupScheduleRequest request = + GetBackupScheduleRequest.newBuilder() + .setName(name == null ? null : name.toString()) + .build(); + return getBackupSchedule(request); } - @Override - public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { - return stub.awaitTermination(duration, unit); + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets backup schedule for the input schedule name. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) {
+   *   String name =
+   *       BackupScheduleName.of("[PROJECT]", "[INSTANCE]", "[DATABASE]", "[SCHEDULE]").toString();
+   *   BackupSchedule response = databaseAdminClient.getBackupSchedule(name);
+   * }
+   * }
+ * + * @param name Required. The name of the schedule to retrieve. Values are of the form + * `projects/<project>/instances/<instance>/databases/<database>/backupSchedules/<backup_schedule_id>`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final BackupSchedule getBackupSchedule(String name) { + GetBackupScheduleRequest request = GetBackupScheduleRequest.newBuilder().setName(name).build(); + return getBackupSchedule(request); } - public static class ListDatabasesPagedResponse - extends AbstractPagedListResponse< - ListDatabasesRequest, - ListDatabasesResponse, - Database, - ListDatabasesPage, - ListDatabasesFixedSizeCollection> { - - public static ApiFuture createAsync( - PageContext context, - ApiFuture futureResponse) { - ApiFuture futurePage = - ListDatabasesPage.createEmptyPage().createPageAsync(context, futureResponse); - return ApiFutures.transform( - futurePage, - input -> new ListDatabasesPagedResponse(input), - MoreExecutors.directExecutor()); - } + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets backup schedule for the input schedule name. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) {
+   *   GetBackupScheduleRequest request =
+   *       GetBackupScheduleRequest.newBuilder()
+   *           .setName(
+   *               BackupScheduleName.of("[PROJECT]", "[INSTANCE]", "[DATABASE]", "[SCHEDULE]")
+   *                   .toString())
+   *           .build();
+   *   BackupSchedule response = databaseAdminClient.getBackupSchedule(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 BackupSchedule getBackupSchedule(GetBackupScheduleRequest request) { + return getBackupScheduleCallable().call(request); + } - private ListDatabasesPagedResponse(ListDatabasesPage page) { - super(page, ListDatabasesFixedSizeCollection.createEmptyCollection()); - } + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets backup schedule for the input schedule name. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) {
+   *   GetBackupScheduleRequest request =
+   *       GetBackupScheduleRequest.newBuilder()
+   *           .setName(
+   *               BackupScheduleName.of("[PROJECT]", "[INSTANCE]", "[DATABASE]", "[SCHEDULE]")
+   *                   .toString())
+   *           .build();
+   *   ApiFuture future =
+   *       databaseAdminClient.getBackupScheduleCallable().futureCall(request);
+   *   // Do something.
+   *   BackupSchedule response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable getBackupScheduleCallable() { + return stub.getBackupScheduleCallable(); } - public static class ListDatabasesPage - extends AbstractPage< + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates a backup schedule. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) {
+   *   BackupSchedule backupSchedule = BackupSchedule.newBuilder().build();
+   *   FieldMask updateMask = FieldMask.newBuilder().build();
+   *   BackupSchedule response =
+   *       databaseAdminClient.updateBackupSchedule(backupSchedule, updateMask);
+   * }
+   * }
+ * + * @param backupSchedule Required. The backup schedule to update. `backup_schedule.name`, and the + * fields to be updated as specified by `update_mask` are required. Other fields are ignored. + * @param updateMask Required. A mask specifying which fields in the BackupSchedule resource + * should be updated. This mask is relative to the BackupSchedule resource, not to the request + * message. The field mask must always be specified; this prevents any future fields from + * being erased accidentally. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final BackupSchedule updateBackupSchedule( + BackupSchedule backupSchedule, FieldMask updateMask) { + UpdateBackupScheduleRequest request = + UpdateBackupScheduleRequest.newBuilder() + .setBackupSchedule(backupSchedule) + .setUpdateMask(updateMask) + .build(); + return updateBackupSchedule(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates a backup schedule. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) {
+   *   UpdateBackupScheduleRequest request =
+   *       UpdateBackupScheduleRequest.newBuilder()
+   *           .setBackupSchedule(BackupSchedule.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .build();
+   *   BackupSchedule response = databaseAdminClient.updateBackupSchedule(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 BackupSchedule updateBackupSchedule(UpdateBackupScheduleRequest request) { + return updateBackupScheduleCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates a backup schedule. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) {
+   *   UpdateBackupScheduleRequest request =
+   *       UpdateBackupScheduleRequest.newBuilder()
+   *           .setBackupSchedule(BackupSchedule.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .build();
+   *   ApiFuture future =
+   *       databaseAdminClient.updateBackupScheduleCallable().futureCall(request);
+   *   // Do something.
+   *   BackupSchedule response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable + updateBackupScheduleCallable() { + return stub.updateBackupScheduleCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a backup schedule. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) {
+   *   BackupScheduleName name =
+   *       BackupScheduleName.of("[PROJECT]", "[INSTANCE]", "[DATABASE]", "[SCHEDULE]");
+   *   databaseAdminClient.deleteBackupSchedule(name);
+   * }
+   * }
+ * + * @param name Required. The name of the schedule to delete. Values are of the form + * `projects/<project>/instances/<instance>/databases/<database>/backupSchedules/<backup_schedule_id>`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteBackupSchedule(BackupScheduleName name) { + DeleteBackupScheduleRequest request = + DeleteBackupScheduleRequest.newBuilder() + .setName(name == null ? null : name.toString()) + .build(); + deleteBackupSchedule(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a backup schedule. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) {
+   *   String name =
+   *       BackupScheduleName.of("[PROJECT]", "[INSTANCE]", "[DATABASE]", "[SCHEDULE]").toString();
+   *   databaseAdminClient.deleteBackupSchedule(name);
+   * }
+   * }
+ * + * @param name Required. The name of the schedule to delete. Values are of the form + * `projects/<project>/instances/<instance>/databases/<database>/backupSchedules/<backup_schedule_id>`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteBackupSchedule(String name) { + DeleteBackupScheduleRequest request = + DeleteBackupScheduleRequest.newBuilder().setName(name).build(); + deleteBackupSchedule(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a backup schedule. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) {
+   *   DeleteBackupScheduleRequest request =
+   *       DeleteBackupScheduleRequest.newBuilder()
+   *           .setName(
+   *               BackupScheduleName.of("[PROJECT]", "[INSTANCE]", "[DATABASE]", "[SCHEDULE]")
+   *                   .toString())
+   *           .build();
+   *   databaseAdminClient.deleteBackupSchedule(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 void deleteBackupSchedule(DeleteBackupScheduleRequest request) { + deleteBackupScheduleCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a backup schedule. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) {
+   *   DeleteBackupScheduleRequest request =
+   *       DeleteBackupScheduleRequest.newBuilder()
+   *           .setName(
+   *               BackupScheduleName.of("[PROJECT]", "[INSTANCE]", "[DATABASE]", "[SCHEDULE]")
+   *                   .toString())
+   *           .build();
+   *   ApiFuture future =
+   *       databaseAdminClient.deleteBackupScheduleCallable().futureCall(request);
+   *   // Do something.
+   *   future.get();
+   * }
+   * }
+ */ + public final UnaryCallable deleteBackupScheduleCallable() { + return stub.deleteBackupScheduleCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists all the backup schedules for the database. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) {
+   *   DatabaseName parent = DatabaseName.of("[PROJECT]", "[INSTANCE]", "[DATABASE]");
+   *   for (BackupSchedule element : databaseAdminClient.listBackupSchedules(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. Database is the parent resource whose backup schedules should be + * listed. Values are of the form + * projects/<project>/instances/<instance>/databases/<database> + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListBackupSchedulesPagedResponse listBackupSchedules(DatabaseName parent) { + ListBackupSchedulesRequest request = + ListBackupSchedulesRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .build(); + return listBackupSchedules(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists all the backup schedules for the database. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) {
+   *   String parent = DatabaseName.of("[PROJECT]", "[INSTANCE]", "[DATABASE]").toString();
+   *   for (BackupSchedule element : databaseAdminClient.listBackupSchedules(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. Database is the parent resource whose backup schedules should be + * listed. Values are of the form + * projects/<project>/instances/<instance>/databases/<database> + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListBackupSchedulesPagedResponse listBackupSchedules(String parent) { + ListBackupSchedulesRequest request = + ListBackupSchedulesRequest.newBuilder().setParent(parent).build(); + return listBackupSchedules(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists all the backup schedules for the database. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) {
+   *   ListBackupSchedulesRequest request =
+   *       ListBackupSchedulesRequest.newBuilder()
+   *           .setParent(DatabaseName.of("[PROJECT]", "[INSTANCE]", "[DATABASE]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   for (BackupSchedule element : databaseAdminClient.listBackupSchedules(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 ListBackupSchedulesPagedResponse listBackupSchedules( + ListBackupSchedulesRequest request) { + return listBackupSchedulesPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists all the backup schedules for the database. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) {
+   *   ListBackupSchedulesRequest request =
+   *       ListBackupSchedulesRequest.newBuilder()
+   *           .setParent(DatabaseName.of("[PROJECT]", "[INSTANCE]", "[DATABASE]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   ApiFuture future =
+   *       databaseAdminClient.listBackupSchedulesPagedCallable().futureCall(request);
+   *   // Do something.
+   *   for (BackupSchedule element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable + listBackupSchedulesPagedCallable() { + return stub.listBackupSchedulesPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists all the backup schedules for the database. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) {
+   *   ListBackupSchedulesRequest request =
+   *       ListBackupSchedulesRequest.newBuilder()
+   *           .setParent(DatabaseName.of("[PROJECT]", "[INSTANCE]", "[DATABASE]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   while (true) {
+   *     ListBackupSchedulesResponse response =
+   *         databaseAdminClient.listBackupSchedulesCallable().call(request);
+   *     for (BackupSchedule element : response.getBackupSchedulesList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable + listBackupSchedulesCallable() { + return stub.listBackupSchedulesCallable(); + } + + @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 ListDatabasesPagedResponse + extends AbstractPagedListResponse< + ListDatabasesRequest, + ListDatabasesResponse, + Database, + ListDatabasesPage, + ListDatabasesFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListDatabasesPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + input -> new ListDatabasesPagedResponse(input), + MoreExecutors.directExecutor()); + } + + private ListDatabasesPagedResponse(ListDatabasesPage page) { + super(page, ListDatabasesFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListDatabasesPage + extends AbstractPage< ListDatabasesRequest, ListDatabasesResponse, Database, ListDatabasesPage> { private ListDatabasesPage( @@ -4637,4 +5385,88 @@ protected ListDatabaseRolesFixedSizeCollection createCollection( return new ListDatabaseRolesFixedSizeCollection(pages, collectionSize); } } + + public static class ListBackupSchedulesPagedResponse + extends AbstractPagedListResponse< + ListBackupSchedulesRequest, + ListBackupSchedulesResponse, + BackupSchedule, + ListBackupSchedulesPage, + ListBackupSchedulesFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext + context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListBackupSchedulesPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + input -> new ListBackupSchedulesPagedResponse(input), + MoreExecutors.directExecutor()); + } + + private ListBackupSchedulesPagedResponse(ListBackupSchedulesPage page) { + super(page, ListBackupSchedulesFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListBackupSchedulesPage + extends AbstractPage< + ListBackupSchedulesRequest, + ListBackupSchedulesResponse, + BackupSchedule, + ListBackupSchedulesPage> { + + private ListBackupSchedulesPage( + PageContext + context, + ListBackupSchedulesResponse response) { + super(context, response); + } + + private static ListBackupSchedulesPage createEmptyPage() { + return new ListBackupSchedulesPage(null, null); + } + + @Override + protected ListBackupSchedulesPage createPage( + PageContext + context, + ListBackupSchedulesResponse response) { + return new ListBackupSchedulesPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext + context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListBackupSchedulesFixedSizeCollection + extends AbstractFixedSizeCollection< + ListBackupSchedulesRequest, + ListBackupSchedulesResponse, + BackupSchedule, + ListBackupSchedulesPage, + ListBackupSchedulesFixedSizeCollection> { + + private ListBackupSchedulesFixedSizeCollection( + List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListBackupSchedulesFixedSizeCollection createEmptyCollection() { + return new ListBackupSchedulesFixedSizeCollection(null, 0); + } + + @Override + protected ListBackupSchedulesFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListBackupSchedulesFixedSizeCollection(pages, collectionSize); + } + } } diff --git a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/admin/database/v1/DatabaseAdminSettings.java b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/admin/database/v1/DatabaseAdminSettings.java index 50d6900e1ce..513f91e7100 100644 --- a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/admin/database/v1/DatabaseAdminSettings.java +++ b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/admin/database/v1/DatabaseAdminSettings.java @@ -17,6 +17,7 @@ package com.google.cloud.spanner.admin.database.v1; import static com.google.cloud.spanner.admin.database.v1.DatabaseAdminClient.ListBackupOperationsPagedResponse; +import static com.google.cloud.spanner.admin.database.v1.DatabaseAdminClient.ListBackupSchedulesPagedResponse; import static com.google.cloud.spanner.admin.database.v1.DatabaseAdminClient.ListBackupsPagedResponse; import static com.google.cloud.spanner.admin.database.v1.DatabaseAdminClient.ListDatabaseOperationsPagedResponse; import static com.google.cloud.spanner.admin.database.v1.DatabaseAdminClient.ListDatabaseRolesPagedResponse; @@ -44,21 +45,27 @@ import com.google.longrunning.Operation; import com.google.protobuf.Empty; import com.google.spanner.admin.database.v1.Backup; +import com.google.spanner.admin.database.v1.BackupSchedule; import com.google.spanner.admin.database.v1.CopyBackupMetadata; import com.google.spanner.admin.database.v1.CopyBackupRequest; import com.google.spanner.admin.database.v1.CreateBackupMetadata; import com.google.spanner.admin.database.v1.CreateBackupRequest; +import com.google.spanner.admin.database.v1.CreateBackupScheduleRequest; import com.google.spanner.admin.database.v1.CreateDatabaseMetadata; import com.google.spanner.admin.database.v1.CreateDatabaseRequest; import com.google.spanner.admin.database.v1.Database; import com.google.spanner.admin.database.v1.DeleteBackupRequest; +import com.google.spanner.admin.database.v1.DeleteBackupScheduleRequest; import com.google.spanner.admin.database.v1.DropDatabaseRequest; import com.google.spanner.admin.database.v1.GetBackupRequest; +import com.google.spanner.admin.database.v1.GetBackupScheduleRequest; import com.google.spanner.admin.database.v1.GetDatabaseDdlRequest; import com.google.spanner.admin.database.v1.GetDatabaseDdlResponse; import com.google.spanner.admin.database.v1.GetDatabaseRequest; import com.google.spanner.admin.database.v1.ListBackupOperationsRequest; import com.google.spanner.admin.database.v1.ListBackupOperationsResponse; +import com.google.spanner.admin.database.v1.ListBackupSchedulesRequest; +import com.google.spanner.admin.database.v1.ListBackupSchedulesResponse; import com.google.spanner.admin.database.v1.ListBackupsRequest; import com.google.spanner.admin.database.v1.ListBackupsResponse; import com.google.spanner.admin.database.v1.ListDatabaseOperationsRequest; @@ -70,6 +77,7 @@ import com.google.spanner.admin.database.v1.RestoreDatabaseMetadata; import com.google.spanner.admin.database.v1.RestoreDatabaseRequest; import com.google.spanner.admin.database.v1.UpdateBackupRequest; +import com.google.spanner.admin.database.v1.UpdateBackupScheduleRequest; import com.google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata; import com.google.spanner.admin.database.v1.UpdateDatabaseDdlRequest; import com.google.spanner.admin.database.v1.UpdateDatabaseMetadata; @@ -266,6 +274,35 @@ public UnaryCallSettings restoreDatabaseSetti return ((DatabaseAdminStubSettings) getStubSettings()).listDatabaseRolesSettings(); } + /** Returns the object with the settings used for calls to createBackupSchedule. */ + public UnaryCallSettings + createBackupScheduleSettings() { + return ((DatabaseAdminStubSettings) getStubSettings()).createBackupScheduleSettings(); + } + + /** Returns the object with the settings used for calls to getBackupSchedule. */ + public UnaryCallSettings getBackupScheduleSettings() { + return ((DatabaseAdminStubSettings) getStubSettings()).getBackupScheduleSettings(); + } + + /** Returns the object with the settings used for calls to updateBackupSchedule. */ + public UnaryCallSettings + updateBackupScheduleSettings() { + return ((DatabaseAdminStubSettings) getStubSettings()).updateBackupScheduleSettings(); + } + + /** Returns the object with the settings used for calls to deleteBackupSchedule. */ + public UnaryCallSettings deleteBackupScheduleSettings() { + return ((DatabaseAdminStubSettings) getStubSettings()).deleteBackupScheduleSettings(); + } + + /** Returns the object with the settings used for calls to listBackupSchedules. */ + public PagedCallSettings< + ListBackupSchedulesRequest, ListBackupSchedulesResponse, ListBackupSchedulesPagedResponse> + listBackupSchedulesSettings() { + return ((DatabaseAdminStubSettings) getStubSettings()).listBackupSchedulesSettings(); + } + public static final DatabaseAdminSettings create(DatabaseAdminStubSettings stub) throws IOException { return new DatabaseAdminSettings.Builder(stub.toBuilder()).build(); @@ -531,6 +568,39 @@ public UnaryCallSettings.Builder restoreDatab return getStubSettingsBuilder().listDatabaseRolesSettings(); } + /** Returns the builder for the settings used for calls to createBackupSchedule. */ + public UnaryCallSettings.Builder + createBackupScheduleSettings() { + return getStubSettingsBuilder().createBackupScheduleSettings(); + } + + /** Returns the builder for the settings used for calls to getBackupSchedule. */ + public UnaryCallSettings.Builder + getBackupScheduleSettings() { + return getStubSettingsBuilder().getBackupScheduleSettings(); + } + + /** Returns the builder for the settings used for calls to updateBackupSchedule. */ + public UnaryCallSettings.Builder + updateBackupScheduleSettings() { + return getStubSettingsBuilder().updateBackupScheduleSettings(); + } + + /** Returns the builder for the settings used for calls to deleteBackupSchedule. */ + public UnaryCallSettings.Builder + deleteBackupScheduleSettings() { + return getStubSettingsBuilder().deleteBackupScheduleSettings(); + } + + /** Returns the builder for the settings used for calls to listBackupSchedules. */ + public PagedCallSettings.Builder< + ListBackupSchedulesRequest, + ListBackupSchedulesResponse, + ListBackupSchedulesPagedResponse> + listBackupSchedulesSettings() { + return getStubSettingsBuilder().listBackupSchedulesSettings(); + } + @Override public DatabaseAdminSettings build() throws IOException { return new DatabaseAdminSettings(this); diff --git a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/admin/database/v1/gapic_metadata.json b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/admin/database/v1/gapic_metadata.json index 01fcbd4de1a..7d6c894d7b6 100644 --- a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/admin/database/v1/gapic_metadata.json +++ b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/admin/database/v1/gapic_metadata.json @@ -16,18 +16,27 @@ "CreateBackup": { "methods": ["createBackupAsync", "createBackupAsync", "createBackupAsync", "createBackupOperationCallable", "createBackupCallable"] }, + "CreateBackupSchedule": { + "methods": ["createBackupSchedule", "createBackupSchedule", "createBackupSchedule", "createBackupScheduleCallable"] + }, "CreateDatabase": { "methods": ["createDatabaseAsync", "createDatabaseAsync", "createDatabaseAsync", "createDatabaseOperationCallable", "createDatabaseCallable"] }, "DeleteBackup": { "methods": ["deleteBackup", "deleteBackup", "deleteBackup", "deleteBackupCallable"] }, + "DeleteBackupSchedule": { + "methods": ["deleteBackupSchedule", "deleteBackupSchedule", "deleteBackupSchedule", "deleteBackupScheduleCallable"] + }, "DropDatabase": { "methods": ["dropDatabase", "dropDatabase", "dropDatabase", "dropDatabaseCallable"] }, "GetBackup": { "methods": ["getBackup", "getBackup", "getBackup", "getBackupCallable"] }, + "GetBackupSchedule": { + "methods": ["getBackupSchedule", "getBackupSchedule", "getBackupSchedule", "getBackupScheduleCallable"] + }, "GetDatabase": { "methods": ["getDatabase", "getDatabase", "getDatabase", "getDatabaseCallable"] }, @@ -40,6 +49,9 @@ "ListBackupOperations": { "methods": ["listBackupOperations", "listBackupOperations", "listBackupOperations", "listBackupOperationsPagedCallable", "listBackupOperationsCallable"] }, + "ListBackupSchedules": { + "methods": ["listBackupSchedules", "listBackupSchedules", "listBackupSchedules", "listBackupSchedulesPagedCallable", "listBackupSchedulesCallable"] + }, "ListBackups": { "methods": ["listBackups", "listBackups", "listBackups", "listBackupsPagedCallable", "listBackupsCallable"] }, @@ -64,6 +76,9 @@ "UpdateBackup": { "methods": ["updateBackup", "updateBackup", "updateBackupCallable"] }, + "UpdateBackupSchedule": { + "methods": ["updateBackupSchedule", "updateBackupSchedule", "updateBackupScheduleCallable"] + }, "UpdateDatabase": { "methods": ["updateDatabaseAsync", "updateDatabaseAsync", "updateDatabaseOperationCallable", "updateDatabaseCallable"] }, diff --git a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/admin/database/v1/stub/DatabaseAdminStub.java b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/admin/database/v1/stub/DatabaseAdminStub.java index 37fb433c3eb..2f53f6cf5b4 100644 --- a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/admin/database/v1/stub/DatabaseAdminStub.java +++ b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/admin/database/v1/stub/DatabaseAdminStub.java @@ -17,6 +17,7 @@ package com.google.cloud.spanner.admin.database.v1.stub; import static com.google.cloud.spanner.admin.database.v1.DatabaseAdminClient.ListBackupOperationsPagedResponse; +import static com.google.cloud.spanner.admin.database.v1.DatabaseAdminClient.ListBackupSchedulesPagedResponse; import static com.google.cloud.spanner.admin.database.v1.DatabaseAdminClient.ListBackupsPagedResponse; import static com.google.cloud.spanner.admin.database.v1.DatabaseAdminClient.ListDatabaseOperationsPagedResponse; import static com.google.cloud.spanner.admin.database.v1.DatabaseAdminClient.ListDatabaseRolesPagedResponse; @@ -34,21 +35,27 @@ import com.google.longrunning.stub.OperationsStub; import com.google.protobuf.Empty; import com.google.spanner.admin.database.v1.Backup; +import com.google.spanner.admin.database.v1.BackupSchedule; import com.google.spanner.admin.database.v1.CopyBackupMetadata; import com.google.spanner.admin.database.v1.CopyBackupRequest; import com.google.spanner.admin.database.v1.CreateBackupMetadata; import com.google.spanner.admin.database.v1.CreateBackupRequest; +import com.google.spanner.admin.database.v1.CreateBackupScheduleRequest; import com.google.spanner.admin.database.v1.CreateDatabaseMetadata; import com.google.spanner.admin.database.v1.CreateDatabaseRequest; import com.google.spanner.admin.database.v1.Database; import com.google.spanner.admin.database.v1.DeleteBackupRequest; +import com.google.spanner.admin.database.v1.DeleteBackupScheduleRequest; import com.google.spanner.admin.database.v1.DropDatabaseRequest; import com.google.spanner.admin.database.v1.GetBackupRequest; +import com.google.spanner.admin.database.v1.GetBackupScheduleRequest; import com.google.spanner.admin.database.v1.GetDatabaseDdlRequest; import com.google.spanner.admin.database.v1.GetDatabaseDdlResponse; import com.google.spanner.admin.database.v1.GetDatabaseRequest; import com.google.spanner.admin.database.v1.ListBackupOperationsRequest; import com.google.spanner.admin.database.v1.ListBackupOperationsResponse; +import com.google.spanner.admin.database.v1.ListBackupSchedulesRequest; +import com.google.spanner.admin.database.v1.ListBackupSchedulesResponse; import com.google.spanner.admin.database.v1.ListBackupsRequest; import com.google.spanner.admin.database.v1.ListBackupsResponse; import com.google.spanner.admin.database.v1.ListDatabaseOperationsRequest; @@ -60,6 +67,7 @@ import com.google.spanner.admin.database.v1.RestoreDatabaseMetadata; import com.google.spanner.admin.database.v1.RestoreDatabaseRequest; import com.google.spanner.admin.database.v1.UpdateBackupRequest; +import com.google.spanner.admin.database.v1.UpdateBackupScheduleRequest; import com.google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata; import com.google.spanner.admin.database.v1.UpdateDatabaseDdlRequest; import com.google.spanner.admin.database.v1.UpdateDatabaseMetadata; @@ -223,6 +231,32 @@ public UnaryCallable restoreDatabaseCallable( throw new UnsupportedOperationException("Not implemented: listDatabaseRolesCallable()"); } + public UnaryCallable createBackupScheduleCallable() { + throw new UnsupportedOperationException("Not implemented: createBackupScheduleCallable()"); + } + + public UnaryCallable getBackupScheduleCallable() { + throw new UnsupportedOperationException("Not implemented: getBackupScheduleCallable()"); + } + + public UnaryCallable updateBackupScheduleCallable() { + throw new UnsupportedOperationException("Not implemented: updateBackupScheduleCallable()"); + } + + public UnaryCallable deleteBackupScheduleCallable() { + throw new UnsupportedOperationException("Not implemented: deleteBackupScheduleCallable()"); + } + + public UnaryCallable + listBackupSchedulesPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listBackupSchedulesPagedCallable()"); + } + + public UnaryCallable + listBackupSchedulesCallable() { + throw new UnsupportedOperationException("Not implemented: listBackupSchedulesCallable()"); + } + @Override public abstract void close(); } diff --git a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/admin/database/v1/stub/DatabaseAdminStubSettings.java b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/admin/database/v1/stub/DatabaseAdminStubSettings.java index 4808f1553e9..7ee75687221 100644 --- a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/admin/database/v1/stub/DatabaseAdminStubSettings.java +++ b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/admin/database/v1/stub/DatabaseAdminStubSettings.java @@ -17,6 +17,7 @@ package com.google.cloud.spanner.admin.database.v1.stub; import static com.google.cloud.spanner.admin.database.v1.DatabaseAdminClient.ListBackupOperationsPagedResponse; +import static com.google.cloud.spanner.admin.database.v1.DatabaseAdminClient.ListBackupSchedulesPagedResponse; import static com.google.cloud.spanner.admin.database.v1.DatabaseAdminClient.ListBackupsPagedResponse; import static com.google.cloud.spanner.admin.database.v1.DatabaseAdminClient.ListDatabaseOperationsPagedResponse; import static com.google.cloud.spanner.admin.database.v1.DatabaseAdminClient.ListDatabaseRolesPagedResponse; @@ -63,22 +64,28 @@ import com.google.longrunning.Operation; import com.google.protobuf.Empty; import com.google.spanner.admin.database.v1.Backup; +import com.google.spanner.admin.database.v1.BackupSchedule; import com.google.spanner.admin.database.v1.CopyBackupMetadata; import com.google.spanner.admin.database.v1.CopyBackupRequest; import com.google.spanner.admin.database.v1.CreateBackupMetadata; import com.google.spanner.admin.database.v1.CreateBackupRequest; +import com.google.spanner.admin.database.v1.CreateBackupScheduleRequest; import com.google.spanner.admin.database.v1.CreateDatabaseMetadata; import com.google.spanner.admin.database.v1.CreateDatabaseRequest; import com.google.spanner.admin.database.v1.Database; import com.google.spanner.admin.database.v1.DatabaseRole; import com.google.spanner.admin.database.v1.DeleteBackupRequest; +import com.google.spanner.admin.database.v1.DeleteBackupScheduleRequest; import com.google.spanner.admin.database.v1.DropDatabaseRequest; import com.google.spanner.admin.database.v1.GetBackupRequest; +import com.google.spanner.admin.database.v1.GetBackupScheduleRequest; import com.google.spanner.admin.database.v1.GetDatabaseDdlRequest; import com.google.spanner.admin.database.v1.GetDatabaseDdlResponse; import com.google.spanner.admin.database.v1.GetDatabaseRequest; import com.google.spanner.admin.database.v1.ListBackupOperationsRequest; import com.google.spanner.admin.database.v1.ListBackupOperationsResponse; +import com.google.spanner.admin.database.v1.ListBackupSchedulesRequest; +import com.google.spanner.admin.database.v1.ListBackupSchedulesResponse; import com.google.spanner.admin.database.v1.ListBackupsRequest; import com.google.spanner.admin.database.v1.ListBackupsResponse; import com.google.spanner.admin.database.v1.ListDatabaseOperationsRequest; @@ -90,6 +97,7 @@ import com.google.spanner.admin.database.v1.RestoreDatabaseMetadata; import com.google.spanner.admin.database.v1.RestoreDatabaseRequest; import com.google.spanner.admin.database.v1.UpdateBackupRequest; +import com.google.spanner.admin.database.v1.UpdateBackupScheduleRequest; import com.google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata; import com.google.spanner.admin.database.v1.UpdateDatabaseDdlRequest; import com.google.spanner.admin.database.v1.UpdateDatabaseMetadata; @@ -192,6 +200,16 @@ public class DatabaseAdminStubSettings extends StubSettings listDatabaseRolesSettings; + private final UnaryCallSettings + createBackupScheduleSettings; + private final UnaryCallSettings + getBackupScheduleSettings; + private final UnaryCallSettings + updateBackupScheduleSettings; + private final UnaryCallSettings deleteBackupScheduleSettings; + private final PagedCallSettings< + ListBackupSchedulesRequest, ListBackupSchedulesResponse, ListBackupSchedulesPagedResponse> + listBackupSchedulesSettings; private static final PagedListDescriptor LIST_DATABASES_PAGE_STR_DESC = @@ -387,6 +405,46 @@ public Iterable extractResources(ListDatabaseRolesResponse payload } }; + private static final PagedListDescriptor< + ListBackupSchedulesRequest, ListBackupSchedulesResponse, BackupSchedule> + LIST_BACKUP_SCHEDULES_PAGE_STR_DESC = + new PagedListDescriptor< + ListBackupSchedulesRequest, ListBackupSchedulesResponse, BackupSchedule>() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListBackupSchedulesRequest injectToken( + ListBackupSchedulesRequest payload, String token) { + return ListBackupSchedulesRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListBackupSchedulesRequest injectPageSize( + ListBackupSchedulesRequest payload, int pageSize) { + return ListBackupSchedulesRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListBackupSchedulesRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListBackupSchedulesResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListBackupSchedulesResponse payload) { + return payload.getBackupSchedulesList() == null + ? ImmutableList.of() + : payload.getBackupSchedulesList(); + } + }; + private static final PagedListResponseFactory< ListDatabasesRequest, ListDatabasesResponse, ListDatabasesPagedResponse> LIST_DATABASES_PAGE_STR_FACT = @@ -489,6 +547,27 @@ public ApiFuture getFuturePagedResponse( } }; + private static final PagedListResponseFactory< + ListBackupSchedulesRequest, ListBackupSchedulesResponse, ListBackupSchedulesPagedResponse> + LIST_BACKUP_SCHEDULES_PAGE_STR_FACT = + new PagedListResponseFactory< + ListBackupSchedulesRequest, + ListBackupSchedulesResponse, + ListBackupSchedulesPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListBackupSchedulesRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext + pageContext = + PageContext.create( + callable, LIST_BACKUP_SCHEDULES_PAGE_STR_DESC, request, context); + return ListBackupSchedulesPagedResponse.createAsync(pageContext, futureResponse); + } + }; + /** Returns the object with the settings used for calls to listDatabases. */ public PagedCallSettings listDatabasesSettings() { @@ -638,6 +717,35 @@ public UnaryCallSettings restoreDatabaseSetti return listDatabaseRolesSettings; } + /** Returns the object with the settings used for calls to createBackupSchedule. */ + public UnaryCallSettings + createBackupScheduleSettings() { + return createBackupScheduleSettings; + } + + /** Returns the object with the settings used for calls to getBackupSchedule. */ + public UnaryCallSettings getBackupScheduleSettings() { + return getBackupScheduleSettings; + } + + /** Returns the object with the settings used for calls to updateBackupSchedule. */ + public UnaryCallSettings + updateBackupScheduleSettings() { + return updateBackupScheduleSettings; + } + + /** Returns the object with the settings used for calls to deleteBackupSchedule. */ + public UnaryCallSettings deleteBackupScheduleSettings() { + return deleteBackupScheduleSettings; + } + + /** Returns the object with the settings used for calls to listBackupSchedules. */ + public PagedCallSettings< + ListBackupSchedulesRequest, ListBackupSchedulesResponse, ListBackupSchedulesPagedResponse> + listBackupSchedulesSettings() { + return listBackupSchedulesSettings; + } + public DatabaseAdminStub createStub() throws IOException { if (getTransportChannelProvider() .getTransportName() @@ -775,6 +883,11 @@ protected DatabaseAdminStubSettings(Builder settingsBuilder) throws IOException listDatabaseOperationsSettings = settingsBuilder.listDatabaseOperationsSettings().build(); listBackupOperationsSettings = settingsBuilder.listBackupOperationsSettings().build(); listDatabaseRolesSettings = settingsBuilder.listDatabaseRolesSettings().build(); + createBackupScheduleSettings = settingsBuilder.createBackupScheduleSettings().build(); + getBackupScheduleSettings = settingsBuilder.getBackupScheduleSettings().build(); + updateBackupScheduleSettings = settingsBuilder.updateBackupScheduleSettings().build(); + deleteBackupScheduleSettings = settingsBuilder.deleteBackupScheduleSettings().build(); + listBackupSchedulesSettings = settingsBuilder.listBackupSchedulesSettings().build(); } /** Builder for DatabaseAdminStubSettings. */ @@ -836,6 +949,19 @@ public static class Builder extends StubSettings.Builder listDatabaseRolesSettings; + private final UnaryCallSettings.Builder + createBackupScheduleSettings; + private final UnaryCallSettings.Builder + getBackupScheduleSettings; + private final UnaryCallSettings.Builder + updateBackupScheduleSettings; + private final UnaryCallSettings.Builder + deleteBackupScheduleSettings; + private final PagedCallSettings.Builder< + ListBackupSchedulesRequest, + ListBackupSchedulesResponse, + ListBackupSchedulesPagedResponse> + listBackupSchedulesSettings; private static final ImmutableMap> RETRYABLE_CODE_DEFINITIONS; @@ -940,6 +1066,12 @@ protected Builder(ClientContext clientContext) { listBackupOperationsSettings = PagedCallSettings.newBuilder(LIST_BACKUP_OPERATIONS_PAGE_STR_FACT); listDatabaseRolesSettings = PagedCallSettings.newBuilder(LIST_DATABASE_ROLES_PAGE_STR_FACT); + createBackupScheduleSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + getBackupScheduleSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + updateBackupScheduleSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + deleteBackupScheduleSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + listBackupSchedulesSettings = + PagedCallSettings.newBuilder(LIST_BACKUP_SCHEDULES_PAGE_STR_FACT); unaryMethodSettingsBuilders = ImmutableList.>of( @@ -962,7 +1094,12 @@ protected Builder(ClientContext clientContext) { restoreDatabaseSettings, listDatabaseOperationsSettings, listBackupOperationsSettings, - listDatabaseRolesSettings); + listDatabaseRolesSettings, + createBackupScheduleSettings, + getBackupScheduleSettings, + updateBackupScheduleSettings, + deleteBackupScheduleSettings, + listBackupSchedulesSettings); initDefaults(this); } @@ -995,6 +1132,11 @@ protected Builder(DatabaseAdminStubSettings settings) { listDatabaseOperationsSettings = settings.listDatabaseOperationsSettings.toBuilder(); listBackupOperationsSettings = settings.listBackupOperationsSettings.toBuilder(); listDatabaseRolesSettings = settings.listDatabaseRolesSettings.toBuilder(); + createBackupScheduleSettings = settings.createBackupScheduleSettings.toBuilder(); + getBackupScheduleSettings = settings.getBackupScheduleSettings.toBuilder(); + updateBackupScheduleSettings = settings.updateBackupScheduleSettings.toBuilder(); + deleteBackupScheduleSettings = settings.deleteBackupScheduleSettings.toBuilder(); + listBackupSchedulesSettings = settings.listBackupSchedulesSettings.toBuilder(); unaryMethodSettingsBuilders = ImmutableList.>of( @@ -1017,7 +1159,12 @@ protected Builder(DatabaseAdminStubSettings settings) { restoreDatabaseSettings, listDatabaseOperationsSettings, listBackupOperationsSettings, - listDatabaseRolesSettings); + listDatabaseRolesSettings, + createBackupScheduleSettings, + getBackupScheduleSettings, + updateBackupScheduleSettings, + deleteBackupScheduleSettings, + listBackupSchedulesSettings); } private static Builder createDefault() { @@ -1145,6 +1292,31 @@ private static Builder initDefaults(Builder builder) { .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + builder + .createBackupScheduleSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .getBackupScheduleSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .updateBackupScheduleSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .deleteBackupScheduleSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .listBackupSchedulesSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + builder .createDatabaseOperationSettings() .setInitialCallSettings( @@ -1460,6 +1632,39 @@ public UnaryCallSettings.Builder restoreDatab return listDatabaseRolesSettings; } + /** Returns the builder for the settings used for calls to createBackupSchedule. */ + public UnaryCallSettings.Builder + createBackupScheduleSettings() { + return createBackupScheduleSettings; + } + + /** Returns the builder for the settings used for calls to getBackupSchedule. */ + public UnaryCallSettings.Builder + getBackupScheduleSettings() { + return getBackupScheduleSettings; + } + + /** Returns the builder for the settings used for calls to updateBackupSchedule. */ + public UnaryCallSettings.Builder + updateBackupScheduleSettings() { + return updateBackupScheduleSettings; + } + + /** Returns the builder for the settings used for calls to deleteBackupSchedule. */ + public UnaryCallSettings.Builder + deleteBackupScheduleSettings() { + return deleteBackupScheduleSettings; + } + + /** Returns the builder for the settings used for calls to listBackupSchedules. */ + public PagedCallSettings.Builder< + ListBackupSchedulesRequest, + ListBackupSchedulesResponse, + ListBackupSchedulesPagedResponse> + listBackupSchedulesSettings() { + return listBackupSchedulesSettings; + } + @Override public DatabaseAdminStubSettings build() throws IOException { return new DatabaseAdminStubSettings(this); diff --git a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/admin/database/v1/stub/GrpcDatabaseAdminStub.java b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/admin/database/v1/stub/GrpcDatabaseAdminStub.java index 875ff8443fc..8207ebcbce5 100644 --- a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/admin/database/v1/stub/GrpcDatabaseAdminStub.java +++ b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/admin/database/v1/stub/GrpcDatabaseAdminStub.java @@ -17,6 +17,7 @@ package com.google.cloud.spanner.admin.database.v1.stub; import static com.google.cloud.spanner.admin.database.v1.DatabaseAdminClient.ListBackupOperationsPagedResponse; +import static com.google.cloud.spanner.admin.database.v1.DatabaseAdminClient.ListBackupSchedulesPagedResponse; import static com.google.cloud.spanner.admin.database.v1.DatabaseAdminClient.ListBackupsPagedResponse; import static com.google.cloud.spanner.admin.database.v1.DatabaseAdminClient.ListDatabaseOperationsPagedResponse; import static com.google.cloud.spanner.admin.database.v1.DatabaseAdminClient.ListDatabaseRolesPagedResponse; @@ -39,21 +40,27 @@ import com.google.longrunning.stub.GrpcOperationsStub; import com.google.protobuf.Empty; import com.google.spanner.admin.database.v1.Backup; +import com.google.spanner.admin.database.v1.BackupSchedule; import com.google.spanner.admin.database.v1.CopyBackupMetadata; import com.google.spanner.admin.database.v1.CopyBackupRequest; import com.google.spanner.admin.database.v1.CreateBackupMetadata; import com.google.spanner.admin.database.v1.CreateBackupRequest; +import com.google.spanner.admin.database.v1.CreateBackupScheduleRequest; import com.google.spanner.admin.database.v1.CreateDatabaseMetadata; import com.google.spanner.admin.database.v1.CreateDatabaseRequest; import com.google.spanner.admin.database.v1.Database; import com.google.spanner.admin.database.v1.DeleteBackupRequest; +import com.google.spanner.admin.database.v1.DeleteBackupScheduleRequest; import com.google.spanner.admin.database.v1.DropDatabaseRequest; import com.google.spanner.admin.database.v1.GetBackupRequest; +import com.google.spanner.admin.database.v1.GetBackupScheduleRequest; import com.google.spanner.admin.database.v1.GetDatabaseDdlRequest; import com.google.spanner.admin.database.v1.GetDatabaseDdlResponse; import com.google.spanner.admin.database.v1.GetDatabaseRequest; import com.google.spanner.admin.database.v1.ListBackupOperationsRequest; import com.google.spanner.admin.database.v1.ListBackupOperationsResponse; +import com.google.spanner.admin.database.v1.ListBackupSchedulesRequest; +import com.google.spanner.admin.database.v1.ListBackupSchedulesResponse; import com.google.spanner.admin.database.v1.ListBackupsRequest; import com.google.spanner.admin.database.v1.ListBackupsResponse; import com.google.spanner.admin.database.v1.ListDatabaseOperationsRequest; @@ -65,6 +72,7 @@ import com.google.spanner.admin.database.v1.RestoreDatabaseMetadata; import com.google.spanner.admin.database.v1.RestoreDatabaseRequest; import com.google.spanner.admin.database.v1.UpdateBackupRequest; +import com.google.spanner.admin.database.v1.UpdateBackupScheduleRequest; import com.google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata; import com.google.spanner.admin.database.v1.UpdateDatabaseDdlRequest; import com.google.spanner.admin.database.v1.UpdateDatabaseMetadata; @@ -277,6 +285,61 @@ public class GrpcDatabaseAdminStub extends DatabaseAdminStub { ProtoUtils.marshaller(ListDatabaseRolesResponse.getDefaultInstance())) .build(); + private static final MethodDescriptor + createBackupScheduleMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.spanner.admin.database.v1.DatabaseAdmin/CreateBackupSchedule") + .setRequestMarshaller( + ProtoUtils.marshaller(CreateBackupScheduleRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(BackupSchedule.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + getBackupScheduleMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.spanner.admin.database.v1.DatabaseAdmin/GetBackupSchedule") + .setRequestMarshaller( + ProtoUtils.marshaller(GetBackupScheduleRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(BackupSchedule.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + updateBackupScheduleMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.spanner.admin.database.v1.DatabaseAdmin/UpdateBackupSchedule") + .setRequestMarshaller( + ProtoUtils.marshaller(UpdateBackupScheduleRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(BackupSchedule.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + deleteBackupScheduleMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.spanner.admin.database.v1.DatabaseAdmin/DeleteBackupSchedule") + .setRequestMarshaller( + ProtoUtils.marshaller(DeleteBackupScheduleRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + listBackupSchedulesMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.spanner.admin.database.v1.DatabaseAdmin/ListBackupSchedules") + .setRequestMarshaller( + ProtoUtils.marshaller(ListBackupSchedulesRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListBackupSchedulesResponse.getDefaultInstance())) + .build(); + private final UnaryCallable listDatabasesCallable; private final UnaryCallable listDatabasesPagedCallable; @@ -323,6 +386,16 @@ public class GrpcDatabaseAdminStub extends DatabaseAdminStub { listDatabaseRolesCallable; private final UnaryCallable listDatabaseRolesPagedCallable; + private final UnaryCallable + createBackupScheduleCallable; + private final UnaryCallable getBackupScheduleCallable; + private final UnaryCallable + updateBackupScheduleCallable; + private final UnaryCallable deleteBackupScheduleCallable; + private final UnaryCallable + listBackupSchedulesCallable; + private final UnaryCallable + listBackupSchedulesPagedCallable; private final BackgroundResource backgroundResources; private final GrpcOperationsStub operationsStub; @@ -572,6 +645,61 @@ protected GrpcDatabaseAdminStub( return builder.build(); }) .build(); + GrpcCallSettings + createBackupScheduleTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(createBackupScheduleMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + GrpcCallSettings getBackupScheduleTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getBackupScheduleMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings + updateBackupScheduleTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(updateBackupScheduleMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add( + "backup_schedule.name", + String.valueOf(request.getBackupSchedule().getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings deleteBackupScheduleTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(deleteBackupScheduleMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings + listBackupSchedulesTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listBackupSchedulesMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); this.listDatabasesCallable = callableFactory.createUnaryCallable( @@ -700,6 +828,36 @@ protected GrpcDatabaseAdminStub( listDatabaseRolesTransportSettings, settings.listDatabaseRolesSettings(), clientContext); + this.createBackupScheduleCallable = + callableFactory.createUnaryCallable( + createBackupScheduleTransportSettings, + settings.createBackupScheduleSettings(), + clientContext); + this.getBackupScheduleCallable = + callableFactory.createUnaryCallable( + getBackupScheduleTransportSettings, + settings.getBackupScheduleSettings(), + clientContext); + this.updateBackupScheduleCallable = + callableFactory.createUnaryCallable( + updateBackupScheduleTransportSettings, + settings.updateBackupScheduleSettings(), + clientContext); + this.deleteBackupScheduleCallable = + callableFactory.createUnaryCallable( + deleteBackupScheduleTransportSettings, + settings.deleteBackupScheduleSettings(), + clientContext); + this.listBackupSchedulesCallable = + callableFactory.createUnaryCallable( + listBackupSchedulesTransportSettings, + settings.listBackupSchedulesSettings(), + clientContext); + this.listBackupSchedulesPagedCallable = + callableFactory.createPagedCallable( + listBackupSchedulesTransportSettings, + settings.listBackupSchedulesSettings(), + clientContext); this.backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources()); @@ -878,6 +1036,38 @@ public UnaryCallable restoreDatabaseCallable( return listDatabaseRolesPagedCallable; } + @Override + public UnaryCallable createBackupScheduleCallable() { + return createBackupScheduleCallable; + } + + @Override + public UnaryCallable getBackupScheduleCallable() { + return getBackupScheduleCallable; + } + + @Override + public UnaryCallable updateBackupScheduleCallable() { + return updateBackupScheduleCallable; + } + + @Override + public UnaryCallable deleteBackupScheduleCallable() { + return deleteBackupScheduleCallable; + } + + @Override + public UnaryCallable + listBackupSchedulesCallable() { + return listBackupSchedulesCallable; + } + + @Override + public UnaryCallable + listBackupSchedulesPagedCallable() { + return listBackupSchedulesPagedCallable; + } + @Override public final void close() { try { diff --git a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/admin/database/v1/stub/HttpJsonDatabaseAdminStub.java b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/admin/database/v1/stub/HttpJsonDatabaseAdminStub.java index 1eaa5055133..fbe9f02b1f8 100644 --- a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/admin/database/v1/stub/HttpJsonDatabaseAdminStub.java +++ b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/admin/database/v1/stub/HttpJsonDatabaseAdminStub.java @@ -17,6 +17,7 @@ package com.google.cloud.spanner.admin.database.v1.stub; import static com.google.cloud.spanner.admin.database.v1.DatabaseAdminClient.ListBackupOperationsPagedResponse; +import static com.google.cloud.spanner.admin.database.v1.DatabaseAdminClient.ListBackupSchedulesPagedResponse; import static com.google.cloud.spanner.admin.database.v1.DatabaseAdminClient.ListBackupsPagedResponse; import static com.google.cloud.spanner.admin.database.v1.DatabaseAdminClient.ListDatabaseOperationsPagedResponse; import static com.google.cloud.spanner.admin.database.v1.DatabaseAdminClient.ListDatabaseRolesPagedResponse; @@ -48,21 +49,27 @@ import com.google.protobuf.Empty; import com.google.protobuf.TypeRegistry; import com.google.spanner.admin.database.v1.Backup; +import com.google.spanner.admin.database.v1.BackupSchedule; import com.google.spanner.admin.database.v1.CopyBackupMetadata; import com.google.spanner.admin.database.v1.CopyBackupRequest; import com.google.spanner.admin.database.v1.CreateBackupMetadata; import com.google.spanner.admin.database.v1.CreateBackupRequest; +import com.google.spanner.admin.database.v1.CreateBackupScheduleRequest; import com.google.spanner.admin.database.v1.CreateDatabaseMetadata; import com.google.spanner.admin.database.v1.CreateDatabaseRequest; import com.google.spanner.admin.database.v1.Database; import com.google.spanner.admin.database.v1.DeleteBackupRequest; +import com.google.spanner.admin.database.v1.DeleteBackupScheduleRequest; import com.google.spanner.admin.database.v1.DropDatabaseRequest; import com.google.spanner.admin.database.v1.GetBackupRequest; +import com.google.spanner.admin.database.v1.GetBackupScheduleRequest; import com.google.spanner.admin.database.v1.GetDatabaseDdlRequest; import com.google.spanner.admin.database.v1.GetDatabaseDdlResponse; import com.google.spanner.admin.database.v1.GetDatabaseRequest; import com.google.spanner.admin.database.v1.ListBackupOperationsRequest; import com.google.spanner.admin.database.v1.ListBackupOperationsResponse; +import com.google.spanner.admin.database.v1.ListBackupSchedulesRequest; +import com.google.spanner.admin.database.v1.ListBackupSchedulesResponse; import com.google.spanner.admin.database.v1.ListBackupsRequest; import com.google.spanner.admin.database.v1.ListBackupsResponse; import com.google.spanner.admin.database.v1.ListDatabaseOperationsRequest; @@ -74,6 +81,7 @@ import com.google.spanner.admin.database.v1.RestoreDatabaseMetadata; import com.google.spanner.admin.database.v1.RestoreDatabaseRequest; import com.google.spanner.admin.database.v1.UpdateBackupRequest; +import com.google.spanner.admin.database.v1.UpdateBackupScheduleRequest; import com.google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata; import com.google.spanner.admin.database.v1.UpdateDatabaseDdlRequest; import com.google.spanner.admin.database.v1.UpdateDatabaseMetadata; @@ -385,7 +393,8 @@ public class HttpJsonDatabaseAdminStub extends DatabaseAdminStub { return fields; }) .setAdditionalPaths( - "/v1/{resource=projects/*/instances/*/backups/*}:setIamPolicy") + "/v1/{resource=projects/*/instances/*/backups/*}:setIamPolicy", + "/v1/{resource=projects/*/instances/*/databases/*/backupSchedules/*}:setIamPolicy") .setQueryParamsExtractor( request -> { Map> fields = new HashMap<>(); @@ -424,7 +433,8 @@ public class HttpJsonDatabaseAdminStub extends DatabaseAdminStub { return fields; }) .setAdditionalPaths( - "/v1/{resource=projects/*/instances/*/backups/*}:getIamPolicy") + "/v1/{resource=projects/*/instances/*/backups/*}:getIamPolicy", + "/v1/{resource=projects/*/instances/*/databases/*/backupSchedules/*}:getIamPolicy") .setQueryParamsExtractor( request -> { Map> fields = new HashMap<>(); @@ -465,6 +475,7 @@ public class HttpJsonDatabaseAdminStub extends DatabaseAdminStub { }) .setAdditionalPaths( "/v1/{resource=projects/*/instances/*/backups/*}:testIamPermissions", + "/v1/{resource=projects/*/instances/*/databases/*/backupSchedules/*}:testIamPermissions", "/v1/{resource=projects/*/instances/*/databases/*/databaseRoles/*}:testIamPermissions") .setQueryParamsExtractor( request -> { @@ -868,6 +879,194 @@ public class HttpJsonDatabaseAdminStub extends DatabaseAdminStub { .build()) .build(); + private static final ApiMethodDescriptor + createBackupScheduleMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName( + "google.spanner.admin.database.v1.DatabaseAdmin/CreateBackupSchedule") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{parent=projects/*/instances/*/databases/*}/backupSchedules", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "parent", request.getParent()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam( + fields, "backupScheduleId", request.getBackupScheduleId()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("backupSchedule", request.getBackupSchedule(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(BackupSchedule.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + getBackupScheduleMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.spanner.admin.database.v1.DatabaseAdmin/GetBackupSchedule") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{name=projects/*/instances/*/databases/*/backupSchedules/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(BackupSchedule.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + updateBackupScheduleMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName( + "google.spanner.admin.database.v1.DatabaseAdmin/UpdateBackupSchedule") + .setHttpMethod("PATCH") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{backupSchedule.name=projects/*/instances/*/databases/*/backupSchedules/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam( + fields, + "backupSchedule.name", + request.getBackupSchedule().getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "updateMask", request.getUpdateMask()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("backupSchedule", request.getBackupSchedule(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(BackupSchedule.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + deleteBackupScheduleMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName( + "google.spanner.admin.database.v1.DatabaseAdmin/DeleteBackupSchedule") + .setHttpMethod("DELETE") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{name=projects/*/instances/*/databases/*/backupSchedules/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Empty.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + listBackupSchedulesMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName( + "google.spanner.admin.database.v1.DatabaseAdmin/ListBackupSchedules") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{parent=projects/*/instances/*/databases/*}/backupSchedules", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "parent", request.getParent()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "pageSize", request.getPageSize()); + serializer.putQueryParam(fields, "pageToken", request.getPageToken()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(ListBackupSchedulesResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + private final UnaryCallable listDatabasesCallable; private final UnaryCallable listDatabasesPagedCallable; @@ -914,6 +1113,16 @@ public class HttpJsonDatabaseAdminStub extends DatabaseAdminStub { listDatabaseRolesCallable; private final UnaryCallable listDatabaseRolesPagedCallable; + private final UnaryCallable + createBackupScheduleCallable; + private final UnaryCallable getBackupScheduleCallable; + private final UnaryCallable + updateBackupScheduleCallable; + private final UnaryCallable deleteBackupScheduleCallable; + private final UnaryCallable + listBackupSchedulesCallable; + private final UnaryCallable + listBackupSchedulesPagedCallable; private final BackgroundResource backgroundResources; private final HttpJsonOperationsStub httpJsonOperationsStub; @@ -1265,6 +1474,68 @@ protected HttpJsonDatabaseAdminStub( return builder.build(); }) .build(); + HttpJsonCallSettings + createBackupScheduleTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(createBackupScheduleMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings + getBackupScheduleTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getBackupScheduleMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings + updateBackupScheduleTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(updateBackupScheduleMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add( + "backup_schedule.name", + String.valueOf(request.getBackupSchedule().getName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings deleteBackupScheduleTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(deleteBackupScheduleMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings + listBackupSchedulesTransportSettings = + HttpJsonCallSettings + .newBuilder() + .setMethodDescriptor(listBackupSchedulesMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); this.listDatabasesCallable = callableFactory.createUnaryCallable( @@ -1393,6 +1664,36 @@ protected HttpJsonDatabaseAdminStub( listDatabaseRolesTransportSettings, settings.listDatabaseRolesSettings(), clientContext); + this.createBackupScheduleCallable = + callableFactory.createUnaryCallable( + createBackupScheduleTransportSettings, + settings.createBackupScheduleSettings(), + clientContext); + this.getBackupScheduleCallable = + callableFactory.createUnaryCallable( + getBackupScheduleTransportSettings, + settings.getBackupScheduleSettings(), + clientContext); + this.updateBackupScheduleCallable = + callableFactory.createUnaryCallable( + updateBackupScheduleTransportSettings, + settings.updateBackupScheduleSettings(), + clientContext); + this.deleteBackupScheduleCallable = + callableFactory.createUnaryCallable( + deleteBackupScheduleTransportSettings, + settings.deleteBackupScheduleSettings(), + clientContext); + this.listBackupSchedulesCallable = + callableFactory.createUnaryCallable( + listBackupSchedulesTransportSettings, + settings.listBackupSchedulesSettings(), + clientContext); + this.listBackupSchedulesPagedCallable = + callableFactory.createPagedCallable( + listBackupSchedulesTransportSettings, + settings.listBackupSchedulesSettings(), + clientContext); this.backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources()); @@ -1421,6 +1722,11 @@ public static List getMethodDescriptors() { methodDescriptors.add(listDatabaseOperationsMethodDescriptor); methodDescriptors.add(listBackupOperationsMethodDescriptor); methodDescriptors.add(listDatabaseRolesMethodDescriptor); + methodDescriptors.add(createBackupScheduleMethodDescriptor); + methodDescriptors.add(getBackupScheduleMethodDescriptor); + methodDescriptors.add(updateBackupScheduleMethodDescriptor); + methodDescriptors.add(deleteBackupScheduleMethodDescriptor); + methodDescriptors.add(listBackupSchedulesMethodDescriptor); return methodDescriptors; } @@ -1597,6 +1903,38 @@ public UnaryCallable restoreDatabaseCallable( return listDatabaseRolesPagedCallable; } + @Override + public UnaryCallable createBackupScheduleCallable() { + return createBackupScheduleCallable; + } + + @Override + public UnaryCallable getBackupScheduleCallable() { + return getBackupScheduleCallable; + } + + @Override + public UnaryCallable updateBackupScheduleCallable() { + return updateBackupScheduleCallable; + } + + @Override + public UnaryCallable deleteBackupScheduleCallable() { + return deleteBackupScheduleCallable; + } + + @Override + public UnaryCallable + listBackupSchedulesCallable() { + return listBackupSchedulesCallable; + } + + @Override + public UnaryCallable + listBackupSchedulesPagedCallable() { + return listBackupSchedulesPagedCallable; + } + @Override public final void close() { try { diff --git a/google-cloud-spanner/src/main/resources/META-INF/native-image/com.google.cloud.spanner.admin.database.v1/reflect-config.json b/google-cloud-spanner/src/main/resources/META-INF/native-image/com.google.cloud.spanner.admin.database.v1/reflect-config.json index 9518d8b2191..51848a41299 100644 --- a/google-cloud-spanner/src/main/resources/META-INF/native-image/com.google.cloud.spanner.admin.database.v1/reflect-config.json +++ b/google-cloud-spanner/src/main/resources/META-INF/native-image/com.google.cloud.spanner.admin.database.v1/reflect-config.json @@ -1646,6 +1646,42 @@ "allDeclaredClasses": true, "allPublicClasses": true }, + { + "name": "com.google.spanner.admin.database.v1.BackupSchedule", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.spanner.admin.database.v1.BackupSchedule$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.spanner.admin.database.v1.BackupScheduleSpec", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.spanner.admin.database.v1.BackupScheduleSpec$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, { "name": "com.google.spanner.admin.database.v1.CopyBackupEncryptionConfig", "queryAllDeclaredConstructors": true, @@ -1772,6 +1808,24 @@ "allDeclaredClasses": true, "allPublicClasses": true }, + { + "name": "com.google.spanner.admin.database.v1.CreateBackupScheduleRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.spanner.admin.database.v1.CreateBackupScheduleRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, { "name": "com.google.spanner.admin.database.v1.CreateDatabaseMetadata", "queryAllDeclaredConstructors": true, @@ -1808,6 +1862,24 @@ "allDeclaredClasses": true, "allPublicClasses": true }, + { + "name": "com.google.spanner.admin.database.v1.CrontabSpec", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.spanner.admin.database.v1.CrontabSpec$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, { "name": "com.google.spanner.admin.database.v1.Database", "queryAllDeclaredConstructors": true, @@ -1898,6 +1970,24 @@ "allDeclaredClasses": true, "allPublicClasses": true }, + { + "name": "com.google.spanner.admin.database.v1.DeleteBackupScheduleRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.spanner.admin.database.v1.DeleteBackupScheduleRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, { "name": "com.google.spanner.admin.database.v1.DropDatabaseRequest", "queryAllDeclaredConstructors": true, @@ -1961,6 +2051,24 @@ "allDeclaredClasses": true, "allPublicClasses": true }, + { + "name": "com.google.spanner.admin.database.v1.FullBackupSpec", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.spanner.admin.database.v1.FullBackupSpec$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, { "name": "com.google.spanner.admin.database.v1.GetBackupRequest", "queryAllDeclaredConstructors": true, @@ -1979,6 +2087,24 @@ "allDeclaredClasses": true, "allPublicClasses": true }, + { + "name": "com.google.spanner.admin.database.v1.GetBackupScheduleRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.spanner.admin.database.v1.GetBackupScheduleRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, { "name": "com.google.spanner.admin.database.v1.GetDatabaseDdlRequest", "queryAllDeclaredConstructors": true, @@ -2069,6 +2195,42 @@ "allDeclaredClasses": true, "allPublicClasses": true }, + { + "name": "com.google.spanner.admin.database.v1.ListBackupSchedulesRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.spanner.admin.database.v1.ListBackupSchedulesRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.spanner.admin.database.v1.ListBackupSchedulesResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.spanner.admin.database.v1.ListBackupSchedulesResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, { "name": "com.google.spanner.admin.database.v1.ListBackupsRequest", "queryAllDeclaredConstructors": true, @@ -2357,6 +2519,24 @@ "allDeclaredClasses": true, "allPublicClasses": true }, + { + "name": "com.google.spanner.admin.database.v1.UpdateBackupScheduleRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.spanner.admin.database.v1.UpdateBackupScheduleRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, { "name": "com.google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata", "queryAllDeclaredConstructors": true, diff --git a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/admin/database/v1/DatabaseAdminClientHttpJsonTest.java b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/admin/database/v1/DatabaseAdminClientHttpJsonTest.java index 368868a2dce..5e0d53da4ce 100644 --- a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/admin/database/v1/DatabaseAdminClientHttpJsonTest.java +++ b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/admin/database/v1/DatabaseAdminClientHttpJsonTest.java @@ -17,6 +17,7 @@ package com.google.cloud.spanner.admin.database.v1; import static com.google.cloud.spanner.admin.database.v1.DatabaseAdminClient.ListBackupOperationsPagedResponse; +import static com.google.cloud.spanner.admin.database.v1.DatabaseAdminClient.ListBackupSchedulesPagedResponse; import static com.google.cloud.spanner.admin.database.v1.DatabaseAdminClient.ListBackupsPagedResponse; import static com.google.cloud.spanner.admin.database.v1.DatabaseAdminClient.ListDatabaseOperationsPagedResponse; import static com.google.cloud.spanner.admin.database.v1.DatabaseAdminClient.ListDatabaseRolesPagedResponse; @@ -41,11 +42,16 @@ import com.google.longrunning.Operation; import com.google.protobuf.Any; import com.google.protobuf.ByteString; +import com.google.protobuf.Duration; import com.google.protobuf.Empty; import com.google.protobuf.FieldMask; import com.google.protobuf.Timestamp; import com.google.spanner.admin.database.v1.Backup; import com.google.spanner.admin.database.v1.BackupName; +import com.google.spanner.admin.database.v1.BackupSchedule; +import com.google.spanner.admin.database.v1.BackupScheduleName; +import com.google.spanner.admin.database.v1.BackupScheduleSpec; +import com.google.spanner.admin.database.v1.CreateBackupEncryptionConfig; import com.google.spanner.admin.database.v1.Database; import com.google.spanner.admin.database.v1.DatabaseDialect; import com.google.spanner.admin.database.v1.DatabaseName; @@ -55,6 +61,7 @@ import com.google.spanner.admin.database.v1.GetDatabaseDdlResponse; import com.google.spanner.admin.database.v1.InstanceName; import com.google.spanner.admin.database.v1.ListBackupOperationsResponse; +import com.google.spanner.admin.database.v1.ListBackupSchedulesResponse; import com.google.spanner.admin.database.v1.ListBackupsResponse; import com.google.spanner.admin.database.v1.ListDatabaseOperationsResponse; import com.google.spanner.admin.database.v1.ListDatabaseRolesResponse; @@ -1085,6 +1092,7 @@ public void createBackupTest() throws Exception { .setDatabaseDialect(DatabaseDialect.forNumber(0)) .addAllReferencingBackups(new ArrayList()) .setMaxExpireTime(Timestamp.newBuilder().build()) + .addAllBackupSchedules(new ArrayList()) .build(); Operation resultOperation = Operation.newBuilder() @@ -1149,6 +1157,7 @@ public void createBackupTest2() throws Exception { .setDatabaseDialect(DatabaseDialect.forNumber(0)) .addAllReferencingBackups(new ArrayList()) .setMaxExpireTime(Timestamp.newBuilder().build()) + .addAllBackupSchedules(new ArrayList()) .build(); Operation resultOperation = Operation.newBuilder() @@ -1213,6 +1222,7 @@ public void copyBackupTest() throws Exception { .setDatabaseDialect(DatabaseDialect.forNumber(0)) .addAllReferencingBackups(new ArrayList()) .setMaxExpireTime(Timestamp.newBuilder().build()) + .addAllBackupSchedules(new ArrayList()) .build(); Operation resultOperation = Operation.newBuilder() @@ -1280,6 +1290,7 @@ public void copyBackupTest2() throws Exception { .setDatabaseDialect(DatabaseDialect.forNumber(0)) .addAllReferencingBackups(new ArrayList()) .setMaxExpireTime(Timestamp.newBuilder().build()) + .addAllBackupSchedules(new ArrayList()) .build(); Operation resultOperation = Operation.newBuilder() @@ -1347,6 +1358,7 @@ public void copyBackupTest3() throws Exception { .setDatabaseDialect(DatabaseDialect.forNumber(0)) .addAllReferencingBackups(new ArrayList()) .setMaxExpireTime(Timestamp.newBuilder().build()) + .addAllBackupSchedules(new ArrayList()) .build(); Operation resultOperation = Operation.newBuilder() @@ -1414,6 +1426,7 @@ public void copyBackupTest4() throws Exception { .setDatabaseDialect(DatabaseDialect.forNumber(0)) .addAllReferencingBackups(new ArrayList()) .setMaxExpireTime(Timestamp.newBuilder().build()) + .addAllBackupSchedules(new ArrayList()) .build(); Operation resultOperation = Operation.newBuilder() @@ -1481,6 +1494,7 @@ public void getBackupTest() throws Exception { .setDatabaseDialect(DatabaseDialect.forNumber(0)) .addAllReferencingBackups(new ArrayList()) .setMaxExpireTime(Timestamp.newBuilder().build()) + .addAllBackupSchedules(new ArrayList()) .build(); mockService.addResponse(expectedResponse); @@ -1536,6 +1550,7 @@ public void getBackupTest2() throws Exception { .setDatabaseDialect(DatabaseDialect.forNumber(0)) .addAllReferencingBackups(new ArrayList()) .setMaxExpireTime(Timestamp.newBuilder().build()) + .addAllBackupSchedules(new ArrayList()) .build(); mockService.addResponse(expectedResponse); @@ -1591,6 +1606,7 @@ public void updateBackupTest() throws Exception { .setDatabaseDialect(DatabaseDialect.forNumber(0)) .addAllReferencingBackups(new ArrayList()) .setMaxExpireTime(Timestamp.newBuilder().build()) + .addAllBackupSchedules(new ArrayList()) .build(); mockService.addResponse(expectedResponse); @@ -1608,6 +1624,7 @@ public void updateBackupTest() throws Exception { .setDatabaseDialect(DatabaseDialect.forNumber(0)) .addAllReferencingBackups(new ArrayList()) .setMaxExpireTime(Timestamp.newBuilder().build()) + .addAllBackupSchedules(new ArrayList()) .build(); FieldMask updateMask = FieldMask.newBuilder().build(); @@ -1651,6 +1668,7 @@ public void updateBackupExceptionTest() throws Exception { .setDatabaseDialect(DatabaseDialect.forNumber(0)) .addAllReferencingBackups(new ArrayList()) .setMaxExpireTime(Timestamp.newBuilder().build()) + .addAllBackupSchedules(new ArrayList()) .build(); FieldMask updateMask = FieldMask.newBuilder().build(); client.updateBackup(backup, updateMask); @@ -2391,4 +2409,472 @@ public void listDatabaseRolesExceptionTest2() throws Exception { // Expected exception. } } + + @Test + public void createBackupScheduleTest() throws Exception { + BackupSchedule expectedResponse = + BackupSchedule.newBuilder() + .setName( + BackupScheduleName.of("[PROJECT]", "[INSTANCE]", "[DATABASE]", "[SCHEDULE]") + .toString()) + .setSpec(BackupScheduleSpec.newBuilder().build()) + .setRetentionDuration(Duration.newBuilder().build()) + .setEncryptionConfig(CreateBackupEncryptionConfig.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + DatabaseName parent = DatabaseName.of("[PROJECT]", "[INSTANCE]", "[DATABASE]"); + BackupSchedule backupSchedule = BackupSchedule.newBuilder().build(); + String backupScheduleId = "backupScheduleId1704974708"; + + BackupSchedule actualResponse = + client.createBackupSchedule(parent, backupSchedule, backupScheduleId); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void createBackupScheduleExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + DatabaseName parent = DatabaseName.of("[PROJECT]", "[INSTANCE]", "[DATABASE]"); + BackupSchedule backupSchedule = BackupSchedule.newBuilder().build(); + String backupScheduleId = "backupScheduleId1704974708"; + client.createBackupSchedule(parent, backupSchedule, backupScheduleId); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createBackupScheduleTest2() throws Exception { + BackupSchedule expectedResponse = + BackupSchedule.newBuilder() + .setName( + BackupScheduleName.of("[PROJECT]", "[INSTANCE]", "[DATABASE]", "[SCHEDULE]") + .toString()) + .setSpec(BackupScheduleSpec.newBuilder().build()) + .setRetentionDuration(Duration.newBuilder().build()) + .setEncryptionConfig(CreateBackupEncryptionConfig.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + String parent = "projects/project-9347/instances/instance-9347/databases/database-9347"; + BackupSchedule backupSchedule = BackupSchedule.newBuilder().build(); + String backupScheduleId = "backupScheduleId1704974708"; + + BackupSchedule actualResponse = + client.createBackupSchedule(parent, backupSchedule, backupScheduleId); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void createBackupScheduleExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String parent = "projects/project-9347/instances/instance-9347/databases/database-9347"; + BackupSchedule backupSchedule = BackupSchedule.newBuilder().build(); + String backupScheduleId = "backupScheduleId1704974708"; + client.createBackupSchedule(parent, backupSchedule, backupScheduleId); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getBackupScheduleTest() throws Exception { + BackupSchedule expectedResponse = + BackupSchedule.newBuilder() + .setName( + BackupScheduleName.of("[PROJECT]", "[INSTANCE]", "[DATABASE]", "[SCHEDULE]") + .toString()) + .setSpec(BackupScheduleSpec.newBuilder().build()) + .setRetentionDuration(Duration.newBuilder().build()) + .setEncryptionConfig(CreateBackupEncryptionConfig.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + BackupScheduleName name = + BackupScheduleName.of("[PROJECT]", "[INSTANCE]", "[DATABASE]", "[SCHEDULE]"); + + BackupSchedule actualResponse = client.getBackupSchedule(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getBackupScheduleExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + BackupScheduleName name = + BackupScheduleName.of("[PROJECT]", "[INSTANCE]", "[DATABASE]", "[SCHEDULE]"); + client.getBackupSchedule(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getBackupScheduleTest2() throws Exception { + BackupSchedule expectedResponse = + BackupSchedule.newBuilder() + .setName( + BackupScheduleName.of("[PROJECT]", "[INSTANCE]", "[DATABASE]", "[SCHEDULE]") + .toString()) + .setSpec(BackupScheduleSpec.newBuilder().build()) + .setRetentionDuration(Duration.newBuilder().build()) + .setEncryptionConfig(CreateBackupEncryptionConfig.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + String name = + "projects/project-8764/instances/instance-8764/databases/database-8764/backupSchedules/backupSchedule-8764"; + + BackupSchedule actualResponse = client.getBackupSchedule(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getBackupScheduleExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = + "projects/project-8764/instances/instance-8764/databases/database-8764/backupSchedules/backupSchedule-8764"; + client.getBackupSchedule(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void updateBackupScheduleTest() throws Exception { + BackupSchedule expectedResponse = + BackupSchedule.newBuilder() + .setName( + BackupScheduleName.of("[PROJECT]", "[INSTANCE]", "[DATABASE]", "[SCHEDULE]") + .toString()) + .setSpec(BackupScheduleSpec.newBuilder().build()) + .setRetentionDuration(Duration.newBuilder().build()) + .setEncryptionConfig(CreateBackupEncryptionConfig.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + BackupSchedule backupSchedule = + BackupSchedule.newBuilder() + .setName( + BackupScheduleName.of("[PROJECT]", "[INSTANCE]", "[DATABASE]", "[SCHEDULE]") + .toString()) + .setSpec(BackupScheduleSpec.newBuilder().build()) + .setRetentionDuration(Duration.newBuilder().build()) + .setEncryptionConfig(CreateBackupEncryptionConfig.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + + BackupSchedule actualResponse = client.updateBackupSchedule(backupSchedule, updateMask); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void updateBackupScheduleExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + BackupSchedule backupSchedule = + BackupSchedule.newBuilder() + .setName( + BackupScheduleName.of("[PROJECT]", "[INSTANCE]", "[DATABASE]", "[SCHEDULE]") + .toString()) + .setSpec(BackupScheduleSpec.newBuilder().build()) + .setRetentionDuration(Duration.newBuilder().build()) + .setEncryptionConfig(CreateBackupEncryptionConfig.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + client.updateBackupSchedule(backupSchedule, updateMask); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteBackupScheduleTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockService.addResponse(expectedResponse); + + BackupScheduleName name = + BackupScheduleName.of("[PROJECT]", "[INSTANCE]", "[DATABASE]", "[SCHEDULE]"); + + client.deleteBackupSchedule(name); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void deleteBackupScheduleExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + BackupScheduleName name = + BackupScheduleName.of("[PROJECT]", "[INSTANCE]", "[DATABASE]", "[SCHEDULE]"); + client.deleteBackupSchedule(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteBackupScheduleTest2() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockService.addResponse(expectedResponse); + + String name = + "projects/project-8764/instances/instance-8764/databases/database-8764/backupSchedules/backupSchedule-8764"; + + client.deleteBackupSchedule(name); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void deleteBackupScheduleExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = + "projects/project-8764/instances/instance-8764/databases/database-8764/backupSchedules/backupSchedule-8764"; + client.deleteBackupSchedule(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listBackupSchedulesTest() throws Exception { + BackupSchedule responsesElement = BackupSchedule.newBuilder().build(); + ListBackupSchedulesResponse expectedResponse = + ListBackupSchedulesResponse.newBuilder() + .setNextPageToken("") + .addAllBackupSchedules(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + DatabaseName parent = DatabaseName.of("[PROJECT]", "[INSTANCE]", "[DATABASE]"); + + ListBackupSchedulesPagedResponse pagedListResponse = client.listBackupSchedules(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getBackupSchedulesList().get(0), resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void listBackupSchedulesExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + DatabaseName parent = DatabaseName.of("[PROJECT]", "[INSTANCE]", "[DATABASE]"); + client.listBackupSchedules(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listBackupSchedulesTest2() throws Exception { + BackupSchedule responsesElement = BackupSchedule.newBuilder().build(); + ListBackupSchedulesResponse expectedResponse = + ListBackupSchedulesResponse.newBuilder() + .setNextPageToken("") + .addAllBackupSchedules(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + String parent = "projects/project-9347/instances/instance-9347/databases/database-9347"; + + ListBackupSchedulesPagedResponse pagedListResponse = client.listBackupSchedules(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getBackupSchedulesList().get(0), resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void listBackupSchedulesExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String parent = "projects/project-9347/instances/instance-9347/databases/database-9347"; + client.listBackupSchedules(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } } diff --git a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/admin/database/v1/DatabaseAdminClientTest.java b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/admin/database/v1/DatabaseAdminClientTest.java index 3766ca90a8f..469c0f53a1c 100644 --- a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/admin/database/v1/DatabaseAdminClientTest.java +++ b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/admin/database/v1/DatabaseAdminClientTest.java @@ -17,6 +17,7 @@ package com.google.cloud.spanner.admin.database.v1; import static com.google.cloud.spanner.admin.database.v1.DatabaseAdminClient.ListBackupOperationsPagedResponse; +import static com.google.cloud.spanner.admin.database.v1.DatabaseAdminClient.ListBackupSchedulesPagedResponse; import static com.google.cloud.spanner.admin.database.v1.DatabaseAdminClient.ListBackupsPagedResponse; import static com.google.cloud.spanner.admin.database.v1.DatabaseAdminClient.ListDatabaseOperationsPagedResponse; import static com.google.cloud.spanner.admin.database.v1.DatabaseAdminClient.ListDatabaseRolesPagedResponse; @@ -43,29 +44,39 @@ import com.google.protobuf.AbstractMessage; import com.google.protobuf.Any; import com.google.protobuf.ByteString; +import com.google.protobuf.Duration; import com.google.protobuf.Empty; import com.google.protobuf.FieldMask; import com.google.protobuf.Timestamp; import com.google.spanner.admin.database.v1.Backup; import com.google.spanner.admin.database.v1.BackupName; +import com.google.spanner.admin.database.v1.BackupSchedule; +import com.google.spanner.admin.database.v1.BackupScheduleName; +import com.google.spanner.admin.database.v1.BackupScheduleSpec; import com.google.spanner.admin.database.v1.CopyBackupRequest; +import com.google.spanner.admin.database.v1.CreateBackupEncryptionConfig; import com.google.spanner.admin.database.v1.CreateBackupRequest; +import com.google.spanner.admin.database.v1.CreateBackupScheduleRequest; import com.google.spanner.admin.database.v1.CreateDatabaseRequest; import com.google.spanner.admin.database.v1.Database; import com.google.spanner.admin.database.v1.DatabaseDialect; import com.google.spanner.admin.database.v1.DatabaseName; import com.google.spanner.admin.database.v1.DatabaseRole; import com.google.spanner.admin.database.v1.DeleteBackupRequest; +import com.google.spanner.admin.database.v1.DeleteBackupScheduleRequest; import com.google.spanner.admin.database.v1.DropDatabaseRequest; import com.google.spanner.admin.database.v1.EncryptionConfig; import com.google.spanner.admin.database.v1.EncryptionInfo; import com.google.spanner.admin.database.v1.GetBackupRequest; +import com.google.spanner.admin.database.v1.GetBackupScheduleRequest; import com.google.spanner.admin.database.v1.GetDatabaseDdlRequest; import com.google.spanner.admin.database.v1.GetDatabaseDdlResponse; import com.google.spanner.admin.database.v1.GetDatabaseRequest; import com.google.spanner.admin.database.v1.InstanceName; import com.google.spanner.admin.database.v1.ListBackupOperationsRequest; import com.google.spanner.admin.database.v1.ListBackupOperationsResponse; +import com.google.spanner.admin.database.v1.ListBackupSchedulesRequest; +import com.google.spanner.admin.database.v1.ListBackupSchedulesResponse; import com.google.spanner.admin.database.v1.ListBackupsRequest; import com.google.spanner.admin.database.v1.ListBackupsResponse; import com.google.spanner.admin.database.v1.ListDatabaseOperationsRequest; @@ -77,6 +88,7 @@ import com.google.spanner.admin.database.v1.RestoreDatabaseRequest; import com.google.spanner.admin.database.v1.RestoreInfo; import com.google.spanner.admin.database.v1.UpdateBackupRequest; +import com.google.spanner.admin.database.v1.UpdateBackupScheduleRequest; import com.google.spanner.admin.database.v1.UpdateDatabaseDdlRequest; import com.google.spanner.admin.database.v1.UpdateDatabaseRequest; import io.grpc.StatusRuntimeException; @@ -993,6 +1005,7 @@ public void createBackupTest() throws Exception { .setDatabaseDialect(DatabaseDialect.forNumber(0)) .addAllReferencingBackups(new ArrayList()) .setMaxExpireTime(Timestamp.newBuilder().build()) + .addAllBackupSchedules(new ArrayList()) .build(); Operation resultOperation = Operation.newBuilder() @@ -1056,6 +1069,7 @@ public void createBackupTest2() throws Exception { .setDatabaseDialect(DatabaseDialect.forNumber(0)) .addAllReferencingBackups(new ArrayList()) .setMaxExpireTime(Timestamp.newBuilder().build()) + .addAllBackupSchedules(new ArrayList()) .build(); Operation resultOperation = Operation.newBuilder() @@ -1119,6 +1133,7 @@ public void copyBackupTest() throws Exception { .setDatabaseDialect(DatabaseDialect.forNumber(0)) .addAllReferencingBackups(new ArrayList()) .setMaxExpireTime(Timestamp.newBuilder().build()) + .addAllBackupSchedules(new ArrayList()) .build(); Operation resultOperation = Operation.newBuilder() @@ -1186,6 +1201,7 @@ public void copyBackupTest2() throws Exception { .setDatabaseDialect(DatabaseDialect.forNumber(0)) .addAllReferencingBackups(new ArrayList()) .setMaxExpireTime(Timestamp.newBuilder().build()) + .addAllBackupSchedules(new ArrayList()) .build(); Operation resultOperation = Operation.newBuilder() @@ -1253,6 +1269,7 @@ public void copyBackupTest3() throws Exception { .setDatabaseDialect(DatabaseDialect.forNumber(0)) .addAllReferencingBackups(new ArrayList()) .setMaxExpireTime(Timestamp.newBuilder().build()) + .addAllBackupSchedules(new ArrayList()) .build(); Operation resultOperation = Operation.newBuilder() @@ -1320,6 +1337,7 @@ public void copyBackupTest4() throws Exception { .setDatabaseDialect(DatabaseDialect.forNumber(0)) .addAllReferencingBackups(new ArrayList()) .setMaxExpireTime(Timestamp.newBuilder().build()) + .addAllBackupSchedules(new ArrayList()) .build(); Operation resultOperation = Operation.newBuilder() @@ -1387,6 +1405,7 @@ public void getBackupTest() throws Exception { .setDatabaseDialect(DatabaseDialect.forNumber(0)) .addAllReferencingBackups(new ArrayList()) .setMaxExpireTime(Timestamp.newBuilder().build()) + .addAllBackupSchedules(new ArrayList()) .build(); mockDatabaseAdmin.addResponse(expectedResponse); @@ -1436,6 +1455,7 @@ public void getBackupTest2() throws Exception { .setDatabaseDialect(DatabaseDialect.forNumber(0)) .addAllReferencingBackups(new ArrayList()) .setMaxExpireTime(Timestamp.newBuilder().build()) + .addAllBackupSchedules(new ArrayList()) .build(); mockDatabaseAdmin.addResponse(expectedResponse); @@ -1485,6 +1505,7 @@ public void updateBackupTest() throws Exception { .setDatabaseDialect(DatabaseDialect.forNumber(0)) .addAllReferencingBackups(new ArrayList()) .setMaxExpireTime(Timestamp.newBuilder().build()) + .addAllBackupSchedules(new ArrayList()) .build(); mockDatabaseAdmin.addResponse(expectedResponse); @@ -2192,4 +2213,406 @@ public void listDatabaseRolesExceptionTest2() throws Exception { // Expected exception. } } + + @Test + public void createBackupScheduleTest() throws Exception { + BackupSchedule expectedResponse = + BackupSchedule.newBuilder() + .setName( + BackupScheduleName.of("[PROJECT]", "[INSTANCE]", "[DATABASE]", "[SCHEDULE]") + .toString()) + .setSpec(BackupScheduleSpec.newBuilder().build()) + .setRetentionDuration(Duration.newBuilder().build()) + .setEncryptionConfig(CreateBackupEncryptionConfig.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .build(); + mockDatabaseAdmin.addResponse(expectedResponse); + + DatabaseName parent = DatabaseName.of("[PROJECT]", "[INSTANCE]", "[DATABASE]"); + BackupSchedule backupSchedule = BackupSchedule.newBuilder().build(); + String backupScheduleId = "backupScheduleId1704974708"; + + BackupSchedule actualResponse = + client.createBackupSchedule(parent, backupSchedule, backupScheduleId); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockDatabaseAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateBackupScheduleRequest actualRequest = + ((CreateBackupScheduleRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertEquals(backupSchedule, actualRequest.getBackupSchedule()); + Assert.assertEquals(backupScheduleId, actualRequest.getBackupScheduleId()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createBackupScheduleExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockDatabaseAdmin.addException(exception); + + try { + DatabaseName parent = DatabaseName.of("[PROJECT]", "[INSTANCE]", "[DATABASE]"); + BackupSchedule backupSchedule = BackupSchedule.newBuilder().build(); + String backupScheduleId = "backupScheduleId1704974708"; + client.createBackupSchedule(parent, backupSchedule, backupScheduleId); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createBackupScheduleTest2() throws Exception { + BackupSchedule expectedResponse = + BackupSchedule.newBuilder() + .setName( + BackupScheduleName.of("[PROJECT]", "[INSTANCE]", "[DATABASE]", "[SCHEDULE]") + .toString()) + .setSpec(BackupScheduleSpec.newBuilder().build()) + .setRetentionDuration(Duration.newBuilder().build()) + .setEncryptionConfig(CreateBackupEncryptionConfig.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .build(); + mockDatabaseAdmin.addResponse(expectedResponse); + + String parent = "parent-995424086"; + BackupSchedule backupSchedule = BackupSchedule.newBuilder().build(); + String backupScheduleId = "backupScheduleId1704974708"; + + BackupSchedule actualResponse = + client.createBackupSchedule(parent, backupSchedule, backupScheduleId); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockDatabaseAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateBackupScheduleRequest actualRequest = + ((CreateBackupScheduleRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertEquals(backupSchedule, actualRequest.getBackupSchedule()); + Assert.assertEquals(backupScheduleId, actualRequest.getBackupScheduleId()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createBackupScheduleExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockDatabaseAdmin.addException(exception); + + try { + String parent = "parent-995424086"; + BackupSchedule backupSchedule = BackupSchedule.newBuilder().build(); + String backupScheduleId = "backupScheduleId1704974708"; + client.createBackupSchedule(parent, backupSchedule, backupScheduleId); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getBackupScheduleTest() throws Exception { + BackupSchedule expectedResponse = + BackupSchedule.newBuilder() + .setName( + BackupScheduleName.of("[PROJECT]", "[INSTANCE]", "[DATABASE]", "[SCHEDULE]") + .toString()) + .setSpec(BackupScheduleSpec.newBuilder().build()) + .setRetentionDuration(Duration.newBuilder().build()) + .setEncryptionConfig(CreateBackupEncryptionConfig.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .build(); + mockDatabaseAdmin.addResponse(expectedResponse); + + BackupScheduleName name = + BackupScheduleName.of("[PROJECT]", "[INSTANCE]", "[DATABASE]", "[SCHEDULE]"); + + BackupSchedule actualResponse = client.getBackupSchedule(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockDatabaseAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetBackupScheduleRequest actualRequest = ((GetBackupScheduleRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getBackupScheduleExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockDatabaseAdmin.addException(exception); + + try { + BackupScheduleName name = + BackupScheduleName.of("[PROJECT]", "[INSTANCE]", "[DATABASE]", "[SCHEDULE]"); + client.getBackupSchedule(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getBackupScheduleTest2() throws Exception { + BackupSchedule expectedResponse = + BackupSchedule.newBuilder() + .setName( + BackupScheduleName.of("[PROJECT]", "[INSTANCE]", "[DATABASE]", "[SCHEDULE]") + .toString()) + .setSpec(BackupScheduleSpec.newBuilder().build()) + .setRetentionDuration(Duration.newBuilder().build()) + .setEncryptionConfig(CreateBackupEncryptionConfig.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .build(); + mockDatabaseAdmin.addResponse(expectedResponse); + + String name = "name3373707"; + + BackupSchedule actualResponse = client.getBackupSchedule(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockDatabaseAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetBackupScheduleRequest actualRequest = ((GetBackupScheduleRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getBackupScheduleExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockDatabaseAdmin.addException(exception); + + try { + String name = "name3373707"; + client.getBackupSchedule(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void updateBackupScheduleTest() throws Exception { + BackupSchedule expectedResponse = + BackupSchedule.newBuilder() + .setName( + BackupScheduleName.of("[PROJECT]", "[INSTANCE]", "[DATABASE]", "[SCHEDULE]") + .toString()) + .setSpec(BackupScheduleSpec.newBuilder().build()) + .setRetentionDuration(Duration.newBuilder().build()) + .setEncryptionConfig(CreateBackupEncryptionConfig.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .build(); + mockDatabaseAdmin.addResponse(expectedResponse); + + BackupSchedule backupSchedule = BackupSchedule.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + + BackupSchedule actualResponse = client.updateBackupSchedule(backupSchedule, updateMask); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockDatabaseAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + UpdateBackupScheduleRequest actualRequest = + ((UpdateBackupScheduleRequest) actualRequests.get(0)); + + Assert.assertEquals(backupSchedule, actualRequest.getBackupSchedule()); + Assert.assertEquals(updateMask, actualRequest.getUpdateMask()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void updateBackupScheduleExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockDatabaseAdmin.addException(exception); + + try { + BackupSchedule backupSchedule = BackupSchedule.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + client.updateBackupSchedule(backupSchedule, updateMask); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteBackupScheduleTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockDatabaseAdmin.addResponse(expectedResponse); + + BackupScheduleName name = + BackupScheduleName.of("[PROJECT]", "[INSTANCE]", "[DATABASE]", "[SCHEDULE]"); + + client.deleteBackupSchedule(name); + + List actualRequests = mockDatabaseAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteBackupScheduleRequest actualRequest = + ((DeleteBackupScheduleRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteBackupScheduleExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockDatabaseAdmin.addException(exception); + + try { + BackupScheduleName name = + BackupScheduleName.of("[PROJECT]", "[INSTANCE]", "[DATABASE]", "[SCHEDULE]"); + client.deleteBackupSchedule(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteBackupScheduleTest2() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockDatabaseAdmin.addResponse(expectedResponse); + + String name = "name3373707"; + + client.deleteBackupSchedule(name); + + List actualRequests = mockDatabaseAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteBackupScheduleRequest actualRequest = + ((DeleteBackupScheduleRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteBackupScheduleExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockDatabaseAdmin.addException(exception); + + try { + String name = "name3373707"; + client.deleteBackupSchedule(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listBackupSchedulesTest() throws Exception { + BackupSchedule responsesElement = BackupSchedule.newBuilder().build(); + ListBackupSchedulesResponse expectedResponse = + ListBackupSchedulesResponse.newBuilder() + .setNextPageToken("") + .addAllBackupSchedules(Arrays.asList(responsesElement)) + .build(); + mockDatabaseAdmin.addResponse(expectedResponse); + + DatabaseName parent = DatabaseName.of("[PROJECT]", "[INSTANCE]", "[DATABASE]"); + + ListBackupSchedulesPagedResponse pagedListResponse = client.listBackupSchedules(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getBackupSchedulesList().get(0), resources.get(0)); + + List actualRequests = mockDatabaseAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListBackupSchedulesRequest actualRequest = ((ListBackupSchedulesRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listBackupSchedulesExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockDatabaseAdmin.addException(exception); + + try { + DatabaseName parent = DatabaseName.of("[PROJECT]", "[INSTANCE]", "[DATABASE]"); + client.listBackupSchedules(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listBackupSchedulesTest2() throws Exception { + BackupSchedule responsesElement = BackupSchedule.newBuilder().build(); + ListBackupSchedulesResponse expectedResponse = + ListBackupSchedulesResponse.newBuilder() + .setNextPageToken("") + .addAllBackupSchedules(Arrays.asList(responsesElement)) + .build(); + mockDatabaseAdmin.addResponse(expectedResponse); + + String parent = "parent-995424086"; + + ListBackupSchedulesPagedResponse pagedListResponse = client.listBackupSchedules(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getBackupSchedulesList().get(0), resources.get(0)); + + List actualRequests = mockDatabaseAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListBackupSchedulesRequest actualRequest = ((ListBackupSchedulesRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listBackupSchedulesExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockDatabaseAdmin.addException(exception); + + try { + String parent = "parent-995424086"; + client.listBackupSchedules(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } } diff --git a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/admin/database/v1/MockDatabaseAdminImpl.java b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/admin/database/v1/MockDatabaseAdminImpl.java index f77ad2edbc8..9e273ed1550 100644 --- a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/admin/database/v1/MockDatabaseAdminImpl.java +++ b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/admin/database/v1/MockDatabaseAdminImpl.java @@ -26,19 +26,25 @@ import com.google.protobuf.AbstractMessage; import com.google.protobuf.Empty; import com.google.spanner.admin.database.v1.Backup; +import com.google.spanner.admin.database.v1.BackupSchedule; import com.google.spanner.admin.database.v1.CopyBackupRequest; import com.google.spanner.admin.database.v1.CreateBackupRequest; +import com.google.spanner.admin.database.v1.CreateBackupScheduleRequest; import com.google.spanner.admin.database.v1.CreateDatabaseRequest; import com.google.spanner.admin.database.v1.Database; import com.google.spanner.admin.database.v1.DatabaseAdminGrpc.DatabaseAdminImplBase; import com.google.spanner.admin.database.v1.DeleteBackupRequest; +import com.google.spanner.admin.database.v1.DeleteBackupScheduleRequest; import com.google.spanner.admin.database.v1.DropDatabaseRequest; import com.google.spanner.admin.database.v1.GetBackupRequest; +import com.google.spanner.admin.database.v1.GetBackupScheduleRequest; import com.google.spanner.admin.database.v1.GetDatabaseDdlRequest; import com.google.spanner.admin.database.v1.GetDatabaseDdlResponse; import com.google.spanner.admin.database.v1.GetDatabaseRequest; import com.google.spanner.admin.database.v1.ListBackupOperationsRequest; import com.google.spanner.admin.database.v1.ListBackupOperationsResponse; +import com.google.spanner.admin.database.v1.ListBackupSchedulesRequest; +import com.google.spanner.admin.database.v1.ListBackupSchedulesResponse; import com.google.spanner.admin.database.v1.ListBackupsRequest; import com.google.spanner.admin.database.v1.ListBackupsResponse; import com.google.spanner.admin.database.v1.ListDatabaseOperationsRequest; @@ -49,6 +55,7 @@ import com.google.spanner.admin.database.v1.ListDatabasesResponse; import com.google.spanner.admin.database.v1.RestoreDatabaseRequest; import com.google.spanner.admin.database.v1.UpdateBackupRequest; +import com.google.spanner.admin.database.v1.UpdateBackupScheduleRequest; import com.google.spanner.admin.database.v1.UpdateDatabaseDdlRequest; import com.google.spanner.admin.database.v1.UpdateDatabaseRequest; import io.grpc.stub.StreamObserver; @@ -505,4 +512,110 @@ public void listDatabaseRoles( Exception.class.getName()))); } } + + @Override + public void createBackupSchedule( + CreateBackupScheduleRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof BackupSchedule) { + requests.add(request); + responseObserver.onNext(((BackupSchedule) 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 CreateBackupSchedule, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + BackupSchedule.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void getBackupSchedule( + GetBackupScheduleRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof BackupSchedule) { + requests.add(request); + responseObserver.onNext(((BackupSchedule) 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 GetBackupSchedule, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + BackupSchedule.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void updateBackupSchedule( + UpdateBackupScheduleRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof BackupSchedule) { + requests.add(request); + responseObserver.onNext(((BackupSchedule) 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 UpdateBackupSchedule, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + BackupSchedule.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void deleteBackupSchedule( + DeleteBackupScheduleRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Empty) { + requests.add(request); + responseObserver.onNext(((Empty) 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 DeleteBackupSchedule, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Empty.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void listBackupSchedules( + ListBackupSchedulesRequest request, + StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof ListBackupSchedulesResponse) { + requests.add(request); + responseObserver.onNext(((ListBackupSchedulesResponse) 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 ListBackupSchedules, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + ListBackupSchedulesResponse.class.getName(), + Exception.class.getName()))); + } + } } diff --git a/grpc-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/DatabaseAdminGrpc.java b/grpc-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/DatabaseAdminGrpc.java index 2314cd8965b..01592c14be9 100644 --- a/grpc-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/DatabaseAdminGrpc.java +++ b/grpc-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/DatabaseAdminGrpc.java @@ -943,6 +943,248 @@ private DatabaseAdminGrpc() {} return getListDatabaseRolesMethod; } + private static volatile io.grpc.MethodDescriptor< + com.google.spanner.admin.database.v1.CreateBackupScheduleRequest, + com.google.spanner.admin.database.v1.BackupSchedule> + getCreateBackupScheduleMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "CreateBackupSchedule", + requestType = com.google.spanner.admin.database.v1.CreateBackupScheduleRequest.class, + responseType = com.google.spanner.admin.database.v1.BackupSchedule.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.spanner.admin.database.v1.CreateBackupScheduleRequest, + com.google.spanner.admin.database.v1.BackupSchedule> + getCreateBackupScheduleMethod() { + io.grpc.MethodDescriptor< + com.google.spanner.admin.database.v1.CreateBackupScheduleRequest, + com.google.spanner.admin.database.v1.BackupSchedule> + getCreateBackupScheduleMethod; + if ((getCreateBackupScheduleMethod = DatabaseAdminGrpc.getCreateBackupScheduleMethod) == null) { + synchronized (DatabaseAdminGrpc.class) { + if ((getCreateBackupScheduleMethod = DatabaseAdminGrpc.getCreateBackupScheduleMethod) + == null) { + DatabaseAdminGrpc.getCreateBackupScheduleMethod = + getCreateBackupScheduleMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "CreateBackupSchedule")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.spanner.admin.database.v1.CreateBackupScheduleRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.spanner.admin.database.v1.BackupSchedule + .getDefaultInstance())) + .setSchemaDescriptor( + new DatabaseAdminMethodDescriptorSupplier("CreateBackupSchedule")) + .build(); + } + } + } + return getCreateBackupScheduleMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.spanner.admin.database.v1.GetBackupScheduleRequest, + com.google.spanner.admin.database.v1.BackupSchedule> + getGetBackupScheduleMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetBackupSchedule", + requestType = com.google.spanner.admin.database.v1.GetBackupScheduleRequest.class, + responseType = com.google.spanner.admin.database.v1.BackupSchedule.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.spanner.admin.database.v1.GetBackupScheduleRequest, + com.google.spanner.admin.database.v1.BackupSchedule> + getGetBackupScheduleMethod() { + io.grpc.MethodDescriptor< + com.google.spanner.admin.database.v1.GetBackupScheduleRequest, + com.google.spanner.admin.database.v1.BackupSchedule> + getGetBackupScheduleMethod; + if ((getGetBackupScheduleMethod = DatabaseAdminGrpc.getGetBackupScheduleMethod) == null) { + synchronized (DatabaseAdminGrpc.class) { + if ((getGetBackupScheduleMethod = DatabaseAdminGrpc.getGetBackupScheduleMethod) == null) { + DatabaseAdminGrpc.getGetBackupScheduleMethod = + getGetBackupScheduleMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetBackupSchedule")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.spanner.admin.database.v1.GetBackupScheduleRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.spanner.admin.database.v1.BackupSchedule + .getDefaultInstance())) + .setSchemaDescriptor( + new DatabaseAdminMethodDescriptorSupplier("GetBackupSchedule")) + .build(); + } + } + } + return getGetBackupScheduleMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.spanner.admin.database.v1.UpdateBackupScheduleRequest, + com.google.spanner.admin.database.v1.BackupSchedule> + getUpdateBackupScheduleMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "UpdateBackupSchedule", + requestType = com.google.spanner.admin.database.v1.UpdateBackupScheduleRequest.class, + responseType = com.google.spanner.admin.database.v1.BackupSchedule.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.spanner.admin.database.v1.UpdateBackupScheduleRequest, + com.google.spanner.admin.database.v1.BackupSchedule> + getUpdateBackupScheduleMethod() { + io.grpc.MethodDescriptor< + com.google.spanner.admin.database.v1.UpdateBackupScheduleRequest, + com.google.spanner.admin.database.v1.BackupSchedule> + getUpdateBackupScheduleMethod; + if ((getUpdateBackupScheduleMethod = DatabaseAdminGrpc.getUpdateBackupScheduleMethod) == null) { + synchronized (DatabaseAdminGrpc.class) { + if ((getUpdateBackupScheduleMethod = DatabaseAdminGrpc.getUpdateBackupScheduleMethod) + == null) { + DatabaseAdminGrpc.getUpdateBackupScheduleMethod = + getUpdateBackupScheduleMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "UpdateBackupSchedule")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.spanner.admin.database.v1.UpdateBackupScheduleRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.spanner.admin.database.v1.BackupSchedule + .getDefaultInstance())) + .setSchemaDescriptor( + new DatabaseAdminMethodDescriptorSupplier("UpdateBackupSchedule")) + .build(); + } + } + } + return getUpdateBackupScheduleMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.spanner.admin.database.v1.DeleteBackupScheduleRequest, + com.google.protobuf.Empty> + getDeleteBackupScheduleMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "DeleteBackupSchedule", + requestType = com.google.spanner.admin.database.v1.DeleteBackupScheduleRequest.class, + responseType = com.google.protobuf.Empty.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.spanner.admin.database.v1.DeleteBackupScheduleRequest, + com.google.protobuf.Empty> + getDeleteBackupScheduleMethod() { + io.grpc.MethodDescriptor< + com.google.spanner.admin.database.v1.DeleteBackupScheduleRequest, + com.google.protobuf.Empty> + getDeleteBackupScheduleMethod; + if ((getDeleteBackupScheduleMethod = DatabaseAdminGrpc.getDeleteBackupScheduleMethod) == null) { + synchronized (DatabaseAdminGrpc.class) { + if ((getDeleteBackupScheduleMethod = DatabaseAdminGrpc.getDeleteBackupScheduleMethod) + == null) { + DatabaseAdminGrpc.getDeleteBackupScheduleMethod = + getDeleteBackupScheduleMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "DeleteBackupSchedule")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.spanner.admin.database.v1.DeleteBackupScheduleRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.protobuf.Empty.getDefaultInstance())) + .setSchemaDescriptor( + new DatabaseAdminMethodDescriptorSupplier("DeleteBackupSchedule")) + .build(); + } + } + } + return getDeleteBackupScheduleMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.spanner.admin.database.v1.ListBackupSchedulesRequest, + com.google.spanner.admin.database.v1.ListBackupSchedulesResponse> + getListBackupSchedulesMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ListBackupSchedules", + requestType = com.google.spanner.admin.database.v1.ListBackupSchedulesRequest.class, + responseType = com.google.spanner.admin.database.v1.ListBackupSchedulesResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.spanner.admin.database.v1.ListBackupSchedulesRequest, + com.google.spanner.admin.database.v1.ListBackupSchedulesResponse> + getListBackupSchedulesMethod() { + io.grpc.MethodDescriptor< + com.google.spanner.admin.database.v1.ListBackupSchedulesRequest, + com.google.spanner.admin.database.v1.ListBackupSchedulesResponse> + getListBackupSchedulesMethod; + if ((getListBackupSchedulesMethod = DatabaseAdminGrpc.getListBackupSchedulesMethod) == null) { + synchronized (DatabaseAdminGrpc.class) { + if ((getListBackupSchedulesMethod = DatabaseAdminGrpc.getListBackupSchedulesMethod) + == null) { + DatabaseAdminGrpc.getListBackupSchedulesMethod = + getListBackupSchedulesMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "ListBackupSchedules")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.spanner.admin.database.v1.ListBackupSchedulesRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.spanner.admin.database.v1.ListBackupSchedulesResponse + .getDefaultInstance())) + .setSchemaDescriptor( + new DatabaseAdminMethodDescriptorSupplier("ListBackupSchedules")) + .build(); + } + } + } + return getListBackupSchedulesMethod; + } + /** Creates a new async stub that supports all call types for the service */ public static DatabaseAdminStub newStub(io.grpc.Channel channel) { io.grpc.stub.AbstractStub.StubFactory factory = @@ -1414,6 +1656,81 @@ default void listDatabaseRoles( io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( getListDatabaseRolesMethod(), responseObserver); } + + /** + * + * + *
+     * Creates a new backup schedule.
+     * 
+ */ + default void createBackupSchedule( + com.google.spanner.admin.database.v1.CreateBackupScheduleRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getCreateBackupScheduleMethod(), responseObserver); + } + + /** + * + * + *
+     * Gets backup schedule for the input schedule name.
+     * 
+ */ + default void getBackupSchedule( + com.google.spanner.admin.database.v1.GetBackupScheduleRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getGetBackupScheduleMethod(), responseObserver); + } + + /** + * + * + *
+     * Updates a backup schedule.
+     * 
+ */ + default void updateBackupSchedule( + com.google.spanner.admin.database.v1.UpdateBackupScheduleRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getUpdateBackupScheduleMethod(), responseObserver); + } + + /** + * + * + *
+     * Deletes a backup schedule.
+     * 
+ */ + default void deleteBackupSchedule( + com.google.spanner.admin.database.v1.DeleteBackupScheduleRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getDeleteBackupScheduleMethod(), responseObserver); + } + + /** + * + * + *
+     * Lists all the backup schedules for the database.
+     * 
+ */ + default void listBackupSchedules( + com.google.spanner.admin.database.v1.ListBackupSchedulesRequest request, + io.grpc.stub.StreamObserver< + com.google.spanner.admin.database.v1.ListBackupSchedulesResponse> + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getListBackupSchedulesMethod(), responseObserver); + } } /** @@ -1914,6 +2231,91 @@ public void listDatabaseRoles( request, responseObserver); } + + /** + * + * + *
+     * Creates a new backup schedule.
+     * 
+ */ + public void createBackupSchedule( + com.google.spanner.admin.database.v1.CreateBackupScheduleRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getCreateBackupScheduleMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Gets backup schedule for the input schedule name.
+     * 
+ */ + public void getBackupSchedule( + com.google.spanner.admin.database.v1.GetBackupScheduleRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetBackupScheduleMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Updates a backup schedule.
+     * 
+ */ + public void updateBackupSchedule( + com.google.spanner.admin.database.v1.UpdateBackupScheduleRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getUpdateBackupScheduleMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Deletes a backup schedule.
+     * 
+ */ + public void deleteBackupSchedule( + com.google.spanner.admin.database.v1.DeleteBackupScheduleRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getDeleteBackupScheduleMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Lists all the backup schedules for the database.
+     * 
+ */ + public void listBackupSchedules( + com.google.spanner.admin.database.v1.ListBackupSchedulesRequest request, + io.grpc.stub.StreamObserver< + com.google.spanner.admin.database.v1.ListBackupSchedulesResponse> + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getListBackupSchedulesMethod(), getCallOptions()), + request, + responseObserver); + } } /** @@ -2327,6 +2729,71 @@ public com.google.spanner.admin.database.v1.ListDatabaseRolesResponse listDataba return io.grpc.stub.ClientCalls.blockingUnaryCall( getChannel(), getListDatabaseRolesMethod(), getCallOptions(), request); } + + /** + * + * + *
+     * Creates a new backup schedule.
+     * 
+ */ + public com.google.spanner.admin.database.v1.BackupSchedule createBackupSchedule( + com.google.spanner.admin.database.v1.CreateBackupScheduleRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getCreateBackupScheduleMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Gets backup schedule for the input schedule name.
+     * 
+ */ + public com.google.spanner.admin.database.v1.BackupSchedule getBackupSchedule( + com.google.spanner.admin.database.v1.GetBackupScheduleRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetBackupScheduleMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Updates a backup schedule.
+     * 
+ */ + public com.google.spanner.admin.database.v1.BackupSchedule updateBackupSchedule( + com.google.spanner.admin.database.v1.UpdateBackupScheduleRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getUpdateBackupScheduleMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Deletes a backup schedule.
+     * 
+ */ + public com.google.protobuf.Empty deleteBackupSchedule( + com.google.spanner.admin.database.v1.DeleteBackupScheduleRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getDeleteBackupScheduleMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Lists all the backup schedules for the database.
+     * 
+ */ + public com.google.spanner.admin.database.v1.ListBackupSchedulesResponse listBackupSchedules( + com.google.spanner.admin.database.v1.ListBackupSchedulesRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getListBackupSchedulesMethod(), getCallOptions(), request); + } } /** @@ -2753,6 +3220,79 @@ protected DatabaseAdminFutureStub build( return io.grpc.stub.ClientCalls.futureUnaryCall( getChannel().newCall(getListDatabaseRolesMethod(), getCallOptions()), request); } + + /** + * + * + *
+     * Creates a new backup schedule.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.spanner.admin.database.v1.BackupSchedule> + createBackupSchedule( + com.google.spanner.admin.database.v1.CreateBackupScheduleRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getCreateBackupScheduleMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Gets backup schedule for the input schedule name.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.spanner.admin.database.v1.BackupSchedule> + getBackupSchedule(com.google.spanner.admin.database.v1.GetBackupScheduleRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetBackupScheduleMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Updates a backup schedule.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.spanner.admin.database.v1.BackupSchedule> + updateBackupSchedule( + com.google.spanner.admin.database.v1.UpdateBackupScheduleRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getUpdateBackupScheduleMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Deletes a backup schedule.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + deleteBackupSchedule( + com.google.spanner.admin.database.v1.DeleteBackupScheduleRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getDeleteBackupScheduleMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Lists all the backup schedules for the database.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.spanner.admin.database.v1.ListBackupSchedulesResponse> + listBackupSchedules( + com.google.spanner.admin.database.v1.ListBackupSchedulesRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getListBackupSchedulesMethod(), getCallOptions()), request); + } } private static final int METHODID_LIST_DATABASES = 0; @@ -2775,6 +3315,11 @@ protected DatabaseAdminFutureStub build( private static final int METHODID_LIST_DATABASE_OPERATIONS = 17; private static final int METHODID_LIST_BACKUP_OPERATIONS = 18; private static final int METHODID_LIST_DATABASE_ROLES = 19; + private static final int METHODID_CREATE_BACKUP_SCHEDULE = 20; + private static final int METHODID_GET_BACKUP_SCHEDULE = 21; + private static final int METHODID_UPDATE_BACKUP_SCHEDULE = 22; + private static final int METHODID_DELETE_BACKUP_SCHEDULE = 23; + private static final int METHODID_LIST_BACKUP_SCHEDULES = 24; private static final class MethodHandlers implements io.grpc.stub.ServerCalls.UnaryMethod, @@ -2909,6 +3454,36 @@ public void invoke(Req request, io.grpc.stub.StreamObserver responseObserv com.google.spanner.admin.database.v1.ListDatabaseRolesResponse>) responseObserver); break; + case METHODID_CREATE_BACKUP_SCHEDULE: + serviceImpl.createBackupSchedule( + (com.google.spanner.admin.database.v1.CreateBackupScheduleRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_GET_BACKUP_SCHEDULE: + serviceImpl.getBackupSchedule( + (com.google.spanner.admin.database.v1.GetBackupScheduleRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_UPDATE_BACKUP_SCHEDULE: + serviceImpl.updateBackupSchedule( + (com.google.spanner.admin.database.v1.UpdateBackupScheduleRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_DELETE_BACKUP_SCHEDULE: + serviceImpl.deleteBackupSchedule( + (com.google.spanner.admin.database.v1.DeleteBackupScheduleRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_LIST_BACKUP_SCHEDULES: + serviceImpl.listBackupSchedules( + (com.google.spanner.admin.database.v1.ListBackupSchedulesRequest) request, + (io.grpc.stub.StreamObserver< + com.google.spanner.admin.database.v1.ListBackupSchedulesResponse>) + responseObserver); + break; default: throw new AssertionError(); } @@ -3052,6 +3627,40 @@ public static final io.grpc.ServerServiceDefinition bindService(AsyncService ser com.google.spanner.admin.database.v1.ListDatabaseRolesRequest, com.google.spanner.admin.database.v1.ListDatabaseRolesResponse>( service, METHODID_LIST_DATABASE_ROLES))) + .addMethod( + getCreateBackupScheduleMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.spanner.admin.database.v1.CreateBackupScheduleRequest, + com.google.spanner.admin.database.v1.BackupSchedule>( + service, METHODID_CREATE_BACKUP_SCHEDULE))) + .addMethod( + getGetBackupScheduleMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.spanner.admin.database.v1.GetBackupScheduleRequest, + com.google.spanner.admin.database.v1.BackupSchedule>( + service, METHODID_GET_BACKUP_SCHEDULE))) + .addMethod( + getUpdateBackupScheduleMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.spanner.admin.database.v1.UpdateBackupScheduleRequest, + com.google.spanner.admin.database.v1.BackupSchedule>( + service, METHODID_UPDATE_BACKUP_SCHEDULE))) + .addMethod( + getDeleteBackupScheduleMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.spanner.admin.database.v1.DeleteBackupScheduleRequest, + com.google.protobuf.Empty>(service, METHODID_DELETE_BACKUP_SCHEDULE))) + .addMethod( + getListBackupSchedulesMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.spanner.admin.database.v1.ListBackupSchedulesRequest, + com.google.spanner.admin.database.v1.ListBackupSchedulesResponse>( + service, METHODID_LIST_BACKUP_SCHEDULES))) .build(); } @@ -3123,6 +3732,11 @@ public static io.grpc.ServiceDescriptor getServiceDescriptor() { .addMethod(getListDatabaseOperationsMethod()) .addMethod(getListBackupOperationsMethod()) .addMethod(getListDatabaseRolesMethod()) + .addMethod(getCreateBackupScheduleMethod()) + .addMethod(getGetBackupScheduleMethod()) + .addMethod(getUpdateBackupScheduleMethod()) + .addMethod(getDeleteBackupScheduleMethod()) + .addMethod(getListBackupSchedulesMethod()) .build(); } } diff --git a/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/Backup.java b/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/Backup.java index 1284d3e6cfc..813c859b36e 100644 --- a/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/Backup.java +++ b/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/Backup.java @@ -46,6 +46,7 @@ private Backup() { encryptionInformation_ = java.util.Collections.emptyList(); databaseDialect_ = 0; referencingBackups_ = com.google.protobuf.LazyStringArrayList.emptyList(); + backupSchedules_ = com.google.protobuf.LazyStringArrayList.emptyList(); } @java.lang.Override @@ -1069,6 +1070,106 @@ public com.google.protobuf.TimestampOrBuilder getMaxExpireTimeOrBuilder() { : maxExpireTime_; } + public static final int BACKUP_SCHEDULES_FIELD_NUMBER = 14; + + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList backupSchedules_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + /** + * + * + *
+   * Output only. List of backup schedule URIs that are associated with
+   * creating this backup. This is only applicable for scheduled backups, and
+   * is empty for on-demand backups.
+   *
+   * To optimize for storage, whenever possible, multiple schedules are
+   * collapsed together to create one backup. In such cases, this field captures
+   * the list of all backup schedule URIs that are associated with creating
+   * this backup. If collapsing is not done, then this field captures the
+   * single backup schedule URI associated with creating this backup.
+   * 
+ * + * repeated string backup_schedules = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return A list containing the backupSchedules. + */ + public com.google.protobuf.ProtocolStringList getBackupSchedulesList() { + return backupSchedules_; + } + /** + * + * + *
+   * Output only. List of backup schedule URIs that are associated with
+   * creating this backup. This is only applicable for scheduled backups, and
+   * is empty for on-demand backups.
+   *
+   * To optimize for storage, whenever possible, multiple schedules are
+   * collapsed together to create one backup. In such cases, this field captures
+   * the list of all backup schedule URIs that are associated with creating
+   * this backup. If collapsing is not done, then this field captures the
+   * single backup schedule URI associated with creating this backup.
+   * 
+ * + * repeated string backup_schedules = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The count of backupSchedules. + */ + public int getBackupSchedulesCount() { + return backupSchedules_.size(); + } + /** + * + * + *
+   * Output only. List of backup schedule URIs that are associated with
+   * creating this backup. This is only applicable for scheduled backups, and
+   * is empty for on-demand backups.
+   *
+   * To optimize for storage, whenever possible, multiple schedules are
+   * collapsed together to create one backup. In such cases, this field captures
+   * the list of all backup schedule URIs that are associated with creating
+   * this backup. If collapsing is not done, then this field captures the
+   * single backup schedule URI associated with creating this backup.
+   * 
+ * + * repeated string backup_schedules = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param index The index of the element to return. + * @return The backupSchedules at the given index. + */ + public java.lang.String getBackupSchedules(int index) { + return backupSchedules_.get(index); + } + /** + * + * + *
+   * Output only. List of backup schedule URIs that are associated with
+   * creating this backup. This is only applicable for scheduled backups, and
+   * is empty for on-demand backups.
+   *
+   * To optimize for storage, whenever possible, multiple schedules are
+   * collapsed together to create one backup. In such cases, this field captures
+   * the list of all backup schedule URIs that are associated with creating
+   * this backup. If collapsing is not done, then this field captures the
+   * single backup schedule URI associated with creating this backup.
+   * 
+ * + * repeated string backup_schedules = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param index The index of the value to return. + * @return The bytes of the backupSchedules at the given index. + */ + public com.google.protobuf.ByteString getBackupSchedulesBytes(int index) { + return backupSchedules_.getByteString(index); + } + private byte memoizedIsInitialized = -1; @java.lang.Override @@ -1125,6 +1226,9 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io for (int i = 0; i < encryptionInformation_.size(); i++) { output.writeMessage(13, encryptionInformation_.get(i)); } + for (int i = 0; i < backupSchedules_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 14, backupSchedules_.getRaw(i)); + } getUnknownFields().writeTo(output); } @@ -1187,6 +1291,14 @@ public int getSerializedSize() { com.google.protobuf.CodedOutputStream.computeMessageSize( 13, encryptionInformation_.get(i)); } + { + int dataSize = 0; + for (int i = 0; i < backupSchedules_.size(); i++) { + dataSize += computeStringSizeNoTag(backupSchedules_.getRaw(i)); + } + size += dataSize; + size += 1 * getBackupSchedulesList().size(); + } size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; @@ -1231,6 +1343,7 @@ public boolean equals(final java.lang.Object obj) { if (hasMaxExpireTime()) { if (!getMaxExpireTime().equals(other.getMaxExpireTime())) return false; } + if (!getBackupSchedulesList().equals(other.getBackupSchedulesList())) return false; if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -1284,6 +1397,10 @@ public int hashCode() { hash = (37 * hash) + MAX_EXPIRE_TIME_FIELD_NUMBER; hash = (53 * hash) + getMaxExpireTime().hashCode(); } + if (getBackupSchedulesCount() > 0) { + hash = (37 * hash) + BACKUP_SCHEDULES_FIELD_NUMBER; + hash = (53 * hash) + getBackupSchedulesList().hashCode(); + } hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; @@ -1476,6 +1593,7 @@ public Builder clear() { maxExpireTimeBuilder_.dispose(); maxExpireTimeBuilder_ = null; } + backupSchedules_ = com.google.protobuf.LazyStringArrayList.emptyList(); return this; } @@ -1572,6 +1690,10 @@ private void buildPartial0(com.google.spanner.admin.database.v1.Backup result) { maxExpireTimeBuilder_ == null ? maxExpireTime_ : maxExpireTimeBuilder_.build(); to_bitField0_ |= 0x00000010; } + if (((from_bitField0_ & 0x00002000) != 0)) { + backupSchedules_.makeImmutable(); + result.backupSchedules_ = backupSchedules_; + } result.bitField0_ |= to_bitField0_; } @@ -1701,6 +1823,16 @@ public Builder mergeFrom(com.google.spanner.admin.database.v1.Backup other) { if (other.hasMaxExpireTime()) { mergeMaxExpireTime(other.getMaxExpireTime()); } + if (!other.backupSchedules_.isEmpty()) { + if (backupSchedules_.isEmpty()) { + backupSchedules_ = other.backupSchedules_; + bitField0_ |= 0x00002000; + } else { + ensureBackupSchedulesIsMutable(); + backupSchedules_.addAll(other.backupSchedules_); + } + onChanged(); + } this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; @@ -1815,6 +1947,13 @@ public Builder mergeFrom( } break; } // case 106 + case 114: + { + java.lang.String s = input.readStringRequireUtf8(); + ensureBackupSchedulesIsMutable(); + backupSchedules_.add(s); + break; + } // case 114 default: { if (!super.parseUnknownField(input, extensionRegistry, tag)) { @@ -4506,6 +4645,261 @@ public com.google.protobuf.TimestampOrBuilder getMaxExpireTimeOrBuilder() { return maxExpireTimeBuilder_; } + private com.google.protobuf.LazyStringArrayList backupSchedules_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + + private void ensureBackupSchedulesIsMutable() { + if (!backupSchedules_.isModifiable()) { + backupSchedules_ = new com.google.protobuf.LazyStringArrayList(backupSchedules_); + } + bitField0_ |= 0x00002000; + } + /** + * + * + *
+     * Output only. List of backup schedule URIs that are associated with
+     * creating this backup. This is only applicable for scheduled backups, and
+     * is empty for on-demand backups.
+     *
+     * To optimize for storage, whenever possible, multiple schedules are
+     * collapsed together to create one backup. In such cases, this field captures
+     * the list of all backup schedule URIs that are associated with creating
+     * this backup. If collapsing is not done, then this field captures the
+     * single backup schedule URI associated with creating this backup.
+     * 
+ * + * repeated string backup_schedules = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return A list containing the backupSchedules. + */ + public com.google.protobuf.ProtocolStringList getBackupSchedulesList() { + backupSchedules_.makeImmutable(); + return backupSchedules_; + } + /** + * + * + *
+     * Output only. List of backup schedule URIs that are associated with
+     * creating this backup. This is only applicable for scheduled backups, and
+     * is empty for on-demand backups.
+     *
+     * To optimize for storage, whenever possible, multiple schedules are
+     * collapsed together to create one backup. In such cases, this field captures
+     * the list of all backup schedule URIs that are associated with creating
+     * this backup. If collapsing is not done, then this field captures the
+     * single backup schedule URI associated with creating this backup.
+     * 
+ * + * repeated string backup_schedules = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The count of backupSchedules. + */ + public int getBackupSchedulesCount() { + return backupSchedules_.size(); + } + /** + * + * + *
+     * Output only. List of backup schedule URIs that are associated with
+     * creating this backup. This is only applicable for scheduled backups, and
+     * is empty for on-demand backups.
+     *
+     * To optimize for storage, whenever possible, multiple schedules are
+     * collapsed together to create one backup. In such cases, this field captures
+     * the list of all backup schedule URIs that are associated with creating
+     * this backup. If collapsing is not done, then this field captures the
+     * single backup schedule URI associated with creating this backup.
+     * 
+ * + * repeated string backup_schedules = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param index The index of the element to return. + * @return The backupSchedules at the given index. + */ + public java.lang.String getBackupSchedules(int index) { + return backupSchedules_.get(index); + } + /** + * + * + *
+     * Output only. List of backup schedule URIs that are associated with
+     * creating this backup. This is only applicable for scheduled backups, and
+     * is empty for on-demand backups.
+     *
+     * To optimize for storage, whenever possible, multiple schedules are
+     * collapsed together to create one backup. In such cases, this field captures
+     * the list of all backup schedule URIs that are associated with creating
+     * this backup. If collapsing is not done, then this field captures the
+     * single backup schedule URI associated with creating this backup.
+     * 
+ * + * repeated string backup_schedules = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param index The index of the value to return. + * @return The bytes of the backupSchedules at the given index. + */ + public com.google.protobuf.ByteString getBackupSchedulesBytes(int index) { + return backupSchedules_.getByteString(index); + } + /** + * + * + *
+     * Output only. List of backup schedule URIs that are associated with
+     * creating this backup. This is only applicable for scheduled backups, and
+     * is empty for on-demand backups.
+     *
+     * To optimize for storage, whenever possible, multiple schedules are
+     * collapsed together to create one backup. In such cases, this field captures
+     * the list of all backup schedule URIs that are associated with creating
+     * this backup. If collapsing is not done, then this field captures the
+     * single backup schedule URI associated with creating this backup.
+     * 
+ * + * repeated string backup_schedules = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param index The index to set the value at. + * @param value The backupSchedules to set. + * @return This builder for chaining. + */ + public Builder setBackupSchedules(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureBackupSchedulesIsMutable(); + backupSchedules_.set(index, value); + bitField0_ |= 0x00002000; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. List of backup schedule URIs that are associated with
+     * creating this backup. This is only applicable for scheduled backups, and
+     * is empty for on-demand backups.
+     *
+     * To optimize for storage, whenever possible, multiple schedules are
+     * collapsed together to create one backup. In such cases, this field captures
+     * the list of all backup schedule URIs that are associated with creating
+     * this backup. If collapsing is not done, then this field captures the
+     * single backup schedule URI associated with creating this backup.
+     * 
+ * + * repeated string backup_schedules = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The backupSchedules to add. + * @return This builder for chaining. + */ + public Builder addBackupSchedules(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureBackupSchedulesIsMutable(); + backupSchedules_.add(value); + bitField0_ |= 0x00002000; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. List of backup schedule URIs that are associated with
+     * creating this backup. This is only applicable for scheduled backups, and
+     * is empty for on-demand backups.
+     *
+     * To optimize for storage, whenever possible, multiple schedules are
+     * collapsed together to create one backup. In such cases, this field captures
+     * the list of all backup schedule URIs that are associated with creating
+     * this backup. If collapsing is not done, then this field captures the
+     * single backup schedule URI associated with creating this backup.
+     * 
+ * + * repeated string backup_schedules = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param values The backupSchedules to add. + * @return This builder for chaining. + */ + public Builder addAllBackupSchedules(java.lang.Iterable values) { + ensureBackupSchedulesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, backupSchedules_); + bitField0_ |= 0x00002000; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. List of backup schedule URIs that are associated with
+     * creating this backup. This is only applicable for scheduled backups, and
+     * is empty for on-demand backups.
+     *
+     * To optimize for storage, whenever possible, multiple schedules are
+     * collapsed together to create one backup. In such cases, this field captures
+     * the list of all backup schedule URIs that are associated with creating
+     * this backup. If collapsing is not done, then this field captures the
+     * single backup schedule URI associated with creating this backup.
+     * 
+ * + * repeated string backup_schedules = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return This builder for chaining. + */ + public Builder clearBackupSchedules() { + backupSchedules_ = com.google.protobuf.LazyStringArrayList.emptyList(); + bitField0_ = (bitField0_ & ~0x00002000); + ; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. List of backup schedule URIs that are associated with
+     * creating this backup. This is only applicable for scheduled backups, and
+     * is empty for on-demand backups.
+     *
+     * To optimize for storage, whenever possible, multiple schedules are
+     * collapsed together to create one backup. In such cases, this field captures
+     * the list of all backup schedule URIs that are associated with creating
+     * this backup. If collapsing is not done, then this field captures the
+     * single backup schedule URI associated with creating this backup.
+     * 
+ * + * repeated string backup_schedules = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The bytes of the backupSchedules to add. + * @return This builder for chaining. + */ + public Builder addBackupSchedulesBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureBackupSchedulesIsMutable(); + backupSchedules_.add(value); + bitField0_ |= 0x00002000; + onChanged(); + return this; + } + @java.lang.Override public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { return super.setUnknownFields(unknownFields); diff --git a/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/BackupOrBuilder.java b/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/BackupOrBuilder.java index c3917c39f62..ac1eec6a02e 100644 --- a/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/BackupOrBuilder.java +++ b/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/BackupOrBuilder.java @@ -675,4 +675,91 @@ com.google.spanner.admin.database.v1.EncryptionInfoOrBuilder getEncryptionInform * */ com.google.protobuf.TimestampOrBuilder getMaxExpireTimeOrBuilder(); + + /** + * + * + *
+   * Output only. List of backup schedule URIs that are associated with
+   * creating this backup. This is only applicable for scheduled backups, and
+   * is empty for on-demand backups.
+   *
+   * To optimize for storage, whenever possible, multiple schedules are
+   * collapsed together to create one backup. In such cases, this field captures
+   * the list of all backup schedule URIs that are associated with creating
+   * this backup. If collapsing is not done, then this field captures the
+   * single backup schedule URI associated with creating this backup.
+   * 
+ * + * repeated string backup_schedules = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return A list containing the backupSchedules. + */ + java.util.List getBackupSchedulesList(); + /** + * + * + *
+   * Output only. List of backup schedule URIs that are associated with
+   * creating this backup. This is only applicable for scheduled backups, and
+   * is empty for on-demand backups.
+   *
+   * To optimize for storage, whenever possible, multiple schedules are
+   * collapsed together to create one backup. In such cases, this field captures
+   * the list of all backup schedule URIs that are associated with creating
+   * this backup. If collapsing is not done, then this field captures the
+   * single backup schedule URI associated with creating this backup.
+   * 
+ * + * repeated string backup_schedules = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The count of backupSchedules. + */ + int getBackupSchedulesCount(); + /** + * + * + *
+   * Output only. List of backup schedule URIs that are associated with
+   * creating this backup. This is only applicable for scheduled backups, and
+   * is empty for on-demand backups.
+   *
+   * To optimize for storage, whenever possible, multiple schedules are
+   * collapsed together to create one backup. In such cases, this field captures
+   * the list of all backup schedule URIs that are associated with creating
+   * this backup. If collapsing is not done, then this field captures the
+   * single backup schedule URI associated with creating this backup.
+   * 
+ * + * repeated string backup_schedules = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param index The index of the element to return. + * @return The backupSchedules at the given index. + */ + java.lang.String getBackupSchedules(int index); + /** + * + * + *
+   * Output only. List of backup schedule URIs that are associated with
+   * creating this backup. This is only applicable for scheduled backups, and
+   * is empty for on-demand backups.
+   *
+   * To optimize for storage, whenever possible, multiple schedules are
+   * collapsed together to create one backup. In such cases, this field captures
+   * the list of all backup schedule URIs that are associated with creating
+   * this backup. If collapsing is not done, then this field captures the
+   * single backup schedule URI associated with creating this backup.
+   * 
+ * + * repeated string backup_schedules = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param index The index of the value to return. + * @return The bytes of the backupSchedules at the given index. + */ + com.google.protobuf.ByteString getBackupSchedulesBytes(int index); } diff --git a/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/BackupProto.java b/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/BackupProto.java index 4ab53f9a43c..4f00e1d577c 100644 --- a/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/BackupProto.java +++ b/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/BackupProto.java @@ -88,6 +88,10 @@ public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry r internal_static_google_spanner_admin_database_v1_CopyBackupEncryptionConfig_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_google_spanner_admin_database_v1_CopyBackupEncryptionConfig_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_spanner_admin_database_v1_FullBackupSpec_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_spanner_admin_database_v1_FullBackupSpec_fieldAccessorTable; public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { return descriptor; @@ -104,7 +108,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "g/operations.proto\032 google/protobuf/fiel" + "d_mask.proto\032\037google/protobuf/timestamp." + "proto\032-google/spanner/admin/database/v1/" - + "common.proto\"\232\007\n\006Backup\0226\n\010database\030\002 \001(" + + "common.proto\"\271\007\n\006Backup\0226\n\010database\030\002 \001(" + "\tB$\372A!\n\037spanner.googleapis.com/Database\022" + "0\n\014version_time\030\t \001(\0132\032.google.protobuf." + "Timestamp\022/\n\013expire_time\030\003 \001(\0132\032.google." @@ -123,91 +127,92 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "DatabaseDialectB\003\340A\003\022B\n\023referencing_back" + "ups\030\013 \003(\tB%\340A\003\372A\037\n\035spanner.googleapis.co" + "m/Backup\0228\n\017max_expire_time\030\014 \001(\0132\032.goog" - + "le.protobuf.TimestampB\003\340A\003\"7\n\005State\022\025\n\021S" - + "TATE_UNSPECIFIED\020\000\022\014\n\010CREATING\020\001\022\t\n\005READ" - + "Y\020\002:\\\352AY\n\035spanner.googleapis.com/Backup\022" - + "8projects/{project}/instances/{instance}" - + "/backups/{backup}\"\205\002\n\023CreateBackupReques" + + "le.protobuf.TimestampB\003\340A\003\022\035\n\020backup_sch" + + "edules\030\016 \003(\tB\003\340A\003\"7\n\005State\022\025\n\021STATE_UNSP" + + "ECIFIED\020\000\022\014\n\010CREATING\020\001\022\t\n\005READY\020\002:\\\352AY\n" + + "\035spanner.googleapis.com/Backup\0228projects" + + "/{project}/instances/{instance}/backups/" + + "{backup}\"\205\002\n\023CreateBackupRequest\0227\n\006pare" + + "nt\030\001 \001(\tB\'\340A\002\372A!\n\037spanner.googleapis.com" + + "/Instance\022\026\n\tbackup_id\030\002 \001(\tB\003\340A\002\022=\n\006bac" + + "kup\030\003 \001(\0132(.google.spanner.admin.databas" + + "e.v1.BackupB\003\340A\002\022^\n\021encryption_config\030\004 " + + "\001(\0132>.google.spanner.admin.database.v1.C" + + "reateBackupEncryptionConfigB\003\340A\001\"\370\001\n\024Cre" + + "ateBackupMetadata\0220\n\004name\030\001 \001(\tB\"\372A\037\n\035sp" + + "anner.googleapis.com/Backup\0226\n\010database\030" + + "\002 \001(\tB$\372A!\n\037spanner.googleapis.com/Datab" + + "ase\022E\n\010progress\030\003 \001(\01323.google.spanner.a" + + "dmin.database.v1.OperationProgress\022/\n\013ca" + + "ncel_time\030\004 \001(\0132\032.google.protobuf.Timest" + + "amp\"\266\002\n\021CopyBackupRequest\0227\n\006parent\030\001 \001(" + + "\tB\'\340A\002\372A!\n\037spanner.googleapis.com/Instan" + + "ce\022\026\n\tbackup_id\030\002 \001(\tB\003\340A\002\022<\n\rsource_bac" + + "kup\030\003 \001(\tB%\340A\002\372A\037\n\035spanner.googleapis.co" + + "m/Backup\0224\n\013expire_time\030\004 \001(\0132\032.google.p" + + "rotobuf.TimestampB\003\340A\002\022\\\n\021encryption_con" + + "fig\030\005 \001(\0132<.google.spanner.admin.databas" + + "e.v1.CopyBackupEncryptionConfigB\003\340A\001\"\371\001\n" + + "\022CopyBackupMetadata\0220\n\004name\030\001 \001(\tB\"\372A\037\n\035" + + "spanner.googleapis.com/Backup\0229\n\rsource_" + + "backup\030\002 \001(\tB\"\372A\037\n\035spanner.googleapis.co" + + "m/Backup\022E\n\010progress\030\003 \001(\01323.google.span" + + "ner.admin.database.v1.OperationProgress\022" + + "/\n\013cancel_time\030\004 \001(\0132\032.google.protobuf.T" + + "imestamp\"\212\001\n\023UpdateBackupRequest\022=\n\006back" + + "up\030\001 \001(\0132(.google.spanner.admin.database" + + ".v1.BackupB\003\340A\002\0224\n\013update_mask\030\002 \001(\0132\032.g" + + "oogle.protobuf.FieldMaskB\003\340A\002\"G\n\020GetBack" + + "upRequest\0223\n\004name\030\001 \001(\tB%\340A\002\372A\037\n\035spanner" + + ".googleapis.com/Backup\"J\n\023DeleteBackupRe" + + "quest\0223\n\004name\030\001 \001(\tB%\340A\002\372A\037\n\035spanner.goo" + + "gleapis.com/Backup\"\204\001\n\022ListBackupsReques" + "t\0227\n\006parent\030\001 \001(\tB\'\340A\002\372A!\n\037spanner.googl" - + "eapis.com/Instance\022\026\n\tbackup_id\030\002 \001(\tB\003\340" - + "A\002\022=\n\006backup\030\003 \001(\0132(.google.spanner.admi" - + "n.database.v1.BackupB\003\340A\002\022^\n\021encryption_" - + "config\030\004 \001(\0132>.google.spanner.admin.data" - + "base.v1.CreateBackupEncryptionConfigB\003\340A" - + "\001\"\370\001\n\024CreateBackupMetadata\0220\n\004name\030\001 \001(\t" - + "B\"\372A\037\n\035spanner.googleapis.com/Backup\0226\n\010" - + "database\030\002 \001(\tB$\372A!\n\037spanner.googleapis." - + "com/Database\022E\n\010progress\030\003 \001(\01323.google." - + "spanner.admin.database.v1.OperationProgr" - + "ess\022/\n\013cancel_time\030\004 \001(\0132\032.google.protob" - + "uf.Timestamp\"\266\002\n\021CopyBackupRequest\0227\n\006pa" - + "rent\030\001 \001(\tB\'\340A\002\372A!\n\037spanner.googleapis.c" - + "om/Instance\022\026\n\tbackup_id\030\002 \001(\tB\003\340A\002\022<\n\rs" - + "ource_backup\030\003 \001(\tB%\340A\002\372A\037\n\035spanner.goog" - + "leapis.com/Backup\0224\n\013expire_time\030\004 \001(\0132\032" - + ".google.protobuf.TimestampB\003\340A\002\022\\\n\021encry" - + "ption_config\030\005 \001(\0132<.google.spanner.admi" - + "n.database.v1.CopyBackupEncryptionConfig" - + "B\003\340A\001\"\371\001\n\022CopyBackupMetadata\0220\n\004name\030\001 \001" - + "(\tB\"\372A\037\n\035spanner.googleapis.com/Backup\0229" - + "\n\rsource_backup\030\002 \001(\tB\"\372A\037\n\035spanner.goog" - + "leapis.com/Backup\022E\n\010progress\030\003 \001(\01323.go" - + "ogle.spanner.admin.database.v1.Operation" - + "Progress\022/\n\013cancel_time\030\004 \001(\0132\032.google.p" - + "rotobuf.Timestamp\"\212\001\n\023UpdateBackupReques" - + "t\022=\n\006backup\030\001 \001(\0132(.google.spanner.admin" - + ".database.v1.BackupB\003\340A\002\0224\n\013update_mask\030" - + "\002 \001(\0132\032.google.protobuf.FieldMaskB\003\340A\002\"G" - + "\n\020GetBackupRequest\0223\n\004name\030\001 \001(\tB%\340A\002\372A\037" - + "\n\035spanner.googleapis.com/Backup\"J\n\023Delet" - + "eBackupRequest\0223\n\004name\030\001 \001(\tB%\340A\002\372A\037\n\035sp" - + "anner.googleapis.com/Backup\"\204\001\n\022ListBack" - + "upsRequest\0227\n\006parent\030\001 \001(\tB\'\340A\002\372A!\n\037span" - + "ner.googleapis.com/Instance\022\016\n\006filter\030\002 " - + "\001(\t\022\021\n\tpage_size\030\003 \001(\005\022\022\n\npage_token\030\004 \001" - + "(\t\"i\n\023ListBackupsResponse\0229\n\007backups\030\001 \003" - + "(\0132(.google.spanner.admin.database.v1.Ba" - + "ckup\022\027\n\017next_page_token\030\002 \001(\t\"\215\001\n\033ListBa" - + "ckupOperationsRequest\0227\n\006parent\030\001 \001(\tB\'\340" - + "A\002\372A!\n\037spanner.googleapis.com/Instance\022\016" - + "\n\006filter\030\002 \001(\t\022\021\n\tpage_size\030\003 \001(\005\022\022\n\npag" - + "e_token\030\004 \001(\t\"j\n\034ListBackupOperationsRes" - + "ponse\0221\n\noperations\030\001 \003(\0132\035.google.longr" - + "unning.Operation\022\027\n\017next_page_token\030\002 \001(" - + "\t\"\342\001\n\nBackupInfo\0222\n\006backup\030\001 \001(\tB\"\372A\037\n\035s" - + "panner.googleapis.com/Backup\0220\n\014version_" - + "time\030\004 \001(\0132\032.google.protobuf.Timestamp\022/" - + "\n\013create_time\030\002 \001(\0132\032.google.protobuf.Ti" - + "mestamp\022=\n\017source_database\030\003 \001(\tB$\372A!\n\037s" - + "panner.googleapis.com/Database\"\237\003\n\034Creat" - + "eBackupEncryptionConfig\022k\n\017encryption_ty" - + "pe\030\001 \001(\0162M.google.spanner.admin.database" - + ".v1.CreateBackupEncryptionConfig.Encrypt" - + "ionTypeB\003\340A\002\022?\n\014kms_key_name\030\002 \001(\tB)\340A\001\372" - + "A#\n!cloudkms.googleapis.com/CryptoKey\022@\n" - + "\rkms_key_names\030\003 \003(\tB)\340A\001\372A#\n!cloudkms.g" - + "oogleapis.com/CryptoKey\"\216\001\n\016EncryptionTy" - + "pe\022\037\n\033ENCRYPTION_TYPE_UNSPECIFIED\020\000\022\033\n\027U" - + "SE_DATABASE_ENCRYPTION\020\001\022\035\n\031GOOGLE_DEFAU" - + "LT_ENCRYPTION\020\002\022\037\n\033CUSTOMER_MANAGED_ENCR" - + "YPTION\020\003\"\253\003\n\032CopyBackupEncryptionConfig\022" - + "i\n\017encryption_type\030\001 \001(\0162K.google.spanne" - + "r.admin.database.v1.CopyBackupEncryption" - + "Config.EncryptionTypeB\003\340A\002\022?\n\014kms_key_na" - + "me\030\002 \001(\tB)\340A\001\372A#\n!cloudkms.googleapis.co" - + "m/CryptoKey\022@\n\rkms_key_names\030\003 \003(\tB)\340A\001\372" - + "A#\n!cloudkms.googleapis.com/CryptoKey\"\236\001" - + "\n\016EncryptionType\022\037\n\033ENCRYPTION_TYPE_UNSP" - + "ECIFIED\020\000\022+\n\'USE_CONFIG_DEFAULT_OR_BACKU" - + "P_ENCRYPTION\020\001\022\035\n\031GOOGLE_DEFAULT_ENCRYPT" - + "ION\020\002\022\037\n\033CUSTOMER_MANAGED_ENCRYPTION\020\003B\375" - + "\001\n$com.google.spanner.admin.database.v1B" - + "\013BackupProtoP\001ZFcloud.google.com/go/span" - + "ner/admin/database/apiv1/databasepb;data" - + "basepb\252\002&Google.Cloud.Spanner.Admin.Data" - + "base.V1\312\002&Google\\Cloud\\Spanner\\Admin\\Dat" - + "abase\\V1\352\002+Google::Cloud::Spanner::Admin" - + "::Database::V1b\006proto3" + + "eapis.com/Instance\022\016\n\006filter\030\002 \001(\t\022\021\n\tpa" + + "ge_size\030\003 \001(\005\022\022\n\npage_token\030\004 \001(\t\"i\n\023Lis" + + "tBackupsResponse\0229\n\007backups\030\001 \003(\0132(.goog" + + "le.spanner.admin.database.v1.Backup\022\027\n\017n" + + "ext_page_token\030\002 \001(\t\"\215\001\n\033ListBackupOpera" + + "tionsRequest\0227\n\006parent\030\001 \001(\tB\'\340A\002\372A!\n\037sp" + + "anner.googleapis.com/Instance\022\016\n\006filter\030" + + "\002 \001(\t\022\021\n\tpage_size\030\003 \001(\005\022\022\n\npage_token\030\004" + + " \001(\t\"j\n\034ListBackupOperationsResponse\0221\n\n" + + "operations\030\001 \003(\0132\035.google.longrunning.Op" + + "eration\022\027\n\017next_page_token\030\002 \001(\t\"\342\001\n\nBac" + + "kupInfo\0222\n\006backup\030\001 \001(\tB\"\372A\037\n\035spanner.go" + + "ogleapis.com/Backup\0220\n\014version_time\030\004 \001(" + + "\0132\032.google.protobuf.Timestamp\022/\n\013create_" + + "time\030\002 \001(\0132\032.google.protobuf.Timestamp\022=" + + "\n\017source_database\030\003 \001(\tB$\372A!\n\037spanner.go" + + "ogleapis.com/Database\"\237\003\n\034CreateBackupEn" + + "cryptionConfig\022k\n\017encryption_type\030\001 \001(\0162" + + "M.google.spanner.admin.database.v1.Creat" + + "eBackupEncryptionConfig.EncryptionTypeB\003" + + "\340A\002\022?\n\014kms_key_name\030\002 \001(\tB)\340A\001\372A#\n!cloud" + + "kms.googleapis.com/CryptoKey\022@\n\rkms_key_" + + "names\030\003 \003(\tB)\340A\001\372A#\n!cloudkms.googleapis" + + ".com/CryptoKey\"\216\001\n\016EncryptionType\022\037\n\033ENC" + + "RYPTION_TYPE_UNSPECIFIED\020\000\022\033\n\027USE_DATABA" + + "SE_ENCRYPTION\020\001\022\035\n\031GOOGLE_DEFAULT_ENCRYP" + + "TION\020\002\022\037\n\033CUSTOMER_MANAGED_ENCRYPTION\020\003\"" + + "\253\003\n\032CopyBackupEncryptionConfig\022i\n\017encryp" + + "tion_type\030\001 \001(\0162K.google.spanner.admin.d" + + "atabase.v1.CopyBackupEncryptionConfig.En" + + "cryptionTypeB\003\340A\002\022?\n\014kms_key_name\030\002 \001(\tB" + + ")\340A\001\372A#\n!cloudkms.googleapis.com/CryptoK" + + "ey\022@\n\rkms_key_names\030\003 \003(\tB)\340A\001\372A#\n!cloud" + + "kms.googleapis.com/CryptoKey\"\236\001\n\016Encrypt" + + "ionType\022\037\n\033ENCRYPTION_TYPE_UNSPECIFIED\020\000" + + "\022+\n\'USE_CONFIG_DEFAULT_OR_BACKUP_ENCRYPT" + + "ION\020\001\022\035\n\031GOOGLE_DEFAULT_ENCRYPTION\020\002\022\037\n\033" + + "CUSTOMER_MANAGED_ENCRYPTION\020\003\"\020\n\016FullBac" + + "kupSpecB\375\001\n$com.google.spanner.admin.dat" + + "abase.v1B\013BackupProtoP\001ZFcloud.google.co" + + "m/go/spanner/admin/database/apiv1/databa" + + "sepb;databasepb\252\002&Google.Cloud.Spanner.A" + + "dmin.Database.V1\312\002&Google\\Cloud\\Spanner\\" + + "Admin\\Database\\V1\352\002+Google::Cloud::Spann" + + "er::Admin::Database::V1b\006proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( @@ -239,6 +244,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "DatabaseDialect", "ReferencingBackups", "MaxExpireTime", + "BackupSchedules", }); internal_static_google_spanner_admin_database_v1_CreateBackupRequest_descriptor = getDescriptor().getMessageTypes().get(1); @@ -352,6 +358,12 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { new java.lang.String[] { "EncryptionType", "KmsKeyName", "KmsKeyNames", }); + internal_static_google_spanner_admin_database_v1_FullBackupSpec_descriptor = + getDescriptor().getMessageTypes().get(15); + internal_static_google_spanner_admin_database_v1_FullBackupSpec_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_spanner_admin_database_v1_FullBackupSpec_descriptor, + new java.lang.String[] {}); com.google.protobuf.ExtensionRegistry registry = com.google.protobuf.ExtensionRegistry.newInstance(); registry.add(com.google.api.FieldBehaviorProto.fieldBehavior); diff --git a/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/BackupSchedule.java b/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/BackupSchedule.java new file mode 100644 index 00000000000..eb5fc00ab96 --- /dev/null +++ b/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/BackupSchedule.java @@ -0,0 +1,2335 @@ +/* + * Copyright 2024 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/spanner/admin/database/v1/backup_schedule.proto + +// Protobuf Java Version: 3.25.3 +package com.google.spanner.admin.database.v1; + +/** + * + * + *
+ * BackupSchedule expresses the automated backup creation specification for a
+ * Spanner database.
+ * Next ID: 10
+ * 
+ * + * Protobuf type {@code google.spanner.admin.database.v1.BackupSchedule} + */ +public final class BackupSchedule extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.spanner.admin.database.v1.BackupSchedule) + BackupScheduleOrBuilder { + private static final long serialVersionUID = 0L; + // Use BackupSchedule.newBuilder() to construct. + private BackupSchedule(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private BackupSchedule() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new BackupSchedule(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.spanner.admin.database.v1.BackupScheduleProto + .internal_static_google_spanner_admin_database_v1_BackupSchedule_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.spanner.admin.database.v1.BackupScheduleProto + .internal_static_google_spanner_admin_database_v1_BackupSchedule_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.spanner.admin.database.v1.BackupSchedule.class, + com.google.spanner.admin.database.v1.BackupSchedule.Builder.class); + } + + private int bitField0_; + private int backupTypeSpecCase_ = 0; + + @SuppressWarnings("serial") + private java.lang.Object backupTypeSpec_; + + public enum BackupTypeSpecCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + FULL_BACKUP_SPEC(7), + BACKUPTYPESPEC_NOT_SET(0); + private final int value; + + private BackupTypeSpecCase(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 BackupTypeSpecCase valueOf(int value) { + return forNumber(value); + } + + public static BackupTypeSpecCase forNumber(int value) { + switch (value) { + case 7: + return FULL_BACKUP_SPEC; + case 0: + return BACKUPTYPESPEC_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public BackupTypeSpecCase getBackupTypeSpecCase() { + return BackupTypeSpecCase.forNumber(backupTypeSpecCase_); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * + * + *
+   * Identifier. Output only for the
+   * [CreateBackupSchedule][DatabaseAdmin.CreateBackupSchededule] operation.
+   * Required for the
+   * [UpdateBackupSchedule][google.spanner.admin.database.v1.DatabaseAdmin.UpdateBackupSchedule]
+   * operation. A globally unique identifier for the backup schedule which
+   * cannot be changed. Values are of the form
+   * `projects/<project>/instances/<instance>/databases/<database>/backupSchedules/[a-z][a-z0-9_\-]*[a-z0-9]`
+   * The final segment of the name must be between 2 and 60 characters in
+   * length.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @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; + } + } + /** + * + * + *
+   * Identifier. Output only for the
+   * [CreateBackupSchedule][DatabaseAdmin.CreateBackupSchededule] operation.
+   * Required for the
+   * [UpdateBackupSchedule][google.spanner.admin.database.v1.DatabaseAdmin.UpdateBackupSchedule]
+   * operation. A globally unique identifier for the backup schedule which
+   * cannot be changed. Values are of the form
+   * `projects/<project>/instances/<instance>/databases/<database>/backupSchedules/[a-z][a-z0-9_\-]*[a-z0-9]`
+   * The final segment of the name must be between 2 and 60 characters in
+   * length.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @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 SPEC_FIELD_NUMBER = 6; + private com.google.spanner.admin.database.v1.BackupScheduleSpec spec_; + /** + * + * + *
+   * Optional. The schedule specification based on which the backup creations
+   * are triggered.
+   * 
+ * + * + * .google.spanner.admin.database.v1.BackupScheduleSpec spec = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the spec field is set. + */ + @java.lang.Override + public boolean hasSpec() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+   * Optional. The schedule specification based on which the backup creations
+   * are triggered.
+   * 
+ * + * + * .google.spanner.admin.database.v1.BackupScheduleSpec spec = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The spec. + */ + @java.lang.Override + public com.google.spanner.admin.database.v1.BackupScheduleSpec getSpec() { + return spec_ == null + ? com.google.spanner.admin.database.v1.BackupScheduleSpec.getDefaultInstance() + : spec_; + } + /** + * + * + *
+   * Optional. The schedule specification based on which the backup creations
+   * are triggered.
+   * 
+ * + * + * .google.spanner.admin.database.v1.BackupScheduleSpec spec = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.spanner.admin.database.v1.BackupScheduleSpecOrBuilder getSpecOrBuilder() { + return spec_ == null + ? com.google.spanner.admin.database.v1.BackupScheduleSpec.getDefaultInstance() + : spec_; + } + + public static final int RETENTION_DURATION_FIELD_NUMBER = 3; + private com.google.protobuf.Duration retentionDuration_; + /** + * + * + *
+   * Optional. The retention duration of a backup that must be at least 6 hours
+   * and at most 366 days. The backup is eligible to be automatically deleted
+   * once the retention period has elapsed.
+   * 
+ * + * + * .google.protobuf.Duration retention_duration = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the retentionDuration field is set. + */ + @java.lang.Override + public boolean hasRetentionDuration() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+   * Optional. The retention duration of a backup that must be at least 6 hours
+   * and at most 366 days. The backup is eligible to be automatically deleted
+   * once the retention period has elapsed.
+   * 
+ * + * + * .google.protobuf.Duration retention_duration = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The retentionDuration. + */ + @java.lang.Override + public com.google.protobuf.Duration getRetentionDuration() { + return retentionDuration_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : retentionDuration_; + } + /** + * + * + *
+   * Optional. The retention duration of a backup that must be at least 6 hours
+   * and at most 366 days. The backup is eligible to be automatically deleted
+   * once the retention period has elapsed.
+   * 
+ * + * + * .google.protobuf.Duration retention_duration = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.protobuf.DurationOrBuilder getRetentionDurationOrBuilder() { + return retentionDuration_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : retentionDuration_; + } + + public static final int ENCRYPTION_CONFIG_FIELD_NUMBER = 4; + private com.google.spanner.admin.database.v1.CreateBackupEncryptionConfig encryptionConfig_; + /** + * + * + *
+   * Optional. The encryption configuration that will be used to encrypt the
+   * backup. If this field is not specified, the backup will use the same
+   * encryption configuration as the database.
+   * 
+ * + * + * .google.spanner.admin.database.v1.CreateBackupEncryptionConfig encryption_config = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the encryptionConfig field is set. + */ + @java.lang.Override + public boolean hasEncryptionConfig() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + * + * + *
+   * Optional. The encryption configuration that will be used to encrypt the
+   * backup. If this field is not specified, the backup will use the same
+   * encryption configuration as the database.
+   * 
+ * + * + * .google.spanner.admin.database.v1.CreateBackupEncryptionConfig encryption_config = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The encryptionConfig. + */ + @java.lang.Override + public com.google.spanner.admin.database.v1.CreateBackupEncryptionConfig getEncryptionConfig() { + return encryptionConfig_ == null + ? com.google.spanner.admin.database.v1.CreateBackupEncryptionConfig.getDefaultInstance() + : encryptionConfig_; + } + /** + * + * + *
+   * Optional. The encryption configuration that will be used to encrypt the
+   * backup. If this field is not specified, the backup will use the same
+   * encryption configuration as the database.
+   * 
+ * + * + * .google.spanner.admin.database.v1.CreateBackupEncryptionConfig encryption_config = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.spanner.admin.database.v1.CreateBackupEncryptionConfigOrBuilder + getEncryptionConfigOrBuilder() { + return encryptionConfig_ == null + ? com.google.spanner.admin.database.v1.CreateBackupEncryptionConfig.getDefaultInstance() + : encryptionConfig_; + } + + public static final int FULL_BACKUP_SPEC_FIELD_NUMBER = 7; + /** + * + * + *
+   * The schedule creates only full backups.
+   * 
+ * + * .google.spanner.admin.database.v1.FullBackupSpec full_backup_spec = 7; + * + * @return Whether the fullBackupSpec field is set. + */ + @java.lang.Override + public boolean hasFullBackupSpec() { + return backupTypeSpecCase_ == 7; + } + /** + * + * + *
+   * The schedule creates only full backups.
+   * 
+ * + * .google.spanner.admin.database.v1.FullBackupSpec full_backup_spec = 7; + * + * @return The fullBackupSpec. + */ + @java.lang.Override + public com.google.spanner.admin.database.v1.FullBackupSpec getFullBackupSpec() { + if (backupTypeSpecCase_ == 7) { + return (com.google.spanner.admin.database.v1.FullBackupSpec) backupTypeSpec_; + } + return com.google.spanner.admin.database.v1.FullBackupSpec.getDefaultInstance(); + } + /** + * + * + *
+   * The schedule creates only full backups.
+   * 
+ * + * .google.spanner.admin.database.v1.FullBackupSpec full_backup_spec = 7; + */ + @java.lang.Override + public com.google.spanner.admin.database.v1.FullBackupSpecOrBuilder getFullBackupSpecOrBuilder() { + if (backupTypeSpecCase_ == 7) { + return (com.google.spanner.admin.database.v1.FullBackupSpec) backupTypeSpec_; + } + return com.google.spanner.admin.database.v1.FullBackupSpec.getDefaultInstance(); + } + + public static final int UPDATE_TIME_FIELD_NUMBER = 9; + private com.google.protobuf.Timestamp updateTime_; + /** + * + * + *
+   * Output only. The timestamp at which the schedule was last updated.
+   * If the schedule has never been updated, this field contains the timestamp
+   * when the schedule was first created.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + @java.lang.Override + public boolean hasUpdateTime() { + return ((bitField0_ & 0x00000008) != 0); + } + /** + * + * + *
+   * Output only. The timestamp at which the schedule was last updated.
+   * If the schedule has never been updated, this field contains the timestamp
+   * when the schedule was first created.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The updateTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getUpdateTime() { + return updateTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : updateTime_; + } + /** + * + * + *
+   * Output only. The timestamp at which the schedule was last updated.
+   * If the schedule has never been updated, this field contains the timestamp
+   * when the schedule was first created.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() { + return updateTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : updateTime_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(3, getRetentionDuration()); + } + if (((bitField0_ & 0x00000004) != 0)) { + output.writeMessage(4, getEncryptionConfig()); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(6, getSpec()); + } + if (backupTypeSpecCase_ == 7) { + output.writeMessage(7, (com.google.spanner.admin.database.v1.FullBackupSpec) backupTypeSpec_); + } + if (((bitField0_ & 0x00000008) != 0)) { + output.writeMessage(9, getUpdateTime()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getRetentionDuration()); + } + if (((bitField0_ & 0x00000004) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getEncryptionConfig()); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(6, getSpec()); + } + if (backupTypeSpecCase_ == 7) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 7, (com.google.spanner.admin.database.v1.FullBackupSpec) backupTypeSpec_); + } + if (((bitField0_ & 0x00000008) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(9, getUpdateTime()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.spanner.admin.database.v1.BackupSchedule)) { + return super.equals(obj); + } + com.google.spanner.admin.database.v1.BackupSchedule other = + (com.google.spanner.admin.database.v1.BackupSchedule) obj; + + if (!getName().equals(other.getName())) return false; + if (hasSpec() != other.hasSpec()) return false; + if (hasSpec()) { + if (!getSpec().equals(other.getSpec())) return false; + } + if (hasRetentionDuration() != other.hasRetentionDuration()) return false; + if (hasRetentionDuration()) { + if (!getRetentionDuration().equals(other.getRetentionDuration())) return false; + } + if (hasEncryptionConfig() != other.hasEncryptionConfig()) return false; + if (hasEncryptionConfig()) { + if (!getEncryptionConfig().equals(other.getEncryptionConfig())) return false; + } + if (hasUpdateTime() != other.hasUpdateTime()) return false; + if (hasUpdateTime()) { + if (!getUpdateTime().equals(other.getUpdateTime())) return false; + } + if (!getBackupTypeSpecCase().equals(other.getBackupTypeSpecCase())) return false; + switch (backupTypeSpecCase_) { + case 7: + if (!getFullBackupSpec().equals(other.getFullBackupSpec())) return false; + break; + case 0: + default: + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + if (hasSpec()) { + hash = (37 * hash) + SPEC_FIELD_NUMBER; + hash = (53 * hash) + getSpec().hashCode(); + } + if (hasRetentionDuration()) { + hash = (37 * hash) + RETENTION_DURATION_FIELD_NUMBER; + hash = (53 * hash) + getRetentionDuration().hashCode(); + } + if (hasEncryptionConfig()) { + hash = (37 * hash) + ENCRYPTION_CONFIG_FIELD_NUMBER; + hash = (53 * hash) + getEncryptionConfig().hashCode(); + } + if (hasUpdateTime()) { + hash = (37 * hash) + UPDATE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getUpdateTime().hashCode(); + } + switch (backupTypeSpecCase_) { + case 7: + hash = (37 * hash) + FULL_BACKUP_SPEC_FIELD_NUMBER; + hash = (53 * hash) + getFullBackupSpec().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.spanner.admin.database.v1.BackupSchedule parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.spanner.admin.database.v1.BackupSchedule parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.spanner.admin.database.v1.BackupSchedule parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.spanner.admin.database.v1.BackupSchedule 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.spanner.admin.database.v1.BackupSchedule parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.spanner.admin.database.v1.BackupSchedule parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.spanner.admin.database.v1.BackupSchedule parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.spanner.admin.database.v1.BackupSchedule 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.spanner.admin.database.v1.BackupSchedule parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.spanner.admin.database.v1.BackupSchedule 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.spanner.admin.database.v1.BackupSchedule parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.spanner.admin.database.v1.BackupSchedule 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.spanner.admin.database.v1.BackupSchedule 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; + } + /** + * + * + *
+   * BackupSchedule expresses the automated backup creation specification for a
+   * Spanner database.
+   * Next ID: 10
+   * 
+ * + * Protobuf type {@code google.spanner.admin.database.v1.BackupSchedule} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.spanner.admin.database.v1.BackupSchedule) + com.google.spanner.admin.database.v1.BackupScheduleOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.spanner.admin.database.v1.BackupScheduleProto + .internal_static_google_spanner_admin_database_v1_BackupSchedule_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.spanner.admin.database.v1.BackupScheduleProto + .internal_static_google_spanner_admin_database_v1_BackupSchedule_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.spanner.admin.database.v1.BackupSchedule.class, + com.google.spanner.admin.database.v1.BackupSchedule.Builder.class); + } + + // Construct using com.google.spanner.admin.database.v1.BackupSchedule.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getSpecFieldBuilder(); + getRetentionDurationFieldBuilder(); + getEncryptionConfigFieldBuilder(); + getUpdateTimeFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + spec_ = null; + if (specBuilder_ != null) { + specBuilder_.dispose(); + specBuilder_ = null; + } + retentionDuration_ = null; + if (retentionDurationBuilder_ != null) { + retentionDurationBuilder_.dispose(); + retentionDurationBuilder_ = null; + } + encryptionConfig_ = null; + if (encryptionConfigBuilder_ != null) { + encryptionConfigBuilder_.dispose(); + encryptionConfigBuilder_ = null; + } + if (fullBackupSpecBuilder_ != null) { + fullBackupSpecBuilder_.clear(); + } + updateTime_ = null; + if (updateTimeBuilder_ != null) { + updateTimeBuilder_.dispose(); + updateTimeBuilder_ = null; + } + backupTypeSpecCase_ = 0; + backupTypeSpec_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.spanner.admin.database.v1.BackupScheduleProto + .internal_static_google_spanner_admin_database_v1_BackupSchedule_descriptor; + } + + @java.lang.Override + public com.google.spanner.admin.database.v1.BackupSchedule getDefaultInstanceForType() { + return com.google.spanner.admin.database.v1.BackupSchedule.getDefaultInstance(); + } + + @java.lang.Override + public com.google.spanner.admin.database.v1.BackupSchedule build() { + com.google.spanner.admin.database.v1.BackupSchedule result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.spanner.admin.database.v1.BackupSchedule buildPartial() { + com.google.spanner.admin.database.v1.BackupSchedule result = + new com.google.spanner.admin.database.v1.BackupSchedule(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + buildPartialOneofs(result); + onBuilt(); + return result; + } + + private void buildPartial0(com.google.spanner.admin.database.v1.BackupSchedule result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.spec_ = specBuilder_ == null ? spec_ : specBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.retentionDuration_ = + retentionDurationBuilder_ == null + ? retentionDuration_ + : retentionDurationBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.encryptionConfig_ = + encryptionConfigBuilder_ == null ? encryptionConfig_ : encryptionConfigBuilder_.build(); + to_bitField0_ |= 0x00000004; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.updateTime_ = updateTimeBuilder_ == null ? updateTime_ : updateTimeBuilder_.build(); + to_bitField0_ |= 0x00000008; + } + result.bitField0_ |= to_bitField0_; + } + + private void buildPartialOneofs(com.google.spanner.admin.database.v1.BackupSchedule result) { + result.backupTypeSpecCase_ = backupTypeSpecCase_; + result.backupTypeSpec_ = this.backupTypeSpec_; + if (backupTypeSpecCase_ == 7 && fullBackupSpecBuilder_ != null) { + result.backupTypeSpec_ = fullBackupSpecBuilder_.build(); + } + } + + @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.spanner.admin.database.v1.BackupSchedule) { + return mergeFrom((com.google.spanner.admin.database.v1.BackupSchedule) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.spanner.admin.database.v1.BackupSchedule other) { + if (other == com.google.spanner.admin.database.v1.BackupSchedule.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.hasSpec()) { + mergeSpec(other.getSpec()); + } + if (other.hasRetentionDuration()) { + mergeRetentionDuration(other.getRetentionDuration()); + } + if (other.hasEncryptionConfig()) { + mergeEncryptionConfig(other.getEncryptionConfig()); + } + if (other.hasUpdateTime()) { + mergeUpdateTime(other.getUpdateTime()); + } + switch (other.getBackupTypeSpecCase()) { + case FULL_BACKUP_SPEC: + { + mergeFullBackupSpec(other.getFullBackupSpec()); + break; + } + case BACKUPTYPESPEC_NOT_SET: + { + break; + } + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 26: + { + input.readMessage( + getRetentionDurationFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 34: + { + input.readMessage( + getEncryptionConfigFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000008; + break; + } // case 34 + case 50: + { + input.readMessage(getSpecFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 50 + case 58: + { + input.readMessage(getFullBackupSpecFieldBuilder().getBuilder(), extensionRegistry); + backupTypeSpecCase_ = 7; + break; + } // case 58 + case 74: + { + input.readMessage(getUpdateTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000020; + break; + } // case 74 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int backupTypeSpecCase_ = 0; + private java.lang.Object backupTypeSpec_; + + public BackupTypeSpecCase getBackupTypeSpecCase() { + return BackupTypeSpecCase.forNumber(backupTypeSpecCase_); + } + + public Builder clearBackupTypeSpec() { + backupTypeSpecCase_ = 0; + backupTypeSpec_ = null; + onChanged(); + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Identifier. Output only for the
+     * [CreateBackupSchedule][DatabaseAdmin.CreateBackupSchededule] operation.
+     * Required for the
+     * [UpdateBackupSchedule][google.spanner.admin.database.v1.DatabaseAdmin.UpdateBackupSchedule]
+     * operation. A globally unique identifier for the backup schedule which
+     * cannot be changed. Values are of the form
+     * `projects/<project>/instances/<instance>/databases/<database>/backupSchedules/[a-z][a-z0-9_\-]*[a-z0-9]`
+     * The final segment of the name must be between 2 and 60 characters in
+     * length.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @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; + } + } + /** + * + * + *
+     * Identifier. Output only for the
+     * [CreateBackupSchedule][DatabaseAdmin.CreateBackupSchededule] operation.
+     * Required for the
+     * [UpdateBackupSchedule][google.spanner.admin.database.v1.DatabaseAdmin.UpdateBackupSchedule]
+     * operation. A globally unique identifier for the backup schedule which
+     * cannot be changed. Values are of the form
+     * `projects/<project>/instances/<instance>/databases/<database>/backupSchedules/[a-z][a-z0-9_\-]*[a-z0-9]`
+     * The final segment of the name must be between 2 and 60 characters in
+     * length.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @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; + } + } + /** + * + * + *
+     * Identifier. Output only for the
+     * [CreateBackupSchedule][DatabaseAdmin.CreateBackupSchededule] operation.
+     * Required for the
+     * [UpdateBackupSchedule][google.spanner.admin.database.v1.DatabaseAdmin.UpdateBackupSchedule]
+     * operation. A globally unique identifier for the backup schedule which
+     * cannot be changed. Values are of the form
+     * `projects/<project>/instances/<instance>/databases/<database>/backupSchedules/[a-z][a-z0-9_\-]*[a-z0-9]`
+     * The final segment of the name must be between 2 and 60 characters in
+     * length.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Identifier. Output only for the
+     * [CreateBackupSchedule][DatabaseAdmin.CreateBackupSchededule] operation.
+     * Required for the
+     * [UpdateBackupSchedule][google.spanner.admin.database.v1.DatabaseAdmin.UpdateBackupSchedule]
+     * operation. A globally unique identifier for the backup schedule which
+     * cannot be changed. Values are of the form
+     * `projects/<project>/instances/<instance>/databases/<database>/backupSchedules/[a-z][a-z0-9_\-]*[a-z0-9]`
+     * The final segment of the name must be between 2 and 60 characters in
+     * length.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Identifier. Output only for the
+     * [CreateBackupSchedule][DatabaseAdmin.CreateBackupSchededule] operation.
+     * Required for the
+     * [UpdateBackupSchedule][google.spanner.admin.database.v1.DatabaseAdmin.UpdateBackupSchedule]
+     * operation. A globally unique identifier for the backup schedule which
+     * cannot be changed. Values are of the form
+     * `projects/<project>/instances/<instance>/databases/<database>/backupSchedules/[a-z][a-z0-9_\-]*[a-z0-9]`
+     * The final segment of the name must be between 2 and 60 characters in
+     * length.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private com.google.spanner.admin.database.v1.BackupScheduleSpec spec_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.spanner.admin.database.v1.BackupScheduleSpec, + com.google.spanner.admin.database.v1.BackupScheduleSpec.Builder, + com.google.spanner.admin.database.v1.BackupScheduleSpecOrBuilder> + specBuilder_; + /** + * + * + *
+     * Optional. The schedule specification based on which the backup creations
+     * are triggered.
+     * 
+ * + * + * .google.spanner.admin.database.v1.BackupScheduleSpec spec = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the spec field is set. + */ + public boolean hasSpec() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+     * Optional. The schedule specification based on which the backup creations
+     * are triggered.
+     * 
+ * + * + * .google.spanner.admin.database.v1.BackupScheduleSpec spec = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The spec. + */ + public com.google.spanner.admin.database.v1.BackupScheduleSpec getSpec() { + if (specBuilder_ == null) { + return spec_ == null + ? com.google.spanner.admin.database.v1.BackupScheduleSpec.getDefaultInstance() + : spec_; + } else { + return specBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Optional. The schedule specification based on which the backup creations
+     * are triggered.
+     * 
+ * + * + * .google.spanner.admin.database.v1.BackupScheduleSpec spec = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setSpec(com.google.spanner.admin.database.v1.BackupScheduleSpec value) { + if (specBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + spec_ = value; + } else { + specBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The schedule specification based on which the backup creations
+     * are triggered.
+     * 
+ * + * + * .google.spanner.admin.database.v1.BackupScheduleSpec spec = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setSpec( + com.google.spanner.admin.database.v1.BackupScheduleSpec.Builder builderForValue) { + if (specBuilder_ == null) { + spec_ = builderForValue.build(); + } else { + specBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The schedule specification based on which the backup creations
+     * are triggered.
+     * 
+ * + * + * .google.spanner.admin.database.v1.BackupScheduleSpec spec = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder mergeSpec(com.google.spanner.admin.database.v1.BackupScheduleSpec value) { + if (specBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && spec_ != null + && spec_ + != com.google.spanner.admin.database.v1.BackupScheduleSpec.getDefaultInstance()) { + getSpecBuilder().mergeFrom(value); + } else { + spec_ = value; + } + } else { + specBuilder_.mergeFrom(value); + } + if (spec_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + /** + * + * + *
+     * Optional. The schedule specification based on which the backup creations
+     * are triggered.
+     * 
+ * + * + * .google.spanner.admin.database.v1.BackupScheduleSpec spec = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearSpec() { + bitField0_ = (bitField0_ & ~0x00000002); + spec_ = null; + if (specBuilder_ != null) { + specBuilder_.dispose(); + specBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The schedule specification based on which the backup creations
+     * are triggered.
+     * 
+ * + * + * .google.spanner.admin.database.v1.BackupScheduleSpec spec = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.spanner.admin.database.v1.BackupScheduleSpec.Builder getSpecBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getSpecFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Optional. The schedule specification based on which the backup creations
+     * are triggered.
+     * 
+ * + * + * .google.spanner.admin.database.v1.BackupScheduleSpec spec = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.spanner.admin.database.v1.BackupScheduleSpecOrBuilder getSpecOrBuilder() { + if (specBuilder_ != null) { + return specBuilder_.getMessageOrBuilder(); + } else { + return spec_ == null + ? com.google.spanner.admin.database.v1.BackupScheduleSpec.getDefaultInstance() + : spec_; + } + } + /** + * + * + *
+     * Optional. The schedule specification based on which the backup creations
+     * are triggered.
+     * 
+ * + * + * .google.spanner.admin.database.v1.BackupScheduleSpec spec = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.spanner.admin.database.v1.BackupScheduleSpec, + com.google.spanner.admin.database.v1.BackupScheduleSpec.Builder, + com.google.spanner.admin.database.v1.BackupScheduleSpecOrBuilder> + getSpecFieldBuilder() { + if (specBuilder_ == null) { + specBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.spanner.admin.database.v1.BackupScheduleSpec, + com.google.spanner.admin.database.v1.BackupScheduleSpec.Builder, + com.google.spanner.admin.database.v1.BackupScheduleSpecOrBuilder>( + getSpec(), getParentForChildren(), isClean()); + spec_ = null; + } + return specBuilder_; + } + + private com.google.protobuf.Duration retentionDuration_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + retentionDurationBuilder_; + /** + * + * + *
+     * Optional. The retention duration of a backup that must be at least 6 hours
+     * and at most 366 days. The backup is eligible to be automatically deleted
+     * once the retention period has elapsed.
+     * 
+ * + * + * .google.protobuf.Duration retention_duration = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the retentionDuration field is set. + */ + public boolean hasRetentionDuration() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + * + * + *
+     * Optional. The retention duration of a backup that must be at least 6 hours
+     * and at most 366 days. The backup is eligible to be automatically deleted
+     * once the retention period has elapsed.
+     * 
+ * + * + * .google.protobuf.Duration retention_duration = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The retentionDuration. + */ + public com.google.protobuf.Duration getRetentionDuration() { + if (retentionDurationBuilder_ == null) { + return retentionDuration_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : retentionDuration_; + } else { + return retentionDurationBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Optional. The retention duration of a backup that must be at least 6 hours
+     * and at most 366 days. The backup is eligible to be automatically deleted
+     * once the retention period has elapsed.
+     * 
+ * + * + * .google.protobuf.Duration retention_duration = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setRetentionDuration(com.google.protobuf.Duration value) { + if (retentionDurationBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + retentionDuration_ = value; + } else { + retentionDurationBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The retention duration of a backup that must be at least 6 hours
+     * and at most 366 days. The backup is eligible to be automatically deleted
+     * once the retention period has elapsed.
+     * 
+ * + * + * .google.protobuf.Duration retention_duration = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setRetentionDuration(com.google.protobuf.Duration.Builder builderForValue) { + if (retentionDurationBuilder_ == null) { + retentionDuration_ = builderForValue.build(); + } else { + retentionDurationBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The retention duration of a backup that must be at least 6 hours
+     * and at most 366 days. The backup is eligible to be automatically deleted
+     * once the retention period has elapsed.
+     * 
+ * + * + * .google.protobuf.Duration retention_duration = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder mergeRetentionDuration(com.google.protobuf.Duration value) { + if (retentionDurationBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && retentionDuration_ != null + && retentionDuration_ != com.google.protobuf.Duration.getDefaultInstance()) { + getRetentionDurationBuilder().mergeFrom(value); + } else { + retentionDuration_ = value; + } + } else { + retentionDurationBuilder_.mergeFrom(value); + } + if (retentionDuration_ != null) { + bitField0_ |= 0x00000004; + onChanged(); + } + return this; + } + /** + * + * + *
+     * Optional. The retention duration of a backup that must be at least 6 hours
+     * and at most 366 days. The backup is eligible to be automatically deleted
+     * once the retention period has elapsed.
+     * 
+ * + * + * .google.protobuf.Duration retention_duration = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearRetentionDuration() { + bitField0_ = (bitField0_ & ~0x00000004); + retentionDuration_ = null; + if (retentionDurationBuilder_ != null) { + retentionDurationBuilder_.dispose(); + retentionDurationBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The retention duration of a backup that must be at least 6 hours
+     * and at most 366 days. The backup is eligible to be automatically deleted
+     * once the retention period has elapsed.
+     * 
+ * + * + * .google.protobuf.Duration retention_duration = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.protobuf.Duration.Builder getRetentionDurationBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return getRetentionDurationFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Optional. The retention duration of a backup that must be at least 6 hours
+     * and at most 366 days. The backup is eligible to be automatically deleted
+     * once the retention period has elapsed.
+     * 
+ * + * + * .google.protobuf.Duration retention_duration = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.protobuf.DurationOrBuilder getRetentionDurationOrBuilder() { + if (retentionDurationBuilder_ != null) { + return retentionDurationBuilder_.getMessageOrBuilder(); + } else { + return retentionDuration_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : retentionDuration_; + } + } + /** + * + * + *
+     * Optional. The retention duration of a backup that must be at least 6 hours
+     * and at most 366 days. The backup is eligible to be automatically deleted
+     * once the retention period has elapsed.
+     * 
+ * + * + * .google.protobuf.Duration retention_duration = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + getRetentionDurationFieldBuilder() { + if (retentionDurationBuilder_ == null) { + retentionDurationBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder>( + getRetentionDuration(), getParentForChildren(), isClean()); + retentionDuration_ = null; + } + return retentionDurationBuilder_; + } + + private com.google.spanner.admin.database.v1.CreateBackupEncryptionConfig encryptionConfig_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.spanner.admin.database.v1.CreateBackupEncryptionConfig, + com.google.spanner.admin.database.v1.CreateBackupEncryptionConfig.Builder, + com.google.spanner.admin.database.v1.CreateBackupEncryptionConfigOrBuilder> + encryptionConfigBuilder_; + /** + * + * + *
+     * Optional. The encryption configuration that will be used to encrypt the
+     * backup. If this field is not specified, the backup will use the same
+     * encryption configuration as the database.
+     * 
+ * + * + * .google.spanner.admin.database.v1.CreateBackupEncryptionConfig encryption_config = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the encryptionConfig field is set. + */ + public boolean hasEncryptionConfig() { + return ((bitField0_ & 0x00000008) != 0); + } + /** + * + * + *
+     * Optional. The encryption configuration that will be used to encrypt the
+     * backup. If this field is not specified, the backup will use the same
+     * encryption configuration as the database.
+     * 
+ * + * + * .google.spanner.admin.database.v1.CreateBackupEncryptionConfig encryption_config = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The encryptionConfig. + */ + public com.google.spanner.admin.database.v1.CreateBackupEncryptionConfig getEncryptionConfig() { + if (encryptionConfigBuilder_ == null) { + return encryptionConfig_ == null + ? com.google.spanner.admin.database.v1.CreateBackupEncryptionConfig.getDefaultInstance() + : encryptionConfig_; + } else { + return encryptionConfigBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Optional. The encryption configuration that will be used to encrypt the
+     * backup. If this field is not specified, the backup will use the same
+     * encryption configuration as the database.
+     * 
+ * + * + * .google.spanner.admin.database.v1.CreateBackupEncryptionConfig encryption_config = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setEncryptionConfig( + com.google.spanner.admin.database.v1.CreateBackupEncryptionConfig value) { + if (encryptionConfigBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + encryptionConfig_ = value; + } else { + encryptionConfigBuilder_.setMessage(value); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The encryption configuration that will be used to encrypt the
+     * backup. If this field is not specified, the backup will use the same
+     * encryption configuration as the database.
+     * 
+ * + * + * .google.spanner.admin.database.v1.CreateBackupEncryptionConfig encryption_config = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setEncryptionConfig( + com.google.spanner.admin.database.v1.CreateBackupEncryptionConfig.Builder builderForValue) { + if (encryptionConfigBuilder_ == null) { + encryptionConfig_ = builderForValue.build(); + } else { + encryptionConfigBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The encryption configuration that will be used to encrypt the
+     * backup. If this field is not specified, the backup will use the same
+     * encryption configuration as the database.
+     * 
+ * + * + * .google.spanner.admin.database.v1.CreateBackupEncryptionConfig encryption_config = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder mergeEncryptionConfig( + com.google.spanner.admin.database.v1.CreateBackupEncryptionConfig value) { + if (encryptionConfigBuilder_ == null) { + if (((bitField0_ & 0x00000008) != 0) + && encryptionConfig_ != null + && encryptionConfig_ + != com.google.spanner.admin.database.v1.CreateBackupEncryptionConfig + .getDefaultInstance()) { + getEncryptionConfigBuilder().mergeFrom(value); + } else { + encryptionConfig_ = value; + } + } else { + encryptionConfigBuilder_.mergeFrom(value); + } + if (encryptionConfig_ != null) { + bitField0_ |= 0x00000008; + onChanged(); + } + return this; + } + /** + * + * + *
+     * Optional. The encryption configuration that will be used to encrypt the
+     * backup. If this field is not specified, the backup will use the same
+     * encryption configuration as the database.
+     * 
+ * + * + * .google.spanner.admin.database.v1.CreateBackupEncryptionConfig encryption_config = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearEncryptionConfig() { + bitField0_ = (bitField0_ & ~0x00000008); + encryptionConfig_ = null; + if (encryptionConfigBuilder_ != null) { + encryptionConfigBuilder_.dispose(); + encryptionConfigBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The encryption configuration that will be used to encrypt the
+     * backup. If this field is not specified, the backup will use the same
+     * encryption configuration as the database.
+     * 
+ * + * + * .google.spanner.admin.database.v1.CreateBackupEncryptionConfig encryption_config = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.spanner.admin.database.v1.CreateBackupEncryptionConfig.Builder + getEncryptionConfigBuilder() { + bitField0_ |= 0x00000008; + onChanged(); + return getEncryptionConfigFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Optional. The encryption configuration that will be used to encrypt the
+     * backup. If this field is not specified, the backup will use the same
+     * encryption configuration as the database.
+     * 
+ * + * + * .google.spanner.admin.database.v1.CreateBackupEncryptionConfig encryption_config = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.spanner.admin.database.v1.CreateBackupEncryptionConfigOrBuilder + getEncryptionConfigOrBuilder() { + if (encryptionConfigBuilder_ != null) { + return encryptionConfigBuilder_.getMessageOrBuilder(); + } else { + return encryptionConfig_ == null + ? com.google.spanner.admin.database.v1.CreateBackupEncryptionConfig.getDefaultInstance() + : encryptionConfig_; + } + } + /** + * + * + *
+     * Optional. The encryption configuration that will be used to encrypt the
+     * backup. If this field is not specified, the backup will use the same
+     * encryption configuration as the database.
+     * 
+ * + * + * .google.spanner.admin.database.v1.CreateBackupEncryptionConfig encryption_config = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.spanner.admin.database.v1.CreateBackupEncryptionConfig, + com.google.spanner.admin.database.v1.CreateBackupEncryptionConfig.Builder, + com.google.spanner.admin.database.v1.CreateBackupEncryptionConfigOrBuilder> + getEncryptionConfigFieldBuilder() { + if (encryptionConfigBuilder_ == null) { + encryptionConfigBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.spanner.admin.database.v1.CreateBackupEncryptionConfig, + com.google.spanner.admin.database.v1.CreateBackupEncryptionConfig.Builder, + com.google.spanner.admin.database.v1.CreateBackupEncryptionConfigOrBuilder>( + getEncryptionConfig(), getParentForChildren(), isClean()); + encryptionConfig_ = null; + } + return encryptionConfigBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.spanner.admin.database.v1.FullBackupSpec, + com.google.spanner.admin.database.v1.FullBackupSpec.Builder, + com.google.spanner.admin.database.v1.FullBackupSpecOrBuilder> + fullBackupSpecBuilder_; + /** + * + * + *
+     * The schedule creates only full backups.
+     * 
+ * + * .google.spanner.admin.database.v1.FullBackupSpec full_backup_spec = 7; + * + * @return Whether the fullBackupSpec field is set. + */ + @java.lang.Override + public boolean hasFullBackupSpec() { + return backupTypeSpecCase_ == 7; + } + /** + * + * + *
+     * The schedule creates only full backups.
+     * 
+ * + * .google.spanner.admin.database.v1.FullBackupSpec full_backup_spec = 7; + * + * @return The fullBackupSpec. + */ + @java.lang.Override + public com.google.spanner.admin.database.v1.FullBackupSpec getFullBackupSpec() { + if (fullBackupSpecBuilder_ == null) { + if (backupTypeSpecCase_ == 7) { + return (com.google.spanner.admin.database.v1.FullBackupSpec) backupTypeSpec_; + } + return com.google.spanner.admin.database.v1.FullBackupSpec.getDefaultInstance(); + } else { + if (backupTypeSpecCase_ == 7) { + return fullBackupSpecBuilder_.getMessage(); + } + return com.google.spanner.admin.database.v1.FullBackupSpec.getDefaultInstance(); + } + } + /** + * + * + *
+     * The schedule creates only full backups.
+     * 
+ * + * .google.spanner.admin.database.v1.FullBackupSpec full_backup_spec = 7; + */ + public Builder setFullBackupSpec(com.google.spanner.admin.database.v1.FullBackupSpec value) { + if (fullBackupSpecBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + backupTypeSpec_ = value; + onChanged(); + } else { + fullBackupSpecBuilder_.setMessage(value); + } + backupTypeSpecCase_ = 7; + return this; + } + /** + * + * + *
+     * The schedule creates only full backups.
+     * 
+ * + * .google.spanner.admin.database.v1.FullBackupSpec full_backup_spec = 7; + */ + public Builder setFullBackupSpec( + com.google.spanner.admin.database.v1.FullBackupSpec.Builder builderForValue) { + if (fullBackupSpecBuilder_ == null) { + backupTypeSpec_ = builderForValue.build(); + onChanged(); + } else { + fullBackupSpecBuilder_.setMessage(builderForValue.build()); + } + backupTypeSpecCase_ = 7; + return this; + } + /** + * + * + *
+     * The schedule creates only full backups.
+     * 
+ * + * .google.spanner.admin.database.v1.FullBackupSpec full_backup_spec = 7; + */ + public Builder mergeFullBackupSpec(com.google.spanner.admin.database.v1.FullBackupSpec value) { + if (fullBackupSpecBuilder_ == null) { + if (backupTypeSpecCase_ == 7 + && backupTypeSpec_ + != com.google.spanner.admin.database.v1.FullBackupSpec.getDefaultInstance()) { + backupTypeSpec_ = + com.google.spanner.admin.database.v1.FullBackupSpec.newBuilder( + (com.google.spanner.admin.database.v1.FullBackupSpec) backupTypeSpec_) + .mergeFrom(value) + .buildPartial(); + } else { + backupTypeSpec_ = value; + } + onChanged(); + } else { + if (backupTypeSpecCase_ == 7) { + fullBackupSpecBuilder_.mergeFrom(value); + } else { + fullBackupSpecBuilder_.setMessage(value); + } + } + backupTypeSpecCase_ = 7; + return this; + } + /** + * + * + *
+     * The schedule creates only full backups.
+     * 
+ * + * .google.spanner.admin.database.v1.FullBackupSpec full_backup_spec = 7; + */ + public Builder clearFullBackupSpec() { + if (fullBackupSpecBuilder_ == null) { + if (backupTypeSpecCase_ == 7) { + backupTypeSpecCase_ = 0; + backupTypeSpec_ = null; + onChanged(); + } + } else { + if (backupTypeSpecCase_ == 7) { + backupTypeSpecCase_ = 0; + backupTypeSpec_ = null; + } + fullBackupSpecBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * The schedule creates only full backups.
+     * 
+ * + * .google.spanner.admin.database.v1.FullBackupSpec full_backup_spec = 7; + */ + public com.google.spanner.admin.database.v1.FullBackupSpec.Builder getFullBackupSpecBuilder() { + return getFullBackupSpecFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The schedule creates only full backups.
+     * 
+ * + * .google.spanner.admin.database.v1.FullBackupSpec full_backup_spec = 7; + */ + @java.lang.Override + public com.google.spanner.admin.database.v1.FullBackupSpecOrBuilder + getFullBackupSpecOrBuilder() { + if ((backupTypeSpecCase_ == 7) && (fullBackupSpecBuilder_ != null)) { + return fullBackupSpecBuilder_.getMessageOrBuilder(); + } else { + if (backupTypeSpecCase_ == 7) { + return (com.google.spanner.admin.database.v1.FullBackupSpec) backupTypeSpec_; + } + return com.google.spanner.admin.database.v1.FullBackupSpec.getDefaultInstance(); + } + } + /** + * + * + *
+     * The schedule creates only full backups.
+     * 
+ * + * .google.spanner.admin.database.v1.FullBackupSpec full_backup_spec = 7; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.spanner.admin.database.v1.FullBackupSpec, + com.google.spanner.admin.database.v1.FullBackupSpec.Builder, + com.google.spanner.admin.database.v1.FullBackupSpecOrBuilder> + getFullBackupSpecFieldBuilder() { + if (fullBackupSpecBuilder_ == null) { + if (!(backupTypeSpecCase_ == 7)) { + backupTypeSpec_ = + com.google.spanner.admin.database.v1.FullBackupSpec.getDefaultInstance(); + } + fullBackupSpecBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.spanner.admin.database.v1.FullBackupSpec, + com.google.spanner.admin.database.v1.FullBackupSpec.Builder, + com.google.spanner.admin.database.v1.FullBackupSpecOrBuilder>( + (com.google.spanner.admin.database.v1.FullBackupSpec) backupTypeSpec_, + getParentForChildren(), + isClean()); + backupTypeSpec_ = null; + } + backupTypeSpecCase_ = 7; + onChanged(); + return fullBackupSpecBuilder_; + } + + private com.google.protobuf.Timestamp updateTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + updateTimeBuilder_; + /** + * + * + *
+     * Output only. The timestamp at which the schedule was last updated.
+     * If the schedule has never been updated, this field contains the timestamp
+     * when the schedule was first created.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + public boolean hasUpdateTime() { + return ((bitField0_ & 0x00000020) != 0); + } + /** + * + * + *
+     * Output only. The timestamp at which the schedule was last updated.
+     * If the schedule has never been updated, this field contains the timestamp
+     * when the schedule was first created.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The updateTime. + */ + public com.google.protobuf.Timestamp getUpdateTime() { + if (updateTimeBuilder_ == null) { + return updateTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : updateTime_; + } else { + return updateTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Output only. The timestamp at which the schedule was last updated.
+     * If the schedule has never been updated, this field contains the timestamp
+     * when the schedule was first created.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setUpdateTime(com.google.protobuf.Timestamp value) { + if (updateTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + updateTime_ = value; + } else { + updateTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The timestamp at which the schedule was last updated.
+     * If the schedule has never been updated, this field contains the timestamp
+     * when the schedule was first created.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setUpdateTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (updateTimeBuilder_ == null) { + updateTime_ = builderForValue.build(); + } else { + updateTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The timestamp at which the schedule was last updated.
+     * If the schedule has never been updated, this field contains the timestamp
+     * when the schedule was first created.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeUpdateTime(com.google.protobuf.Timestamp value) { + if (updateTimeBuilder_ == null) { + if (((bitField0_ & 0x00000020) != 0) + && updateTime_ != null + && updateTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getUpdateTimeBuilder().mergeFrom(value); + } else { + updateTime_ = value; + } + } else { + updateTimeBuilder_.mergeFrom(value); + } + if (updateTime_ != null) { + bitField0_ |= 0x00000020; + onChanged(); + } + return this; + } + /** + * + * + *
+     * Output only. The timestamp at which the schedule was last updated.
+     * If the schedule has never been updated, this field contains the timestamp
+     * when the schedule was first created.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearUpdateTime() { + bitField0_ = (bitField0_ & ~0x00000020); + updateTime_ = null; + if (updateTimeBuilder_ != null) { + updateTimeBuilder_.dispose(); + updateTimeBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The timestamp at which the schedule was last updated.
+     * If the schedule has never been updated, this field contains the timestamp
+     * when the schedule was first created.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getUpdateTimeBuilder() { + bitField0_ |= 0x00000020; + onChanged(); + return getUpdateTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. The timestamp at which the schedule was last updated.
+     * If the schedule has never been updated, this field contains the timestamp
+     * when the schedule was first created.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() { + if (updateTimeBuilder_ != null) { + return updateTimeBuilder_.getMessageOrBuilder(); + } else { + return updateTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : updateTime_; + } + } + /** + * + * + *
+     * Output only. The timestamp at which the schedule was last updated.
+     * If the schedule has never been updated, this field contains the timestamp
+     * when the schedule was first created.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getUpdateTimeFieldBuilder() { + if (updateTimeBuilder_ == null) { + updateTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getUpdateTime(), getParentForChildren(), isClean()); + updateTime_ = null; + } + return updateTimeBuilder_; + } + + @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.spanner.admin.database.v1.BackupSchedule) + } + + // @@protoc_insertion_point(class_scope:google.spanner.admin.database.v1.BackupSchedule) + private static final com.google.spanner.admin.database.v1.BackupSchedule DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.spanner.admin.database.v1.BackupSchedule(); + } + + public static com.google.spanner.admin.database.v1.BackupSchedule getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public BackupSchedule parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.spanner.admin.database.v1.BackupSchedule getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/BackupScheduleName.java b/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/BackupScheduleName.java new file mode 100644 index 00000000000..4ab35282678 --- /dev/null +++ b/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/BackupScheduleName.java @@ -0,0 +1,261 @@ +/* + * Copyright 2024 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.spanner.admin.database.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 BackupScheduleName implements ResourceName { + private static final PathTemplate PROJECT_INSTANCE_DATABASE_SCHEDULE = + PathTemplate.createWithoutUrlEncoding( + "projects/{project}/instances/{instance}/databases/{database}/backupSchedules/{schedule}"); + private volatile Map fieldValuesMap; + private final String project; + private final String instance; + private final String database; + private final String schedule; + + @Deprecated + protected BackupScheduleName() { + project = null; + instance = null; + database = null; + schedule = null; + } + + private BackupScheduleName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + instance = Preconditions.checkNotNull(builder.getInstance()); + database = Preconditions.checkNotNull(builder.getDatabase()); + schedule = Preconditions.checkNotNull(builder.getSchedule()); + } + + public String getProject() { + return project; + } + + public String getInstance() { + return instance; + } + + public String getDatabase() { + return database; + } + + public String getSchedule() { + return schedule; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static BackupScheduleName of( + String project, String instance, String database, String schedule) { + return newBuilder() + .setProject(project) + .setInstance(instance) + .setDatabase(database) + .setSchedule(schedule) + .build(); + } + + public static String format(String project, String instance, String database, String schedule) { + return newBuilder() + .setProject(project) + .setInstance(instance) + .setDatabase(database) + .setSchedule(schedule) + .build() + .toString(); + } + + public static BackupScheduleName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PROJECT_INSTANCE_DATABASE_SCHEDULE.validatedMatch( + formattedString, "BackupScheduleName.parse: formattedString not in valid format"); + return of( + matchMap.get("project"), + matchMap.get("instance"), + matchMap.get("database"), + matchMap.get("schedule")); + } + + 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 (BackupScheduleName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PROJECT_INSTANCE_DATABASE_SCHEDULE.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 (instance != null) { + fieldMapBuilder.put("instance", instance); + } + if (database != null) { + fieldMapBuilder.put("database", database); + } + if (schedule != null) { + fieldMapBuilder.put("schedule", schedule); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return PROJECT_INSTANCE_DATABASE_SCHEDULE.instantiate( + "project", project, "instance", instance, "database", database, "schedule", schedule); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null && getClass() == o.getClass()) { + BackupScheduleName that = ((BackupScheduleName) o); + return Objects.equals(this.project, that.project) + && Objects.equals(this.instance, that.instance) + && Objects.equals(this.database, that.database) + && Objects.equals(this.schedule, that.schedule); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(project); + h *= 1000003; + h ^= Objects.hashCode(instance); + h *= 1000003; + h ^= Objects.hashCode(database); + h *= 1000003; + h ^= Objects.hashCode(schedule); + return h; + } + + /** + * Builder for + * projects/{project}/instances/{instance}/databases/{database}/backupSchedules/{schedule}. + */ + public static class Builder { + private String project; + private String instance; + private String database; + private String schedule; + + protected Builder() {} + + public String getProject() { + return project; + } + + public String getInstance() { + return instance; + } + + public String getDatabase() { + return database; + } + + public String getSchedule() { + return schedule; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setInstance(String instance) { + this.instance = instance; + return this; + } + + public Builder setDatabase(String database) { + this.database = database; + return this; + } + + public Builder setSchedule(String schedule) { + this.schedule = schedule; + return this; + } + + private Builder(BackupScheduleName backupScheduleName) { + this.project = backupScheduleName.project; + this.instance = backupScheduleName.instance; + this.database = backupScheduleName.database; + this.schedule = backupScheduleName.schedule; + } + + public BackupScheduleName build() { + return new BackupScheduleName(this); + } + } +} diff --git a/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/BackupScheduleOrBuilder.java b/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/BackupScheduleOrBuilder.java new file mode 100644 index 00000000000..cb1db14d217 --- /dev/null +++ b/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/BackupScheduleOrBuilder.java @@ -0,0 +1,287 @@ +/* + * Copyright 2024 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/spanner/admin/database/v1/backup_schedule.proto + +// Protobuf Java Version: 3.25.3 +package com.google.spanner.admin.database.v1; + +public interface BackupScheduleOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.spanner.admin.database.v1.BackupSchedule) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Identifier. Output only for the
+   * [CreateBackupSchedule][DatabaseAdmin.CreateBackupSchededule] operation.
+   * Required for the
+   * [UpdateBackupSchedule][google.spanner.admin.database.v1.DatabaseAdmin.UpdateBackupSchedule]
+   * operation. A globally unique identifier for the backup schedule which
+   * cannot be changed. Values are of the form
+   * `projects/<project>/instances/<instance>/databases/<database>/backupSchedules/[a-z][a-z0-9_\-]*[a-z0-9]`
+   * The final segment of the name must be between 2 and 60 characters in
+   * length.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Identifier. Output only for the
+   * [CreateBackupSchedule][DatabaseAdmin.CreateBackupSchededule] operation.
+   * Required for the
+   * [UpdateBackupSchedule][google.spanner.admin.database.v1.DatabaseAdmin.UpdateBackupSchedule]
+   * operation. A globally unique identifier for the backup schedule which
+   * cannot be changed. Values are of the form
+   * `projects/<project>/instances/<instance>/databases/<database>/backupSchedules/[a-z][a-z0-9_\-]*[a-z0-9]`
+   * The final segment of the name must be between 2 and 60 characters in
+   * length.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Optional. The schedule specification based on which the backup creations
+   * are triggered.
+   * 
+ * + * + * .google.spanner.admin.database.v1.BackupScheduleSpec spec = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the spec field is set. + */ + boolean hasSpec(); + /** + * + * + *
+   * Optional. The schedule specification based on which the backup creations
+   * are triggered.
+   * 
+ * + * + * .google.spanner.admin.database.v1.BackupScheduleSpec spec = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The spec. + */ + com.google.spanner.admin.database.v1.BackupScheduleSpec getSpec(); + /** + * + * + *
+   * Optional. The schedule specification based on which the backup creations
+   * are triggered.
+   * 
+ * + * + * .google.spanner.admin.database.v1.BackupScheduleSpec spec = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.spanner.admin.database.v1.BackupScheduleSpecOrBuilder getSpecOrBuilder(); + + /** + * + * + *
+   * Optional. The retention duration of a backup that must be at least 6 hours
+   * and at most 366 days. The backup is eligible to be automatically deleted
+   * once the retention period has elapsed.
+   * 
+ * + * + * .google.protobuf.Duration retention_duration = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the retentionDuration field is set. + */ + boolean hasRetentionDuration(); + /** + * + * + *
+   * Optional. The retention duration of a backup that must be at least 6 hours
+   * and at most 366 days. The backup is eligible to be automatically deleted
+   * once the retention period has elapsed.
+   * 
+ * + * + * .google.protobuf.Duration retention_duration = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The retentionDuration. + */ + com.google.protobuf.Duration getRetentionDuration(); + /** + * + * + *
+   * Optional. The retention duration of a backup that must be at least 6 hours
+   * and at most 366 days. The backup is eligible to be automatically deleted
+   * once the retention period has elapsed.
+   * 
+ * + * + * .google.protobuf.Duration retention_duration = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.protobuf.DurationOrBuilder getRetentionDurationOrBuilder(); + + /** + * + * + *
+   * Optional. The encryption configuration that will be used to encrypt the
+   * backup. If this field is not specified, the backup will use the same
+   * encryption configuration as the database.
+   * 
+ * + * + * .google.spanner.admin.database.v1.CreateBackupEncryptionConfig encryption_config = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the encryptionConfig field is set. + */ + boolean hasEncryptionConfig(); + /** + * + * + *
+   * Optional. The encryption configuration that will be used to encrypt the
+   * backup. If this field is not specified, the backup will use the same
+   * encryption configuration as the database.
+   * 
+ * + * + * .google.spanner.admin.database.v1.CreateBackupEncryptionConfig encryption_config = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The encryptionConfig. + */ + com.google.spanner.admin.database.v1.CreateBackupEncryptionConfig getEncryptionConfig(); + /** + * + * + *
+   * Optional. The encryption configuration that will be used to encrypt the
+   * backup. If this field is not specified, the backup will use the same
+   * encryption configuration as the database.
+   * 
+ * + * + * .google.spanner.admin.database.v1.CreateBackupEncryptionConfig encryption_config = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.spanner.admin.database.v1.CreateBackupEncryptionConfigOrBuilder + getEncryptionConfigOrBuilder(); + + /** + * + * + *
+   * The schedule creates only full backups.
+   * 
+ * + * .google.spanner.admin.database.v1.FullBackupSpec full_backup_spec = 7; + * + * @return Whether the fullBackupSpec field is set. + */ + boolean hasFullBackupSpec(); + /** + * + * + *
+   * The schedule creates only full backups.
+   * 
+ * + * .google.spanner.admin.database.v1.FullBackupSpec full_backup_spec = 7; + * + * @return The fullBackupSpec. + */ + com.google.spanner.admin.database.v1.FullBackupSpec getFullBackupSpec(); + /** + * + * + *
+   * The schedule creates only full backups.
+   * 
+ * + * .google.spanner.admin.database.v1.FullBackupSpec full_backup_spec = 7; + */ + com.google.spanner.admin.database.v1.FullBackupSpecOrBuilder getFullBackupSpecOrBuilder(); + + /** + * + * + *
+   * Output only. The timestamp at which the schedule was last updated.
+   * If the schedule has never been updated, this field contains the timestamp
+   * when the schedule was first created.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + boolean hasUpdateTime(); + /** + * + * + *
+   * Output only. The timestamp at which the schedule was last updated.
+   * If the schedule has never been updated, this field contains the timestamp
+   * when the schedule was first created.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The updateTime. + */ + com.google.protobuf.Timestamp getUpdateTime(); + /** + * + * + *
+   * Output only. The timestamp at which the schedule was last updated.
+   * If the schedule has never been updated, this field contains the timestamp
+   * when the schedule was first created.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder(); + + com.google.spanner.admin.database.v1.BackupSchedule.BackupTypeSpecCase getBackupTypeSpecCase(); +} diff --git a/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/BackupScheduleProto.java b/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/BackupScheduleProto.java new file mode 100644 index 00000000000..d2227049ae4 --- /dev/null +++ b/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/BackupScheduleProto.java @@ -0,0 +1,237 @@ +/* + * Copyright 2024 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/spanner/admin/database/v1/backup_schedule.proto + +// Protobuf Java Version: 3.25.3 +package com.google.spanner.admin.database.v1; + +public final class BackupScheduleProto { + private BackupScheduleProto() {} + + 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_spanner_admin_database_v1_BackupScheduleSpec_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_spanner_admin_database_v1_BackupScheduleSpec_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_spanner_admin_database_v1_BackupSchedule_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_spanner_admin_database_v1_BackupSchedule_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_spanner_admin_database_v1_CrontabSpec_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_spanner_admin_database_v1_CrontabSpec_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_spanner_admin_database_v1_CreateBackupScheduleRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_spanner_admin_database_v1_CreateBackupScheduleRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_spanner_admin_database_v1_GetBackupScheduleRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_spanner_admin_database_v1_GetBackupScheduleRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_spanner_admin_database_v1_DeleteBackupScheduleRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_spanner_admin_database_v1_DeleteBackupScheduleRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_spanner_admin_database_v1_ListBackupSchedulesRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_spanner_admin_database_v1_ListBackupSchedulesRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_spanner_admin_database_v1_ListBackupSchedulesResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_spanner_admin_database_v1_ListBackupSchedulesResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_spanner_admin_database_v1_UpdateBackupScheduleRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_spanner_admin_database_v1_UpdateBackupScheduleRequest_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\n6google/spanner/admin/database/v1/backu" + + "p_schedule.proto\022 google.spanner.admin.d" + + "atabase.v1\032\037google/api/field_behavior.pr" + + "oto\032\031google/api/resource.proto\032\036google/p" + + "rotobuf/duration.proto\032 google/protobuf/" + + "field_mask.proto\032\037google/protobuf/timest" + + "amp.proto\032-google/spanner/admin/database" + + "/v1/backup.proto\"i\n\022BackupScheduleSpec\022B" + + "\n\tcron_spec\030\001 \001(\0132-.google.spanner.admin" + + ".database.v1.CrontabSpecH\000B\017\n\rschedule_s" + + "pec\"\310\004\n\016BackupSchedule\022\021\n\004name\030\001 \001(\tB\003\340A" + + "\010\022G\n\004spec\030\006 \001(\01324.google.spanner.admin.d" + + "atabase.v1.BackupScheduleSpecB\003\340A\001\022:\n\022re" + + "tention_duration\030\003 \001(\0132\031.google.protobuf" + + ".DurationB\003\340A\001\022^\n\021encryption_config\030\004 \001(" + + "\0132>.google.spanner.admin.database.v1.Cre" + + "ateBackupEncryptionConfigB\003\340A\001\022L\n\020full_b" + + "ackup_spec\030\007 \001(\01320.google.spanner.admin." + + "database.v1.FullBackupSpecH\000\0224\n\013update_t" + + "ime\030\t \001(\0132\032.google.protobuf.TimestampB\003\340" + + "A\003:\245\001\352A\241\001\n%spanner.googleapis.com/Backup" + + "Schedule\022Wprojects/{project}/instances/{" + + "instance}/databases/{database}/backupSch" + + "edules/{schedule}*\017backupSchedules2\016back" + + "upScheduleB\022\n\020backup_type_spec\"q\n\013Cronta" + + "bSpec\022\021\n\004text\030\001 \001(\tB\003\340A\002\022\026\n\ttime_zone\030\002 " + + "\001(\tB\003\340A\003\0227\n\017creation_window\030\003 \001(\0132\031.goog" + + "le.protobuf.DurationB\003\340A\003\"\307\001\n\033CreateBack" + + "upScheduleRequest\0227\n\006parent\030\001 \001(\tB\'\340A\002\372A" + + "!\n\037spanner.googleapis.com/Database\022\037\n\022ba" + + "ckup_schedule_id\030\002 \001(\tB\003\340A\002\022N\n\017backup_sc" + + "hedule\030\003 \001(\01320.google.spanner.admin.data" + + "base.v1.BackupScheduleB\003\340A\002\"W\n\030GetBackup" + + "ScheduleRequest\022;\n\004name\030\001 \001(\tB-\340A\002\372A\'\n%s" + + "panner.googleapis.com/BackupSchedule\"Z\n\033" + + "DeleteBackupScheduleRequest\022;\n\004name\030\001 \001(" + + "\tB-\340A\002\372A\'\n%spanner.googleapis.com/Backup" + + "Schedule\"\206\001\n\032ListBackupSchedulesRequest\022" + + "7\n\006parent\030\001 \001(\tB\'\340A\002\372A!\n\037spanner.googlea" + + "pis.com/Database\022\026\n\tpage_size\030\002 \001(\005B\003\340A\001" + + "\022\027\n\npage_token\030\004 \001(\tB\003\340A\001\"\202\001\n\033ListBackup" + + "SchedulesResponse\022J\n\020backup_schedules\030\001 " + + "\003(\01320.google.spanner.admin.database.v1.B" + + "ackupSchedule\022\027\n\017next_page_token\030\002 \001(\t\"\243" + + "\001\n\033UpdateBackupScheduleRequest\022N\n\017backup" + + "_schedule\030\001 \001(\01320.google.spanner.admin.d" + + "atabase.v1.BackupScheduleB\003\340A\002\0224\n\013update" + + "_mask\030\002 \001(\0132\032.google.protobuf.FieldMaskB" + + "\003\340A\002B\205\002\n$com.google.spanner.admin.databa" + + "se.v1B\023BackupScheduleProtoP\001ZFcloud.goog" + + "le.com/go/spanner/admin/database/apiv1/d" + + "atabasepb;databasepb\252\002&Google.Cloud.Span" + + "ner.Admin.Database.V1\312\002&Google\\Cloud\\Spa" + + "nner\\Admin\\Database\\V1\352\002+Google::Cloud::" + + "Spanner::Admin::Database::V1b\006proto3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.api.FieldBehaviorProto.getDescriptor(), + com.google.api.ResourceProto.getDescriptor(), + com.google.protobuf.DurationProto.getDescriptor(), + com.google.protobuf.FieldMaskProto.getDescriptor(), + com.google.protobuf.TimestampProto.getDescriptor(), + com.google.spanner.admin.database.v1.BackupProto.getDescriptor(), + }); + internal_static_google_spanner_admin_database_v1_BackupScheduleSpec_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_spanner_admin_database_v1_BackupScheduleSpec_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_spanner_admin_database_v1_BackupScheduleSpec_descriptor, + new java.lang.String[] { + "CronSpec", "ScheduleSpec", + }); + internal_static_google_spanner_admin_database_v1_BackupSchedule_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_spanner_admin_database_v1_BackupSchedule_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_spanner_admin_database_v1_BackupSchedule_descriptor, + new java.lang.String[] { + "Name", + "Spec", + "RetentionDuration", + "EncryptionConfig", + "FullBackupSpec", + "UpdateTime", + "BackupTypeSpec", + }); + internal_static_google_spanner_admin_database_v1_CrontabSpec_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_google_spanner_admin_database_v1_CrontabSpec_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_spanner_admin_database_v1_CrontabSpec_descriptor, + new java.lang.String[] { + "Text", "TimeZone", "CreationWindow", + }); + internal_static_google_spanner_admin_database_v1_CreateBackupScheduleRequest_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_google_spanner_admin_database_v1_CreateBackupScheduleRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_spanner_admin_database_v1_CreateBackupScheduleRequest_descriptor, + new java.lang.String[] { + "Parent", "BackupScheduleId", "BackupSchedule", + }); + internal_static_google_spanner_admin_database_v1_GetBackupScheduleRequest_descriptor = + getDescriptor().getMessageTypes().get(4); + internal_static_google_spanner_admin_database_v1_GetBackupScheduleRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_spanner_admin_database_v1_GetBackupScheduleRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_spanner_admin_database_v1_DeleteBackupScheduleRequest_descriptor = + getDescriptor().getMessageTypes().get(5); + internal_static_google_spanner_admin_database_v1_DeleteBackupScheduleRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_spanner_admin_database_v1_DeleteBackupScheduleRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_spanner_admin_database_v1_ListBackupSchedulesRequest_descriptor = + getDescriptor().getMessageTypes().get(6); + internal_static_google_spanner_admin_database_v1_ListBackupSchedulesRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_spanner_admin_database_v1_ListBackupSchedulesRequest_descriptor, + new java.lang.String[] { + "Parent", "PageSize", "PageToken", + }); + internal_static_google_spanner_admin_database_v1_ListBackupSchedulesResponse_descriptor = + getDescriptor().getMessageTypes().get(7); + internal_static_google_spanner_admin_database_v1_ListBackupSchedulesResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_spanner_admin_database_v1_ListBackupSchedulesResponse_descriptor, + new java.lang.String[] { + "BackupSchedules", "NextPageToken", + }); + internal_static_google_spanner_admin_database_v1_UpdateBackupScheduleRequest_descriptor = + getDescriptor().getMessageTypes().get(8); + internal_static_google_spanner_admin_database_v1_UpdateBackupScheduleRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_spanner_admin_database_v1_UpdateBackupScheduleRequest_descriptor, + new java.lang.String[] { + "BackupSchedule", "UpdateMask", + }); + com.google.protobuf.ExtensionRegistry registry = + com.google.protobuf.ExtensionRegistry.newInstance(); + registry.add(com.google.api.FieldBehaviorProto.fieldBehavior); + registry.add(com.google.api.ResourceProto.resource); + registry.add(com.google.api.ResourceProto.resourceReference); + com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( + descriptor, registry); + com.google.api.FieldBehaviorProto.getDescriptor(); + com.google.api.ResourceProto.getDescriptor(); + com.google.protobuf.DurationProto.getDescriptor(); + com.google.protobuf.FieldMaskProto.getDescriptor(); + com.google.protobuf.TimestampProto.getDescriptor(); + com.google.spanner.admin.database.v1.BackupProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/BackupScheduleSpec.java b/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/BackupScheduleSpec.java new file mode 100644 index 00000000000..d5f0ad3ed70 --- /dev/null +++ b/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/BackupScheduleSpec.java @@ -0,0 +1,820 @@ +/* + * Copyright 2024 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/spanner/admin/database/v1/backup_schedule.proto + +// Protobuf Java Version: 3.25.3 +package com.google.spanner.admin.database.v1; + +/** + * + * + *
+ * Defines specifications of the backup schedule.
+ * 
+ * + * Protobuf type {@code google.spanner.admin.database.v1.BackupScheduleSpec} + */ +public final class BackupScheduleSpec extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.spanner.admin.database.v1.BackupScheduleSpec) + BackupScheduleSpecOrBuilder { + private static final long serialVersionUID = 0L; + // Use BackupScheduleSpec.newBuilder() to construct. + private BackupScheduleSpec(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private BackupScheduleSpec() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new BackupScheduleSpec(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.spanner.admin.database.v1.BackupScheduleProto + .internal_static_google_spanner_admin_database_v1_BackupScheduleSpec_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.spanner.admin.database.v1.BackupScheduleProto + .internal_static_google_spanner_admin_database_v1_BackupScheduleSpec_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.spanner.admin.database.v1.BackupScheduleSpec.class, + com.google.spanner.admin.database.v1.BackupScheduleSpec.Builder.class); + } + + private int scheduleSpecCase_ = 0; + + @SuppressWarnings("serial") + private java.lang.Object scheduleSpec_; + + public enum ScheduleSpecCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + CRON_SPEC(1), + SCHEDULESPEC_NOT_SET(0); + private final int value; + + private ScheduleSpecCase(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 ScheduleSpecCase valueOf(int value) { + return forNumber(value); + } + + public static ScheduleSpecCase forNumber(int value) { + switch (value) { + case 1: + return CRON_SPEC; + case 0: + return SCHEDULESPEC_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public ScheduleSpecCase getScheduleSpecCase() { + return ScheduleSpecCase.forNumber(scheduleSpecCase_); + } + + public static final int CRON_SPEC_FIELD_NUMBER = 1; + /** + * + * + *
+   * Cron style schedule specification.
+   * 
+ * + * .google.spanner.admin.database.v1.CrontabSpec cron_spec = 1; + * + * @return Whether the cronSpec field is set. + */ + @java.lang.Override + public boolean hasCronSpec() { + return scheduleSpecCase_ == 1; + } + /** + * + * + *
+   * Cron style schedule specification.
+   * 
+ * + * .google.spanner.admin.database.v1.CrontabSpec cron_spec = 1; + * + * @return The cronSpec. + */ + @java.lang.Override + public com.google.spanner.admin.database.v1.CrontabSpec getCronSpec() { + if (scheduleSpecCase_ == 1) { + return (com.google.spanner.admin.database.v1.CrontabSpec) scheduleSpec_; + } + return com.google.spanner.admin.database.v1.CrontabSpec.getDefaultInstance(); + } + /** + * + * + *
+   * Cron style schedule specification.
+   * 
+ * + * .google.spanner.admin.database.v1.CrontabSpec cron_spec = 1; + */ + @java.lang.Override + public com.google.spanner.admin.database.v1.CrontabSpecOrBuilder getCronSpecOrBuilder() { + if (scheduleSpecCase_ == 1) { + return (com.google.spanner.admin.database.v1.CrontabSpec) scheduleSpec_; + } + return com.google.spanner.admin.database.v1.CrontabSpec.getDefaultInstance(); + } + + 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 (scheduleSpecCase_ == 1) { + output.writeMessage(1, (com.google.spanner.admin.database.v1.CrontabSpec) scheduleSpec_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (scheduleSpecCase_ == 1) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 1, (com.google.spanner.admin.database.v1.CrontabSpec) scheduleSpec_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.spanner.admin.database.v1.BackupScheduleSpec)) { + return super.equals(obj); + } + com.google.spanner.admin.database.v1.BackupScheduleSpec other = + (com.google.spanner.admin.database.v1.BackupScheduleSpec) obj; + + if (!getScheduleSpecCase().equals(other.getScheduleSpecCase())) return false; + switch (scheduleSpecCase_) { + case 1: + if (!getCronSpec().equals(other.getCronSpec())) return false; + break; + case 0: + default: + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + switch (scheduleSpecCase_) { + case 1: + hash = (37 * hash) + CRON_SPEC_FIELD_NUMBER; + hash = (53 * hash) + getCronSpec().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.spanner.admin.database.v1.BackupScheduleSpec parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.spanner.admin.database.v1.BackupScheduleSpec parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.spanner.admin.database.v1.BackupScheduleSpec parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.spanner.admin.database.v1.BackupScheduleSpec 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.spanner.admin.database.v1.BackupScheduleSpec parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.spanner.admin.database.v1.BackupScheduleSpec parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.spanner.admin.database.v1.BackupScheduleSpec parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.spanner.admin.database.v1.BackupScheduleSpec 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.spanner.admin.database.v1.BackupScheduleSpec parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.spanner.admin.database.v1.BackupScheduleSpec 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.spanner.admin.database.v1.BackupScheduleSpec parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.spanner.admin.database.v1.BackupScheduleSpec 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.spanner.admin.database.v1.BackupScheduleSpec 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; + } + /** + * + * + *
+   * Defines specifications of the backup schedule.
+   * 
+ * + * Protobuf type {@code google.spanner.admin.database.v1.BackupScheduleSpec} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.spanner.admin.database.v1.BackupScheduleSpec) + com.google.spanner.admin.database.v1.BackupScheduleSpecOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.spanner.admin.database.v1.BackupScheduleProto + .internal_static_google_spanner_admin_database_v1_BackupScheduleSpec_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.spanner.admin.database.v1.BackupScheduleProto + .internal_static_google_spanner_admin_database_v1_BackupScheduleSpec_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.spanner.admin.database.v1.BackupScheduleSpec.class, + com.google.spanner.admin.database.v1.BackupScheduleSpec.Builder.class); + } + + // Construct using com.google.spanner.admin.database.v1.BackupScheduleSpec.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (cronSpecBuilder_ != null) { + cronSpecBuilder_.clear(); + } + scheduleSpecCase_ = 0; + scheduleSpec_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.spanner.admin.database.v1.BackupScheduleProto + .internal_static_google_spanner_admin_database_v1_BackupScheduleSpec_descriptor; + } + + @java.lang.Override + public com.google.spanner.admin.database.v1.BackupScheduleSpec getDefaultInstanceForType() { + return com.google.spanner.admin.database.v1.BackupScheduleSpec.getDefaultInstance(); + } + + @java.lang.Override + public com.google.spanner.admin.database.v1.BackupScheduleSpec build() { + com.google.spanner.admin.database.v1.BackupScheduleSpec result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.spanner.admin.database.v1.BackupScheduleSpec buildPartial() { + com.google.spanner.admin.database.v1.BackupScheduleSpec result = + new com.google.spanner.admin.database.v1.BackupScheduleSpec(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + buildPartialOneofs(result); + onBuilt(); + return result; + } + + private void buildPartial0(com.google.spanner.admin.database.v1.BackupScheduleSpec result) { + int from_bitField0_ = bitField0_; + } + + private void buildPartialOneofs( + com.google.spanner.admin.database.v1.BackupScheduleSpec result) { + result.scheduleSpecCase_ = scheduleSpecCase_; + result.scheduleSpec_ = this.scheduleSpec_; + if (scheduleSpecCase_ == 1 && cronSpecBuilder_ != null) { + result.scheduleSpec_ = cronSpecBuilder_.build(); + } + } + + @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.spanner.admin.database.v1.BackupScheduleSpec) { + return mergeFrom((com.google.spanner.admin.database.v1.BackupScheduleSpec) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.spanner.admin.database.v1.BackupScheduleSpec other) { + if (other == com.google.spanner.admin.database.v1.BackupScheduleSpec.getDefaultInstance()) + return this; + switch (other.getScheduleSpecCase()) { + case CRON_SPEC: + { + mergeCronSpec(other.getCronSpec()); + break; + } + case SCHEDULESPEC_NOT_SET: + { + break; + } + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage(getCronSpecFieldBuilder().getBuilder(), extensionRegistry); + scheduleSpecCase_ = 1; + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int scheduleSpecCase_ = 0; + private java.lang.Object scheduleSpec_; + + public ScheduleSpecCase getScheduleSpecCase() { + return ScheduleSpecCase.forNumber(scheduleSpecCase_); + } + + public Builder clearScheduleSpec() { + scheduleSpecCase_ = 0; + scheduleSpec_ = null; + onChanged(); + return this; + } + + private int bitField0_; + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.spanner.admin.database.v1.CrontabSpec, + com.google.spanner.admin.database.v1.CrontabSpec.Builder, + com.google.spanner.admin.database.v1.CrontabSpecOrBuilder> + cronSpecBuilder_; + /** + * + * + *
+     * Cron style schedule specification.
+     * 
+ * + * .google.spanner.admin.database.v1.CrontabSpec cron_spec = 1; + * + * @return Whether the cronSpec field is set. + */ + @java.lang.Override + public boolean hasCronSpec() { + return scheduleSpecCase_ == 1; + } + /** + * + * + *
+     * Cron style schedule specification.
+     * 
+ * + * .google.spanner.admin.database.v1.CrontabSpec cron_spec = 1; + * + * @return The cronSpec. + */ + @java.lang.Override + public com.google.spanner.admin.database.v1.CrontabSpec getCronSpec() { + if (cronSpecBuilder_ == null) { + if (scheduleSpecCase_ == 1) { + return (com.google.spanner.admin.database.v1.CrontabSpec) scheduleSpec_; + } + return com.google.spanner.admin.database.v1.CrontabSpec.getDefaultInstance(); + } else { + if (scheduleSpecCase_ == 1) { + return cronSpecBuilder_.getMessage(); + } + return com.google.spanner.admin.database.v1.CrontabSpec.getDefaultInstance(); + } + } + /** + * + * + *
+     * Cron style schedule specification.
+     * 
+ * + * .google.spanner.admin.database.v1.CrontabSpec cron_spec = 1; + */ + public Builder setCronSpec(com.google.spanner.admin.database.v1.CrontabSpec value) { + if (cronSpecBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + scheduleSpec_ = value; + onChanged(); + } else { + cronSpecBuilder_.setMessage(value); + } + scheduleSpecCase_ = 1; + return this; + } + /** + * + * + *
+     * Cron style schedule specification.
+     * 
+ * + * .google.spanner.admin.database.v1.CrontabSpec cron_spec = 1; + */ + public Builder setCronSpec( + com.google.spanner.admin.database.v1.CrontabSpec.Builder builderForValue) { + if (cronSpecBuilder_ == null) { + scheduleSpec_ = builderForValue.build(); + onChanged(); + } else { + cronSpecBuilder_.setMessage(builderForValue.build()); + } + scheduleSpecCase_ = 1; + return this; + } + /** + * + * + *
+     * Cron style schedule specification.
+     * 
+ * + * .google.spanner.admin.database.v1.CrontabSpec cron_spec = 1; + */ + public Builder mergeCronSpec(com.google.spanner.admin.database.v1.CrontabSpec value) { + if (cronSpecBuilder_ == null) { + if (scheduleSpecCase_ == 1 + && scheduleSpec_ + != com.google.spanner.admin.database.v1.CrontabSpec.getDefaultInstance()) { + scheduleSpec_ = + com.google.spanner.admin.database.v1.CrontabSpec.newBuilder( + (com.google.spanner.admin.database.v1.CrontabSpec) scheduleSpec_) + .mergeFrom(value) + .buildPartial(); + } else { + scheduleSpec_ = value; + } + onChanged(); + } else { + if (scheduleSpecCase_ == 1) { + cronSpecBuilder_.mergeFrom(value); + } else { + cronSpecBuilder_.setMessage(value); + } + } + scheduleSpecCase_ = 1; + return this; + } + /** + * + * + *
+     * Cron style schedule specification.
+     * 
+ * + * .google.spanner.admin.database.v1.CrontabSpec cron_spec = 1; + */ + public Builder clearCronSpec() { + if (cronSpecBuilder_ == null) { + if (scheduleSpecCase_ == 1) { + scheduleSpecCase_ = 0; + scheduleSpec_ = null; + onChanged(); + } + } else { + if (scheduleSpecCase_ == 1) { + scheduleSpecCase_ = 0; + scheduleSpec_ = null; + } + cronSpecBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Cron style schedule specification.
+     * 
+ * + * .google.spanner.admin.database.v1.CrontabSpec cron_spec = 1; + */ + public com.google.spanner.admin.database.v1.CrontabSpec.Builder getCronSpecBuilder() { + return getCronSpecFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Cron style schedule specification.
+     * 
+ * + * .google.spanner.admin.database.v1.CrontabSpec cron_spec = 1; + */ + @java.lang.Override + public com.google.spanner.admin.database.v1.CrontabSpecOrBuilder getCronSpecOrBuilder() { + if ((scheduleSpecCase_ == 1) && (cronSpecBuilder_ != null)) { + return cronSpecBuilder_.getMessageOrBuilder(); + } else { + if (scheduleSpecCase_ == 1) { + return (com.google.spanner.admin.database.v1.CrontabSpec) scheduleSpec_; + } + return com.google.spanner.admin.database.v1.CrontabSpec.getDefaultInstance(); + } + } + /** + * + * + *
+     * Cron style schedule specification.
+     * 
+ * + * .google.spanner.admin.database.v1.CrontabSpec cron_spec = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.spanner.admin.database.v1.CrontabSpec, + com.google.spanner.admin.database.v1.CrontabSpec.Builder, + com.google.spanner.admin.database.v1.CrontabSpecOrBuilder> + getCronSpecFieldBuilder() { + if (cronSpecBuilder_ == null) { + if (!(scheduleSpecCase_ == 1)) { + scheduleSpec_ = com.google.spanner.admin.database.v1.CrontabSpec.getDefaultInstance(); + } + cronSpecBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.spanner.admin.database.v1.CrontabSpec, + com.google.spanner.admin.database.v1.CrontabSpec.Builder, + com.google.spanner.admin.database.v1.CrontabSpecOrBuilder>( + (com.google.spanner.admin.database.v1.CrontabSpec) scheduleSpec_, + getParentForChildren(), + isClean()); + scheduleSpec_ = null; + } + scheduleSpecCase_ = 1; + onChanged(); + return cronSpecBuilder_; + } + + @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.spanner.admin.database.v1.BackupScheduleSpec) + } + + // @@protoc_insertion_point(class_scope:google.spanner.admin.database.v1.BackupScheduleSpec) + private static final com.google.spanner.admin.database.v1.BackupScheduleSpec DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.spanner.admin.database.v1.BackupScheduleSpec(); + } + + public static com.google.spanner.admin.database.v1.BackupScheduleSpec getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public BackupScheduleSpec parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.spanner.admin.database.v1.BackupScheduleSpec getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/BackupScheduleSpecOrBuilder.java b/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/BackupScheduleSpecOrBuilder.java new file mode 100644 index 00000000000..df8f8268965 --- /dev/null +++ b/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/BackupScheduleSpecOrBuilder.java @@ -0,0 +1,63 @@ +/* + * Copyright 2024 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/spanner/admin/database/v1/backup_schedule.proto + +// Protobuf Java Version: 3.25.3 +package com.google.spanner.admin.database.v1; + +public interface BackupScheduleSpecOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.spanner.admin.database.v1.BackupScheduleSpec) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Cron style schedule specification.
+   * 
+ * + * .google.spanner.admin.database.v1.CrontabSpec cron_spec = 1; + * + * @return Whether the cronSpec field is set. + */ + boolean hasCronSpec(); + /** + * + * + *
+   * Cron style schedule specification.
+   * 
+ * + * .google.spanner.admin.database.v1.CrontabSpec cron_spec = 1; + * + * @return The cronSpec. + */ + com.google.spanner.admin.database.v1.CrontabSpec getCronSpec(); + /** + * + * + *
+   * Cron style schedule specification.
+   * 
+ * + * .google.spanner.admin.database.v1.CrontabSpec cron_spec = 1; + */ + com.google.spanner.admin.database.v1.CrontabSpecOrBuilder getCronSpecOrBuilder(); + + com.google.spanner.admin.database.v1.BackupScheduleSpec.ScheduleSpecCase getScheduleSpecCase(); +} diff --git a/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/CreateBackupScheduleRequest.java b/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/CreateBackupScheduleRequest.java new file mode 100644 index 00000000000..f16ded8cbb7 --- /dev/null +++ b/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/CreateBackupScheduleRequest.java @@ -0,0 +1,1152 @@ +/* + * Copyright 2024 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/spanner/admin/database/v1/backup_schedule.proto + +// Protobuf Java Version: 3.25.3 +package com.google.spanner.admin.database.v1; + +/** + * + * + *
+ * The request for
+ * [CreateBackupSchedule][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackupSchedule].
+ * 
+ * + * Protobuf type {@code google.spanner.admin.database.v1.CreateBackupScheduleRequest} + */ +public final class CreateBackupScheduleRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.spanner.admin.database.v1.CreateBackupScheduleRequest) + CreateBackupScheduleRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use CreateBackupScheduleRequest.newBuilder() to construct. + private CreateBackupScheduleRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CreateBackupScheduleRequest() { + parent_ = ""; + backupScheduleId_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new CreateBackupScheduleRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.spanner.admin.database.v1.BackupScheduleProto + .internal_static_google_spanner_admin_database_v1_CreateBackupScheduleRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.spanner.admin.database.v1.BackupScheduleProto + .internal_static_google_spanner_admin_database_v1_CreateBackupScheduleRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.spanner.admin.database.v1.CreateBackupScheduleRequest.class, + com.google.spanner.admin.database.v1.CreateBackupScheduleRequest.Builder.class); + } + + private int bitField0_; + public static final int PARENT_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object parent_ = ""; + /** + * + * + *
+   * Required. The name of the database that this backup schedule applies to.
+   * 
+ * + * + * 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 name of the database that this backup schedule applies to.
+   * 
+ * + * + * 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_SCHEDULE_ID_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object backupScheduleId_ = ""; + /** + * + * + *
+   * Required. The Id to use for the backup schedule. The `backup_schedule_id`
+   * appended to `parent` forms the full backup schedule name of the form
+   * `projects/<project>/instances/<instance>/databases/<database>/backupSchedules/<backup_schedule_id>`.
+   * 
+ * + * string backup_schedule_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The backupScheduleId. + */ + @java.lang.Override + public java.lang.String getBackupScheduleId() { + java.lang.Object ref = backupScheduleId_; + 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(); + backupScheduleId_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The Id to use for the backup schedule. The `backup_schedule_id`
+   * appended to `parent` forms the full backup schedule name of the form
+   * `projects/<project>/instances/<instance>/databases/<database>/backupSchedules/<backup_schedule_id>`.
+   * 
+ * + * string backup_schedule_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for backupScheduleId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getBackupScheduleIdBytes() { + java.lang.Object ref = backupScheduleId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + backupScheduleId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int BACKUP_SCHEDULE_FIELD_NUMBER = 3; + private com.google.spanner.admin.database.v1.BackupSchedule backupSchedule_; + /** + * + * + *
+   * Required. The backup schedule to create.
+   * 
+ * + * + * .google.spanner.admin.database.v1.BackupSchedule backup_schedule = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the backupSchedule field is set. + */ + @java.lang.Override + public boolean hasBackupSchedule() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+   * Required. The backup schedule to create.
+   * 
+ * + * + * .google.spanner.admin.database.v1.BackupSchedule backup_schedule = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The backupSchedule. + */ + @java.lang.Override + public com.google.spanner.admin.database.v1.BackupSchedule getBackupSchedule() { + return backupSchedule_ == null + ? com.google.spanner.admin.database.v1.BackupSchedule.getDefaultInstance() + : backupSchedule_; + } + /** + * + * + *
+   * Required. The backup schedule to create.
+   * 
+ * + * + * .google.spanner.admin.database.v1.BackupSchedule backup_schedule = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.spanner.admin.database.v1.BackupScheduleOrBuilder getBackupScheduleOrBuilder() { + return backupSchedule_ == null + ? com.google.spanner.admin.database.v1.BackupSchedule.getDefaultInstance() + : backupSchedule_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(backupScheduleId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, backupScheduleId_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(3, getBackupSchedule()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(backupScheduleId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, backupScheduleId_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getBackupSchedule()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.spanner.admin.database.v1.CreateBackupScheduleRequest)) { + return super.equals(obj); + } + com.google.spanner.admin.database.v1.CreateBackupScheduleRequest other = + (com.google.spanner.admin.database.v1.CreateBackupScheduleRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (!getBackupScheduleId().equals(other.getBackupScheduleId())) return false; + if (hasBackupSchedule() != other.hasBackupSchedule()) return false; + if (hasBackupSchedule()) { + if (!getBackupSchedule().equals(other.getBackupSchedule())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + hash = (37 * hash) + BACKUP_SCHEDULE_ID_FIELD_NUMBER; + hash = (53 * hash) + getBackupScheduleId().hashCode(); + if (hasBackupSchedule()) { + hash = (37 * hash) + BACKUP_SCHEDULE_FIELD_NUMBER; + hash = (53 * hash) + getBackupSchedule().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.spanner.admin.database.v1.CreateBackupScheduleRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.spanner.admin.database.v1.CreateBackupScheduleRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.spanner.admin.database.v1.CreateBackupScheduleRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.spanner.admin.database.v1.CreateBackupScheduleRequest 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.spanner.admin.database.v1.CreateBackupScheduleRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.spanner.admin.database.v1.CreateBackupScheduleRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.spanner.admin.database.v1.CreateBackupScheduleRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.spanner.admin.database.v1.CreateBackupScheduleRequest 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.spanner.admin.database.v1.CreateBackupScheduleRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.spanner.admin.database.v1.CreateBackupScheduleRequest 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.spanner.admin.database.v1.CreateBackupScheduleRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.spanner.admin.database.v1.CreateBackupScheduleRequest 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.spanner.admin.database.v1.CreateBackupScheduleRequest 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; + } + /** + * + * + *
+   * The request for
+   * [CreateBackupSchedule][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackupSchedule].
+   * 
+ * + * Protobuf type {@code google.spanner.admin.database.v1.CreateBackupScheduleRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.spanner.admin.database.v1.CreateBackupScheduleRequest) + com.google.spanner.admin.database.v1.CreateBackupScheduleRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.spanner.admin.database.v1.BackupScheduleProto + .internal_static_google_spanner_admin_database_v1_CreateBackupScheduleRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.spanner.admin.database.v1.BackupScheduleProto + .internal_static_google_spanner_admin_database_v1_CreateBackupScheduleRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.spanner.admin.database.v1.CreateBackupScheduleRequest.class, + com.google.spanner.admin.database.v1.CreateBackupScheduleRequest.Builder.class); + } + + // Construct using com.google.spanner.admin.database.v1.CreateBackupScheduleRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getBackupScheduleFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + parent_ = ""; + backupScheduleId_ = ""; + backupSchedule_ = null; + if (backupScheduleBuilder_ != null) { + backupScheduleBuilder_.dispose(); + backupScheduleBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.spanner.admin.database.v1.BackupScheduleProto + .internal_static_google_spanner_admin_database_v1_CreateBackupScheduleRequest_descriptor; + } + + @java.lang.Override + public com.google.spanner.admin.database.v1.CreateBackupScheduleRequest + getDefaultInstanceForType() { + return com.google.spanner.admin.database.v1.CreateBackupScheduleRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.spanner.admin.database.v1.CreateBackupScheduleRequest build() { + com.google.spanner.admin.database.v1.CreateBackupScheduleRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.spanner.admin.database.v1.CreateBackupScheduleRequest buildPartial() { + com.google.spanner.admin.database.v1.CreateBackupScheduleRequest result = + new com.google.spanner.admin.database.v1.CreateBackupScheduleRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.spanner.admin.database.v1.CreateBackupScheduleRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.parent_ = parent_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.backupScheduleId_ = backupScheduleId_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000004) != 0)) { + result.backupSchedule_ = + backupScheduleBuilder_ == null ? backupSchedule_ : backupScheduleBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @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.spanner.admin.database.v1.CreateBackupScheduleRequest) { + return mergeFrom((com.google.spanner.admin.database.v1.CreateBackupScheduleRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.spanner.admin.database.v1.CreateBackupScheduleRequest other) { + if (other + == com.google.spanner.admin.database.v1.CreateBackupScheduleRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getBackupScheduleId().isEmpty()) { + backupScheduleId_ = other.backupScheduleId_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.hasBackupSchedule()) { + mergeBackupSchedule(other.getBackupSchedule()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + parent_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + backupScheduleId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + input.readMessage(getBackupScheduleFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. The name of the database that this backup schedule applies to.
+     * 
+ * + * + * 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 name of the database that this backup schedule applies to.
+     * 
+ * + * + * 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 name of the database that this backup schedule applies to.
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the database that this backup schedule applies to.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + parent_ = getDefaultInstance().getParent(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the database that this backup schedule applies to.
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object backupScheduleId_ = ""; + /** + * + * + *
+     * Required. The Id to use for the backup schedule. The `backup_schedule_id`
+     * appended to `parent` forms the full backup schedule name of the form
+     * `projects/<project>/instances/<instance>/databases/<database>/backupSchedules/<backup_schedule_id>`.
+     * 
+ * + * string backup_schedule_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The backupScheduleId. + */ + public java.lang.String getBackupScheduleId() { + java.lang.Object ref = backupScheduleId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + backupScheduleId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The Id to use for the backup schedule. The `backup_schedule_id`
+     * appended to `parent` forms the full backup schedule name of the form
+     * `projects/<project>/instances/<instance>/databases/<database>/backupSchedules/<backup_schedule_id>`.
+     * 
+ * + * string backup_schedule_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for backupScheduleId. + */ + public com.google.protobuf.ByteString getBackupScheduleIdBytes() { + java.lang.Object ref = backupScheduleId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + backupScheduleId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The Id to use for the backup schedule. The `backup_schedule_id`
+     * appended to `parent` forms the full backup schedule name of the form
+     * `projects/<project>/instances/<instance>/databases/<database>/backupSchedules/<backup_schedule_id>`.
+     * 
+ * + * string backup_schedule_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The backupScheduleId to set. + * @return This builder for chaining. + */ + public Builder setBackupScheduleId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + backupScheduleId_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The Id to use for the backup schedule. The `backup_schedule_id`
+     * appended to `parent` forms the full backup schedule name of the form
+     * `projects/<project>/instances/<instance>/databases/<database>/backupSchedules/<backup_schedule_id>`.
+     * 
+ * + * string backup_schedule_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearBackupScheduleId() { + backupScheduleId_ = getDefaultInstance().getBackupScheduleId(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The Id to use for the backup schedule. The `backup_schedule_id`
+     * appended to `parent` forms the full backup schedule name of the form
+     * `projects/<project>/instances/<instance>/databases/<database>/backupSchedules/<backup_schedule_id>`.
+     * 
+ * + * string backup_schedule_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for backupScheduleId to set. + * @return This builder for chaining. + */ + public Builder setBackupScheduleIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + backupScheduleId_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private com.google.spanner.admin.database.v1.BackupSchedule backupSchedule_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.spanner.admin.database.v1.BackupSchedule, + com.google.spanner.admin.database.v1.BackupSchedule.Builder, + com.google.spanner.admin.database.v1.BackupScheduleOrBuilder> + backupScheduleBuilder_; + /** + * + * + *
+     * Required. The backup schedule to create.
+     * 
+ * + * + * .google.spanner.admin.database.v1.BackupSchedule backup_schedule = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the backupSchedule field is set. + */ + public boolean hasBackupSchedule() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + * + * + *
+     * Required. The backup schedule to create.
+     * 
+ * + * + * .google.spanner.admin.database.v1.BackupSchedule backup_schedule = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The backupSchedule. + */ + public com.google.spanner.admin.database.v1.BackupSchedule getBackupSchedule() { + if (backupScheduleBuilder_ == null) { + return backupSchedule_ == null + ? com.google.spanner.admin.database.v1.BackupSchedule.getDefaultInstance() + : backupSchedule_; + } else { + return backupScheduleBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. The backup schedule to create.
+     * 
+ * + * + * .google.spanner.admin.database.v1.BackupSchedule backup_schedule = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setBackupSchedule(com.google.spanner.admin.database.v1.BackupSchedule value) { + if (backupScheduleBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + backupSchedule_ = value; + } else { + backupScheduleBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The backup schedule to create.
+     * 
+ * + * + * .google.spanner.admin.database.v1.BackupSchedule backup_schedule = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setBackupSchedule( + com.google.spanner.admin.database.v1.BackupSchedule.Builder builderForValue) { + if (backupScheduleBuilder_ == null) { + backupSchedule_ = builderForValue.build(); + } else { + backupScheduleBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The backup schedule to create.
+     * 
+ * + * + * .google.spanner.admin.database.v1.BackupSchedule backup_schedule = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeBackupSchedule(com.google.spanner.admin.database.v1.BackupSchedule value) { + if (backupScheduleBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && backupSchedule_ != null + && backupSchedule_ + != com.google.spanner.admin.database.v1.BackupSchedule.getDefaultInstance()) { + getBackupScheduleBuilder().mergeFrom(value); + } else { + backupSchedule_ = value; + } + } else { + backupScheduleBuilder_.mergeFrom(value); + } + if (backupSchedule_ != null) { + bitField0_ |= 0x00000004; + onChanged(); + } + return this; + } + /** + * + * + *
+     * Required. The backup schedule to create.
+     * 
+ * + * + * .google.spanner.admin.database.v1.BackupSchedule backup_schedule = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearBackupSchedule() { + bitField0_ = (bitField0_ & ~0x00000004); + backupSchedule_ = null; + if (backupScheduleBuilder_ != null) { + backupScheduleBuilder_.dispose(); + backupScheduleBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The backup schedule to create.
+     * 
+ * + * + * .google.spanner.admin.database.v1.BackupSchedule backup_schedule = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.spanner.admin.database.v1.BackupSchedule.Builder getBackupScheduleBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return getBackupScheduleFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. The backup schedule to create.
+     * 
+ * + * + * .google.spanner.admin.database.v1.BackupSchedule backup_schedule = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.spanner.admin.database.v1.BackupScheduleOrBuilder + getBackupScheduleOrBuilder() { + if (backupScheduleBuilder_ != null) { + return backupScheduleBuilder_.getMessageOrBuilder(); + } else { + return backupSchedule_ == null + ? com.google.spanner.admin.database.v1.BackupSchedule.getDefaultInstance() + : backupSchedule_; + } + } + /** + * + * + *
+     * Required. The backup schedule to create.
+     * 
+ * + * + * .google.spanner.admin.database.v1.BackupSchedule backup_schedule = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.spanner.admin.database.v1.BackupSchedule, + com.google.spanner.admin.database.v1.BackupSchedule.Builder, + com.google.spanner.admin.database.v1.BackupScheduleOrBuilder> + getBackupScheduleFieldBuilder() { + if (backupScheduleBuilder_ == null) { + backupScheduleBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.spanner.admin.database.v1.BackupSchedule, + com.google.spanner.admin.database.v1.BackupSchedule.Builder, + com.google.spanner.admin.database.v1.BackupScheduleOrBuilder>( + getBackupSchedule(), getParentForChildren(), isClean()); + backupSchedule_ = null; + } + return backupScheduleBuilder_; + } + + @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.spanner.admin.database.v1.CreateBackupScheduleRequest) + } + + // @@protoc_insertion_point(class_scope:google.spanner.admin.database.v1.CreateBackupScheduleRequest) + private static final com.google.spanner.admin.database.v1.CreateBackupScheduleRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.spanner.admin.database.v1.CreateBackupScheduleRequest(); + } + + public static com.google.spanner.admin.database.v1.CreateBackupScheduleRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CreateBackupScheduleRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.spanner.admin.database.v1.CreateBackupScheduleRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/CreateBackupScheduleRequestOrBuilder.java b/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/CreateBackupScheduleRequestOrBuilder.java new file mode 100644 index 00000000000..4882326d5a1 --- /dev/null +++ b/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/CreateBackupScheduleRequestOrBuilder.java @@ -0,0 +1,125 @@ +/* + * Copyright 2024 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/spanner/admin/database/v1/backup_schedule.proto + +// Protobuf Java Version: 3.25.3 +package com.google.spanner.admin.database.v1; + +public interface CreateBackupScheduleRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.spanner.admin.database.v1.CreateBackupScheduleRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The name of the database that this backup schedule applies to.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. The name of the database that this backup schedule applies to.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Required. The Id to use for the backup schedule. The `backup_schedule_id`
+   * appended to `parent` forms the full backup schedule name of the form
+   * `projects/<project>/instances/<instance>/databases/<database>/backupSchedules/<backup_schedule_id>`.
+   * 
+ * + * string backup_schedule_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The backupScheduleId. + */ + java.lang.String getBackupScheduleId(); + /** + * + * + *
+   * Required. The Id to use for the backup schedule. The `backup_schedule_id`
+   * appended to `parent` forms the full backup schedule name of the form
+   * `projects/<project>/instances/<instance>/databases/<database>/backupSchedules/<backup_schedule_id>`.
+   * 
+ * + * string backup_schedule_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for backupScheduleId. + */ + com.google.protobuf.ByteString getBackupScheduleIdBytes(); + + /** + * + * + *
+   * Required. The backup schedule to create.
+   * 
+ * + * + * .google.spanner.admin.database.v1.BackupSchedule backup_schedule = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the backupSchedule field is set. + */ + boolean hasBackupSchedule(); + /** + * + * + *
+   * Required. The backup schedule to create.
+   * 
+ * + * + * .google.spanner.admin.database.v1.BackupSchedule backup_schedule = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The backupSchedule. + */ + com.google.spanner.admin.database.v1.BackupSchedule getBackupSchedule(); + /** + * + * + *
+   * Required. The backup schedule to create.
+   * 
+ * + * + * .google.spanner.admin.database.v1.BackupSchedule backup_schedule = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.spanner.admin.database.v1.BackupScheduleOrBuilder getBackupScheduleOrBuilder(); +} diff --git a/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/CrontabSpec.java b/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/CrontabSpec.java new file mode 100644 index 00000000000..17b2126c51c --- /dev/null +++ b/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/CrontabSpec.java @@ -0,0 +1,1269 @@ +/* + * Copyright 2024 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/spanner/admin/database/v1/backup_schedule.proto + +// Protobuf Java Version: 3.25.3 +package com.google.spanner.admin.database.v1; + +/** + * + * + *
+ * CrontabSpec can be used to specify the version time and frequency at
+ * which the backup should be created.
+ * 
+ * + * Protobuf type {@code google.spanner.admin.database.v1.CrontabSpec} + */ +public final class CrontabSpec extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.spanner.admin.database.v1.CrontabSpec) + CrontabSpecOrBuilder { + private static final long serialVersionUID = 0L; + // Use CrontabSpec.newBuilder() to construct. + private CrontabSpec(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CrontabSpec() { + text_ = ""; + timeZone_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new CrontabSpec(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.spanner.admin.database.v1.BackupScheduleProto + .internal_static_google_spanner_admin_database_v1_CrontabSpec_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.spanner.admin.database.v1.BackupScheduleProto + .internal_static_google_spanner_admin_database_v1_CrontabSpec_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.spanner.admin.database.v1.CrontabSpec.class, + com.google.spanner.admin.database.v1.CrontabSpec.Builder.class); + } + + private int bitField0_; + public static final int TEXT_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object text_ = ""; + /** + * + * + *
+   * Required. Textual representation of the crontab. User can customize the
+   * backup frequency and the backup version time using the cron
+   * expression. The version time must be in UTC timzeone.
+   *
+   * The backup will contain an externally consistent copy of the
+   * database at the version time. Allowed frequencies are 12 hour, 1 day,
+   * 1 week and 1 month. Examples of valid cron specifications:
+   *   * `0 2/12 * * * ` : every 12 hours at (2, 14) hours past midnight in UTC.
+   *   * `0 2,14 * * * ` : every 12 hours at (2,14) hours past midnight in UTC.
+   *   * `0 2 * * * `    : once a day at 2 past midnight in UTC.
+   *   * `0 2 * * 0 `    : once a week every Sunday at 2 past midnight in UTC.
+   *   * `0 2 8 * * `    : once a month on 8th day at 2 past midnight in UTC.
+   * 
+ * + * string text = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The text. + */ + @java.lang.Override + public java.lang.String getText() { + java.lang.Object ref = text_; + 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(); + text_ = s; + return s; + } + } + /** + * + * + *
+   * Required. Textual representation of the crontab. User can customize the
+   * backup frequency and the backup version time using the cron
+   * expression. The version time must be in UTC timzeone.
+   *
+   * The backup will contain an externally consistent copy of the
+   * database at the version time. Allowed frequencies are 12 hour, 1 day,
+   * 1 week and 1 month. Examples of valid cron specifications:
+   *   * `0 2/12 * * * ` : every 12 hours at (2, 14) hours past midnight in UTC.
+   *   * `0 2,14 * * * ` : every 12 hours at (2,14) hours past midnight in UTC.
+   *   * `0 2 * * * `    : once a day at 2 past midnight in UTC.
+   *   * `0 2 * * 0 `    : once a week every Sunday at 2 past midnight in UTC.
+   *   * `0 2 8 * * `    : once a month on 8th day at 2 past midnight in UTC.
+   * 
+ * + * string text = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for text. + */ + @java.lang.Override + public com.google.protobuf.ByteString getTextBytes() { + java.lang.Object ref = text_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + text_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int TIME_ZONE_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object timeZone_ = ""; + /** + * + * + *
+   * Output only. The time zone of the times in `CrontabSpec.text`. Currently
+   * only UTC is supported.
+   * 
+ * + * string time_zone = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The timeZone. + */ + @java.lang.Override + public java.lang.String getTimeZone() { + java.lang.Object ref = timeZone_; + 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(); + timeZone_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. The time zone of the times in `CrontabSpec.text`. Currently
+   * only UTC is supported.
+   * 
+ * + * string time_zone = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for timeZone. + */ + @java.lang.Override + public com.google.protobuf.ByteString getTimeZoneBytes() { + java.lang.Object ref = timeZone_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + timeZone_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CREATION_WINDOW_FIELD_NUMBER = 3; + private com.google.protobuf.Duration creationWindow_; + /** + * + * + *
+   * Output only. Schedule backups will contain an externally consistent copy
+   * of the database at the version time specified in
+   * `schedule_spec.cron_spec`. However, Spanner may not initiate the creation
+   * of the scheduled backups at that version time. Spanner will initiate
+   * the creation of scheduled backups within the time window bounded by the
+   * version_time specified in `schedule_spec.cron_spec` and version_time +
+   * `creation_window`.
+   * 
+ * + * + * .google.protobuf.Duration creation_window = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the creationWindow field is set. + */ + @java.lang.Override + public boolean hasCreationWindow() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+   * Output only. Schedule backups will contain an externally consistent copy
+   * of the database at the version time specified in
+   * `schedule_spec.cron_spec`. However, Spanner may not initiate the creation
+   * of the scheduled backups at that version time. Spanner will initiate
+   * the creation of scheduled backups within the time window bounded by the
+   * version_time specified in `schedule_spec.cron_spec` and version_time +
+   * `creation_window`.
+   * 
+ * + * + * .google.protobuf.Duration creation_window = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The creationWindow. + */ + @java.lang.Override + public com.google.protobuf.Duration getCreationWindow() { + return creationWindow_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : creationWindow_; + } + /** + * + * + *
+   * Output only. Schedule backups will contain an externally consistent copy
+   * of the database at the version time specified in
+   * `schedule_spec.cron_spec`. However, Spanner may not initiate the creation
+   * of the scheduled backups at that version time. Spanner will initiate
+   * the creation of scheduled backups within the time window bounded by the
+   * version_time specified in `schedule_spec.cron_spec` and version_time +
+   * `creation_window`.
+   * 
+ * + * + * .google.protobuf.Duration creation_window = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.DurationOrBuilder getCreationWindowOrBuilder() { + return creationWindow_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : creationWindow_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(text_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, text_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(timeZone_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, timeZone_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(3, getCreationWindow()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(text_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, text_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(timeZone_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, timeZone_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getCreationWindow()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.spanner.admin.database.v1.CrontabSpec)) { + return super.equals(obj); + } + com.google.spanner.admin.database.v1.CrontabSpec other = + (com.google.spanner.admin.database.v1.CrontabSpec) obj; + + if (!getText().equals(other.getText())) return false; + if (!getTimeZone().equals(other.getTimeZone())) return false; + if (hasCreationWindow() != other.hasCreationWindow()) return false; + if (hasCreationWindow()) { + if (!getCreationWindow().equals(other.getCreationWindow())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + TEXT_FIELD_NUMBER; + hash = (53 * hash) + getText().hashCode(); + hash = (37 * hash) + TIME_ZONE_FIELD_NUMBER; + hash = (53 * hash) + getTimeZone().hashCode(); + if (hasCreationWindow()) { + hash = (37 * hash) + CREATION_WINDOW_FIELD_NUMBER; + hash = (53 * hash) + getCreationWindow().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.spanner.admin.database.v1.CrontabSpec parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.spanner.admin.database.v1.CrontabSpec parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.spanner.admin.database.v1.CrontabSpec parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.spanner.admin.database.v1.CrontabSpec 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.spanner.admin.database.v1.CrontabSpec parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.spanner.admin.database.v1.CrontabSpec parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.spanner.admin.database.v1.CrontabSpec parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.spanner.admin.database.v1.CrontabSpec 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.spanner.admin.database.v1.CrontabSpec parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.spanner.admin.database.v1.CrontabSpec 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.spanner.admin.database.v1.CrontabSpec parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.spanner.admin.database.v1.CrontabSpec 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.spanner.admin.database.v1.CrontabSpec 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; + } + /** + * + * + *
+   * CrontabSpec can be used to specify the version time and frequency at
+   * which the backup should be created.
+   * 
+ * + * Protobuf type {@code google.spanner.admin.database.v1.CrontabSpec} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.spanner.admin.database.v1.CrontabSpec) + com.google.spanner.admin.database.v1.CrontabSpecOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.spanner.admin.database.v1.BackupScheduleProto + .internal_static_google_spanner_admin_database_v1_CrontabSpec_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.spanner.admin.database.v1.BackupScheduleProto + .internal_static_google_spanner_admin_database_v1_CrontabSpec_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.spanner.admin.database.v1.CrontabSpec.class, + com.google.spanner.admin.database.v1.CrontabSpec.Builder.class); + } + + // Construct using com.google.spanner.admin.database.v1.CrontabSpec.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getCreationWindowFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + text_ = ""; + timeZone_ = ""; + creationWindow_ = null; + if (creationWindowBuilder_ != null) { + creationWindowBuilder_.dispose(); + creationWindowBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.spanner.admin.database.v1.BackupScheduleProto + .internal_static_google_spanner_admin_database_v1_CrontabSpec_descriptor; + } + + @java.lang.Override + public com.google.spanner.admin.database.v1.CrontabSpec getDefaultInstanceForType() { + return com.google.spanner.admin.database.v1.CrontabSpec.getDefaultInstance(); + } + + @java.lang.Override + public com.google.spanner.admin.database.v1.CrontabSpec build() { + com.google.spanner.admin.database.v1.CrontabSpec result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.spanner.admin.database.v1.CrontabSpec buildPartial() { + com.google.spanner.admin.database.v1.CrontabSpec result = + new com.google.spanner.admin.database.v1.CrontabSpec(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.spanner.admin.database.v1.CrontabSpec result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.text_ = text_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.timeZone_ = timeZone_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000004) != 0)) { + result.creationWindow_ = + creationWindowBuilder_ == null ? creationWindow_ : creationWindowBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @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.spanner.admin.database.v1.CrontabSpec) { + return mergeFrom((com.google.spanner.admin.database.v1.CrontabSpec) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.spanner.admin.database.v1.CrontabSpec other) { + if (other == com.google.spanner.admin.database.v1.CrontabSpec.getDefaultInstance()) + return this; + if (!other.getText().isEmpty()) { + text_ = other.text_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getTimeZone().isEmpty()) { + timeZone_ = other.timeZone_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.hasCreationWindow()) { + mergeCreationWindow(other.getCreationWindow()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + text_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + timeZone_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + input.readMessage(getCreationWindowFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object text_ = ""; + /** + * + * + *
+     * Required. Textual representation of the crontab. User can customize the
+     * backup frequency and the backup version time using the cron
+     * expression. The version time must be in UTC timzeone.
+     *
+     * The backup will contain an externally consistent copy of the
+     * database at the version time. Allowed frequencies are 12 hour, 1 day,
+     * 1 week and 1 month. Examples of valid cron specifications:
+     *   * `0 2/12 * * * ` : every 12 hours at (2, 14) hours past midnight in UTC.
+     *   * `0 2,14 * * * ` : every 12 hours at (2,14) hours past midnight in UTC.
+     *   * `0 2 * * * `    : once a day at 2 past midnight in UTC.
+     *   * `0 2 * * 0 `    : once a week every Sunday at 2 past midnight in UTC.
+     *   * `0 2 8 * * `    : once a month on 8th day at 2 past midnight in UTC.
+     * 
+ * + * string text = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The text. + */ + public java.lang.String getText() { + java.lang.Object ref = text_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + text_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. Textual representation of the crontab. User can customize the
+     * backup frequency and the backup version time using the cron
+     * expression. The version time must be in UTC timzeone.
+     *
+     * The backup will contain an externally consistent copy of the
+     * database at the version time. Allowed frequencies are 12 hour, 1 day,
+     * 1 week and 1 month. Examples of valid cron specifications:
+     *   * `0 2/12 * * * ` : every 12 hours at (2, 14) hours past midnight in UTC.
+     *   * `0 2,14 * * * ` : every 12 hours at (2,14) hours past midnight in UTC.
+     *   * `0 2 * * * `    : once a day at 2 past midnight in UTC.
+     *   * `0 2 * * 0 `    : once a week every Sunday at 2 past midnight in UTC.
+     *   * `0 2 8 * * `    : once a month on 8th day at 2 past midnight in UTC.
+     * 
+ * + * string text = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for text. + */ + public com.google.protobuf.ByteString getTextBytes() { + java.lang.Object ref = text_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + text_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. Textual representation of the crontab. User can customize the
+     * backup frequency and the backup version time using the cron
+     * expression. The version time must be in UTC timzeone.
+     *
+     * The backup will contain an externally consistent copy of the
+     * database at the version time. Allowed frequencies are 12 hour, 1 day,
+     * 1 week and 1 month. Examples of valid cron specifications:
+     *   * `0 2/12 * * * ` : every 12 hours at (2, 14) hours past midnight in UTC.
+     *   * `0 2,14 * * * ` : every 12 hours at (2,14) hours past midnight in UTC.
+     *   * `0 2 * * * `    : once a day at 2 past midnight in UTC.
+     *   * `0 2 * * 0 `    : once a week every Sunday at 2 past midnight in UTC.
+     *   * `0 2 8 * * `    : once a month on 8th day at 2 past midnight in UTC.
+     * 
+ * + * string text = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The text to set. + * @return This builder for chaining. + */ + public Builder setText(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + text_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Textual representation of the crontab. User can customize the
+     * backup frequency and the backup version time using the cron
+     * expression. The version time must be in UTC timzeone.
+     *
+     * The backup will contain an externally consistent copy of the
+     * database at the version time. Allowed frequencies are 12 hour, 1 day,
+     * 1 week and 1 month. Examples of valid cron specifications:
+     *   * `0 2/12 * * * ` : every 12 hours at (2, 14) hours past midnight in UTC.
+     *   * `0 2,14 * * * ` : every 12 hours at (2,14) hours past midnight in UTC.
+     *   * `0 2 * * * `    : once a day at 2 past midnight in UTC.
+     *   * `0 2 * * 0 `    : once a week every Sunday at 2 past midnight in UTC.
+     *   * `0 2 8 * * `    : once a month on 8th day at 2 past midnight in UTC.
+     * 
+ * + * string text = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearText() { + text_ = getDefaultInstance().getText(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Textual representation of the crontab. User can customize the
+     * backup frequency and the backup version time using the cron
+     * expression. The version time must be in UTC timzeone.
+     *
+     * The backup will contain an externally consistent copy of the
+     * database at the version time. Allowed frequencies are 12 hour, 1 day,
+     * 1 week and 1 month. Examples of valid cron specifications:
+     *   * `0 2/12 * * * ` : every 12 hours at (2, 14) hours past midnight in UTC.
+     *   * `0 2,14 * * * ` : every 12 hours at (2,14) hours past midnight in UTC.
+     *   * `0 2 * * * `    : once a day at 2 past midnight in UTC.
+     *   * `0 2 * * 0 `    : once a week every Sunday at 2 past midnight in UTC.
+     *   * `0 2 8 * * `    : once a month on 8th day at 2 past midnight in UTC.
+     * 
+ * + * string text = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for text to set. + * @return This builder for chaining. + */ + public Builder setTextBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + text_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object timeZone_ = ""; + /** + * + * + *
+     * Output only. The time zone of the times in `CrontabSpec.text`. Currently
+     * only UTC is supported.
+     * 
+ * + * string time_zone = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The timeZone. + */ + public java.lang.String getTimeZone() { + java.lang.Object ref = timeZone_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + timeZone_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. The time zone of the times in `CrontabSpec.text`. Currently
+     * only UTC is supported.
+     * 
+ * + * string time_zone = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for timeZone. + */ + public com.google.protobuf.ByteString getTimeZoneBytes() { + java.lang.Object ref = timeZone_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + timeZone_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. The time zone of the times in `CrontabSpec.text`. Currently
+     * only UTC is supported.
+     * 
+ * + * string time_zone = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The timeZone to set. + * @return This builder for chaining. + */ + public Builder setTimeZone(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + timeZone_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The time zone of the times in `CrontabSpec.text`. Currently
+     * only UTC is supported.
+     * 
+ * + * string time_zone = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearTimeZone() { + timeZone_ = getDefaultInstance().getTimeZone(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The time zone of the times in `CrontabSpec.text`. Currently
+     * only UTC is supported.
+     * 
+ * + * string time_zone = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for timeZone to set. + * @return This builder for chaining. + */ + public Builder setTimeZoneBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + timeZone_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private com.google.protobuf.Duration creationWindow_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + creationWindowBuilder_; + /** + * + * + *
+     * Output only. Schedule backups will contain an externally consistent copy
+     * of the database at the version time specified in
+     * `schedule_spec.cron_spec`. However, Spanner may not initiate the creation
+     * of the scheduled backups at that version time. Spanner will initiate
+     * the creation of scheduled backups within the time window bounded by the
+     * version_time specified in `schedule_spec.cron_spec` and version_time +
+     * `creation_window`.
+     * 
+ * + * + * .google.protobuf.Duration creation_window = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the creationWindow field is set. + */ + public boolean hasCreationWindow() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + * + * + *
+     * Output only. Schedule backups will contain an externally consistent copy
+     * of the database at the version time specified in
+     * `schedule_spec.cron_spec`. However, Spanner may not initiate the creation
+     * of the scheduled backups at that version time. Spanner will initiate
+     * the creation of scheduled backups within the time window bounded by the
+     * version_time specified in `schedule_spec.cron_spec` and version_time +
+     * `creation_window`.
+     * 
+ * + * + * .google.protobuf.Duration creation_window = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The creationWindow. + */ + public com.google.protobuf.Duration getCreationWindow() { + if (creationWindowBuilder_ == null) { + return creationWindow_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : creationWindow_; + } else { + return creationWindowBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Output only. Schedule backups will contain an externally consistent copy
+     * of the database at the version time specified in
+     * `schedule_spec.cron_spec`. However, Spanner may not initiate the creation
+     * of the scheduled backups at that version time. Spanner will initiate
+     * the creation of scheduled backups within the time window bounded by the
+     * version_time specified in `schedule_spec.cron_spec` and version_time +
+     * `creation_window`.
+     * 
+ * + * + * .google.protobuf.Duration creation_window = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setCreationWindow(com.google.protobuf.Duration value) { + if (creationWindowBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + creationWindow_ = value; + } else { + creationWindowBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Schedule backups will contain an externally consistent copy
+     * of the database at the version time specified in
+     * `schedule_spec.cron_spec`. However, Spanner may not initiate the creation
+     * of the scheduled backups at that version time. Spanner will initiate
+     * the creation of scheduled backups within the time window bounded by the
+     * version_time specified in `schedule_spec.cron_spec` and version_time +
+     * `creation_window`.
+     * 
+ * + * + * .google.protobuf.Duration creation_window = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setCreationWindow(com.google.protobuf.Duration.Builder builderForValue) { + if (creationWindowBuilder_ == null) { + creationWindow_ = builderForValue.build(); + } else { + creationWindowBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Schedule backups will contain an externally consistent copy
+     * of the database at the version time specified in
+     * `schedule_spec.cron_spec`. However, Spanner may not initiate the creation
+     * of the scheduled backups at that version time. Spanner will initiate
+     * the creation of scheduled backups within the time window bounded by the
+     * version_time specified in `schedule_spec.cron_spec` and version_time +
+     * `creation_window`.
+     * 
+ * + * + * .google.protobuf.Duration creation_window = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeCreationWindow(com.google.protobuf.Duration value) { + if (creationWindowBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && creationWindow_ != null + && creationWindow_ != com.google.protobuf.Duration.getDefaultInstance()) { + getCreationWindowBuilder().mergeFrom(value); + } else { + creationWindow_ = value; + } + } else { + creationWindowBuilder_.mergeFrom(value); + } + if (creationWindow_ != null) { + bitField0_ |= 0x00000004; + onChanged(); + } + return this; + } + /** + * + * + *
+     * Output only. Schedule backups will contain an externally consistent copy
+     * of the database at the version time specified in
+     * `schedule_spec.cron_spec`. However, Spanner may not initiate the creation
+     * of the scheduled backups at that version time. Spanner will initiate
+     * the creation of scheduled backups within the time window bounded by the
+     * version_time specified in `schedule_spec.cron_spec` and version_time +
+     * `creation_window`.
+     * 
+ * + * + * .google.protobuf.Duration creation_window = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearCreationWindow() { + bitField0_ = (bitField0_ & ~0x00000004); + creationWindow_ = null; + if (creationWindowBuilder_ != null) { + creationWindowBuilder_.dispose(); + creationWindowBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Schedule backups will contain an externally consistent copy
+     * of the database at the version time specified in
+     * `schedule_spec.cron_spec`. However, Spanner may not initiate the creation
+     * of the scheduled backups at that version time. Spanner will initiate
+     * the creation of scheduled backups within the time window bounded by the
+     * version_time specified in `schedule_spec.cron_spec` and version_time +
+     * `creation_window`.
+     * 
+ * + * + * .google.protobuf.Duration creation_window = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Duration.Builder getCreationWindowBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return getCreationWindowFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. Schedule backups will contain an externally consistent copy
+     * of the database at the version time specified in
+     * `schedule_spec.cron_spec`. However, Spanner may not initiate the creation
+     * of the scheduled backups at that version time. Spanner will initiate
+     * the creation of scheduled backups within the time window bounded by the
+     * version_time specified in `schedule_spec.cron_spec` and version_time +
+     * `creation_window`.
+     * 
+ * + * + * .google.protobuf.Duration creation_window = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.DurationOrBuilder getCreationWindowOrBuilder() { + if (creationWindowBuilder_ != null) { + return creationWindowBuilder_.getMessageOrBuilder(); + } else { + return creationWindow_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : creationWindow_; + } + } + /** + * + * + *
+     * Output only. Schedule backups will contain an externally consistent copy
+     * of the database at the version time specified in
+     * `schedule_spec.cron_spec`. However, Spanner may not initiate the creation
+     * of the scheduled backups at that version time. Spanner will initiate
+     * the creation of scheduled backups within the time window bounded by the
+     * version_time specified in `schedule_spec.cron_spec` and version_time +
+     * `creation_window`.
+     * 
+ * + * + * .google.protobuf.Duration creation_window = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + getCreationWindowFieldBuilder() { + if (creationWindowBuilder_ == null) { + creationWindowBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder>( + getCreationWindow(), getParentForChildren(), isClean()); + creationWindow_ = null; + } + return creationWindowBuilder_; + } + + @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.spanner.admin.database.v1.CrontabSpec) + } + + // @@protoc_insertion_point(class_scope:google.spanner.admin.database.v1.CrontabSpec) + private static final com.google.spanner.admin.database.v1.CrontabSpec DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.spanner.admin.database.v1.CrontabSpec(); + } + + public static com.google.spanner.admin.database.v1.CrontabSpec getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CrontabSpec parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.spanner.admin.database.v1.CrontabSpec getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/CrontabSpecOrBuilder.java b/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/CrontabSpecOrBuilder.java new file mode 100644 index 00000000000..6fdc1185acb --- /dev/null +++ b/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/CrontabSpecOrBuilder.java @@ -0,0 +1,159 @@ +/* + * Copyright 2024 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/spanner/admin/database/v1/backup_schedule.proto + +// Protobuf Java Version: 3.25.3 +package com.google.spanner.admin.database.v1; + +public interface CrontabSpecOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.spanner.admin.database.v1.CrontabSpec) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Textual representation of the crontab. User can customize the
+   * backup frequency and the backup version time using the cron
+   * expression. The version time must be in UTC timzeone.
+   *
+   * The backup will contain an externally consistent copy of the
+   * database at the version time. Allowed frequencies are 12 hour, 1 day,
+   * 1 week and 1 month. Examples of valid cron specifications:
+   *   * `0 2/12 * * * ` : every 12 hours at (2, 14) hours past midnight in UTC.
+   *   * `0 2,14 * * * ` : every 12 hours at (2,14) hours past midnight in UTC.
+   *   * `0 2 * * * `    : once a day at 2 past midnight in UTC.
+   *   * `0 2 * * 0 `    : once a week every Sunday at 2 past midnight in UTC.
+   *   * `0 2 8 * * `    : once a month on 8th day at 2 past midnight in UTC.
+   * 
+ * + * string text = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The text. + */ + java.lang.String getText(); + /** + * + * + *
+   * Required. Textual representation of the crontab. User can customize the
+   * backup frequency and the backup version time using the cron
+   * expression. The version time must be in UTC timzeone.
+   *
+   * The backup will contain an externally consistent copy of the
+   * database at the version time. Allowed frequencies are 12 hour, 1 day,
+   * 1 week and 1 month. Examples of valid cron specifications:
+   *   * `0 2/12 * * * ` : every 12 hours at (2, 14) hours past midnight in UTC.
+   *   * `0 2,14 * * * ` : every 12 hours at (2,14) hours past midnight in UTC.
+   *   * `0 2 * * * `    : once a day at 2 past midnight in UTC.
+   *   * `0 2 * * 0 `    : once a week every Sunday at 2 past midnight in UTC.
+   *   * `0 2 8 * * `    : once a month on 8th day at 2 past midnight in UTC.
+   * 
+ * + * string text = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for text. + */ + com.google.protobuf.ByteString getTextBytes(); + + /** + * + * + *
+   * Output only. The time zone of the times in `CrontabSpec.text`. Currently
+   * only UTC is supported.
+   * 
+ * + * string time_zone = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The timeZone. + */ + java.lang.String getTimeZone(); + /** + * + * + *
+   * Output only. The time zone of the times in `CrontabSpec.text`. Currently
+   * only UTC is supported.
+   * 
+ * + * string time_zone = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for timeZone. + */ + com.google.protobuf.ByteString getTimeZoneBytes(); + + /** + * + * + *
+   * Output only. Schedule backups will contain an externally consistent copy
+   * of the database at the version time specified in
+   * `schedule_spec.cron_spec`. However, Spanner may not initiate the creation
+   * of the scheduled backups at that version time. Spanner will initiate
+   * the creation of scheduled backups within the time window bounded by the
+   * version_time specified in `schedule_spec.cron_spec` and version_time +
+   * `creation_window`.
+   * 
+ * + * + * .google.protobuf.Duration creation_window = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the creationWindow field is set. + */ + boolean hasCreationWindow(); + /** + * + * + *
+   * Output only. Schedule backups will contain an externally consistent copy
+   * of the database at the version time specified in
+   * `schedule_spec.cron_spec`. However, Spanner may not initiate the creation
+   * of the scheduled backups at that version time. Spanner will initiate
+   * the creation of scheduled backups within the time window bounded by the
+   * version_time specified in `schedule_spec.cron_spec` and version_time +
+   * `creation_window`.
+   * 
+ * + * + * .google.protobuf.Duration creation_window = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The creationWindow. + */ + com.google.protobuf.Duration getCreationWindow(); + /** + * + * + *
+   * Output only. Schedule backups will contain an externally consistent copy
+   * of the database at the version time specified in
+   * `schedule_spec.cron_spec`. However, Spanner may not initiate the creation
+   * of the scheduled backups at that version time. Spanner will initiate
+   * the creation of scheduled backups within the time window bounded by the
+   * version_time specified in `schedule_spec.cron_spec` and version_time +
+   * `creation_window`.
+   * 
+ * + * + * .google.protobuf.Duration creation_window = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.DurationOrBuilder getCreationWindowOrBuilder(); +} diff --git a/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/DeleteBackupScheduleRequest.java b/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/DeleteBackupScheduleRequest.java new file mode 100644 index 00000000000..f015c243bf2 --- /dev/null +++ b/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/DeleteBackupScheduleRequest.java @@ -0,0 +1,663 @@ +/* + * Copyright 2024 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/spanner/admin/database/v1/backup_schedule.proto + +// Protobuf Java Version: 3.25.3 +package com.google.spanner.admin.database.v1; + +/** + * + * + *
+ * The request for
+ * [DeleteBackupSchedule][google.spanner.admin.database.v1.DatabaseAdmin.DeleteBackupSchedule].
+ * 
+ * + * Protobuf type {@code google.spanner.admin.database.v1.DeleteBackupScheduleRequest} + */ +public final class DeleteBackupScheduleRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.spanner.admin.database.v1.DeleteBackupScheduleRequest) + DeleteBackupScheduleRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use DeleteBackupScheduleRequest.newBuilder() to construct. + private DeleteBackupScheduleRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private DeleteBackupScheduleRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new DeleteBackupScheduleRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.spanner.admin.database.v1.BackupScheduleProto + .internal_static_google_spanner_admin_database_v1_DeleteBackupScheduleRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.spanner.admin.database.v1.BackupScheduleProto + .internal_static_google_spanner_admin_database_v1_DeleteBackupScheduleRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.spanner.admin.database.v1.DeleteBackupScheduleRequest.class, + com.google.spanner.admin.database.v1.DeleteBackupScheduleRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * + * + *
+   * Required. The name of the schedule to delete.
+   * Values are of the form
+   * `projects/<project>/instances/<instance>/databases/<database>/backupSchedules/<backup_schedule_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 name of the schedule to delete.
+   * Values are of the form
+   * `projects/<project>/instances/<instance>/databases/<database>/backupSchedules/<backup_schedule_id>`.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.spanner.admin.database.v1.DeleteBackupScheduleRequest)) { + return super.equals(obj); + } + com.google.spanner.admin.database.v1.DeleteBackupScheduleRequest other = + (com.google.spanner.admin.database.v1.DeleteBackupScheduleRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.spanner.admin.database.v1.DeleteBackupScheduleRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.spanner.admin.database.v1.DeleteBackupScheduleRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.spanner.admin.database.v1.DeleteBackupScheduleRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.spanner.admin.database.v1.DeleteBackupScheduleRequest 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.spanner.admin.database.v1.DeleteBackupScheduleRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.spanner.admin.database.v1.DeleteBackupScheduleRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.spanner.admin.database.v1.DeleteBackupScheduleRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.spanner.admin.database.v1.DeleteBackupScheduleRequest 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.spanner.admin.database.v1.DeleteBackupScheduleRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.spanner.admin.database.v1.DeleteBackupScheduleRequest 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.spanner.admin.database.v1.DeleteBackupScheduleRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.spanner.admin.database.v1.DeleteBackupScheduleRequest 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.spanner.admin.database.v1.DeleteBackupScheduleRequest 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; + } + /** + * + * + *
+   * The request for
+   * [DeleteBackupSchedule][google.spanner.admin.database.v1.DatabaseAdmin.DeleteBackupSchedule].
+   * 
+ * + * Protobuf type {@code google.spanner.admin.database.v1.DeleteBackupScheduleRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.spanner.admin.database.v1.DeleteBackupScheduleRequest) + com.google.spanner.admin.database.v1.DeleteBackupScheduleRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.spanner.admin.database.v1.BackupScheduleProto + .internal_static_google_spanner_admin_database_v1_DeleteBackupScheduleRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.spanner.admin.database.v1.BackupScheduleProto + .internal_static_google_spanner_admin_database_v1_DeleteBackupScheduleRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.spanner.admin.database.v1.DeleteBackupScheduleRequest.class, + com.google.spanner.admin.database.v1.DeleteBackupScheduleRequest.Builder.class); + } + + // Construct using com.google.spanner.admin.database.v1.DeleteBackupScheduleRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.spanner.admin.database.v1.BackupScheduleProto + .internal_static_google_spanner_admin_database_v1_DeleteBackupScheduleRequest_descriptor; + } + + @java.lang.Override + public com.google.spanner.admin.database.v1.DeleteBackupScheduleRequest + getDefaultInstanceForType() { + return com.google.spanner.admin.database.v1.DeleteBackupScheduleRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.spanner.admin.database.v1.DeleteBackupScheduleRequest build() { + com.google.spanner.admin.database.v1.DeleteBackupScheduleRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.spanner.admin.database.v1.DeleteBackupScheduleRequest buildPartial() { + com.google.spanner.admin.database.v1.DeleteBackupScheduleRequest result = + new com.google.spanner.admin.database.v1.DeleteBackupScheduleRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.spanner.admin.database.v1.DeleteBackupScheduleRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + } + + @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.spanner.admin.database.v1.DeleteBackupScheduleRequest) { + return mergeFrom((com.google.spanner.admin.database.v1.DeleteBackupScheduleRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.spanner.admin.database.v1.DeleteBackupScheduleRequest other) { + if (other + == com.google.spanner.admin.database.v1.DeleteBackupScheduleRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. The name of the schedule to delete.
+     * Values are of the form
+     * `projects/<project>/instances/<instance>/databases/<database>/backupSchedules/<backup_schedule_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 name of the schedule to delete.
+     * Values are of the form
+     * `projects/<project>/instances/<instance>/databases/<database>/backupSchedules/<backup_schedule_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 name of the schedule to delete.
+     * Values are of the form
+     * `projects/<project>/instances/<instance>/databases/<database>/backupSchedules/<backup_schedule_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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the schedule to delete.
+     * Values are of the form
+     * `projects/<project>/instances/<instance>/databases/<database>/backupSchedules/<backup_schedule_id>`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the schedule to delete.
+     * Values are of the form
+     * `projects/<project>/instances/<instance>/databases/<database>/backupSchedules/<backup_schedule_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; + bitField0_ |= 0x00000001; + 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.spanner.admin.database.v1.DeleteBackupScheduleRequest) + } + + // @@protoc_insertion_point(class_scope:google.spanner.admin.database.v1.DeleteBackupScheduleRequest) + private static final com.google.spanner.admin.database.v1.DeleteBackupScheduleRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.spanner.admin.database.v1.DeleteBackupScheduleRequest(); + } + + public static com.google.spanner.admin.database.v1.DeleteBackupScheduleRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DeleteBackupScheduleRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.spanner.admin.database.v1.DeleteBackupScheduleRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/DeleteBackupScheduleRequestOrBuilder.java b/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/DeleteBackupScheduleRequestOrBuilder.java new file mode 100644 index 00000000000..5cf1ecb4f55 --- /dev/null +++ b/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/DeleteBackupScheduleRequestOrBuilder.java @@ -0,0 +1,59 @@ +/* + * Copyright 2024 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/spanner/admin/database/v1/backup_schedule.proto + +// Protobuf Java Version: 3.25.3 +package com.google.spanner.admin.database.v1; + +public interface DeleteBackupScheduleRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.spanner.admin.database.v1.DeleteBackupScheduleRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The name of the schedule to delete.
+   * Values are of the form
+   * `projects/<project>/instances/<instance>/databases/<database>/backupSchedules/<backup_schedule_id>`.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. The name of the schedule to delete.
+   * Values are of the form
+   * `projects/<project>/instances/<instance>/databases/<database>/backupSchedules/<backup_schedule_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-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/FullBackupSpec.java b/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/FullBackupSpec.java new file mode 100644 index 00000000000..9a8af831031 --- /dev/null +++ b/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/FullBackupSpec.java @@ -0,0 +1,436 @@ +/* + * Copyright 2024 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/spanner/admin/database/v1/backup.proto + +// Protobuf Java Version: 3.25.3 +package com.google.spanner.admin.database.v1; + +/** + * + * + *
+ * The specification for full backups.
+ * A full backup stores the entire contents of the database at a given
+ * version time.
+ * 
+ * + * Protobuf type {@code google.spanner.admin.database.v1.FullBackupSpec} + */ +public final class FullBackupSpec extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.spanner.admin.database.v1.FullBackupSpec) + FullBackupSpecOrBuilder { + private static final long serialVersionUID = 0L; + // Use FullBackupSpec.newBuilder() to construct. + private FullBackupSpec(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private FullBackupSpec() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new FullBackupSpec(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.spanner.admin.database.v1.BackupProto + .internal_static_google_spanner_admin_database_v1_FullBackupSpec_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.spanner.admin.database.v1.BackupProto + .internal_static_google_spanner_admin_database_v1_FullBackupSpec_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.spanner.admin.database.v1.FullBackupSpec.class, + com.google.spanner.admin.database.v1.FullBackupSpec.Builder.class); + } + + 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 { + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.spanner.admin.database.v1.FullBackupSpec)) { + return super.equals(obj); + } + com.google.spanner.admin.database.v1.FullBackupSpec other = + (com.google.spanner.admin.database.v1.FullBackupSpec) obj; + + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.spanner.admin.database.v1.FullBackupSpec parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.spanner.admin.database.v1.FullBackupSpec parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.spanner.admin.database.v1.FullBackupSpec parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.spanner.admin.database.v1.FullBackupSpec 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.spanner.admin.database.v1.FullBackupSpec parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.spanner.admin.database.v1.FullBackupSpec parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.spanner.admin.database.v1.FullBackupSpec parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.spanner.admin.database.v1.FullBackupSpec 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.spanner.admin.database.v1.FullBackupSpec parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.spanner.admin.database.v1.FullBackupSpec 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.spanner.admin.database.v1.FullBackupSpec parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.spanner.admin.database.v1.FullBackupSpec 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.spanner.admin.database.v1.FullBackupSpec 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; + } + /** + * + * + *
+   * The specification for full backups.
+   * A full backup stores the entire contents of the database at a given
+   * version time.
+   * 
+ * + * Protobuf type {@code google.spanner.admin.database.v1.FullBackupSpec} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.spanner.admin.database.v1.FullBackupSpec) + com.google.spanner.admin.database.v1.FullBackupSpecOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.spanner.admin.database.v1.BackupProto + .internal_static_google_spanner_admin_database_v1_FullBackupSpec_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.spanner.admin.database.v1.BackupProto + .internal_static_google_spanner_admin_database_v1_FullBackupSpec_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.spanner.admin.database.v1.FullBackupSpec.class, + com.google.spanner.admin.database.v1.FullBackupSpec.Builder.class); + } + + // Construct using com.google.spanner.admin.database.v1.FullBackupSpec.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.spanner.admin.database.v1.BackupProto + .internal_static_google_spanner_admin_database_v1_FullBackupSpec_descriptor; + } + + @java.lang.Override + public com.google.spanner.admin.database.v1.FullBackupSpec getDefaultInstanceForType() { + return com.google.spanner.admin.database.v1.FullBackupSpec.getDefaultInstance(); + } + + @java.lang.Override + public com.google.spanner.admin.database.v1.FullBackupSpec build() { + com.google.spanner.admin.database.v1.FullBackupSpec result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.spanner.admin.database.v1.FullBackupSpec buildPartial() { + com.google.spanner.admin.database.v1.FullBackupSpec result = + new com.google.spanner.admin.database.v1.FullBackupSpec(this); + 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.spanner.admin.database.v1.FullBackupSpec) { + return mergeFrom((com.google.spanner.admin.database.v1.FullBackupSpec) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.spanner.admin.database.v1.FullBackupSpec other) { + if (other == com.google.spanner.admin.database.v1.FullBackupSpec.getDefaultInstance()) + return this; + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + @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.spanner.admin.database.v1.FullBackupSpec) + } + + // @@protoc_insertion_point(class_scope:google.spanner.admin.database.v1.FullBackupSpec) + private static final com.google.spanner.admin.database.v1.FullBackupSpec DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.spanner.admin.database.v1.FullBackupSpec(); + } + + public static com.google.spanner.admin.database.v1.FullBackupSpec getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public FullBackupSpec parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.spanner.admin.database.v1.FullBackupSpec getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/FullBackupSpecOrBuilder.java b/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/FullBackupSpecOrBuilder.java new file mode 100644 index 00000000000..d7e604faeac --- /dev/null +++ b/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/FullBackupSpecOrBuilder.java @@ -0,0 +1,25 @@ +/* + * Copyright 2024 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/spanner/admin/database/v1/backup.proto + +// Protobuf Java Version: 3.25.3 +package com.google.spanner.admin.database.v1; + +public interface FullBackupSpecOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.spanner.admin.database.v1.FullBackupSpec) + com.google.protobuf.MessageOrBuilder {} diff --git a/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/GetBackupScheduleRequest.java b/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/GetBackupScheduleRequest.java new file mode 100644 index 00000000000..3f7b923b3f6 --- /dev/null +++ b/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/GetBackupScheduleRequest.java @@ -0,0 +1,660 @@ +/* + * Copyright 2024 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/spanner/admin/database/v1/backup_schedule.proto + +// Protobuf Java Version: 3.25.3 +package com.google.spanner.admin.database.v1; + +/** + * + * + *
+ * The request for
+ * [GetBackupSchedule][google.spanner.admin.database.v1.DatabaseAdmin.GetBackupSchedule].
+ * 
+ * + * Protobuf type {@code google.spanner.admin.database.v1.GetBackupScheduleRequest} + */ +public final class GetBackupScheduleRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.spanner.admin.database.v1.GetBackupScheduleRequest) + GetBackupScheduleRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use GetBackupScheduleRequest.newBuilder() to construct. + private GetBackupScheduleRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GetBackupScheduleRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GetBackupScheduleRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.spanner.admin.database.v1.BackupScheduleProto + .internal_static_google_spanner_admin_database_v1_GetBackupScheduleRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.spanner.admin.database.v1.BackupScheduleProto + .internal_static_google_spanner_admin_database_v1_GetBackupScheduleRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.spanner.admin.database.v1.GetBackupScheduleRequest.class, + com.google.spanner.admin.database.v1.GetBackupScheduleRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * + * + *
+   * Required. The name of the schedule to retrieve.
+   * Values are of the form
+   * `projects/<project>/instances/<instance>/databases/<database>/backupSchedules/<backup_schedule_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 name of the schedule to retrieve.
+   * Values are of the form
+   * `projects/<project>/instances/<instance>/databases/<database>/backupSchedules/<backup_schedule_id>`.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.spanner.admin.database.v1.GetBackupScheduleRequest)) { + return super.equals(obj); + } + com.google.spanner.admin.database.v1.GetBackupScheduleRequest other = + (com.google.spanner.admin.database.v1.GetBackupScheduleRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.spanner.admin.database.v1.GetBackupScheduleRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.spanner.admin.database.v1.GetBackupScheduleRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.spanner.admin.database.v1.GetBackupScheduleRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.spanner.admin.database.v1.GetBackupScheduleRequest 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.spanner.admin.database.v1.GetBackupScheduleRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.spanner.admin.database.v1.GetBackupScheduleRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.spanner.admin.database.v1.GetBackupScheduleRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.spanner.admin.database.v1.GetBackupScheduleRequest 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.spanner.admin.database.v1.GetBackupScheduleRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.spanner.admin.database.v1.GetBackupScheduleRequest 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.spanner.admin.database.v1.GetBackupScheduleRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.spanner.admin.database.v1.GetBackupScheduleRequest 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.spanner.admin.database.v1.GetBackupScheduleRequest 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; + } + /** + * + * + *
+   * The request for
+   * [GetBackupSchedule][google.spanner.admin.database.v1.DatabaseAdmin.GetBackupSchedule].
+   * 
+ * + * Protobuf type {@code google.spanner.admin.database.v1.GetBackupScheduleRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.spanner.admin.database.v1.GetBackupScheduleRequest) + com.google.spanner.admin.database.v1.GetBackupScheduleRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.spanner.admin.database.v1.BackupScheduleProto + .internal_static_google_spanner_admin_database_v1_GetBackupScheduleRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.spanner.admin.database.v1.BackupScheduleProto + .internal_static_google_spanner_admin_database_v1_GetBackupScheduleRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.spanner.admin.database.v1.GetBackupScheduleRequest.class, + com.google.spanner.admin.database.v1.GetBackupScheduleRequest.Builder.class); + } + + // Construct using com.google.spanner.admin.database.v1.GetBackupScheduleRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.spanner.admin.database.v1.BackupScheduleProto + .internal_static_google_spanner_admin_database_v1_GetBackupScheduleRequest_descriptor; + } + + @java.lang.Override + public com.google.spanner.admin.database.v1.GetBackupScheduleRequest + getDefaultInstanceForType() { + return com.google.spanner.admin.database.v1.GetBackupScheduleRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.spanner.admin.database.v1.GetBackupScheduleRequest build() { + com.google.spanner.admin.database.v1.GetBackupScheduleRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.spanner.admin.database.v1.GetBackupScheduleRequest buildPartial() { + com.google.spanner.admin.database.v1.GetBackupScheduleRequest result = + new com.google.spanner.admin.database.v1.GetBackupScheduleRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.spanner.admin.database.v1.GetBackupScheduleRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + } + + @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.spanner.admin.database.v1.GetBackupScheduleRequest) { + return mergeFrom((com.google.spanner.admin.database.v1.GetBackupScheduleRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.spanner.admin.database.v1.GetBackupScheduleRequest other) { + if (other + == com.google.spanner.admin.database.v1.GetBackupScheduleRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. The name of the schedule to retrieve.
+     * Values are of the form
+     * `projects/<project>/instances/<instance>/databases/<database>/backupSchedules/<backup_schedule_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 name of the schedule to retrieve.
+     * Values are of the form
+     * `projects/<project>/instances/<instance>/databases/<database>/backupSchedules/<backup_schedule_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 name of the schedule to retrieve.
+     * Values are of the form
+     * `projects/<project>/instances/<instance>/databases/<database>/backupSchedules/<backup_schedule_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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the schedule to retrieve.
+     * Values are of the form
+     * `projects/<project>/instances/<instance>/databases/<database>/backupSchedules/<backup_schedule_id>`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the schedule to retrieve.
+     * Values are of the form
+     * `projects/<project>/instances/<instance>/databases/<database>/backupSchedules/<backup_schedule_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; + bitField0_ |= 0x00000001; + 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.spanner.admin.database.v1.GetBackupScheduleRequest) + } + + // @@protoc_insertion_point(class_scope:google.spanner.admin.database.v1.GetBackupScheduleRequest) + private static final com.google.spanner.admin.database.v1.GetBackupScheduleRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.spanner.admin.database.v1.GetBackupScheduleRequest(); + } + + public static com.google.spanner.admin.database.v1.GetBackupScheduleRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetBackupScheduleRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.spanner.admin.database.v1.GetBackupScheduleRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/GetBackupScheduleRequestOrBuilder.java b/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/GetBackupScheduleRequestOrBuilder.java new file mode 100644 index 00000000000..16539d3a894 --- /dev/null +++ b/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/GetBackupScheduleRequestOrBuilder.java @@ -0,0 +1,59 @@ +/* + * Copyright 2024 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/spanner/admin/database/v1/backup_schedule.proto + +// Protobuf Java Version: 3.25.3 +package com.google.spanner.admin.database.v1; + +public interface GetBackupScheduleRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.spanner.admin.database.v1.GetBackupScheduleRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The name of the schedule to retrieve.
+   * Values are of the form
+   * `projects/<project>/instances/<instance>/databases/<database>/backupSchedules/<backup_schedule_id>`.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. The name of the schedule to retrieve.
+   * Values are of the form
+   * `projects/<project>/instances/<instance>/databases/<database>/backupSchedules/<backup_schedule_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-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/ListBackupSchedulesRequest.java b/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/ListBackupSchedulesRequest.java new file mode 100644 index 00000000000..01a82d606c7 --- /dev/null +++ b/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/ListBackupSchedulesRequest.java @@ -0,0 +1,970 @@ +/* + * Copyright 2024 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/spanner/admin/database/v1/backup_schedule.proto + +// Protobuf Java Version: 3.25.3 +package com.google.spanner.admin.database.v1; + +/** + * + * + *
+ * The request for
+ * [ListBackupSchedules][google.spanner.admin.database.v1.DatabaseAdmin.ListBackupSchedules].
+ * 
+ * + * Protobuf type {@code google.spanner.admin.database.v1.ListBackupSchedulesRequest} + */ +public final class ListBackupSchedulesRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.spanner.admin.database.v1.ListBackupSchedulesRequest) + ListBackupSchedulesRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListBackupSchedulesRequest.newBuilder() to construct. + private ListBackupSchedulesRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListBackupSchedulesRequest() { + parent_ = ""; + pageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListBackupSchedulesRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.spanner.admin.database.v1.BackupScheduleProto + .internal_static_google_spanner_admin_database_v1_ListBackupSchedulesRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.spanner.admin.database.v1.BackupScheduleProto + .internal_static_google_spanner_admin_database_v1_ListBackupSchedulesRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.spanner.admin.database.v1.ListBackupSchedulesRequest.class, + com.google.spanner.admin.database.v1.ListBackupSchedulesRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object parent_ = ""; + /** + * + * + *
+   * Required. Database is the parent resource whose backup schedules should be
+   * listed. Values are of the form
+   * projects/<project>/instances/<instance>/databases/<database>
+   * 
+ * + * + * 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. Database is the parent resource whose backup schedules should be
+   * listed. Values are of the form
+   * projects/<project>/instances/<instance>/databases/<database>
+   * 
+ * + * + * 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_ = 0; + /** + * + * + *
+   * Optional. Number of backup schedules to be returned in the response. If 0
+   * or less, defaults to the server's maximum allowed page size.
+   * 
+ * + * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + + public static final int PAGE_TOKEN_FIELD_NUMBER = 4; + + @SuppressWarnings("serial") + private volatile java.lang.Object pageToken_ = ""; + /** + * + * + *
+   * Optional. If non-empty, `page_token` should contain a
+   * [next_page_token][google.spanner.admin.database.v1.ListBackupSchedulesResponse.next_page_token]
+   * from a previous
+   * [ListBackupSchedulesResponse][google.spanner.admin.database.v1.ListBackupSchedulesResponse]
+   * to the same `parent`.
+   * 
+ * + * string page_token = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + /** + * + * + *
+   * Optional. If non-empty, `page_token` should contain a
+   * [next_page_token][google.spanner.admin.database.v1.ListBackupSchedulesResponse.next_page_token]
+   * from a previous
+   * [ListBackupSchedulesResponse][google.spanner.admin.database.v1.ListBackupSchedulesResponse]
+   * to the same `parent`.
+   * 
+ * + * string page_token = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (pageSize_ != 0) { + output.writeInt32(2, pageSize_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, pageToken_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (pageSize_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(2, pageSize_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, pageToken_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.spanner.admin.database.v1.ListBackupSchedulesRequest)) { + return super.equals(obj); + } + com.google.spanner.admin.database.v1.ListBackupSchedulesRequest other = + (com.google.spanner.admin.database.v1.ListBackupSchedulesRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (getPageSize() != other.getPageSize()) return false; + if (!getPageToken().equals(other.getPageToken())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + hash = (37 * hash) + PAGE_SIZE_FIELD_NUMBER; + hash = (53 * hash) + getPageSize(); + hash = (37 * hash) + PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getPageToken().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.spanner.admin.database.v1.ListBackupSchedulesRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.spanner.admin.database.v1.ListBackupSchedulesRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.spanner.admin.database.v1.ListBackupSchedulesRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.spanner.admin.database.v1.ListBackupSchedulesRequest 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.spanner.admin.database.v1.ListBackupSchedulesRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.spanner.admin.database.v1.ListBackupSchedulesRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.spanner.admin.database.v1.ListBackupSchedulesRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.spanner.admin.database.v1.ListBackupSchedulesRequest 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.spanner.admin.database.v1.ListBackupSchedulesRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.spanner.admin.database.v1.ListBackupSchedulesRequest 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.spanner.admin.database.v1.ListBackupSchedulesRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.spanner.admin.database.v1.ListBackupSchedulesRequest 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.spanner.admin.database.v1.ListBackupSchedulesRequest 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; + } + /** + * + * + *
+   * The request for
+   * [ListBackupSchedules][google.spanner.admin.database.v1.DatabaseAdmin.ListBackupSchedules].
+   * 
+ * + * Protobuf type {@code google.spanner.admin.database.v1.ListBackupSchedulesRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.spanner.admin.database.v1.ListBackupSchedulesRequest) + com.google.spanner.admin.database.v1.ListBackupSchedulesRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.spanner.admin.database.v1.BackupScheduleProto + .internal_static_google_spanner_admin_database_v1_ListBackupSchedulesRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.spanner.admin.database.v1.BackupScheduleProto + .internal_static_google_spanner_admin_database_v1_ListBackupSchedulesRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.spanner.admin.database.v1.ListBackupSchedulesRequest.class, + com.google.spanner.admin.database.v1.ListBackupSchedulesRequest.Builder.class); + } + + // Construct using com.google.spanner.admin.database.v1.ListBackupSchedulesRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + parent_ = ""; + pageSize_ = 0; + pageToken_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.spanner.admin.database.v1.BackupScheduleProto + .internal_static_google_spanner_admin_database_v1_ListBackupSchedulesRequest_descriptor; + } + + @java.lang.Override + public com.google.spanner.admin.database.v1.ListBackupSchedulesRequest + getDefaultInstanceForType() { + return com.google.spanner.admin.database.v1.ListBackupSchedulesRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.spanner.admin.database.v1.ListBackupSchedulesRequest build() { + com.google.spanner.admin.database.v1.ListBackupSchedulesRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.spanner.admin.database.v1.ListBackupSchedulesRequest buildPartial() { + com.google.spanner.admin.database.v1.ListBackupSchedulesRequest result = + new com.google.spanner.admin.database.v1.ListBackupSchedulesRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.spanner.admin.database.v1.ListBackupSchedulesRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.parent_ = parent_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.pageSize_ = pageSize_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.pageToken_ = pageToken_; + } + } + + @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.spanner.admin.database.v1.ListBackupSchedulesRequest) { + return mergeFrom((com.google.spanner.admin.database.v1.ListBackupSchedulesRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.spanner.admin.database.v1.ListBackupSchedulesRequest other) { + if (other + == com.google.spanner.admin.database.v1.ListBackupSchedulesRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.getPageSize() != 0) { + setPageSize(other.getPageSize()); + } + if (!other.getPageToken().isEmpty()) { + pageToken_ = other.pageToken_; + bitField0_ |= 0x00000004; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + parent_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 16: + { + pageSize_ = input.readInt32(); + bitField0_ |= 0x00000002; + break; + } // case 16 + case 34: + { + pageToken_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 34 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. Database is the parent resource whose backup schedules should be
+     * listed. Values are of the form
+     * projects/<project>/instances/<instance>/databases/<database>
+     * 
+ * + * + * 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. Database is the parent resource whose backup schedules should be
+     * listed. Values are of the form
+     * projects/<project>/instances/<instance>/databases/<database>
+     * 
+ * + * + * 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. Database is the parent resource whose backup schedules should be
+     * listed. Values are of the form
+     * projects/<project>/instances/<instance>/databases/<database>
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Database is the parent resource whose backup schedules should be
+     * listed. Values are of the form
+     * projects/<project>/instances/<instance>/databases/<database>
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + parent_ = getDefaultInstance().getParent(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Database is the parent resource whose backup schedules should be
+     * listed. Values are of the form
+     * projects/<project>/instances/<instance>/databases/<database>
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private int pageSize_; + /** + * + * + *
+     * Optional. Number of backup schedules to be returned in the response. If 0
+     * or less, defaults to the server's maximum allowed page size.
+     * 
+ * + * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + /** + * + * + *
+     * Optional. Number of backup schedules to be returned in the response. If 0
+     * or less, defaults to the server's maximum allowed page size.
+     * 
+ * + * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The pageSize to set. + * @return This builder for chaining. + */ + public Builder setPageSize(int value) { + + pageSize_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Number of backup schedules to be returned in the response. If 0
+     * or less, defaults to the server's maximum allowed page size.
+     * 
+ * + * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearPageSize() { + bitField0_ = (bitField0_ & ~0x00000002); + pageSize_ = 0; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + /** + * + * + *
+     * Optional. If non-empty, `page_token` should contain a
+     * [next_page_token][google.spanner.admin.database.v1.ListBackupSchedulesResponse.next_page_token]
+     * from a previous
+     * [ListBackupSchedulesResponse][google.spanner.admin.database.v1.ListBackupSchedulesResponse]
+     * to the same `parent`.
+     * 
+ * + * string page_token = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + /** + * + * + *
+     * Optional. If non-empty, `page_token` should contain a
+     * [next_page_token][google.spanner.admin.database.v1.ListBackupSchedulesResponse.next_page_token]
+     * from a previous
+     * [ListBackupSchedulesResponse][google.spanner.admin.database.v1.ListBackupSchedulesResponse]
+     * to the same `parent`.
+     * 
+ * + * string page_token = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + /** + * + * + *
+     * Optional. If non-empty, `page_token` should contain a
+     * [next_page_token][google.spanner.admin.database.v1.ListBackupSchedulesResponse.next_page_token]
+     * from a previous
+     * [ListBackupSchedulesResponse][google.spanner.admin.database.v1.ListBackupSchedulesResponse]
+     * to the same `parent`.
+     * 
+ * + * string page_token = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. If non-empty, `page_token` should contain a
+     * [next_page_token][google.spanner.admin.database.v1.ListBackupSchedulesResponse.next_page_token]
+     * from a previous
+     * [ListBackupSchedulesResponse][google.spanner.admin.database.v1.ListBackupSchedulesResponse]
+     * to the same `parent`.
+     * 
+ * + * string page_token = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearPageToken() { + pageToken_ = getDefaultInstance().getPageToken(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. If non-empty, `page_token` should contain a
+     * [next_page_token][google.spanner.admin.database.v1.ListBackupSchedulesResponse.next_page_token]
+     * from a previous
+     * [ListBackupSchedulesResponse][google.spanner.admin.database.v1.ListBackupSchedulesResponse]
+     * to the same `parent`.
+     * 
+ * + * string page_token = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + bitField0_ |= 0x00000004; + 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.spanner.admin.database.v1.ListBackupSchedulesRequest) + } + + // @@protoc_insertion_point(class_scope:google.spanner.admin.database.v1.ListBackupSchedulesRequest) + private static final com.google.spanner.admin.database.v1.ListBackupSchedulesRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.spanner.admin.database.v1.ListBackupSchedulesRequest(); + } + + public static com.google.spanner.admin.database.v1.ListBackupSchedulesRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListBackupSchedulesRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.spanner.admin.database.v1.ListBackupSchedulesRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/ListBackupSchedulesRequestOrBuilder.java b/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/ListBackupSchedulesRequestOrBuilder.java new file mode 100644 index 00000000000..84d6c2fcfcf --- /dev/null +++ b/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/ListBackupSchedulesRequestOrBuilder.java @@ -0,0 +1,106 @@ +/* + * Copyright 2024 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/spanner/admin/database/v1/backup_schedule.proto + +// Protobuf Java Version: 3.25.3 +package com.google.spanner.admin.database.v1; + +public interface ListBackupSchedulesRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.spanner.admin.database.v1.ListBackupSchedulesRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Database is the parent resource whose backup schedules should be
+   * listed. Values are of the form
+   * projects/<project>/instances/<instance>/databases/<database>
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. Database is the parent resource whose backup schedules should be
+   * listed. Values are of the form
+   * projects/<project>/instances/<instance>/databases/<database>
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Optional. Number of backup schedules to be returned in the response. If 0
+   * or less, defaults to the server's maximum allowed page size.
+   * 
+ * + * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageSize. + */ + int getPageSize(); + + /** + * + * + *
+   * Optional. If non-empty, `page_token` should contain a
+   * [next_page_token][google.spanner.admin.database.v1.ListBackupSchedulesResponse.next_page_token]
+   * from a previous
+   * [ListBackupSchedulesResponse][google.spanner.admin.database.v1.ListBackupSchedulesResponse]
+   * to the same `parent`.
+   * 
+ * + * string page_token = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageToken. + */ + java.lang.String getPageToken(); + /** + * + * + *
+   * Optional. If non-empty, `page_token` should contain a
+   * [next_page_token][google.spanner.admin.database.v1.ListBackupSchedulesResponse.next_page_token]
+   * from a previous
+   * [ListBackupSchedulesResponse][google.spanner.admin.database.v1.ListBackupSchedulesResponse]
+   * to the same `parent`.
+   * 
+ * + * string page_token = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for pageToken. + */ + com.google.protobuf.ByteString getPageTokenBytes(); +} diff --git a/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/ListBackupSchedulesResponse.java b/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/ListBackupSchedulesResponse.java new file mode 100644 index 00000000000..14db767e7bf --- /dev/null +++ b/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/ListBackupSchedulesResponse.java @@ -0,0 +1,1158 @@ +/* + * Copyright 2024 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/spanner/admin/database/v1/backup_schedule.proto + +// Protobuf Java Version: 3.25.3 +package com.google.spanner.admin.database.v1; + +/** + * + * + *
+ * The response for
+ * [ListBackupSchedules][google.spanner.admin.database.v1.DatabaseAdmin.ListBackupSchedules].
+ * 
+ * + * Protobuf type {@code google.spanner.admin.database.v1.ListBackupSchedulesResponse} + */ +public final class ListBackupSchedulesResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.spanner.admin.database.v1.ListBackupSchedulesResponse) + ListBackupSchedulesResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListBackupSchedulesResponse.newBuilder() to construct. + private ListBackupSchedulesResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListBackupSchedulesResponse() { + backupSchedules_ = java.util.Collections.emptyList(); + nextPageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListBackupSchedulesResponse(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.spanner.admin.database.v1.BackupScheduleProto + .internal_static_google_spanner_admin_database_v1_ListBackupSchedulesResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.spanner.admin.database.v1.BackupScheduleProto + .internal_static_google_spanner_admin_database_v1_ListBackupSchedulesResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.spanner.admin.database.v1.ListBackupSchedulesResponse.class, + com.google.spanner.admin.database.v1.ListBackupSchedulesResponse.Builder.class); + } + + public static final int BACKUP_SCHEDULES_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private java.util.List backupSchedules_; + /** + * + * + *
+   * The list of backup schedules for a database.
+   * 
+ * + * repeated .google.spanner.admin.database.v1.BackupSchedule backup_schedules = 1; + */ + @java.lang.Override + public java.util.List + getBackupSchedulesList() { + return backupSchedules_; + } + /** + * + * + *
+   * The list of backup schedules for a database.
+   * 
+ * + * repeated .google.spanner.admin.database.v1.BackupSchedule backup_schedules = 1; + */ + @java.lang.Override + public java.util.List + getBackupSchedulesOrBuilderList() { + return backupSchedules_; + } + /** + * + * + *
+   * The list of backup schedules for a database.
+   * 
+ * + * repeated .google.spanner.admin.database.v1.BackupSchedule backup_schedules = 1; + */ + @java.lang.Override + public int getBackupSchedulesCount() { + return backupSchedules_.size(); + } + /** + * + * + *
+   * The list of backup schedules for a database.
+   * 
+ * + * repeated .google.spanner.admin.database.v1.BackupSchedule backup_schedules = 1; + */ + @java.lang.Override + public com.google.spanner.admin.database.v1.BackupSchedule getBackupSchedules(int index) { + return backupSchedules_.get(index); + } + /** + * + * + *
+   * The list of backup schedules for a database.
+   * 
+ * + * repeated .google.spanner.admin.database.v1.BackupSchedule backup_schedules = 1; + */ + @java.lang.Override + public com.google.spanner.admin.database.v1.BackupScheduleOrBuilder getBackupSchedulesOrBuilder( + int index) { + return backupSchedules_.get(index); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object nextPageToken_ = ""; + /** + * + * + *
+   * `next_page_token` can be sent in a subsequent
+   * [ListBackupSchedules][google.spanner.admin.database.v1.DatabaseAdmin.ListBackupSchedules]
+   * call to fetch more of the schedules.
+   * 
+ * + * 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; + } + } + /** + * + * + *
+   * `next_page_token` can be sent in a subsequent
+   * [ListBackupSchedules][google.spanner.admin.database.v1.DatabaseAdmin.ListBackupSchedules]
+   * call to fetch more of the schedules.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + for (int i = 0; i < backupSchedules_.size(); i++) { + output.writeMessage(1, backupSchedules_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, nextPageToken_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < backupSchedules_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, backupSchedules_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, nextPageToken_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.spanner.admin.database.v1.ListBackupSchedulesResponse)) { + return super.equals(obj); + } + com.google.spanner.admin.database.v1.ListBackupSchedulesResponse other = + (com.google.spanner.admin.database.v1.ListBackupSchedulesResponse) obj; + + if (!getBackupSchedulesList().equals(other.getBackupSchedulesList())) return false; + if (!getNextPageToken().equals(other.getNextPageToken())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getBackupSchedulesCount() > 0) { + hash = (37 * hash) + BACKUP_SCHEDULES_FIELD_NUMBER; + hash = (53 * hash) + getBackupSchedulesList().hashCode(); + } + hash = (37 * hash) + NEXT_PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getNextPageToken().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.spanner.admin.database.v1.ListBackupSchedulesResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.spanner.admin.database.v1.ListBackupSchedulesResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.spanner.admin.database.v1.ListBackupSchedulesResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.spanner.admin.database.v1.ListBackupSchedulesResponse 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.spanner.admin.database.v1.ListBackupSchedulesResponse parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.spanner.admin.database.v1.ListBackupSchedulesResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.spanner.admin.database.v1.ListBackupSchedulesResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.spanner.admin.database.v1.ListBackupSchedulesResponse 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.spanner.admin.database.v1.ListBackupSchedulesResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.spanner.admin.database.v1.ListBackupSchedulesResponse 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.spanner.admin.database.v1.ListBackupSchedulesResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.spanner.admin.database.v1.ListBackupSchedulesResponse 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.spanner.admin.database.v1.ListBackupSchedulesResponse 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; + } + /** + * + * + *
+   * The response for
+   * [ListBackupSchedules][google.spanner.admin.database.v1.DatabaseAdmin.ListBackupSchedules].
+   * 
+ * + * Protobuf type {@code google.spanner.admin.database.v1.ListBackupSchedulesResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.spanner.admin.database.v1.ListBackupSchedulesResponse) + com.google.spanner.admin.database.v1.ListBackupSchedulesResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.spanner.admin.database.v1.BackupScheduleProto + .internal_static_google_spanner_admin_database_v1_ListBackupSchedulesResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.spanner.admin.database.v1.BackupScheduleProto + .internal_static_google_spanner_admin_database_v1_ListBackupSchedulesResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.spanner.admin.database.v1.ListBackupSchedulesResponse.class, + com.google.spanner.admin.database.v1.ListBackupSchedulesResponse.Builder.class); + } + + // Construct using com.google.spanner.admin.database.v1.ListBackupSchedulesResponse.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (backupSchedulesBuilder_ == null) { + backupSchedules_ = java.util.Collections.emptyList(); + } else { + backupSchedules_ = null; + backupSchedulesBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + nextPageToken_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.spanner.admin.database.v1.BackupScheduleProto + .internal_static_google_spanner_admin_database_v1_ListBackupSchedulesResponse_descriptor; + } + + @java.lang.Override + public com.google.spanner.admin.database.v1.ListBackupSchedulesResponse + getDefaultInstanceForType() { + return com.google.spanner.admin.database.v1.ListBackupSchedulesResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.spanner.admin.database.v1.ListBackupSchedulesResponse build() { + com.google.spanner.admin.database.v1.ListBackupSchedulesResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.spanner.admin.database.v1.ListBackupSchedulesResponse buildPartial() { + com.google.spanner.admin.database.v1.ListBackupSchedulesResponse result = + new com.google.spanner.admin.database.v1.ListBackupSchedulesResponse(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.spanner.admin.database.v1.ListBackupSchedulesResponse result) { + if (backupSchedulesBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + backupSchedules_ = java.util.Collections.unmodifiableList(backupSchedules_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.backupSchedules_ = backupSchedules_; + } else { + result.backupSchedules_ = backupSchedulesBuilder_.build(); + } + } + + private void buildPartial0( + com.google.spanner.admin.database.v1.ListBackupSchedulesResponse result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.nextPageToken_ = nextPageToken_; + } + } + + @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.spanner.admin.database.v1.ListBackupSchedulesResponse) { + return mergeFrom((com.google.spanner.admin.database.v1.ListBackupSchedulesResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.spanner.admin.database.v1.ListBackupSchedulesResponse other) { + if (other + == com.google.spanner.admin.database.v1.ListBackupSchedulesResponse.getDefaultInstance()) + return this; + if (backupSchedulesBuilder_ == null) { + if (!other.backupSchedules_.isEmpty()) { + if (backupSchedules_.isEmpty()) { + backupSchedules_ = other.backupSchedules_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureBackupSchedulesIsMutable(); + backupSchedules_.addAll(other.backupSchedules_); + } + onChanged(); + } + } else { + if (!other.backupSchedules_.isEmpty()) { + if (backupSchedulesBuilder_.isEmpty()) { + backupSchedulesBuilder_.dispose(); + backupSchedulesBuilder_ = null; + backupSchedules_ = other.backupSchedules_; + bitField0_ = (bitField0_ & ~0x00000001); + backupSchedulesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getBackupSchedulesFieldBuilder() + : null; + } else { + backupSchedulesBuilder_.addAllMessages(other.backupSchedules_); + } + } + } + if (!other.getNextPageToken().isEmpty()) { + nextPageToken_ = other.nextPageToken_; + bitField0_ |= 0x00000002; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.spanner.admin.database.v1.BackupSchedule m = + input.readMessage( + com.google.spanner.admin.database.v1.BackupSchedule.parser(), + extensionRegistry); + if (backupSchedulesBuilder_ == null) { + ensureBackupSchedulesIsMutable(); + backupSchedules_.add(m); + } else { + backupSchedulesBuilder_.addMessage(m); + } + break; + } // case 10 + case 18: + { + nextPageToken_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.util.List backupSchedules_ = + java.util.Collections.emptyList(); + + private void ensureBackupSchedulesIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + backupSchedules_ = + new java.util.ArrayList( + backupSchedules_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.spanner.admin.database.v1.BackupSchedule, + com.google.spanner.admin.database.v1.BackupSchedule.Builder, + com.google.spanner.admin.database.v1.BackupScheduleOrBuilder> + backupSchedulesBuilder_; + + /** + * + * + *
+     * The list of backup schedules for a database.
+     * 
+ * + * repeated .google.spanner.admin.database.v1.BackupSchedule backup_schedules = 1; + */ + public java.util.List + getBackupSchedulesList() { + if (backupSchedulesBuilder_ == null) { + return java.util.Collections.unmodifiableList(backupSchedules_); + } else { + return backupSchedulesBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * The list of backup schedules for a database.
+     * 
+ * + * repeated .google.spanner.admin.database.v1.BackupSchedule backup_schedules = 1; + */ + public int getBackupSchedulesCount() { + if (backupSchedulesBuilder_ == null) { + return backupSchedules_.size(); + } else { + return backupSchedulesBuilder_.getCount(); + } + } + /** + * + * + *
+     * The list of backup schedules for a database.
+     * 
+ * + * repeated .google.spanner.admin.database.v1.BackupSchedule backup_schedules = 1; + */ + public com.google.spanner.admin.database.v1.BackupSchedule getBackupSchedules(int index) { + if (backupSchedulesBuilder_ == null) { + return backupSchedules_.get(index); + } else { + return backupSchedulesBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * The list of backup schedules for a database.
+     * 
+ * + * repeated .google.spanner.admin.database.v1.BackupSchedule backup_schedules = 1; + */ + public Builder setBackupSchedules( + int index, com.google.spanner.admin.database.v1.BackupSchedule value) { + if (backupSchedulesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureBackupSchedulesIsMutable(); + backupSchedules_.set(index, value); + onChanged(); + } else { + backupSchedulesBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The list of backup schedules for a database.
+     * 
+ * + * repeated .google.spanner.admin.database.v1.BackupSchedule backup_schedules = 1; + */ + public Builder setBackupSchedules( + int index, com.google.spanner.admin.database.v1.BackupSchedule.Builder builderForValue) { + if (backupSchedulesBuilder_ == null) { + ensureBackupSchedulesIsMutable(); + backupSchedules_.set(index, builderForValue.build()); + onChanged(); + } else { + backupSchedulesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The list of backup schedules for a database.
+     * 
+ * + * repeated .google.spanner.admin.database.v1.BackupSchedule backup_schedules = 1; + */ + public Builder addBackupSchedules(com.google.spanner.admin.database.v1.BackupSchedule value) { + if (backupSchedulesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureBackupSchedulesIsMutable(); + backupSchedules_.add(value); + onChanged(); + } else { + backupSchedulesBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * The list of backup schedules for a database.
+     * 
+ * + * repeated .google.spanner.admin.database.v1.BackupSchedule backup_schedules = 1; + */ + public Builder addBackupSchedules( + int index, com.google.spanner.admin.database.v1.BackupSchedule value) { + if (backupSchedulesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureBackupSchedulesIsMutable(); + backupSchedules_.add(index, value); + onChanged(); + } else { + backupSchedulesBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The list of backup schedules for a database.
+     * 
+ * + * repeated .google.spanner.admin.database.v1.BackupSchedule backup_schedules = 1; + */ + public Builder addBackupSchedules( + com.google.spanner.admin.database.v1.BackupSchedule.Builder builderForValue) { + if (backupSchedulesBuilder_ == null) { + ensureBackupSchedulesIsMutable(); + backupSchedules_.add(builderForValue.build()); + onChanged(); + } else { + backupSchedulesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The list of backup schedules for a database.
+     * 
+ * + * repeated .google.spanner.admin.database.v1.BackupSchedule backup_schedules = 1; + */ + public Builder addBackupSchedules( + int index, com.google.spanner.admin.database.v1.BackupSchedule.Builder builderForValue) { + if (backupSchedulesBuilder_ == null) { + ensureBackupSchedulesIsMutable(); + backupSchedules_.add(index, builderForValue.build()); + onChanged(); + } else { + backupSchedulesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The list of backup schedules for a database.
+     * 
+ * + * repeated .google.spanner.admin.database.v1.BackupSchedule backup_schedules = 1; + */ + public Builder addAllBackupSchedules( + java.lang.Iterable values) { + if (backupSchedulesBuilder_ == null) { + ensureBackupSchedulesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, backupSchedules_); + onChanged(); + } else { + backupSchedulesBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * The list of backup schedules for a database.
+     * 
+ * + * repeated .google.spanner.admin.database.v1.BackupSchedule backup_schedules = 1; + */ + public Builder clearBackupSchedules() { + if (backupSchedulesBuilder_ == null) { + backupSchedules_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + backupSchedulesBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * The list of backup schedules for a database.
+     * 
+ * + * repeated .google.spanner.admin.database.v1.BackupSchedule backup_schedules = 1; + */ + public Builder removeBackupSchedules(int index) { + if (backupSchedulesBuilder_ == null) { + ensureBackupSchedulesIsMutable(); + backupSchedules_.remove(index); + onChanged(); + } else { + backupSchedulesBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * The list of backup schedules for a database.
+     * 
+ * + * repeated .google.spanner.admin.database.v1.BackupSchedule backup_schedules = 1; + */ + public com.google.spanner.admin.database.v1.BackupSchedule.Builder getBackupSchedulesBuilder( + int index) { + return getBackupSchedulesFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * The list of backup schedules for a database.
+     * 
+ * + * repeated .google.spanner.admin.database.v1.BackupSchedule backup_schedules = 1; + */ + public com.google.spanner.admin.database.v1.BackupScheduleOrBuilder getBackupSchedulesOrBuilder( + int index) { + if (backupSchedulesBuilder_ == null) { + return backupSchedules_.get(index); + } else { + return backupSchedulesBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * The list of backup schedules for a database.
+     * 
+ * + * repeated .google.spanner.admin.database.v1.BackupSchedule backup_schedules = 1; + */ + public java.util.List + getBackupSchedulesOrBuilderList() { + if (backupSchedulesBuilder_ != null) { + return backupSchedulesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(backupSchedules_); + } + } + /** + * + * + *
+     * The list of backup schedules for a database.
+     * 
+ * + * repeated .google.spanner.admin.database.v1.BackupSchedule backup_schedules = 1; + */ + public com.google.spanner.admin.database.v1.BackupSchedule.Builder addBackupSchedulesBuilder() { + return getBackupSchedulesFieldBuilder() + .addBuilder(com.google.spanner.admin.database.v1.BackupSchedule.getDefaultInstance()); + } + /** + * + * + *
+     * The list of backup schedules for a database.
+     * 
+ * + * repeated .google.spanner.admin.database.v1.BackupSchedule backup_schedules = 1; + */ + public com.google.spanner.admin.database.v1.BackupSchedule.Builder addBackupSchedulesBuilder( + int index) { + return getBackupSchedulesFieldBuilder() + .addBuilder( + index, com.google.spanner.admin.database.v1.BackupSchedule.getDefaultInstance()); + } + /** + * + * + *
+     * The list of backup schedules for a database.
+     * 
+ * + * repeated .google.spanner.admin.database.v1.BackupSchedule backup_schedules = 1; + */ + public java.util.List + getBackupSchedulesBuilderList() { + return getBackupSchedulesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.spanner.admin.database.v1.BackupSchedule, + com.google.spanner.admin.database.v1.BackupSchedule.Builder, + com.google.spanner.admin.database.v1.BackupScheduleOrBuilder> + getBackupSchedulesFieldBuilder() { + if (backupSchedulesBuilder_ == null) { + backupSchedulesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.spanner.admin.database.v1.BackupSchedule, + com.google.spanner.admin.database.v1.BackupSchedule.Builder, + com.google.spanner.admin.database.v1.BackupScheduleOrBuilder>( + backupSchedules_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + backupSchedules_ = null; + } + return backupSchedulesBuilder_; + } + + private java.lang.Object nextPageToken_ = ""; + /** + * + * + *
+     * `next_page_token` can be sent in a subsequent
+     * [ListBackupSchedules][google.spanner.admin.database.v1.DatabaseAdmin.ListBackupSchedules]
+     * call to fetch more of the schedules.
+     * 
+ * + * 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; + } + } + /** + * + * + *
+     * `next_page_token` can be sent in a subsequent
+     * [ListBackupSchedules][google.spanner.admin.database.v1.DatabaseAdmin.ListBackupSchedules]
+     * call to fetch more of the schedules.
+     * 
+ * + * 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; + } + } + /** + * + * + *
+     * `next_page_token` can be sent in a subsequent
+     * [ListBackupSchedules][google.spanner.admin.database.v1.DatabaseAdmin.ListBackupSchedules]
+     * call to fetch more of the schedules.
+     * 
+ * + * 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; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * `next_page_token` can be sent in a subsequent
+     * [ListBackupSchedules][google.spanner.admin.database.v1.DatabaseAdmin.ListBackupSchedules]
+     * call to fetch more of the schedules.
+     * 
+ * + * string next_page_token = 2; + * + * @return This builder for chaining. + */ + public Builder clearNextPageToken() { + nextPageToken_ = getDefaultInstance().getNextPageToken(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * `next_page_token` can be sent in a subsequent
+     * [ListBackupSchedules][google.spanner.admin.database.v1.DatabaseAdmin.ListBackupSchedules]
+     * call to fetch more of the schedules.
+     * 
+ * + * 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; + bitField0_ |= 0x00000002; + 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.spanner.admin.database.v1.ListBackupSchedulesResponse) + } + + // @@protoc_insertion_point(class_scope:google.spanner.admin.database.v1.ListBackupSchedulesResponse) + private static final com.google.spanner.admin.database.v1.ListBackupSchedulesResponse + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.spanner.admin.database.v1.ListBackupSchedulesResponse(); + } + + public static com.google.spanner.admin.database.v1.ListBackupSchedulesResponse + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListBackupSchedulesResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.spanner.admin.database.v1.ListBackupSchedulesResponse + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/ListBackupSchedulesResponseOrBuilder.java b/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/ListBackupSchedulesResponseOrBuilder.java new file mode 100644 index 00000000000..c835805ec85 --- /dev/null +++ b/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/ListBackupSchedulesResponseOrBuilder.java @@ -0,0 +1,108 @@ +/* + * Copyright 2024 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/spanner/admin/database/v1/backup_schedule.proto + +// Protobuf Java Version: 3.25.3 +package com.google.spanner.admin.database.v1; + +public interface ListBackupSchedulesResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.spanner.admin.database.v1.ListBackupSchedulesResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The list of backup schedules for a database.
+   * 
+ * + * repeated .google.spanner.admin.database.v1.BackupSchedule backup_schedules = 1; + */ + java.util.List getBackupSchedulesList(); + /** + * + * + *
+   * The list of backup schedules for a database.
+   * 
+ * + * repeated .google.spanner.admin.database.v1.BackupSchedule backup_schedules = 1; + */ + com.google.spanner.admin.database.v1.BackupSchedule getBackupSchedules(int index); + /** + * + * + *
+   * The list of backup schedules for a database.
+   * 
+ * + * repeated .google.spanner.admin.database.v1.BackupSchedule backup_schedules = 1; + */ + int getBackupSchedulesCount(); + /** + * + * + *
+   * The list of backup schedules for a database.
+   * 
+ * + * repeated .google.spanner.admin.database.v1.BackupSchedule backup_schedules = 1; + */ + java.util.List + getBackupSchedulesOrBuilderList(); + /** + * + * + *
+   * The list of backup schedules for a database.
+   * 
+ * + * repeated .google.spanner.admin.database.v1.BackupSchedule backup_schedules = 1; + */ + com.google.spanner.admin.database.v1.BackupScheduleOrBuilder getBackupSchedulesOrBuilder( + int index); + + /** + * + * + *
+   * `next_page_token` can be sent in a subsequent
+   * [ListBackupSchedules][google.spanner.admin.database.v1.DatabaseAdmin.ListBackupSchedules]
+   * call to fetch more of the schedules.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + java.lang.String getNextPageToken(); + /** + * + * + *
+   * `next_page_token` can be sent in a subsequent
+   * [ListBackupSchedules][google.spanner.admin.database.v1.DatabaseAdmin.ListBackupSchedules]
+   * call to fetch more of the schedules.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + com.google.protobuf.ByteString getNextPageTokenBytes(); +} diff --git a/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/SpannerDatabaseAdminProto.java b/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/SpannerDatabaseAdminProto.java index 8b78748dbe2..ab98cc3e295 100644 --- a/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/SpannerDatabaseAdminProto.java +++ b/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/SpannerDatabaseAdminProto.java @@ -144,262 +144,299 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "otobuf/empty.proto\032 google/protobuf/fiel" + "d_mask.proto\032\037google/protobuf/timestamp." + "proto\032-google/spanner/admin/database/v1/" - + "backup.proto\032-google/spanner/admin/datab" - + "ase/v1/common.proto\"\253\001\n\013RestoreInfo\022H\n\013s" - + "ource_type\030\001 \001(\01623.google.spanner.admin." - + "database.v1.RestoreSourceType\022C\n\013backup_" - + "info\030\002 \001(\0132,.google.spanner.admin.databa" - + "se.v1.BackupInfoH\000B\r\n\013source_info\"\312\006\n\010Da" - + "tabase\022\021\n\004name\030\001 \001(\tB\003\340A\002\022D\n\005state\030\002 \001(\016" - + "20.google.spanner.admin.database.v1.Data" - + "base.StateB\003\340A\003\0224\n\013create_time\030\003 \001(\0132\032.g" - + "oogle.protobuf.TimestampB\003\340A\003\022H\n\014restore" - + "_info\030\004 \001(\0132-.google.spanner.admin.datab" - + "ase.v1.RestoreInfoB\003\340A\003\022R\n\021encryption_co" - + "nfig\030\005 \001(\01322.google.spanner.admin.databa" - + "se.v1.EncryptionConfigB\003\340A\003\022N\n\017encryptio" - + "n_info\030\010 \003(\01320.google.spanner.admin.data" - + "base.v1.EncryptionInfoB\003\340A\003\022%\n\030version_r" - + "etention_period\030\006 \001(\tB\003\340A\003\022>\n\025earliest_v" - + "ersion_time\030\007 \001(\0132\032.google.protobuf.Time" - + "stampB\003\340A\003\022\033\n\016default_leader\030\t \001(\tB\003\340A\003\022" - + "P\n\020database_dialect\030\n \001(\01621.google.spann" - + "er.admin.database.v1.DatabaseDialectB\003\340A" - + "\003\022\036\n\026enable_drop_protection\030\013 \001(\010\022\030\n\013rec" - + "onciling\030\014 \001(\010B\003\340A\003\"M\n\005State\022\025\n\021STATE_UN" - + "SPECIFIED\020\000\022\014\n\010CREATING\020\001\022\t\n\005READY\020\002\022\024\n\020" - + "READY_OPTIMIZING\020\003:b\352A_\n\037spanner.googlea" - + "pis.com/Database\022\n\025earliest_version_time\030\007 \001(\0132\032.goog" + + "le.protobuf.TimestampB\003\340A\003\022\033\n\016default_le" + + "ader\030\t \001(\tB\003\340A\003\022P\n\020database_dialect\030\n \001(" + + "\01621.google.spanner.admin.database.v1.Dat" + + "abaseDialectB\003\340A\003\022\036\n\026enable_drop_protect" + + "ion\030\013 \001(\010\022\030\n\013reconciling\030\014 \001(\010B\003\340A\003\"M\n\005S" + + "tate\022\025\n\021STATE_UNSPECIFIED\020\000\022\014\n\010CREATING\020" + + "\001\022\t\n\005READY\020\002\022\024\n\020READY_OPTIMIZING\020\003:b\352A_\n" + + "\037spanner.googleapis.com/Database\022\332A\006parent\202\323" - + "\344\223\002/\022-/v1/{parent=projects/*/instances/*" - + "}/databases\022\244\002\n\016CreateDatabase\0227.google." - + "spanner.admin.database.v1.CreateDatabase" - + "Request\032\035.google.longrunning.Operation\"\271" - + "\001\312Ad\n)google.spanner.admin.database.v1.D" - + "atabase\0227google.spanner.admin.database.v" - + "1.CreateDatabaseMetadata\332A\027parent,create" - + "_statement\202\323\344\223\0022\"-/v1/{parent=projects/*" - + "/instances/*}/databases:\001*\022\255\001\n\013GetDataba" - + "se\0224.google.spanner.admin.database.v1.Ge" - + "tDatabaseRequest\032*.google.spanner.admin." - + "database.v1.Database\"<\332A\004name\202\323\344\223\002/\022-/v1" - + "/{name=projects/*/instances/*/databases/" - + "*}\022\357\001\n\016UpdateDatabase\0227.google.spanner.a" - + "dmin.database.v1.UpdateDatabaseRequest\032\035" - + ".google.longrunning.Operation\"\204\001\312A\"\n\010Dat" - + "abase\022\026UpdateDatabaseMetadata\332A\024database" - + ",update_mask\202\323\344\223\002B26/v1/{database.name=p" - + "rojects/*/instances/*/databases/*}:\010data" - + "base\022\235\002\n\021UpdateDatabaseDdl\022:.google.span" - + "ner.admin.database.v1.UpdateDatabaseDdlR" - + "equest\032\035.google.longrunning.Operation\"\254\001" - + "\312AS\n\025google.protobuf.Empty\022:google.spann" - + "er.admin.database.v1.UpdateDatabaseDdlMe" - + "tadata\332A\023database,statements\202\323\344\223\002:25/v1/" - + "{database=projects/*/instances/*/databas" - + "es/*}/ddl:\001*\022\243\001\n\014DropDatabase\0225.google.s" - + "panner.admin.database.v1.DropDatabaseReq" - + "uest\032\026.google.protobuf.Empty\"D\332A\010databas" - + "e\202\323\344\223\0023*1/v1/{database=projects/*/instan" - + "ces/*/databases/*}\022\315\001\n\016GetDatabaseDdl\0227." - + "google.spanner.admin.database.v1.GetData" - + "baseDdlRequest\0328.google.spanner.admin.da" - + "tabase.v1.GetDatabaseDdlResponse\"H\332A\010dat" - + "abase\202\323\344\223\0027\0225/v1/{database=projects/*/in" - + "stances/*/databases/*}/ddl\022\353\001\n\014SetIamPol" - + "icy\022\".google.iam.v1.SetIamPolicyRequest\032" - + "\025.google.iam.v1.Policy\"\237\001\332A\017resource,pol" - + "icy\202\323\344\223\002\206\001\">/v1/{resource=projects/*/ins" - + "tances/*/databases/*}:setIamPolicy:\001*ZA\"" - + "/v1/{resource=projects/*/instances/*/" - + "databases/*}:getIamPolicy:\001*ZA\".google.spanner.admin.database." - + "v1.ListBackupOperationsResponse\"E\332A\006pare" - + "nt\202\323\344\223\0026\0224/v1/{parent=projects/*/instanc" - + "es/*}/backupOperations\022\334\001\n\021ListDatabaseR" - + "oles\022:.google.spanner.admin.database.v1." - + "ListDatabaseRolesRequest\032;.google.spanne" - + "r.admin.database.v1.ListDatabaseRolesRes" - + "ponse\"N\332A\006parent\202\323\344\223\002?\022=/v1/{parent=proj" - + "ects/*/instances/*/databases/*}/database" - + "Roles\032x\312A\026spanner.googleapis.com\322A\\https" - + "://www.googleapis.com/auth/cloud-platfor" - + "m,https://www.googleapis.com/auth/spanne" - + "r.adminB\330\002\n$com.google.spanner.admin.dat" - + "abase.v1B\031SpannerDatabaseAdminProtoP\001ZFc" - + "loud.google.com/go/spanner/admin/databas" - + "e/apiv1/databasepb;databasepb\252\002&Google.C" - + "loud.Spanner.Admin.Database.V1\312\002&Google\\" - + "Cloud\\Spanner\\Admin\\Database\\V1\352\002+Google" - + "::Cloud::Spanner::Admin::Database::V1\352AJ" - + "\n\037spanner.googleapis.com/Instance\022\'proje" - + "cts/{project}/instances/{instance}b\006prot" - + "o3" + + "\030\n\013database_id\030\002 \001(\tB\003\340A\002\0224\n\006backup\030\003 \001(" + + "\tB\"\372A\037\n\035spanner.googleapis.com/BackupH\000\022" + + "a\n\021encryption_config\030\004 \001(\0132A.google.span" + + "ner.admin.database.v1.RestoreDatabaseEnc" + + "ryptionConfigB\003\340A\001B\010\n\006source\"\265\003\n\037Restore" + + "DatabaseEncryptionConfig\022n\n\017encryption_t" + + "ype\030\001 \001(\0162P.google.spanner.admin.databas" + + "e.v1.RestoreDatabaseEncryptionConfig.Enc" + + "ryptionTypeB\003\340A\002\022?\n\014kms_key_name\030\002 \001(\tB)" + + "\340A\001\372A#\n!cloudkms.googleapis.com/CryptoKe" + + "y\022@\n\rkms_key_names\030\003 \003(\tB)\340A\001\372A#\n!cloudk" + + "ms.googleapis.com/CryptoKey\"\236\001\n\016Encrypti" + + "onType\022\037\n\033ENCRYPTION_TYPE_UNSPECIFIED\020\000\022" + + "+\n\'USE_CONFIG_DEFAULT_OR_BACKUP_ENCRYPTI" + + "ON\020\001\022\035\n\031GOOGLE_DEFAULT_ENCRYPTION\020\002\022\037\n\033C" + + "USTOMER_MANAGED_ENCRYPTION\020\003\"\215\003\n\027Restore" + + "DatabaseMetadata\0222\n\004name\030\001 \001(\tB$\372A!\n\037spa" + + "nner.googleapis.com/Database\022H\n\013source_t" + + "ype\030\002 \001(\01623.google.spanner.admin.databas" + + "e.v1.RestoreSourceType\022C\n\013backup_info\030\003 " + + "\001(\0132,.google.spanner.admin.database.v1.B" + + "ackupInfoH\000\022E\n\010progress\030\004 \001(\01323.google.s" + + "panner.admin.database.v1.OperationProgre" + + "ss\022/\n\013cancel_time\030\005 \001(\0132\032.google.protobu" + + "f.Timestamp\022(\n optimize_database_operati" + + "on_name\030\006 \001(\tB\r\n\013source_info\"\235\001\n Optimiz" + + "eRestoredDatabaseMetadata\0222\n\004name\030\001 \001(\tB" + + "$\372A!\n\037spanner.googleapis.com/Database\022E\n" + + "\010progress\030\002 \001(\01323.google.spanner.admin.d" + + "atabase.v1.OperationProgress\"\236\001\n\014Databas" + + "eRole\022\021\n\004name\030\001 \001(\tB\003\340A\002:{\352Ax\n#spanner.g" + + "oogleapis.com/DatabaseRole\022Qprojects/{pr" + + "oject}/instances/{instance}/databases/{d" + + "atabase}/databaseRoles/{role}\"z\n\030ListDat" + + "abaseRolesRequest\0227\n\006parent\030\001 \001(\tB\'\340A\002\372A" + + "!\n\037spanner.googleapis.com/Database\022\021\n\tpa" + + "ge_size\030\002 \001(\005\022\022\n\npage_token\030\003 \001(\t\"|\n\031Lis" + + "tDatabaseRolesResponse\022F\n\016database_roles" + + "\030\001 \003(\0132..google.spanner.admin.database.v" + + "1.DatabaseRole\022\027\n\017next_page_token\030\002 \001(\t*" + + "5\n\021RestoreSourceType\022\024\n\020TYPE_UNSPECIFIED" + + "\020\000\022\n\n\006BACKUP\020\0012\2301\n\rDatabaseAdmin\022\300\001\n\rLis" + + "tDatabases\0226.google.spanner.admin.databa" + + "se.v1.ListDatabasesRequest\0327.google.span" + + "ner.admin.database.v1.ListDatabasesRespo" + + "nse\">\332A\006parent\202\323\344\223\002/\022-/v1/{parent=projec" + + "ts/*/instances/*}/databases\022\244\002\n\016CreateDa" + + "tabase\0227.google.spanner.admin.database.v" + + "1.CreateDatabaseRequest\032\035.google.longrun" + + "ning.Operation\"\271\001\312Ad\n)google.spanner.adm" + + "in.database.v1.Database\0227google.spanner." + + "admin.database.v1.CreateDatabaseMetadata" + + "\332A\027parent,create_statement\202\323\344\223\0022\"-/v1/{p" + + "arent=projects/*/instances/*}/databases:" + + "\001*\022\255\001\n\013GetDatabase\0224.google.spanner.admi" + + "n.database.v1.GetDatabaseRequest\032*.googl" + + "e.spanner.admin.database.v1.Database\"<\332A" + + "\004name\202\323\344\223\002/\022-/v1/{name=projects/*/instan" + + "ces/*/databases/*}\022\357\001\n\016UpdateDatabase\0227." + + "google.spanner.admin.database.v1.UpdateD" + + "atabaseRequest\032\035.google.longrunning.Oper" + + "ation\"\204\001\312A\"\n\010Database\022\026UpdateDatabaseMet" + + "adata\332A\024database,update_mask\202\323\344\223\002B26/v1/" + + "{database.name=projects/*/instances/*/da" + + "tabases/*}:\010database\022\235\002\n\021UpdateDatabaseD" + + "dl\022:.google.spanner.admin.database.v1.Up" + + "dateDatabaseDdlRequest\032\035.google.longrunn" + + "ing.Operation\"\254\001\312AS\n\025google.protobuf.Emp" + + "ty\022:google.spanner.admin.database.v1.Upd" + + "ateDatabaseDdlMetadata\332A\023database,statem" + + "ents\202\323\344\223\002:25/v1/{database=projects/*/ins" + + "tances/*/databases/*}/ddl:\001*\022\243\001\n\014DropDat" + + "abase\0225.google.spanner.admin.database.v1" + + ".DropDatabaseRequest\032\026.google.protobuf.E" + + "mpty\"D\332A\010database\202\323\344\223\0023*1/v1/{database=p" + + "rojects/*/instances/*/databases/*}\022\315\001\n\016G" + + "etDatabaseDdl\0227.google.spanner.admin.dat" + + "abase.v1.GetDatabaseDdlRequest\0328.google." + + "spanner.admin.database.v1.GetDatabaseDdl" + + "Response\"H\332A\010database\202\323\344\223\0027\0225/v1/{databa" + + "se=projects/*/instances/*/databases/*}/d" + + "dl\022\302\002\n\014SetIamPolicy\022\".google.iam.v1.SetI" + + "amPolicyRequest\032\025.google.iam.v1.Policy\"\366" + + "\001\332A\017resource,policy\202\323\344\223\002\335\001\">/v1/{resourc" + + "e=projects/*/instances/*/databases/*}:se" + + "tIamPolicy:\001*ZA\"/v1/{resource=" + + "projects/*/instances/*/databases/*}:getI" + + "amPolicy:\001*ZA\".google.spanner.admin.databa" + + "se.v1.ListBackupOperationsResponse\"E\332A\006p" + + "arent\202\323\344\223\0026\0224/v1/{parent=projects/*/inst" + + "ances/*}/backupOperations\022\334\001\n\021ListDataba" + + "seRoles\022:.google.spanner.admin.database." + + "v1.ListDatabaseRolesRequest\032;.google.spa" + + "nner.admin.database.v1.ListDatabaseRoles" + + "Response\"N\332A\006parent\202\323\344\223\002?\022=/v1/{parent=p" + + "rojects/*/instances/*/databases/*}/datab" + + "aseRoles\022\216\002\n\024CreateBackupSchedule\022=.goog" + + "le.spanner.admin.database.v1.CreateBacku" + + "pScheduleRequest\0320.google.spanner.admin." + + "database.v1.BackupSchedule\"\204\001\332A)parent,b" + + "ackup_schedule,backup_schedule_id\202\323\344\223\002R\"" + + "?/v1/{parent=projects/*/instances/*/data" + + "bases/*}/backupSchedules:\017backup_schedul" + + "e\022\321\001\n\021GetBackupSchedule\022:.google.spanner" + + ".admin.database.v1.GetBackupScheduleRequ" + + "est\0320.google.spanner.admin.database.v1.B" + + "ackupSchedule\"N\332A\004name\202\323\344\223\002A\022?/v1/{name=" + + "projects/*/instances/*/databases/*/backu" + + "pSchedules/*}\022\220\002\n\024UpdateBackupSchedule\022=" + + ".google.spanner.admin.database.v1.Update" + + "BackupScheduleRequest\0320.google.spanner.a" + + "dmin.database.v1.BackupSchedule\"\206\001\332A\033bac" + + "kup_schedule,update_mask\202\323\344\223\002b2O/v1/{bac" + + "kup_schedule.name=projects/*/instances/*" + + "/databases/*/backupSchedules/*}:\017backup_" + + "schedule\022\275\001\n\024DeleteBackupSchedule\022=.goog" + + "le.spanner.admin.database.v1.DeleteBacku" + + "pScheduleRequest\032\026.google.protobuf.Empty" + + "\"N\332A\004name\202\323\344\223\002A*?/v1/{name=projects/*/in" + + "stances/*/databases/*/backupSchedules/*}" + + "\022\344\001\n\023ListBackupSchedules\022<.google.spanne" + + "r.admin.database.v1.ListBackupSchedulesR" + + "equest\032=.google.spanner.admin.database.v" + + "1.ListBackupSchedulesResponse\"P\332A\006parent" + + "\202\323\344\223\002A\022?/v1/{parent=projects/*/instances" + + "/*/databases/*}/backupSchedules\032x\312A\026span" + + "ner.googleapis.com\322A\\https://www.googlea" + + "pis.com/auth/cloud-platform,https://www." + + "googleapis.com/auth/spanner.adminB\330\002\n$co" + + "m.google.spanner.admin.database.v1B\031Span" + + "nerDatabaseAdminProtoP\001ZFcloud.google.co" + + "m/go/spanner/admin/database/apiv1/databa" + + "sepb;databasepb\252\002&Google.Cloud.Spanner.A" + + "dmin.Database.V1\312\002&Google\\Cloud\\Spanner\\" + + "Admin\\Database\\V1\352\002+Google::Cloud::Spann" + + "er::Admin::Database::V1\352AJ\n\037spanner.goog" + + "leapis.com/Instance\022\'projects/{project}/" + + "instances/{instance}b\006proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( @@ -416,6 +453,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { com.google.protobuf.FieldMaskProto.getDescriptor(), com.google.protobuf.TimestampProto.getDescriptor(), com.google.spanner.admin.database.v1.BackupProto.getDescriptor(), + com.google.spanner.admin.database.v1.BackupScheduleProto.getDescriptor(), com.google.spanner.admin.database.v1.CommonProto.getDescriptor(), }); internal_static_google_spanner_admin_database_v1_RestoreInfo_descriptor = @@ -656,6 +694,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { com.google.protobuf.FieldMaskProto.getDescriptor(); com.google.protobuf.TimestampProto.getDescriptor(); com.google.spanner.admin.database.v1.BackupProto.getDescriptor(); + com.google.spanner.admin.database.v1.BackupScheduleProto.getDescriptor(); com.google.spanner.admin.database.v1.CommonProto.getDescriptor(); } diff --git a/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/UpdateBackupScheduleRequest.java b/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/UpdateBackupScheduleRequest.java new file mode 100644 index 00000000000..92c58484868 --- /dev/null +++ b/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/UpdateBackupScheduleRequest.java @@ -0,0 +1,1107 @@ +/* + * Copyright 2024 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/spanner/admin/database/v1/backup_schedule.proto + +// Protobuf Java Version: 3.25.3 +package com.google.spanner.admin.database.v1; + +/** + * + * + *
+ * The request for
+ * [UpdateBackupScheduleRequest][google.spanner.admin.database.v1.DatabaseAdmin.UpdateBackupSchedule].
+ * 
+ * + * Protobuf type {@code google.spanner.admin.database.v1.UpdateBackupScheduleRequest} + */ +public final class UpdateBackupScheduleRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.spanner.admin.database.v1.UpdateBackupScheduleRequest) + UpdateBackupScheduleRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use UpdateBackupScheduleRequest.newBuilder() to construct. + private UpdateBackupScheduleRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private UpdateBackupScheduleRequest() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new UpdateBackupScheduleRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.spanner.admin.database.v1.BackupScheduleProto + .internal_static_google_spanner_admin_database_v1_UpdateBackupScheduleRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.spanner.admin.database.v1.BackupScheduleProto + .internal_static_google_spanner_admin_database_v1_UpdateBackupScheduleRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.spanner.admin.database.v1.UpdateBackupScheduleRequest.class, + com.google.spanner.admin.database.v1.UpdateBackupScheduleRequest.Builder.class); + } + + private int bitField0_; + public static final int BACKUP_SCHEDULE_FIELD_NUMBER = 1; + private com.google.spanner.admin.database.v1.BackupSchedule backupSchedule_; + /** + * + * + *
+   * Required. The backup schedule to update. `backup_schedule.name`, and the
+   * fields to be updated as specified by `update_mask` are required. Other
+   * fields are ignored.
+   * 
+ * + * + * .google.spanner.admin.database.v1.BackupSchedule backup_schedule = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the backupSchedule field is set. + */ + @java.lang.Override + public boolean hasBackupSchedule() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+   * Required. The backup schedule to update. `backup_schedule.name`, and the
+   * fields to be updated as specified by `update_mask` are required. Other
+   * fields are ignored.
+   * 
+ * + * + * .google.spanner.admin.database.v1.BackupSchedule backup_schedule = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The backupSchedule. + */ + @java.lang.Override + public com.google.spanner.admin.database.v1.BackupSchedule getBackupSchedule() { + return backupSchedule_ == null + ? com.google.spanner.admin.database.v1.BackupSchedule.getDefaultInstance() + : backupSchedule_; + } + /** + * + * + *
+   * Required. The backup schedule to update. `backup_schedule.name`, and the
+   * fields to be updated as specified by `update_mask` are required. Other
+   * fields are ignored.
+   * 
+ * + * + * .google.spanner.admin.database.v1.BackupSchedule backup_schedule = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.spanner.admin.database.v1.BackupScheduleOrBuilder getBackupScheduleOrBuilder() { + return backupSchedule_ == null + ? com.google.spanner.admin.database.v1.BackupSchedule.getDefaultInstance() + : backupSchedule_; + } + + public static final int UPDATE_MASK_FIELD_NUMBER = 2; + private com.google.protobuf.FieldMask updateMask_; + /** + * + * + *
+   * Required. A mask specifying which fields in the BackupSchedule resource
+   * should be updated. This mask is relative to the BackupSchedule resource,
+   * not to the request message. The field mask must always be
+   * specified; this prevents any future fields from being erased
+   * accidentally.
+   * 
+ * + * .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 ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+   * Required. A mask specifying which fields in the BackupSchedule resource
+   * should be updated. This mask is relative to the BackupSchedule resource,
+   * not to the request message. The field mask must always be
+   * specified; this prevents any future fields from being erased
+   * accidentally.
+   * 
+ * + * .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. A mask specifying which fields in the BackupSchedule resource
+   * should be updated. This mask is relative to the BackupSchedule resource,
+   * not to the request message. The field mask must always be
+   * specified; this prevents any future fields from being erased
+   * accidentally.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + return updateMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; + } + + 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 (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(1, getBackupSchedule()); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(2, getUpdateMask()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getBackupSchedule()); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getUpdateMask()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.spanner.admin.database.v1.UpdateBackupScheduleRequest)) { + return super.equals(obj); + } + com.google.spanner.admin.database.v1.UpdateBackupScheduleRequest other = + (com.google.spanner.admin.database.v1.UpdateBackupScheduleRequest) obj; + + if (hasBackupSchedule() != other.hasBackupSchedule()) return false; + if (hasBackupSchedule()) { + if (!getBackupSchedule().equals(other.getBackupSchedule())) return false; + } + if (hasUpdateMask() != other.hasUpdateMask()) return false; + if (hasUpdateMask()) { + if (!getUpdateMask().equals(other.getUpdateMask())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasBackupSchedule()) { + hash = (37 * hash) + BACKUP_SCHEDULE_FIELD_NUMBER; + hash = (53 * hash) + getBackupSchedule().hashCode(); + } + if (hasUpdateMask()) { + hash = (37 * hash) + UPDATE_MASK_FIELD_NUMBER; + hash = (53 * hash) + getUpdateMask().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.spanner.admin.database.v1.UpdateBackupScheduleRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.spanner.admin.database.v1.UpdateBackupScheduleRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.spanner.admin.database.v1.UpdateBackupScheduleRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.spanner.admin.database.v1.UpdateBackupScheduleRequest 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.spanner.admin.database.v1.UpdateBackupScheduleRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.spanner.admin.database.v1.UpdateBackupScheduleRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.spanner.admin.database.v1.UpdateBackupScheduleRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.spanner.admin.database.v1.UpdateBackupScheduleRequest 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.spanner.admin.database.v1.UpdateBackupScheduleRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.spanner.admin.database.v1.UpdateBackupScheduleRequest 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.spanner.admin.database.v1.UpdateBackupScheduleRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.spanner.admin.database.v1.UpdateBackupScheduleRequest 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.spanner.admin.database.v1.UpdateBackupScheduleRequest 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; + } + /** + * + * + *
+   * The request for
+   * [UpdateBackupScheduleRequest][google.spanner.admin.database.v1.DatabaseAdmin.UpdateBackupSchedule].
+   * 
+ * + * Protobuf type {@code google.spanner.admin.database.v1.UpdateBackupScheduleRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.spanner.admin.database.v1.UpdateBackupScheduleRequest) + com.google.spanner.admin.database.v1.UpdateBackupScheduleRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.spanner.admin.database.v1.BackupScheduleProto + .internal_static_google_spanner_admin_database_v1_UpdateBackupScheduleRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.spanner.admin.database.v1.BackupScheduleProto + .internal_static_google_spanner_admin_database_v1_UpdateBackupScheduleRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.spanner.admin.database.v1.UpdateBackupScheduleRequest.class, + com.google.spanner.admin.database.v1.UpdateBackupScheduleRequest.Builder.class); + } + + // Construct using com.google.spanner.admin.database.v1.UpdateBackupScheduleRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getBackupScheduleFieldBuilder(); + getUpdateMaskFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + backupSchedule_ = null; + if (backupScheduleBuilder_ != null) { + backupScheduleBuilder_.dispose(); + backupScheduleBuilder_ = null; + } + updateMask_ = null; + if (updateMaskBuilder_ != null) { + updateMaskBuilder_.dispose(); + updateMaskBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.spanner.admin.database.v1.BackupScheduleProto + .internal_static_google_spanner_admin_database_v1_UpdateBackupScheduleRequest_descriptor; + } + + @java.lang.Override + public com.google.spanner.admin.database.v1.UpdateBackupScheduleRequest + getDefaultInstanceForType() { + return com.google.spanner.admin.database.v1.UpdateBackupScheduleRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.spanner.admin.database.v1.UpdateBackupScheduleRequest build() { + com.google.spanner.admin.database.v1.UpdateBackupScheduleRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.spanner.admin.database.v1.UpdateBackupScheduleRequest buildPartial() { + com.google.spanner.admin.database.v1.UpdateBackupScheduleRequest result = + new com.google.spanner.admin.database.v1.UpdateBackupScheduleRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.spanner.admin.database.v1.UpdateBackupScheduleRequest result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.backupSchedule_ = + backupScheduleBuilder_ == null ? backupSchedule_ : backupScheduleBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.updateMask_ = updateMaskBuilder_ == null ? updateMask_ : updateMaskBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + result.bitField0_ |= to_bitField0_; + } + + @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.spanner.admin.database.v1.UpdateBackupScheduleRequest) { + return mergeFrom((com.google.spanner.admin.database.v1.UpdateBackupScheduleRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.spanner.admin.database.v1.UpdateBackupScheduleRequest other) { + if (other + == com.google.spanner.admin.database.v1.UpdateBackupScheduleRequest.getDefaultInstance()) + return this; + if (other.hasBackupSchedule()) { + mergeBackupSchedule(other.getBackupSchedule()); + } + if (other.hasUpdateMask()) { + mergeUpdateMask(other.getUpdateMask()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage(getBackupScheduleFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage(getUpdateMaskFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private com.google.spanner.admin.database.v1.BackupSchedule backupSchedule_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.spanner.admin.database.v1.BackupSchedule, + com.google.spanner.admin.database.v1.BackupSchedule.Builder, + com.google.spanner.admin.database.v1.BackupScheduleOrBuilder> + backupScheduleBuilder_; + /** + * + * + *
+     * Required. The backup schedule to update. `backup_schedule.name`, and the
+     * fields to be updated as specified by `update_mask` are required. Other
+     * fields are ignored.
+     * 
+ * + * + * .google.spanner.admin.database.v1.BackupSchedule backup_schedule = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the backupSchedule field is set. + */ + public boolean hasBackupSchedule() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+     * Required. The backup schedule to update. `backup_schedule.name`, and the
+     * fields to be updated as specified by `update_mask` are required. Other
+     * fields are ignored.
+     * 
+ * + * + * .google.spanner.admin.database.v1.BackupSchedule backup_schedule = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The backupSchedule. + */ + public com.google.spanner.admin.database.v1.BackupSchedule getBackupSchedule() { + if (backupScheduleBuilder_ == null) { + return backupSchedule_ == null + ? com.google.spanner.admin.database.v1.BackupSchedule.getDefaultInstance() + : backupSchedule_; + } else { + return backupScheduleBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. The backup schedule to update. `backup_schedule.name`, and the
+     * fields to be updated as specified by `update_mask` are required. Other
+     * fields are ignored.
+     * 
+ * + * + * .google.spanner.admin.database.v1.BackupSchedule backup_schedule = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setBackupSchedule(com.google.spanner.admin.database.v1.BackupSchedule value) { + if (backupScheduleBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + backupSchedule_ = value; + } else { + backupScheduleBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The backup schedule to update. `backup_schedule.name`, and the
+     * fields to be updated as specified by `update_mask` are required. Other
+     * fields are ignored.
+     * 
+ * + * + * .google.spanner.admin.database.v1.BackupSchedule backup_schedule = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setBackupSchedule( + com.google.spanner.admin.database.v1.BackupSchedule.Builder builderForValue) { + if (backupScheduleBuilder_ == null) { + backupSchedule_ = builderForValue.build(); + } else { + backupScheduleBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The backup schedule to update. `backup_schedule.name`, and the
+     * fields to be updated as specified by `update_mask` are required. Other
+     * fields are ignored.
+     * 
+ * + * + * .google.spanner.admin.database.v1.BackupSchedule backup_schedule = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeBackupSchedule(com.google.spanner.admin.database.v1.BackupSchedule value) { + if (backupScheduleBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && backupSchedule_ != null + && backupSchedule_ + != com.google.spanner.admin.database.v1.BackupSchedule.getDefaultInstance()) { + getBackupScheduleBuilder().mergeFrom(value); + } else { + backupSchedule_ = value; + } + } else { + backupScheduleBuilder_.mergeFrom(value); + } + if (backupSchedule_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + /** + * + * + *
+     * Required. The backup schedule to update. `backup_schedule.name`, and the
+     * fields to be updated as specified by `update_mask` are required. Other
+     * fields are ignored.
+     * 
+ * + * + * .google.spanner.admin.database.v1.BackupSchedule backup_schedule = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearBackupSchedule() { + bitField0_ = (bitField0_ & ~0x00000001); + backupSchedule_ = null; + if (backupScheduleBuilder_ != null) { + backupScheduleBuilder_.dispose(); + backupScheduleBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The backup schedule to update. `backup_schedule.name`, and the
+     * fields to be updated as specified by `update_mask` are required. Other
+     * fields are ignored.
+     * 
+ * + * + * .google.spanner.admin.database.v1.BackupSchedule backup_schedule = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.spanner.admin.database.v1.BackupSchedule.Builder getBackupScheduleBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return getBackupScheduleFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. The backup schedule to update. `backup_schedule.name`, and the
+     * fields to be updated as specified by `update_mask` are required. Other
+     * fields are ignored.
+     * 
+ * + * + * .google.spanner.admin.database.v1.BackupSchedule backup_schedule = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.spanner.admin.database.v1.BackupScheduleOrBuilder + getBackupScheduleOrBuilder() { + if (backupScheduleBuilder_ != null) { + return backupScheduleBuilder_.getMessageOrBuilder(); + } else { + return backupSchedule_ == null + ? com.google.spanner.admin.database.v1.BackupSchedule.getDefaultInstance() + : backupSchedule_; + } + } + /** + * + * + *
+     * Required. The backup schedule to update. `backup_schedule.name`, and the
+     * fields to be updated as specified by `update_mask` are required. Other
+     * fields are ignored.
+     * 
+ * + * + * .google.spanner.admin.database.v1.BackupSchedule backup_schedule = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.spanner.admin.database.v1.BackupSchedule, + com.google.spanner.admin.database.v1.BackupSchedule.Builder, + com.google.spanner.admin.database.v1.BackupScheduleOrBuilder> + getBackupScheduleFieldBuilder() { + if (backupScheduleBuilder_ == null) { + backupScheduleBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.spanner.admin.database.v1.BackupSchedule, + com.google.spanner.admin.database.v1.BackupSchedule.Builder, + com.google.spanner.admin.database.v1.BackupScheduleOrBuilder>( + getBackupSchedule(), getParentForChildren(), isClean()); + backupSchedule_ = null; + } + return backupScheduleBuilder_; + } + + 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. A mask specifying which fields in the BackupSchedule resource
+     * should be updated. This mask is relative to the BackupSchedule resource,
+     * not to the request message. The field mask must always be
+     * specified; this prevents any future fields from being erased
+     * accidentally.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the updateMask field is set. + */ + public boolean hasUpdateMask() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+     * Required. A mask specifying which fields in the BackupSchedule resource
+     * should be updated. This mask is relative to the BackupSchedule resource,
+     * not to the request message. The field mask must always be
+     * specified; this prevents any future fields from being erased
+     * accidentally.
+     * 
+ * + * .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. A mask specifying which fields in the BackupSchedule resource
+     * should be updated. This mask is relative to the BackupSchedule resource,
+     * not to the request message. The field mask must always be
+     * specified; this prevents any future fields from being erased
+     * accidentally.
+     * 
+ * + * .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; + } else { + updateMaskBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. A mask specifying which fields in the BackupSchedule resource
+     * should be updated. This mask is relative to the BackupSchedule resource,
+     * not to the request message. The field mask must always be
+     * specified; this prevents any future fields from being erased
+     * accidentally.
+     * 
+ * + * .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(); + } else { + updateMaskBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. A mask specifying which fields in the BackupSchedule resource
+     * should be updated. This mask is relative to the BackupSchedule resource,
+     * not to the request message. The field mask must always be
+     * specified; this prevents any future fields from being erased
+     * accidentally.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeUpdateMask(com.google.protobuf.FieldMask value) { + if (updateMaskBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && updateMask_ != null + && updateMask_ != com.google.protobuf.FieldMask.getDefaultInstance()) { + getUpdateMaskBuilder().mergeFrom(value); + } else { + updateMask_ = value; + } + } else { + updateMaskBuilder_.mergeFrom(value); + } + if (updateMask_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + /** + * + * + *
+     * Required. A mask specifying which fields in the BackupSchedule resource
+     * should be updated. This mask is relative to the BackupSchedule resource,
+     * not to the request message. The field mask must always be
+     * specified; this prevents any future fields from being erased
+     * accidentally.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearUpdateMask() { + bitField0_ = (bitField0_ & ~0x00000002); + updateMask_ = null; + if (updateMaskBuilder_ != null) { + updateMaskBuilder_.dispose(); + updateMaskBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Required. A mask specifying which fields in the BackupSchedule resource
+     * should be updated. This mask is relative to the BackupSchedule resource,
+     * not to the request message. The field mask must always be
+     * specified; this prevents any future fields from being erased
+     * accidentally.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.protobuf.FieldMask.Builder getUpdateMaskBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getUpdateMaskFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. A mask specifying which fields in the BackupSchedule resource
+     * should be updated. This mask is relative to the BackupSchedule resource,
+     * not to the request message. The field mask must always be
+     * specified; this prevents any future fields from being erased
+     * accidentally.
+     * 
+ * + * .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. A mask specifying which fields in the BackupSchedule resource
+     * should be updated. This mask is relative to the BackupSchedule resource,
+     * not to the request message. The field mask must always be
+     * specified; this prevents any future fields from being erased
+     * accidentally.
+     * 
+ * + * .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.spanner.admin.database.v1.UpdateBackupScheduleRequest) + } + + // @@protoc_insertion_point(class_scope:google.spanner.admin.database.v1.UpdateBackupScheduleRequest) + private static final com.google.spanner.admin.database.v1.UpdateBackupScheduleRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.spanner.admin.database.v1.UpdateBackupScheduleRequest(); + } + + public static com.google.spanner.admin.database.v1.UpdateBackupScheduleRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public UpdateBackupScheduleRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.spanner.admin.database.v1.UpdateBackupScheduleRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/UpdateBackupScheduleRequestOrBuilder.java b/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/UpdateBackupScheduleRequestOrBuilder.java new file mode 100644 index 00000000000..100874a6098 --- /dev/null +++ b/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/UpdateBackupScheduleRequestOrBuilder.java @@ -0,0 +1,123 @@ +/* + * Copyright 2024 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/spanner/admin/database/v1/backup_schedule.proto + +// Protobuf Java Version: 3.25.3 +package com.google.spanner.admin.database.v1; + +public interface UpdateBackupScheduleRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.spanner.admin.database.v1.UpdateBackupScheduleRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The backup schedule to update. `backup_schedule.name`, and the
+   * fields to be updated as specified by `update_mask` are required. Other
+   * fields are ignored.
+   * 
+ * + * + * .google.spanner.admin.database.v1.BackupSchedule backup_schedule = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the backupSchedule field is set. + */ + boolean hasBackupSchedule(); + /** + * + * + *
+   * Required. The backup schedule to update. `backup_schedule.name`, and the
+   * fields to be updated as specified by `update_mask` are required. Other
+   * fields are ignored.
+   * 
+ * + * + * .google.spanner.admin.database.v1.BackupSchedule backup_schedule = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The backupSchedule. + */ + com.google.spanner.admin.database.v1.BackupSchedule getBackupSchedule(); + /** + * + * + *
+   * Required. The backup schedule to update. `backup_schedule.name`, and the
+   * fields to be updated as specified by `update_mask` are required. Other
+   * fields are ignored.
+   * 
+ * + * + * .google.spanner.admin.database.v1.BackupSchedule backup_schedule = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.spanner.admin.database.v1.BackupScheduleOrBuilder getBackupScheduleOrBuilder(); + + /** + * + * + *
+   * Required. A mask specifying which fields in the BackupSchedule resource
+   * should be updated. This mask is relative to the BackupSchedule resource,
+   * not to the request message. The field mask must always be
+   * specified; this prevents any future fields from being erased
+   * accidentally.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the updateMask field is set. + */ + boolean hasUpdateMask(); + /** + * + * + *
+   * Required. A mask specifying which fields in the BackupSchedule resource
+   * should be updated. This mask is relative to the BackupSchedule resource,
+   * not to the request message. The field mask must always be
+   * specified; this prevents any future fields from being erased
+   * accidentally.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The updateMask. + */ + com.google.protobuf.FieldMask getUpdateMask(); + /** + * + * + *
+   * Required. A mask specifying which fields in the BackupSchedule resource
+   * should be updated. This mask is relative to the BackupSchedule resource,
+   * not to the request message. The field mask must always be
+   * specified; this prevents any future fields from being erased
+   * accidentally.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder(); +} diff --git a/proto-google-cloud-spanner-admin-database-v1/src/main/proto/google/spanner/admin/database/v1/backup.proto b/proto-google-cloud-spanner-admin-database-v1/src/main/proto/google/spanner/admin/database/v1/backup.proto index bb8ef4d55e8..f684a4c605e 100644 --- a/proto-google-cloud-spanner-admin-database-v1/src/main/proto/google/spanner/admin/database/v1/backup.proto +++ b/proto-google-cloud-spanner-admin-database-v1/src/main/proto/google/spanner/admin/database/v1/backup.proto @@ -156,6 +156,18 @@ message Backup { // less than `Backup.max_expire_time`. google.protobuf.Timestamp max_expire_time = 12 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. List of backup schedule URIs that are associated with + // creating this backup. This is only applicable for scheduled backups, and + // is empty for on-demand backups. + // + // To optimize for storage, whenever possible, multiple schedules are + // collapsed together to create one backup. In such cases, this field captures + // the list of all backup schedule URIs that are associated with creating + // this backup. If collapsing is not done, then this field captures the + // single backup schedule URI associated with creating this backup. + repeated string backup_schedules = 14 + [(google.api.field_behavior) = OUTPUT_ONLY]; } // The request for @@ -688,3 +700,8 @@ message CopyBackupEncryptionConfig { } ]; } + +// The specification for full backups. +// A full backup stores the entire contents of the database at a given +// version time. +message FullBackupSpec {} diff --git a/proto-google-cloud-spanner-admin-database-v1/src/main/proto/google/spanner/admin/database/v1/backup_schedule.proto b/proto-google-cloud-spanner-admin-database-v1/src/main/proto/google/spanner/admin/database/v1/backup_schedule.proto new file mode 100644 index 00000000000..9ef4587f814 --- /dev/null +++ b/proto-google-cloud-spanner-admin-database-v1/src/main/proto/google/spanner/admin/database/v1/backup_schedule.proto @@ -0,0 +1,227 @@ +// Copyright 2024 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.spanner.admin.database.v1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/protobuf/duration.proto"; +import "google/protobuf/field_mask.proto"; +import "google/protobuf/timestamp.proto"; +import "google/spanner/admin/database/v1/backup.proto"; + +option csharp_namespace = "Google.Cloud.Spanner.Admin.Database.V1"; +option go_package = "cloud.google.com/go/spanner/admin/database/apiv1/databasepb;databasepb"; +option java_multiple_files = true; +option java_outer_classname = "BackupScheduleProto"; +option java_package = "com.google.spanner.admin.database.v1"; +option php_namespace = "Google\\Cloud\\Spanner\\Admin\\Database\\V1"; +option ruby_package = "Google::Cloud::Spanner::Admin::Database::V1"; + +// Defines specifications of the backup schedule. +message BackupScheduleSpec { + // Required. + oneof schedule_spec { + // Cron style schedule specification. + CrontabSpec cron_spec = 1; + } +} + +// BackupSchedule expresses the automated backup creation specification for a +// Spanner database. +// Next ID: 10 +message BackupSchedule { + option (google.api.resource) = { + type: "spanner.googleapis.com/BackupSchedule" + pattern: "projects/{project}/instances/{instance}/databases/{database}/backupSchedules/{schedule}" + plural: "backupSchedules" + singular: "backupSchedule" + }; + + // Identifier. Output only for the + // [CreateBackupSchedule][DatabaseAdmin.CreateBackupSchededule] operation. + // Required for the + // [UpdateBackupSchedule][google.spanner.admin.database.v1.DatabaseAdmin.UpdateBackupSchedule] + // operation. A globally unique identifier for the backup schedule which + // cannot be changed. Values are of the form + // `projects//instances//databases//backupSchedules/[a-z][a-z0-9_\-]*[a-z0-9]` + // The final segment of the name must be between 2 and 60 characters in + // length. + string name = 1 [(google.api.field_behavior) = IDENTIFIER]; + + // Optional. The schedule specification based on which the backup creations + // are triggered. + BackupScheduleSpec spec = 6 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The retention duration of a backup that must be at least 6 hours + // and at most 366 days. The backup is eligible to be automatically deleted + // once the retention period has elapsed. + google.protobuf.Duration retention_duration = 3 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The encryption configuration that will be used to encrypt the + // backup. If this field is not specified, the backup will use the same + // encryption configuration as the database. + CreateBackupEncryptionConfig encryption_config = 4 + [(google.api.field_behavior) = OPTIONAL]; + + // Required. Backup type spec determines the type of backup that is created by + // the backup schedule. Currently, only full backups are supported. + oneof backup_type_spec { + // The schedule creates only full backups. + FullBackupSpec full_backup_spec = 7; + } + + // Output only. The timestamp at which the schedule was last updated. + // If the schedule has never been updated, this field contains the timestamp + // when the schedule was first created. + google.protobuf.Timestamp update_time = 9 + [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// CrontabSpec can be used to specify the version time and frequency at +// which the backup should be created. +message CrontabSpec { + // Required. Textual representation of the crontab. User can customize the + // backup frequency and the backup version time using the cron + // expression. The version time must be in UTC timzeone. + // + // The backup will contain an externally consistent copy of the + // database at the version time. Allowed frequencies are 12 hour, 1 day, + // 1 week and 1 month. Examples of valid cron specifications: + // * `0 2/12 * * * ` : every 12 hours at (2, 14) hours past midnight in UTC. + // * `0 2,14 * * * ` : every 12 hours at (2,14) hours past midnight in UTC. + // * `0 2 * * * ` : once a day at 2 past midnight in UTC. + // * `0 2 * * 0 ` : once a week every Sunday at 2 past midnight in UTC. + // * `0 2 8 * * ` : once a month on 8th day at 2 past midnight in UTC. + string text = 1 [(google.api.field_behavior) = REQUIRED]; + + // Output only. The time zone of the times in `CrontabSpec.text`. Currently + // only UTC is supported. + string time_zone = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Schedule backups will contain an externally consistent copy + // of the database at the version time specified in + // `schedule_spec.cron_spec`. However, Spanner may not initiate the creation + // of the scheduled backups at that version time. Spanner will initiate + // the creation of scheduled backups within the time window bounded by the + // version_time specified in `schedule_spec.cron_spec` and version_time + + // `creation_window`. + google.protobuf.Duration creation_window = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// The request for +// [CreateBackupSchedule][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackupSchedule]. +message CreateBackupScheduleRequest { + // Required. The name of the database that this backup schedule applies to. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "spanner.googleapis.com/Database" + } + ]; + + // Required. The Id to use for the backup schedule. The `backup_schedule_id` + // appended to `parent` forms the full backup schedule name of the form + // `projects//instances//databases//backupSchedules/`. + string backup_schedule_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The backup schedule to create. + BackupSchedule backup_schedule = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// The request for +// [GetBackupSchedule][google.spanner.admin.database.v1.DatabaseAdmin.GetBackupSchedule]. +message GetBackupScheduleRequest { + // Required. The name of the schedule to retrieve. + // Values are of the form + // `projects//instances//databases//backupSchedules/`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "spanner.googleapis.com/BackupSchedule" + } + ]; +} + +// The request for +// [DeleteBackupSchedule][google.spanner.admin.database.v1.DatabaseAdmin.DeleteBackupSchedule]. +message DeleteBackupScheduleRequest { + // Required. The name of the schedule to delete. + // Values are of the form + // `projects//instances//databases//backupSchedules/`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "spanner.googleapis.com/BackupSchedule" + } + ]; +} + +// The request for +// [ListBackupSchedules][google.spanner.admin.database.v1.DatabaseAdmin.ListBackupSchedules]. +message ListBackupSchedulesRequest { + // Required. Database is the parent resource whose backup schedules should be + // listed. Values are of the form + // projects//instances//databases/ + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "spanner.googleapis.com/Database" + } + ]; + + // Optional. Number of backup schedules to be returned in the response. If 0 + // or less, defaults to the server's maximum allowed page size. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If non-empty, `page_token` should contain a + // [next_page_token][google.spanner.admin.database.v1.ListBackupSchedulesResponse.next_page_token] + // from a previous + // [ListBackupSchedulesResponse][google.spanner.admin.database.v1.ListBackupSchedulesResponse] + // to the same `parent`. + string page_token = 4 [(google.api.field_behavior) = OPTIONAL]; +} + +// The response for +// [ListBackupSchedules][google.spanner.admin.database.v1.DatabaseAdmin.ListBackupSchedules]. +message ListBackupSchedulesResponse { + // The list of backup schedules for a database. + repeated BackupSchedule backup_schedules = 1; + + // `next_page_token` can be sent in a subsequent + // [ListBackupSchedules][google.spanner.admin.database.v1.DatabaseAdmin.ListBackupSchedules] + // call to fetch more of the schedules. + string next_page_token = 2; +} + +// The request for +// [UpdateBackupScheduleRequest][google.spanner.admin.database.v1.DatabaseAdmin.UpdateBackupSchedule]. +message UpdateBackupScheduleRequest { + // Required. The backup schedule to update. `backup_schedule.name`, and the + // fields to be updated as specified by `update_mask` are required. Other + // fields are ignored. + BackupSchedule backup_schedule = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. A mask specifying which fields in the BackupSchedule resource + // should be updated. This mask is relative to the BackupSchedule resource, + // not to the request message. The field mask must always be + // specified; this prevents any future fields from being erased + // accidentally. + google.protobuf.FieldMask update_mask = 2 + [(google.api.field_behavior) = REQUIRED]; +} diff --git a/proto-google-cloud-spanner-admin-database-v1/src/main/proto/google/spanner/admin/database/v1/spanner_database_admin.proto b/proto-google-cloud-spanner-admin-database-v1/src/main/proto/google/spanner/admin/database/v1/spanner_database_admin.proto index 0d4e261709c..5df142403e6 100644 --- a/proto-google-cloud-spanner-admin-database-v1/src/main/proto/google/spanner/admin/database/v1/spanner_database_admin.proto +++ b/proto-google-cloud-spanner-admin-database-v1/src/main/proto/google/spanner/admin/database/v1/spanner_database_admin.proto @@ -27,6 +27,7 @@ import "google/protobuf/empty.proto"; import "google/protobuf/field_mask.proto"; import "google/protobuf/timestamp.proto"; import "google/spanner/admin/database/v1/backup.proto"; +import "google/spanner/admin/database/v1/backup_schedule.proto"; import "google/spanner/admin/database/v1/common.proto"; option csharp_namespace = "Google.Cloud.Spanner.Admin.Database.V1"; @@ -199,6 +200,10 @@ service DatabaseAdmin { post: "/v1/{resource=projects/*/instances/*/backups/*}:setIamPolicy" body: "*" } + additional_bindings { + post: "/v1/{resource=projects/*/instances/*/databases/*/backupSchedules/*}:setIamPolicy" + body: "*" + } }; option (google.api.method_signature) = "resource,policy"; } @@ -220,6 +225,10 @@ service DatabaseAdmin { post: "/v1/{resource=projects/*/instances/*/backups/*}:getIamPolicy" body: "*" } + additional_bindings { + post: "/v1/{resource=projects/*/instances/*/databases/*/backupSchedules/*}:getIamPolicy" + body: "*" + } }; option (google.api.method_signature) = "resource"; } @@ -243,6 +252,10 @@ service DatabaseAdmin { post: "/v1/{resource=projects/*/instances/*/backups/*}:testIamPermissions" body: "*" } + additional_bindings { + post: "/v1/{resource=projects/*/instances/*/databases/*/backupSchedules/*}:testIamPermissions" + body: "*" + } additional_bindings { post: "/v1/{resource=projects/*/instances/*/databases/*/databaseRoles/*}:testIamPermissions" body: "*" @@ -411,6 +424,53 @@ service DatabaseAdmin { }; option (google.api.method_signature) = "parent"; } + + // Creates a new backup schedule. + rpc CreateBackupSchedule(CreateBackupScheduleRequest) + returns (BackupSchedule) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/instances/*/databases/*}/backupSchedules" + body: "backup_schedule" + }; + option (google.api.method_signature) = + "parent,backup_schedule,backup_schedule_id"; + } + + // Gets backup schedule for the input schedule name. + rpc GetBackupSchedule(GetBackupScheduleRequest) returns (BackupSchedule) { + option (google.api.http) = { + get: "/v1/{name=projects/*/instances/*/databases/*/backupSchedules/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Updates a backup schedule. + rpc UpdateBackupSchedule(UpdateBackupScheduleRequest) + returns (BackupSchedule) { + option (google.api.http) = { + patch: "/v1/{backup_schedule.name=projects/*/instances/*/databases/*/backupSchedules/*}" + body: "backup_schedule" + }; + option (google.api.method_signature) = "backup_schedule,update_mask"; + } + + // Deletes a backup schedule. + rpc DeleteBackupSchedule(DeleteBackupScheduleRequest) + returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/instances/*/databases/*/backupSchedules/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Lists all the backup schedules for the database. + rpc ListBackupSchedules(ListBackupSchedulesRequest) + returns (ListBackupSchedulesResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/instances/*/databases/*}/backupSchedules" + }; + option (google.api.method_signature) = "parent"; + } } // Information about the database restore. diff --git a/renovate.json b/renovate.json index 33c03a11c6a..26169743fc5 100644 --- a/renovate.json +++ b/renovate.json @@ -20,7 +20,7 @@ "customManagers": [ { "customType": "regex", - "fileMatch": [ + "fileMatch": [ "^.kokoro/presubmit/graalvm-native.*.cfg$" ], "matchStrings": ["value: \"gcr.io/cloud-devrel-public-resources/graalvm.*:(?.*?)\""], @@ -30,7 +30,7 @@ { "customType": "regex", "fileMatch": [ - "^.github/workflows/unmanaged_dependency_check.yaml$" + "^.github/workflows/unmanaged_dependency_check.yaml$" ], "matchStrings": ["uses: googleapis/sdk-platform-java/java-shared-dependencies/unmanaged-dependency-check@google-cloud-shared-dependencies/v(?.+?)\\n"], "depNameTemplate": "com.google.cloud:sdk-platform-java-config",