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

Commit

Permalink
feat: added ignore_dependent_resources to DeleteCaPoolRequest, Delete…
Browse files Browse the repository at this point in the history
…CertificateAuthorityRequest, DisableCertificateAuthorityRequest (#345)

* feat: added ignore_dependent_resources to DeleteCaPoolRequest, DeleteCertificateAuthorityRequest, DisableCertificateAuthorityRequest

PiperOrigin-RevId: 522096199

Source-Link: googleapis/googleapis@d9592ed

Source-Link: googleapis/googleapis-gen@0ab428e
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>
  • Loading branch information
gcf-owl-bot[bot] and gcf-owl-bot[bot] committed Apr 5, 2023
1 parent 39986e2 commit 7f71213
Show file tree
Hide file tree
Showing 6 changed files with 56 additions and 8 deletions.
2 changes: 1 addition & 1 deletion google/cloud/security/privateca_v1/types/resources.py
Expand Up @@ -128,7 +128,7 @@ class SubjectRequestMode(proto.Enum):
permission.
REFLECTED_SPIFFE (2):
A mode reserved for special cases. Indicates that the
certificate should have one or more SPIFFE
certificate should have one SPIFFE
[SubjectAltNames][google.cloud.security.privateca.v1.SubjectAltNames]
set by the service based on the caller's identity. This mode
will ignore any explicitly specified
Expand Down
33 changes: 33 additions & 0 deletions google/cloud/security/privateca_v1/types/service.py
Expand Up @@ -526,6 +526,13 @@ class DisableCertificateAuthorityRequest(proto.Message):
The request ID must be a valid UUID with the
exception that zero UUID is not supported
(00000000-0000-0000-0000-000000000000).
ignore_dependent_resources (bool):
Optional. This field allows this CA to be
disabled even if it's being depended on by
another resource. However, doing so may result
in unintended and unrecoverable effects on any
dependent resource(s) since the CA will no
longer be able to issue certificates.
"""

name: str = proto.Field(
Expand All @@ -536,6 +543,10 @@ class DisableCertificateAuthorityRequest(proto.Message):
proto.STRING,
number=2,
)
ignore_dependent_resources: bool = proto.Field(
proto.BOOL,
number=3,
)


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

name: str = proto.Field(
Expand All @@ -823,6 +841,10 @@ class DeleteCertificateAuthorityRequest(proto.Message):
proto.BOOL,
number=5,
)
ignore_dependent_resources: bool = proto.Field(
proto.BOOL,
number=6,
)


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

name: str = proto.Field(
Expand All @@ -1017,6 +1046,10 @@ class DeleteCaPoolRequest(proto.Message):
proto.STRING,
number=2,
)
ignore_dependent_resources: bool = proto.Field(
proto.BOOL,
number=4,
)


class FetchCaCertsRequest(proto.Message):
Expand Down
Expand Up @@ -8,7 +8,7 @@
],
"language": "PYTHON",
"name": "google-cloud-private-ca",
"version": "1.7.1"
"version": "0.1.0"
},
"snippets": [
{
Expand Down
Expand Up @@ -8,7 +8,7 @@
],
"language": "PYTHON",
"name": "google-cloud-private-ca",
"version": "1.7.1"
"version": "0.1.0"
},
"snippets": [
{
Expand Down
6 changes: 3 additions & 3 deletions scripts/fixup_privateca_v1_keywords.py
Expand Up @@ -44,10 +44,10 @@ class privatecaCallTransformer(cst.CSTTransformer):
'create_certificate': ('parent', 'certificate', 'certificate_id', 'request_id', 'validate_only', 'issuing_certificate_authority_id', ),
'create_certificate_authority': ('parent', 'certificate_authority_id', 'certificate_authority', 'request_id', ),
'create_certificate_template': ('parent', 'certificate_template_id', 'certificate_template', 'request_id', ),
'delete_ca_pool': ('name', 'request_id', ),
'delete_certificate_authority': ('name', 'request_id', 'ignore_active_certificates', 'skip_grace_period', ),
'delete_ca_pool': ('name', 'request_id', 'ignore_dependent_resources', ),
'delete_certificate_authority': ('name', 'request_id', 'ignore_active_certificates', 'skip_grace_period', 'ignore_dependent_resources', ),
'delete_certificate_template': ('name', 'request_id', ),
'disable_certificate_authority': ('name', 'request_id', ),
'disable_certificate_authority': ('name', 'request_id', 'ignore_dependent_resources', ),
'enable_certificate_authority': ('name', 'request_id', ),
'fetch_ca_certs': ('ca_pool', 'request_id', ),
'fetch_certificate_authority_csr': ('name', ),
Expand Down
Expand Up @@ -13808,6 +13808,7 @@ def test_delete_certificate_authority_rest_required_fields(
assert not set(unset_fields) - set(
(
"ignore_active_certificates",
"ignore_dependent_resources",
"request_id",
"skip_grace_period",
)
Expand Down Expand Up @@ -13866,6 +13867,7 @@ def test_delete_certificate_authority_rest_unset_required_fields():
set(
(
"ignoreActiveCertificates",
"ignoreDependentResources",
"requestId",
"skipGracePeriod",
)
Expand Down Expand Up @@ -16264,7 +16266,12 @@ def test_delete_ca_pool_rest_required_fields(request_type=service.DeleteCaPoolRe
credentials=ga_credentials.AnonymousCredentials()
).delete_ca_pool._get_unset_required_fields(jsonified_request)
# Check that path parameters and body parameters are not mixing in.
assert not set(unset_fields) - set(("request_id",))
assert not set(unset_fields) - set(
(
"ignore_dependent_resources",
"request_id",
)
)
jsonified_request.update(unset_fields)

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

unset_fields = transport.delete_ca_pool._get_unset_required_fields({})
assert set(unset_fields) == (set(("requestId",)) & set(("name",)))
assert set(unset_fields) == (
set(
(
"ignoreDependentResources",
"requestId",
)
)
& set(("name",))
)


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

0 comments on commit 7f71213

Please sign in to comment.