Skip to content

Commit 4983639

Browse files
feat: Expose tags field in Database and RestoreDatabaseRequest public protos (#1074)
1 parent e6fd577 commit 4983639

File tree

4 files changed

+26
-1
lines changed

4 files changed

+26
-1
lines changed

google/cloud/firestore_admin_v1/types/database.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,13 @@ class Database(proto.Message):
119119
source_info (google.cloud.firestore_admin_v1.types.Database.SourceInfo):
120120
Output only. Information about the provenance
121121
of this database.
122+
tags (MutableMapping[str, str]):
123+
Optional. Input only. Immutable. Tag
124+
keys/values directly bound to this resource. For
125+
example:
126+
127+
"123/environment": "production",
128+
"123/costCenter": "marketing".
122129
free_tier (bool):
123130
Output only. Background: Free tier is the
124131
ability of a Firestore database to use a small
@@ -524,6 +531,11 @@ class CustomerManagedEncryptionOptions(proto.Message):
524531
number=26,
525532
message=SourceInfo,
526533
)
534+
tags: MutableMapping[str, str] = proto.MapField(
535+
proto.STRING,
536+
proto.STRING,
537+
number=29,
538+
)
527539
free_tier: bool = proto.Field(
528540
proto.BOOL,
529541
number=30,

google/cloud/firestore_admin_v1/types/firestore_admin.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1047,6 +1047,12 @@ class RestoreDatabaseRequest(proto.Message):
10471047
If this field is not specified, the restored database will
10481048
use the same encryption configuration as the backup, namely
10491049
[use_source_encryption][google.firestore.admin.v1.Database.EncryptionConfig.use_source_encryption].
1050+
tags (MutableMapping[str, str]):
1051+
Optional. Immutable. Tags to be bound to the restored
1052+
database.
1053+
1054+
The tags should be provided in the format of
1055+
``tagKeys/{tag_key_id} -> tagValues/{tag_value_id}``.
10501056
"""
10511057

10521058
parent: str = proto.Field(
@@ -1066,6 +1072,11 @@ class RestoreDatabaseRequest(proto.Message):
10661072
number=9,
10671073
message=gfa_database.Database.EncryptionConfig,
10681074
)
1075+
tags: MutableMapping[str, str] = proto.MapField(
1076+
proto.STRING,
1077+
proto.STRING,
1078+
number=10,
1079+
)
10691080

10701081

10711082
__all__ = tuple(sorted(__protobuf__.manifest))

scripts/fixup_firestore_admin_v1_keywords.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ class firestore_adminCallTransformer(cst.CSTTransformer):
7272
'list_indexes': ('parent', 'filter', 'page_size', 'page_token', ),
7373
'list_user_creds': ('parent', ),
7474
'reset_user_password': ('name', ),
75-
'restore_database': ('parent', 'database_id', 'backup', 'encryption_config', ),
75+
'restore_database': ('parent', 'database_id', 'backup', 'encryption_config', 'tags', ),
7676
'update_backup_schedule': ('backup_schedule', 'update_mask', ),
7777
'update_database': ('database', 'update_mask', ),
7878
'update_field': ('field', 'update_mask', ),

tests/unit/gapic/firestore_admin_v1/test_firestore_admin.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20792,6 +20792,7 @@ def test_create_database_rest_call_success(request_type):
2079220792
"backup": {"backup": "backup_value"},
2079320793
"operation": "operation_value",
2079420794
},
20795+
"tags": {},
2079520796
"free_tier": True,
2079620797
"etag": "etag_value",
2079720798
"database_edition": 1,
@@ -21303,6 +21304,7 @@ def test_update_database_rest_call_success(request_type):
2130321304
"backup": {"backup": "backup_value"},
2130421305
"operation": "operation_value",
2130521306
},
21307+
"tags": {},
2130621308
"free_tier": True,
2130721309
"etag": "etag_value",
2130821310
"database_edition": 1,

0 commit comments

Comments
 (0)