Skip to content

Commit 5d7b972

Browse files
feat: [google-cloud-kms] Adding eTag field to AutokeyConfig (#13911)
BEGIN_COMMIT_OVERRIDE feat: Adding eTag field to AutokeyConfig docs: Updating docs for total_size field in KMS List APIs END_COMMIT_OVERRIDE - [ ] Regenerate this pull request now. docs: Updating docs for total_size field in KMS List APIs PiperOrigin-RevId: 758946748 Source-Link: googleapis/googleapis@29b2bad Source-Link: googleapis/googleapis-gen@9ebef64 Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWttcy8uT3dsQm90LnlhbWwiLCJoIjoiOWViZWY2NDBjOTFiOTJjODNkNGZhZmZjZTRhMTJhOTljM2ExNmQ2OSJ9 --------- Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
1 parent f20efc4 commit 5d7b972

5 files changed

Lines changed: 49 additions & 1 deletion

File tree

packages/google-cloud-kms/google/cloud/kms_v1/types/autokey_admin.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,13 @@ class AutokeyConfig(proto.Message):
9999
project field will clear the configuration.
100100
state (google.cloud.kms_v1.types.AutokeyConfig.State):
101101
Output only. The state for the AutokeyConfig.
102+
etag (str):
103+
Optional. A checksum computed by the server
104+
based on the value of other fields. This may be
105+
sent on update requests to ensure that the
106+
client has an up-to-date value before
107+
proceeding. The request will be rejected with an
108+
ABORTED error on a mismatched etag.
102109
"""
103110

104111
class State(proto.Enum):
@@ -137,6 +144,10 @@ class State(proto.Enum):
137144
number=4,
138145
enum=State,
139146
)
147+
etag: str = proto.Field(
148+
proto.STRING,
149+
number=6,
150+
)
140151

141152

142153
class ShowEffectiveAutokeyConfigRequest(proto.Message):

packages/google-cloud-kms/google/cloud/kms_v1/types/ekm_service.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,10 @@ class ListEkmConnectionsResponse(proto.Message):
111111
The total number of
112112
[EkmConnections][google.cloud.kms.v1.EkmConnection] that
113113
matched the query.
114+
115+
This field is not populated if
116+
[ListEkmConnectionsRequest.filter][google.cloud.kms.v1.ListEkmConnectionsRequest.filter]
117+
is applied.
114118
"""
115119

116120
@property

packages/google-cloud-kms/google/cloud/kms_v1/types/resources.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -694,6 +694,8 @@ class CryptoKeyVersionAlgorithm(proto.Enum):
694694
The suffix following ``HMAC_`` corresponds to the hash algorithm
695695
being used (eg. SHA256).
696696
697+
Algorithms beginning with ``PQ_`` are post-quantum.
698+
697699
For more information, see [Key purposes and algorithms]
698700
(https://cloud.google.com/kms/docs/algorithms).
699701
@@ -857,7 +859,7 @@ class CryptoKeyVersionState(proto.Enum):
857859
[ENABLED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.ENABLED]
858860
state.
859861
DESTROYED (3):
860-
This version is destroyed, and the key material is no longer
862+
This key material of this version is destroyed and no longer
861863
stored. This version may only become
862864
[ENABLED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.ENABLED]
863865
again if this version is

packages/google-cloud-kms/google/cloud/kms_v1/types/service.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -321,6 +321,10 @@ class ListKeyRingsResponse(proto.Message):
321321
total_size (int):
322322
The total number of [KeyRings][google.cloud.kms.v1.KeyRing]
323323
that matched the query.
324+
325+
This field is not populated if
326+
[ListKeyRingsRequest.filter][google.cloud.kms.v1.ListKeyRingsRequest.filter]
327+
is applied.
324328
"""
325329

326330
@property
@@ -357,6 +361,10 @@ class ListCryptoKeysResponse(proto.Message):
357361
The total number of
358362
[CryptoKeys][google.cloud.kms.v1.CryptoKey] that matched the
359363
query.
364+
365+
This field is not populated if
366+
[ListCryptoKeysRequest.filter][google.cloud.kms.v1.ListCryptoKeysRequest.filter]
367+
is applied.
360368
"""
361369

362370
@property
@@ -394,6 +402,10 @@ class ListCryptoKeyVersionsResponse(proto.Message):
394402
The total number of
395403
[CryptoKeyVersions][google.cloud.kms.v1.CryptoKeyVersion]
396404
that matched the query.
405+
406+
This field is not populated if
407+
[ListCryptoKeyVersionsRequest.filter][google.cloud.kms.v1.ListCryptoKeyVersionsRequest.filter]
408+
is applied.
397409
"""
398410

399411
@property
@@ -432,6 +444,10 @@ class ListImportJobsResponse(proto.Message):
432444
The total number of
433445
[ImportJobs][google.cloud.kms.v1.ImportJob] that matched the
434446
query.
447+
448+
This field is not populated if
449+
[ListImportJobsRequest.filter][google.cloud.kms.v1.ListImportJobsRequest.filter]
450+
is applied.
435451
"""
436452

437453
@property

packages/google-cloud-kms/tests/unit/gapic/kms_v1/test_autokey_admin.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1121,6 +1121,7 @@ def test_update_autokey_config(request_type, transport: str = "grpc"):
11211121
name="name_value",
11221122
key_project="key_project_value",
11231123
state=autokey_admin.AutokeyConfig.State.ACTIVE,
1124+
etag="etag_value",
11241125
)
11251126
response = client.update_autokey_config(request)
11261127

@@ -1135,6 +1136,7 @@ def test_update_autokey_config(request_type, transport: str = "grpc"):
11351136
assert response.name == "name_value"
11361137
assert response.key_project == "key_project_value"
11371138
assert response.state == autokey_admin.AutokeyConfig.State.ACTIVE
1139+
assert response.etag == "etag_value"
11381140

11391141

11401142
def test_update_autokey_config_non_empty_request_with_auto_populated_field():
@@ -1269,6 +1271,7 @@ async def test_update_autokey_config_async(
12691271
name="name_value",
12701272
key_project="key_project_value",
12711273
state=autokey_admin.AutokeyConfig.State.ACTIVE,
1274+
etag="etag_value",
12721275
)
12731276
)
12741277
response = await client.update_autokey_config(request)
@@ -1284,6 +1287,7 @@ async def test_update_autokey_config_async(
12841287
assert response.name == "name_value"
12851288
assert response.key_project == "key_project_value"
12861289
assert response.state == autokey_admin.AutokeyConfig.State.ACTIVE
1290+
assert response.etag == "etag_value"
12871291

12881292

12891293
@pytest.mark.asyncio
@@ -1478,6 +1482,7 @@ def test_get_autokey_config(request_type, transport: str = "grpc"):
14781482
name="name_value",
14791483
key_project="key_project_value",
14801484
state=autokey_admin.AutokeyConfig.State.ACTIVE,
1485+
etag="etag_value",
14811486
)
14821487
response = client.get_autokey_config(request)
14831488

