Skip to content
This repository was archived by the owner on Jul 6, 2023. It is now read-only.

Commit 7f71213

Browse files
feat: added ignore_dependent_resources to DeleteCaPoolRequest, DeleteCertificateAuthorityRequest, DisableCertificateAuthorityRequest (#345)
* feat: added ignore_dependent_resources to DeleteCaPoolRequest, DeleteCertificateAuthorityRequest, DisableCertificateAuthorityRequest PiperOrigin-RevId: 522096199 Source-Link: googleapis/googleapis@d9592ed Source-Link: https://github.com/googleapis/googleapis-gen/commit/0ab428e3934981db9c8c7bf17b1fea5d74682afb Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiMGFiNDI4ZTM5MzQ5ODFkYjljOGM3YmYxN2IxZmVhNWQ3NDY4MmFmYiJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --------- Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
1 parent 39986e2 commit 7f71213

File tree

6 files changed

+56
-8
lines changed

6 files changed

+56
-8
lines changed

google/cloud/security/privateca_v1/types/resources.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ class SubjectRequestMode(proto.Enum):
128128
permission.
129129
REFLECTED_SPIFFE (2):
130130
A mode reserved for special cases. Indicates that the
131-
certificate should have one or more SPIFFE
131+
certificate should have one SPIFFE
132132
[SubjectAltNames][google.cloud.security.privateca.v1.SubjectAltNames]
133133
set by the service based on the caller's identity. This mode
134134
will ignore any explicitly specified

google/cloud/security/privateca_v1/types/service.py

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -526,6 +526,13 @@ class DisableCertificateAuthorityRequest(proto.Message):
526526
The request ID must be a valid UUID with the
527527
exception that zero UUID is not supported
528528
(00000000-0000-0000-0000-000000000000).
529+
ignore_dependent_resources (bool):
530+
Optional. This field allows this CA to be
531+
disabled even if it's being depended on by
532+
another resource. However, doing so may result
533+
in unintended and unrecoverable effects on any
534+
dependent resource(s) since the CA will no
535+
longer be able to issue certificates.
529536
"""
530537

531538
name: str = proto.Field(
@@ -536,6 +543,10 @@ class DisableCertificateAuthorityRequest(proto.Message):
536543
proto.STRING,
537544
number=2,
538545
)
546+
ignore_dependent_resources: bool = proto.Field(
547+
proto.BOOL,
548+
number=3,
549+
)
539550

540551

541552
class EnableCertificateAuthorityRequest(proto.Message):
@@ -805,6 +816,13 @@ class DeleteCertificateAuthorityRequest(proto.Message):
805816
undeletion would have been allowed. If you
806817
proceed, there will be no way to recover this
807818
CA.
819+
ignore_dependent_resources (bool):
820+
Optional. This field allows this ca to be
821+
deleted even if it's being depended on by
822+
another resource. However, doing so may result
823+
in unintended and unrecoverable effects on any
824+
dependent resource(s) since the CA will no
825+
longer be able to issue certificates.
808826
"""
809827

810828
name: str = proto.Field(
@@ -823,6 +841,10 @@ class DeleteCertificateAuthorityRequest(proto.Message):
823841
proto.BOOL,
824842
number=5,
825843
)
844+
ignore_dependent_resources: bool = proto.Field(
845+
proto.BOOL,
846+
number=6,
847+
)
826848

827849

828850
class UpdateCertificateAuthorityRequest(proto.Message):
@@ -1007,6 +1029,13 @@ class DeleteCaPoolRequest(proto.Message):
10071029
The request ID must be a valid UUID with the
10081030
exception that zero UUID is not supported
10091031
(00000000-0000-0000-0000-000000000000).
1032+
ignore_dependent_resources (bool):
1033+
Optional. This field allows this pool to be
1034+
deleted even if it's being depended on by
1035+
another resource. However, doing so may result
1036+
in unintended and unrecoverable effects on any
1037+
dependent resource(s) since the pool will no
1038+
longer be able to issue certificates.
10101039
"""
10111040

10121041
name: str = proto.Field(
@@ -1017,6 +1046,10 @@ class DeleteCaPoolRequest(proto.Message):
10171046
proto.STRING,
10181047
number=2,
10191048
)
1049+
ignore_dependent_resources: bool = proto.Field(
1050+
proto.BOOL,
1051+
number=4,
1052+
)
10201053

10211054

10221055
class FetchCaCertsRequest(proto.Message):

samples/generated_samples/snippet_metadata_google.cloud.security.privateca.v1.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
],
99
"language": "PYTHON",
1010
"name": "google-cloud-private-ca",
11-
"version": "1.7.1"
11+
"version": "0.1.0"
1212
},
1313
"snippets": [
1414
{

samples/generated_samples/snippet_metadata_google.cloud.security.privateca.v1beta1.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
],
99
"language": "PYTHON",
1010
"name": "google-cloud-private-ca",
11-
"version": "1.7.1"
11+
"version": "0.1.0"
1212
},
1313
"snippets": [
1414
{

scripts/fixup_privateca_v1_keywords.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,10 @@ class privatecaCallTransformer(cst.CSTTransformer):
4444
'create_certificate': ('parent', 'certificate', 'certificate_id', 'request_id', 'validate_only', 'issuing_certificate_authority_id', ),
4545
'create_certificate_authority': ('parent', 'certificate_authority_id', 'certificate_authority', 'request_id', ),
4646
'create_certificate_template': ('parent', 'certificate_template_id', 'certificate_template', 'request_id', ),
47-
'delete_ca_pool': ('name', 'request_id', ),
48-
'delete_certificate_authority': ('name', 'request_id', 'ignore_active_certificates', 'skip_grace_period', ),
47+
'delete_ca_pool': ('name', 'request_id', 'ignore_dependent_resources', ),
48+
'delete_certificate_authority': ('name', 'request_id', 'ignore_active_certificates', 'skip_grace_period', 'ignore_dependent_resources', ),
4949
'delete_certificate_template': ('name', 'request_id', ),
50-
'disable_certificate_authority': ('name', 'request_id', ),
50+
'disable_certificate_authority': ('name', 'request_id', 'ignore_dependent_resources', ),
5151
'enable_certificate_authority': ('name', 'request_id', ),
5252
'fetch_ca_certs': ('ca_pool', 'request_id', ),
5353
'fetch_certificate_authority_csr': ('name', ),

tests/unit/gapic/privateca_v1/test_certificate_authority_service.py

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13808,6 +13808,7 @@ def test_delete_certificate_authority_rest_required_fields(
1380813808
assert not set(unset_fields) - set(
1380913809
(
1381013810
"ignore_active_certificates",
13811+
"ignore_dependent_resources",
1381113812
"request_id",
1381213813
"skip_grace_period",
1381313814
)
@@ -13866,6 +13867,7 @@ def test_delete_certificate_authority_rest_unset_required_fields():
1386613867
set(
1386713868
(
1386813869
"ignoreActiveCertificates",
13870+
"ignoreDependentResources",
1386913871
"requestId",
1387013872
"skipGracePeriod",
1387113873
)
@@ -16264,7 +16266,12 @@ def test_delete_ca_pool_rest_required_fields(request_type=service.DeleteCaPoolRe
1626416266
credentials=ga_credentials.AnonymousCredentials()
1626516267
).delete_ca_pool._get_unset_required_fields(jsonified_request)
1626616268
# Check that path parameters and body parameters are not mixing in.
16267-
assert not set(unset_fields) - set(("request_id",))
16269+
assert not set(unset_fields) - set(
16270+
(
16271+
"ignore_dependent_resources",
16272+
"request_id",
16273+
)
16274+
)
1626816275
jsonified_request.update(unset_fields)
1626916276

1627016277
# verify required fields with non-default values are left alone
@@ -16315,7 +16322,15 @@ def test_delete_ca_pool_rest_unset_required_fields():
1631516322
)
1631616323

1631716324
unset_fields = transport.delete_ca_pool._get_unset_required_fields({})
16318-
assert set(unset_fields) == (set(("requestId",)) & set(("name",)))
16325+
assert set(unset_fields) == (
16326+
set(
16327+
(
16328+
"ignoreDependentResources",
16329+
"requestId",
16330+
)
16331+
)
16332+
& set(("name",))
16333+
)
1631916334

1632016335

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

0 commit comments

Comments
 (0)