| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 14335c3 commit 48dd206
11 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -128,6 +128,8 @@ class FirestoreAdminAsyncClient: | |||
| 128 | 128 | parse_index_path = staticmethod(FirestoreAdminClient.parse_index_path) | |
| 129 | 129 | location_path = staticmethod(FirestoreAdminClient.location_path) | |
| 130 | 130 | parse_location_path = staticmethod(FirestoreAdminClient.parse_location_path) | |
| 131 | + operation_path = staticmethod(FirestoreAdminClient.operation_path) | ||
| 132 | + parse_operation_path = staticmethod(FirestoreAdminClient.parse_operation_path) | ||
| 131 | 133 | common_billing_account_path = staticmethod( | |
| 132 | 134 | FirestoreAdminClient.common_billing_account_path | |
| 133 | 135 | ) | |
@@ -834,7 +836,7 @@ async def sample_get_field(): | |||
| 834 | 836 | database. | |
| 835 | 837 | Fields are grouped by their "Collection | |
| 836 | 838 | Group", which represent all collections | |
| 837 | - in the database with the same id. | ||
| 839 | + in the database with the same ID. | ||
| 838 | 840 | ||
| 839 | 841 | """ | |
| 840 | 842 | # Create or coerce a protobuf request object. | |
@@ -967,7 +969,7 @@ async def sample_update_field(): | |||
| 967 | 969 | ||
| 968 | 970 | Fields are grouped by their "Collection Group", which | |
| 969 | 971 | represent all collections in the database with the | |
| 970 | - same id. | ||
| 972 | + same ID. | ||
| 971 | 973 | ||
| 972 | 974 | """ | |
| 973 | 975 | # Create or coerce a protobuf request object. | |
@@ -1632,7 +1634,7 @@ async def sample_create_database(): | |||
| 1632 | 1634 | last a letter or a number. Must not be UUID-like | |
| 1633 | 1635 | /[0-9a-f]{8}(-[0-9a-f]{4}){3}-[0-9a-f]{12}/. | |
| 1634 | 1636 | ||
| 1635 | - "(default)" database id is also valid. | ||
| 1637 | + "(default)" database ID is also valid. | ||
| 1636 | 1638 | ||
| 1637 | 1639 | This corresponds to the ``database_id`` field | |
| 1638 | 1640 | on the ``request`` instance; if ``request`` is provided, this | |
@@ -2548,7 +2550,7 @@ async def sample_restore_database(): | |||
| 2548 | 2550 | Args: | |
| 2549 | 2551 | request (Optional[Union[google.cloud.firestore_admin_v1.types.RestoreDatabaseRequest, dict]]): | |
| 2550 | 2552 | The request object. The request message for | |
| 2551 | - [FirestoreAdmin.RestoreDatabase][google.firestore.admin.v1.RestoreDatabase]. | ||
| 2553 | + [FirestoreAdmin.RestoreDatabase][google.firestore.admin.v1.FirestoreAdmin.RestoreDatabase]. | ||
| 2552 | 2554 | retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any, | |
| 2553 | 2555 | should be retried. | |
| 2554 | 2556 | timeout (float): The timeout for this request. | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -378,6 +378,28 @@ def parse_location_path(path: str) -> Dict[str, str]: | |||
| 378 | 378 | m = re.match(r"^projects/(?P<project>.+?)/locations/(?P<location>.+?)$", path) | |
| 379 | 379 | return m.groupdict() if m else {} | |
| 380 | 380 | ||
| 381 | + @staticmethod | ||
| 382 | + def operation_path( | ||
| 383 | + project: str, | ||
| 384 | + database: str, | ||
| 385 | + operation: str, | ||
| 386 | + ) -> str: | ||
| 387 | + """Returns a fully-qualified operation string.""" | ||
| 388 | + return "projects/{project}/databases/{database}/operations/{operation}".format( | ||
| 389 | + project=project, | ||
| 390 | + database=database, | ||
| 391 | + operation=operation, | ||
| 392 | + ) | ||
| 393 | + | ||
| 394 | + @staticmethod | ||
| 395 | + def parse_operation_path(path: str) -> Dict[str, str]: | ||
| 396 | + """Parses a operation path into its component segments.""" | ||
| 397 | + m = re.match( | ||
| 398 | + r"^projects/(?P<project>.+?)/databases/(?P<database>.+?)/operations/(?P<operation>.+?)$", | ||
| 399 | + path, | ||
| 400 | + ) | ||
| 401 | + return m.groupdict() if m else {} | ||
| 402 | + | ||
| 381 | 403 | @staticmethod | |
| 382 | 404 | def common_billing_account_path( | |
| 383 | 405 | billing_account: str, | |
@@ -1354,7 +1376,7 @@ def sample_get_field(): | |||
| 1354 | 1376 | database. | |
| 1355 | 1377 | Fields are grouped by their "Collection | |
| 1356 | 1378 | Group", which represent all collections | |
| 1357 | - in the database with the same id. | ||
| 1379 | + in the database with the same ID. | ||
| 1358 | 1380 | ||
| 1359 | 1381 | """ | |
| 1360 | 1382 | # Create or coerce a protobuf request object. | |
@@ -1484,7 +1506,7 @@ def sample_update_field(): | |||
| 1484 | 1506 | ||
| 1485 | 1507 | Fields are grouped by their "Collection Group", which | |
| 1486 | 1508 | represent all collections in the database with the | |
| 1487 | - same id. | ||
| 1509 | + same ID. | ||
| 1488 | 1510 | ||
| 1489 | 1511 | """ | |
| 1490 | 1512 | # Create or coerce a protobuf request object. | |
@@ -2134,7 +2156,7 @@ def sample_create_database(): | |||
| 2134 | 2156 | last a letter or a number. Must not be UUID-like | |
| 2135 | 2157 | /[0-9a-f]{8}(-[0-9a-f]{4}){3}-[0-9a-f]{12}/. | |
| 2136 | 2158 | ||
| 2137 | - "(default)" database id is also valid. | ||
| 2159 | + "(default)" database ID is also valid. | ||
| 2138 | 2160 | ||
| 2139 | 2161 | This corresponds to the ``database_id`` field | |
| 2140 | 2162 | on the ``request`` instance; if ``request`` is provided, this | |
@@ -3026,7 +3048,7 @@ def sample_restore_database(): | |||
| 3026 | 3048 | Args: | |
| 3027 | 3049 | request (Union[google.cloud.firestore_admin_v1.types.RestoreDatabaseRequest, dict]): | |
| 3028 | 3050 | The request object. The request message for | |
| 3029 | - [FirestoreAdmin.RestoreDatabase][google.firestore.admin.v1.RestoreDatabase]. | ||
| 3051 | + [FirestoreAdmin.RestoreDatabase][google.firestore.admin.v1.FirestoreAdmin.RestoreDatabase]. | ||
| 3030 | 3052 | retry (google.api_core.retry.Retry): Designation of what errors, if any, | |
| 3031 | 3053 | should be retried. | |
| 3032 | 3054 | timeout (float): The timeout for this request. | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -2157,7 +2157,7 @@ def __call__( | |||
| 2157 | 2157 | database. | |
| 2158 | 2158 | Fields are grouped by their "Collection | |
| 2159 | 2159 | Group", which represent all collections | |
| 2160 | - in the database with the same id. | ||
| 2160 | + in the database with the same ID. | ||
| 2161 | 2161 | ||
| 2162 | 2162 | """ | |
| 2163 | 2163 | ||
@@ -2861,7 +2861,7 @@ def __call__( | |||
| 2861 | 2861 | Args: | |
| 2862 | 2862 | request (~.firestore_admin.RestoreDatabaseRequest): | |
| 2863 | 2863 | The request object. The request message for | |
| 2864 | - [FirestoreAdmin.RestoreDatabase][google.firestore.admin.v1.RestoreDatabase]. | ||
| 2864 | + [FirestoreAdmin.RestoreDatabase][google.firestore.admin.v1.FirestoreAdmin.RestoreDatabase]. | ||
| 2865 | 2865 | retry (google.api_core.retry.Retry): Designation of what errors, if any, | |
| 2866 | 2866 | should be retried. | |
| 2867 | 2867 | timeout (float): The timeout for this request. | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -50,6 +50,10 @@ class Database(proto.Message): | |||
| 50 | 50 | database was most recently updated. Note this | |
| 51 | 51 | only includes updates to the database resource | |
| 52 | 52 | and not data contained by the database. | |
| 53 | + delete_time (google.protobuf.timestamp_pb2.Timestamp): | ||
| 54 | + Output only. The timestamp at which this | ||
| 55 | + database was deleted. Only set if the database | ||
| 56 | + has been deleted. | ||
| 53 | 57 | location_id (str): | |
| 54 | 58 | The location of the database. Available | |
| 55 | 59 | locations are listed at | |
@@ -93,8 +97,8 @@ class Database(proto.Message): | |||
| 93 | 97 | this database. | |
| 94 | 98 | key_prefix (str): | |
| 95 | 99 | Output only. The key_prefix for this database. This | |
| 96 | - key_prefix is used, in combination with the project id ("~") | ||
| 97 | - to construct the application id that is returned from the | ||
| 100 | + key_prefix is used, in combination with the project ID ("~") | ||
| 101 | + to construct the application ID that is returned from the | ||
| 98 | 102 | Cloud Datastore APIs in Google App Engine first generation | |
| 99 | 103 | runtimes. | |
| 100 | 104 | ||
@@ -103,6 +107,16 @@ class Database(proto.Message): | |||
| 103 | 107 | v~foo). | |
| 104 | 108 | delete_protection_state (google.cloud.firestore_admin_v1.types.Database.DeleteProtectionState): | |
| 105 | 109 | State of delete protection for the database. | |
| 110 | + cmek_config (google.cloud.firestore_admin_v1.types.Database.CmekConfig): | ||
| 111 | + Optional. Presence indicates CMEK is enabled | ||
| 112 | + for this database. | ||
| 113 | + previous_id (str): | ||
| 114 | + Output only. The database resource's prior | ||
| 115 | + database ID. This field is only populated for | ||
| 116 | + deleted databases. | ||
| 117 | + source_info (google.cloud.firestore_admin_v1.types.Database.SourceInfo): | ||
| 118 | + Output only. Information about the provenance | ||
| 119 | + of this database. | ||
| 106 | 120 | etag (str): | |
| 107 | 121 | This checksum is computed by the server based | |
| 108 | 122 | on the value of other fields, and may be sent on | |
@@ -120,8 +134,7 @@ class DatabaseType(proto.Enum): | |||
| 120 | 134 | ||
| 121 | 135 | Values: | |
| 122 | 136 | DATABASE_TYPE_UNSPECIFIED (0): | |
| 123 | - The default value. This value is used if the | ||
| 124 | - database type is omitted. | ||
| 137 | + Not used. | ||
| 125 | 138 | FIRESTORE_NATIVE (1): | |
| 126 | 139 | Firestore Native Mode | |
| 127 | 140 | DATASTORE_MODE (2): | |
@@ -225,6 +238,173 @@ class DeleteProtectionState(proto.Enum): | |||
| 225 | 238 | DELETE_PROTECTION_DISABLED = 1 | |
| 226 | 239 | DELETE_PROTECTION_ENABLED = 2 | |
| 227 | 240 | ||
| 241 | + class CmekConfig(proto.Message): | ||
| 242 | + r"""The CMEK (Customer Managed Encryption Key) configuration for | ||
| 243 | + a Firestore database. If not present, the database is secured by | ||
| 244 | + the default Google encryption key. | ||
| 245 | + | ||
| 246 | + Attributes: | ||
| 247 | + kms_key_name (str): | ||
| 248 | + Required. Only keys in the same location as this database | ||
| 249 | + are allowed to be used for encryption. | ||
| 250 | + | ||
| 251 | + For Firestore's nam5 multi-region, this corresponds to Cloud | ||
| 252 | + KMS multi-region us. For Firestore's eur3 multi-region, this | ||
| 253 | + corresponds to Cloud KMS multi-region europe. See | ||
| 254 | + https://cloud.google.com/kms/docs/locations. | ||
| 255 | + | ||
| 256 | + The expected format is | ||
| 257 | + ``projects/{project_id}/locations/{kms_location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}``. | ||
| 258 | + active_key_version (MutableSequence[str]): | ||
| 259 | + Output only. Currently in-use `KMS key | ||
| 260 | + versions <https://cloud.google.com/kms/docs/resource-hierarchy#key_versions>`__. | ||
| 261 | + During `key | ||
| 262 | + rotation <https://cloud.google.com/kms/docs/key-rotation>`__, | ||
| 263 | + there can be multiple in-use key versions. | ||
| 264 | + | ||
| 265 | + The expected format is | ||
| 266 | + ``projects/{project_id}/locations/{kms_location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}/cryptoKeyVersions/{key_version}``. | ||
| 267 | + """ | ||
| 268 | + | ||
| 269 | + kms_key_name: str = proto.Field( | ||
| 270 | + proto.STRING, | ||
| 271 | + number=1, | ||
| 272 | + ) | ||
| 273 | + active_key_version: MutableSequence[str] = proto.RepeatedField( | ||
| 274 | + proto.STRING, | ||
| 275 | + number=2, | ||
| 276 | + ) | ||
| 277 | + | ||
| 278 | + class SourceInfo(proto.Message): | ||
| 279 | + r"""Information about the provenance of this database. | ||
| 280 | + | ||
| 281 | + .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields | ||
| 282 | + | ||
| 283 | + Attributes: | ||
| 284 | + backup (google.cloud.firestore_admin_v1.types.Database.SourceInfo.BackupSource): | ||
| 285 | + If set, this database was restored from the | ||
| 286 | + specified backup (or a snapshot thereof). | ||
| 287 | + | ||
| 288 | + This field is a member of `oneof`_ ``source``. | ||
| 289 | + operation (str): | ||
| 290 | + The associated long-running operation. This field may not be | ||
| 291 | + set after the operation has completed. Format: | ||
| 292 | + ``projects/{project}/databases/{database}/operations/{operation}``. | ||
| 293 | + """ | ||
| 294 | + | ||
| 295 | + class BackupSource(proto.Message): | ||
| 296 | + r"""Information about a backup that was used to restore a | ||
| 297 | + database. | ||
| 298 | + | ||
| 299 | + Attributes: | ||
| 300 | + backup (str): | ||
| 301 | + The resource name of the backup that was used to restore | ||
| 302 | + this database. Format: | ||
| 303 | + ``projects/{project}/locations/{location}/backups/{backup}``. | ||
| 304 | + """ | ||
| 305 | + | ||
| 306 | + backup: str = proto.Field( | ||
| 307 | + proto.STRING, | ||
| 308 | + number=1, | ||
| 309 | + ) | ||
| 310 | + | ||
| 311 | + backup: "Database.SourceInfo.BackupSource" = proto.Field( | ||
| 312 | + proto.MESSAGE, | ||
| 313 | + number=1, | ||
| 314 | + oneof="source", | ||
| 315 | + message="Database.SourceInfo.BackupSource", | ||
| 316 | + ) | ||
| 317 | + operation: str = proto.Field( | ||
| 318 | + proto.STRING, | ||
| 319 | + number=3, | ||
| 320 | + ) | ||
| 321 | + | ||
| 322 | + class EncryptionConfig(proto.Message): | ||
| 323 | + r"""Encryption configuration for a new database being created from | ||
| 324 | + another source. | ||
| 325 | + | ||
| 326 | + The source could be a [Backup][google.firestore.admin.v1.Backup] . | ||
| 327 | + | ||
| 328 | + This message has `oneof`_ fields (mutually exclusive fields). | ||
| 329 | + For each oneof, at most one member field can be set at the same time. | ||
| 330 | + Setting any member of the oneof automatically clears all other | ||
| 331 | + members. | ||
| 332 | + | ||
| 333 | + .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields | ||
| 334 | + | ||
| 335 | + Attributes: | ||
| 336 | + google_default_encryption (google.cloud.firestore_admin_v1.types.Database.EncryptionConfig.GoogleDefaultEncryptionOptions): | ||
| 337 | + Use Google default encryption. | ||
| 338 | + | ||
| 339 | + This field is a member of `oneof`_ ``encryption_type``. | ||
| 340 | + use_source_encryption (google.cloud.firestore_admin_v1.types.Database.EncryptionConfig.SourceEncryptionOptions): | ||
| 341 | + The database will use the same encryption | ||
| 342 | + configuration as the source. | ||
| 343 | + | ||
| 344 | + This field is a member of `oneof`_ ``encryption_type``. | ||
| 345 | + customer_managed_encryption (google.cloud.firestore_admin_v1.types.Database.EncryptionConfig.CustomerManagedEncryptionOptions): | ||
| 346 | + Use Customer Managed Encryption Keys (CMEK) | ||
| 347 | + for encryption. | ||
| 348 | + | ||
| 349 | + This field is a member of `oneof`_ ``encryption_type``. | ||
| 350 | + """ | ||
| 351 | + | ||
| 352 | + class GoogleDefaultEncryptionOptions(proto.Message): | ||
| 353 | + r"""The configuration options for using Google default | ||
| 354 | + encryption. | ||
| 355 | + | ||
| 356 | + """ | ||
| 357 | + | ||
| 358 | + class SourceEncryptionOptions(proto.Message): | ||
| 359 | + r"""The configuration options for using the same encryption | ||
| 360 | + method as the source. | ||
| 361 | + | ||
| 362 | + """ | ||
| 363 | + | ||
| 364 | + class CustomerManagedEncryptionOptions(proto.Message): | ||
| 365 | + r"""The configuration options for using CMEK (Customer Managed | ||
| 366 | + Encryption Key) encryption. | ||
| 367 | + | ||
| 368 | + Attributes: | ||
| 369 | + kms_key_name (str): | ||
| 370 | + Required. Only keys in the same location as the database are | ||
| 371 | + allowed to be used for encryption. | ||
| 372 | + | ||
| 373 | + For Firestore's nam5 multi-region, this corresponds to Cloud | ||
| 374 | + KMS multi-region us. For Firestore's eur3 multi-region, this | ||
| 375 | + corresponds to Cloud KMS multi-region europe. See | ||
| 376 | + https://cloud.google.com/kms/docs/locations. | ||
| 377 | + | ||
| 378 | + The expected format is | ||
| 379 | + ``projects/{project_id}/locations/{kms_location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}``. | ||
| 380 | + """ | ||
| 381 | + | ||
| 382 | + kms_key_name: str = proto.Field( | ||
| 383 | + proto.STRING, | ||
| 384 | + number=1, | ||
| 385 | + ) | ||
| 386 | + | ||
| 387 | + google_default_encryption: "Database.EncryptionConfig.GoogleDefaultEncryptionOptions" = proto.Field( | ||
| 388 | + proto.MESSAGE, | ||
| 389 | + number=1, | ||
| 390 | + oneof="encryption_type", | ||
| 391 | + message="Database.EncryptionConfig.GoogleDefaultEncryptionOptions", | ||
| 392 | + ) | ||
| 393 | + use_source_encryption: "Database.EncryptionConfig.SourceEncryptionOptions" = ( | ||
| 394 | + proto.Field( | ||
| 395 | + proto.MESSAGE, | ||
| 396 | + number=2, | ||
| 397 | + oneof="encryption_type", | ||
| 398 | + message="Database.EncryptionConfig.SourceEncryptionOptions", | ||
| 399 | + ) | ||
| 400 | + ) | ||
| 401 | + customer_managed_encryption: "Database.EncryptionConfig.CustomerManagedEncryptionOptions" = proto.Field( | ||
| 402 | + proto.MESSAGE, | ||
| 403 | + number=3, | ||
| 404 | + oneof="encryption_type", | ||
| 405 | + message="Database.EncryptionConfig.CustomerManagedEncryptionOptions", | ||
| 406 | + ) | ||
| 407 | + | ||
| 228 | 408 | name: str = proto.Field( | |
| 229 | 409 | proto.STRING, | |
| 230 | 410 | number=1, | |
@@ -243,6 +423,11 @@ class DeleteProtectionState(proto.Enum): | |||
| 243 | 423 | number=6, | |
| 244 | 424 | message=timestamp_pb2.Timestamp, | |
| 245 | 425 | ) | |
| 426 | + delete_time: timestamp_pb2.Timestamp = proto.Field( | ||
| 427 | + proto.MESSAGE, | ||
| 428 | + number=7, | ||
| 429 | + message=timestamp_pb2.Timestamp, | ||
| 430 | + ) | ||
| 246 | 431 | location_id: str = proto.Field( | |
| 247 | 432 | proto.STRING, | |
| 248 | 433 | number=9, | |
@@ -286,6 +471,20 @@ class DeleteProtectionState(proto.Enum): | |||
| 286 | 471 | number=22, | |
| 287 | 472 | enum=DeleteProtectionState, | |
| 288 | 473 | ) | |
| 474 | + cmek_config: CmekConfig = proto.Field( | ||
| 475 | + proto.MESSAGE, | ||
| 476 | + number=23, | ||
| 477 | + message=CmekConfig, | ||
| 478 | + ) | ||
| 479 | + previous_id: str = proto.Field( | ||
| 480 | + proto.STRING, | ||
| 481 | + number=25, | ||
| 482 | + ) | ||
| 483 | + source_info: SourceInfo = proto.Field( | ||
| 484 | + proto.MESSAGE, | ||
| 485 | + number=26, | ||
| 486 | + message=SourceInfo, | ||
| 487 | + ) | ||
| 289 | 488 | etag: str = proto.Field( | |
| 290 | 489 | proto.STRING, | |
| 291 | 490 | number=99, | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -34,7 +34,7 @@ class Field(proto.Message): | |||
| 34 | 34 | r"""Represents a single field in the database. | |
| 35 | 35 | ||
| 36 | 36 | Fields are grouped by their "Collection Group", which represent | |
| 37 | - all collections in the database with the same id. | ||
| 37 | + all collections in the database with the same ID. | ||
| 38 | 38 | ||
| 39 | 39 | Attributes: | |
| 40 | 40 | name (str): | |
| Back | FazBrowse Home | New Git URL |
0 commit comments