@@ -1492,6 +1497,7 @@ def test_get_autokey_config(request_type, transport: str = "grpc"):
14921497
assert response.name == "name_value"
14931498
assert response.key_project == "key_project_value"
14941499
assert response.state == autokey_admin.AutokeyConfig.State.ACTIVE
1500+
assert response.etag == "etag_value"
14951501

14961502

14971503
def test_get_autokey_config_non_empty_request_with_auto_populated_field():
@@ -1628,6 +1634,7 @@ async def test_get_autokey_config_async(
16281634
name="name_value",
16291635
key_project="key_project_value",
16301636
state=autokey_admin.AutokeyConfig.State.ACTIVE,
1637+
etag="etag_value",
16311638
)
16321639
)
16331640
response = await client.get_autokey_config(request)
@@ -1643,6 +1650,7 @@ async def test_get_autokey_config_async(
16431650
assert response.name == "name_value"
16441651
assert response.key_project == "key_project_value"
16451652
assert response.state == autokey_admin.AutokeyConfig.State.ACTIVE
1653+
assert response.etag == "etag_value"
16461654

16471655

16481656
@pytest.mark.asyncio
@@ -2910,6 +2918,7 @@ async def test_update_autokey_config_empty_call_grpc_asyncio():
29102918
name="name_value",
29112919
key_project="key_project_value",
29122920
state=autokey_admin.AutokeyConfig.State.ACTIVE,
2921+
etag="etag_value",
29132922
)
29142923
)
29152924
await client.update_autokey_config(request=None)
@@ -2941,6 +2950,7 @@ async def test_get_autokey_config_empty_call_grpc_asyncio():
29412950
name="name_value",
29422951
key_project="key_project_value",
29432952
state=autokey_admin.AutokeyConfig.State.ACTIVE,
2953+
etag="etag_value",
29442954
)
29452955
)
29462956
await client.get_autokey_config(request=None)
@@ -3032,6 +3042,7 @@ def test_update_autokey_config_rest_call_success(request_type):
30323042
"name": "folders/sample1/autokeyConfig",
30333043
"key_project": "key_project_value",
30343044
"state": 1,
3045+
"etag": "etag_value",
30353046
}
30363047
# The version of a generated dependency at test runtime may differ from the version used during generation.
30373048
# Delete any fields which are not present in the current runtime dependency
@@ -3109,6 +3120,7 @@ def get_message_fields(field):
31093120
name="name_value",
31103121
key_project="key_project_value",
31113122
state=autokey_admin.AutokeyConfig.State.ACTIVE,
3123+
etag="etag_value",
31123124
)
31133125

31143126
# Wrap the value into a proper Response obj
@@ -3128,6 +3140,7 @@ def get_message_fields(field):
31283140
assert response.name == "name_value"
31293141
assert response.key_project == "key_project_value"
31303142
assert response.state == autokey_admin.AutokeyConfig.State.ACTIVE
3143+
assert response.etag == "etag_value"
31313144

31323145

31333146
@pytest.mark.parametrize("null_interceptor", [True, False])
@@ -3243,6 +3256,7 @@ def test_get_autokey_config_rest_call_success(request_type):
32433256
name="name_value",
32443257
key_project="key_project_value",
32453258
state=autokey_admin.AutokeyConfig.State.ACTIVE,
3259+
etag="etag_value",
32463260
)
32473261

32483262
# Wrap the value into a proper Response obj
@@ -3262,6 +3276,7 @@ def test_get_autokey_config_rest_call_success(request_type):
32623276
assert response.name == "name_value"
32633277
assert response.key_project == "key_project_value"
32643278
assert response.state == autokey_admin.AutokeyConfig.State.ACTIVE
3279+
assert response.etag == "etag_value"
32653280

32663281

32673282
@pytest.mark.parametrize("null_interceptor", [True, False])

0 commit comments

Comments
 (0)