Skip to content

Commit 63d082b

Browse files
docs: Add documentation for enums (#331)
* docs: Add documentation for enums fix: Add context manager return types chore: Update gapic-generator-python to v1.8.1 PiperOrigin-RevId: 503210727 Source-Link: googleapis/googleapis@a391fd1 Source-Link: googleapis/googleapis-gen@0080f83 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiMDA4MGY4MzBkZWMzN2MzMzg0MTU3MDgyYmNlMjc5ZTM3MDc5ZWE1OCJ9 * 🦉 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 066f977 commit 63d082b

File tree

6 files changed

+342
-4
lines changed

6 files changed

+342
-4
lines changed

packages/google-cloud-private-ca/google/cloud/security/privateca_v1/services/certificate_authority_service/client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4197,7 +4197,7 @@ def sample_update_certificate_template():
41974197
# Done; return the response.
41984198
return response
41994199

4200-
def __enter__(self):
4200+
def __enter__(self) -> "CertificateAuthorityServiceClient":
42014201
return self
42024202

42034203
def __exit__(self, type, value, traceback):

packages/google-cloud-private-ca/google/cloud/security/privateca_v1/types/resources.py

Lines changed: 224 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,44 @@ class RevocationReason(proto.Enum):
5656
and values in this definition are not the same ASN.1 values defined
5757
in RFC 5280. These values will be translated to the correct ASN.1
5858
values when a CRL is created.
59+
60+
Values:
61+
REVOCATION_REASON_UNSPECIFIED (0):
62+
Default unspecified value. This value does indicate that a
63+
[Certificate][google.cloud.security.privateca.v1.Certificate]
64+
has been revoked, but that a reason has not been recorded.
65+
KEY_COMPROMISE (1):
66+
Key material for this
67+
[Certificate][google.cloud.security.privateca.v1.Certificate]
68+
may have leaked.
69+
CERTIFICATE_AUTHORITY_COMPROMISE (2):
70+
The key material for a certificate authority
71+
in the issuing path may have leaked.
72+
AFFILIATION_CHANGED (3):
73+
The subject or other attributes in this
74+
[Certificate][google.cloud.security.privateca.v1.Certificate]
75+
have changed.
76+
SUPERSEDED (4):
77+
This
78+
[Certificate][google.cloud.security.privateca.v1.Certificate]
79+
has been superseded.
80+
CESSATION_OF_OPERATION (5):
81+
This
82+
[Certificate][google.cloud.security.privateca.v1.Certificate]
83+
or entities in the issuing path have ceased to operate.
84+
CERTIFICATE_HOLD (6):
85+
This
86+
[Certificate][google.cloud.security.privateca.v1.Certificate]
87+
should not be considered valid, it is expected that it may
88+
become valid in the future.
89+
PRIVILEGE_WITHDRAWN (7):
90+
This
91+
[Certificate][google.cloud.security.privateca.v1.Certificate]
92+
no longer has permission to assert the listed attributes.
93+
ATTRIBUTE_AUTHORITY_COMPROMISE (8):
94+
The authority which determines appropriate attributes for a
95+
[Certificate][google.cloud.security.privateca.v1.Certificate]
96+
may have been compromised.
5997
"""
6098
REVOCATION_REASON_UNSPECIFIED = 0
6199
KEY_COMPROMISE = 1
@@ -74,6 +112,29 @@ class SubjectRequestMode(proto.Enum):
74112
[Subject][google.cloud.security.privateca.v1.Subject] and/or
75113
[SubjectAltNames][google.cloud.security.privateca.v1.SubjectAltNames]
76114
will be resolved.
115+
116+
Values:
117+
SUBJECT_REQUEST_MODE_UNSPECIFIED (0):
118+
Not specified.
119+
DEFAULT (1):
120+
The default mode used in most cases. Indicates that the
121+
certificate's
122+
[Subject][google.cloud.security.privateca.v1.Subject] and/or
123+
[SubjectAltNames][google.cloud.security.privateca.v1.SubjectAltNames]
124+
are specified in the certificate request. This mode requires
125+
the caller to have the ``privateca.certificates.create``
126+
permission.
127+
REFLECTED_SPIFFE (2):
128+
A mode reserved for special cases. Indicates that the
129+
certificate should have one or more SPIFFE
130+
[SubjectAltNames][google.cloud.security.privateca.v1.SubjectAltNames]
131+
set by the service based on the caller's identity. This mode
132+
will ignore any explicitly specified
133+
[Subject][google.cloud.security.privateca.v1.Subject] and/or
134+
[SubjectAltNames][google.cloud.security.privateca.v1.SubjectAltNames]
135+
in the certificate request. This mode requires the caller to
136+
have the ``privateca.certificates.createForSelf``
137+
permission.
77138
"""
78139
SUBJECT_REQUEST_MODE_UNSPECIFIED = 0
79140
DEFAULT = 1
@@ -187,6 +248,16 @@ class Type(proto.Enum):
187248
r"""The type of a
188249
[CertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthority],
189250
indicating its issuing chain.
251+
252+
Values:
253+
TYPE_UNSPECIFIED (0):
254+
Not specified.
255+
SELF_SIGNED (1):
256+
Self-signed CA.
257+
SUBORDINATE (2):
258+
Subordinate CA. Could be issued by a Private CA
259+
[CertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthority]
260+
or an unmanaged CA.
190261
"""
191262
TYPE_UNSPECIFIED = 0
192263
SELF_SIGNED = 1
@@ -196,6 +267,44 @@ class State(proto.Enum):
196267
r"""The state of a
197268
[CertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthority],
198269
indicating if it can be used.
270+
271+
Values:
272+
STATE_UNSPECIFIED (0):
273+
Not specified.
274+
ENABLED (1):
275+
Certificates can be issued from this CA. CRLs will be
276+
generated for this CA. The CA will be part of the
277+
[CaPool][google.cloud.security.privateca.v1.CaPool]'s trust
278+
anchor, and will be used to issue certificates from the
279+
[CaPool][google.cloud.security.privateca.v1.CaPool].
280+
DISABLED (2):
281+
Certificates cannot be issued from this CA. CRLs will still
282+
be generated. The CA will be part of the
283+
[CaPool][google.cloud.security.privateca.v1.CaPool]'s trust
284+
anchor, but will not be used to issue certificates from the
285+
[CaPool][google.cloud.security.privateca.v1.CaPool].
286+
STAGED (3):
287+
Certificates can be issued from this CA. CRLs will be
288+
generated for this CA. The CA will be part of the
289+
[CaPool][google.cloud.security.privateca.v1.CaPool]'s trust
290+
anchor, but will not be used to issue certificates from the
291+
[CaPool][google.cloud.security.privateca.v1.CaPool].
292+
AWAITING_USER_ACTIVATION (4):
293+
Certificates cannot be issued from this CA. CRLs will not be
294+
generated. The CA will not be part of the
295+
[CaPool][google.cloud.security.privateca.v1.CaPool]'s trust
296+
anchor, and will not be used to issue certificates from the
297+
[CaPool][google.cloud.security.privateca.v1.CaPool].
298+
DELETED (5):
299+
Certificates cannot be issued from this CA. CRLs will not be
300+
generated. The CA may still be recovered by calling
301+
[CertificateAuthorityService.UndeleteCertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthorityService.UndeleteCertificateAuthority]
302+
before
303+
[expire_time][google.cloud.security.privateca.v1.CertificateAuthority.expire_time].
304+
The CA will not be part of the
305+
[CaPool][google.cloud.security.privateca.v1.CaPool]'s trust
306+
anchor, and will not be used to issue certificates from the
307+
[CaPool][google.cloud.security.privateca.v1.CaPool].
199308
"""
200309
STATE_UNSPECIFIED = 0
201310
ENABLED = 1
@@ -214,6 +323,26 @@ class SignHashAlgorithm(proto.Enum):
214323
preferred, use PKCS1 algorithms if required for compatibility. For
215324
further recommendations, see
216325
https://cloud.google.com/kms/docs/algorithms#algorithm_recommendations.
326+
327+
Values:
328+
SIGN_HASH_ALGORITHM_UNSPECIFIED (0):
329+
Not specified.
330+
RSA_PSS_2048_SHA256 (1):
331+
maps to CryptoKeyVersionAlgorithm.RSA_SIGN_PSS_2048_SHA256
332+
RSA_PSS_3072_SHA256 (2):
333+
maps to CryptoKeyVersionAlgorithm. RSA_SIGN_PSS_3072_SHA256
334+
RSA_PSS_4096_SHA256 (3):
335+
maps to CryptoKeyVersionAlgorithm.RSA_SIGN_PSS_4096_SHA256
336+
RSA_PKCS1_2048_SHA256 (6):
337+
maps to CryptoKeyVersionAlgorithm.RSA_SIGN_PKCS1_2048_SHA256
338+
RSA_PKCS1_3072_SHA256 (7):
339+
maps to CryptoKeyVersionAlgorithm.RSA_SIGN_PKCS1_3072_SHA256
340+
RSA_PKCS1_4096_SHA256 (8):
341+
maps to CryptoKeyVersionAlgorithm.RSA_SIGN_PKCS1_4096_SHA256
342+
EC_P256_SHA256 (4):
343+
maps to CryptoKeyVersionAlgorithm.EC_SIGN_P256_SHA256
344+
EC_P384_SHA384 (5):
345+
maps to CryptoKeyVersionAlgorithm.EC_SIGN_P384_SHA384
217346
"""
218347
SIGN_HASH_ALGORITHM_UNSPECIFIED = 0
219348
RSA_PSS_2048_SHA256 = 1
@@ -423,6 +552,14 @@ class CaPool(proto.Message):
423552
class Tier(proto.Enum):
424553
r"""The tier of a [CaPool][google.cloud.security.privateca.v1.CaPool],
425554
indicating its supported functionality and/or billing SKU.
555+
556+
Values:
557+
TIER_UNSPECIFIED (0):
558+
Not specified.
559+
ENTERPRISE (1):
560+
Enterprise tier.
561+
DEVOPS (2):
562+
DevOps tier.
426563
"""
427564
TIER_UNSPECIFIED = 0
428565
ENTERPRISE = 1
@@ -609,6 +746,21 @@ class EcSignatureAlgorithm(proto.Enum):
609746
used in a
610747
[Certificate][google.cloud.security.privateca.v1.Certificate] issued
611748
from a [CaPool][google.cloud.security.privateca.v1.CaPool].
749+
750+
Values:
751+
EC_SIGNATURE_ALGORITHM_UNSPECIFIED (0):
752+
Not specified. Signifies that any signature
753+
algorithm may be used.
754+
ECDSA_P256 (1):
755+
Refers to the Elliptic Curve Digital
756+
Signature Algorithm over the NIST P-256 curve.
757+
ECDSA_P384 (2):
758+
Refers to the Elliptic Curve Digital
759+
Signature Algorithm over the NIST P-384 curve.
760+
EDDSA_25519 (3):
761+
Refers to the Edwards-curve Digital Signature
762+
Algorithm over curve 25519, as described in RFC
763+
8410.
612764
"""
613765
EC_SIGNATURE_ALGORITHM_UNSPECIFIED = 0
614766
ECDSA_P256 = 1
@@ -772,6 +924,18 @@ class State(proto.Enum):
772924
r"""The state of a
773925
[CertificateRevocationList][google.cloud.security.privateca.v1.CertificateRevocationList],
774926
indicating if it is current.
927+
928+
Values:
929+
STATE_UNSPECIFIED (0):
930+
Not specified.
931+
ACTIVE (1):
932+
The
933+
[CertificateRevocationList][google.cloud.security.privateca.v1.CertificateRevocationList]
934+
is up to date.
935+
SUPERSEDED (2):
936+
The
937+
[CertificateRevocationList][google.cloud.security.privateca.v1.CertificateRevocationList]
938+
is no longer current.
775939
"""
776940
STATE_UNSPECIFIED = 0
777941
ACTIVE = 1
@@ -1304,6 +1468,26 @@ class PublicKey(proto.Message):
13041468
class KeyFormat(proto.Enum):
13051469
r"""Types of public keys formats that are supported. Currently, only
13061470
``PEM`` format is supported.
1471+
1472+
Values:
1473+
KEY_FORMAT_UNSPECIFIED (0):
1474+
Default unspecified value.
1475+
PEM (1):
1476+
The key is PEM-encoded as defined in `RFC
1477+
7468 <https://tools.ietf.org/html/rfc7468>`__. It can be any
1478+
of the following: a PEM-encoded PKCS#1/RFC 3447 RSAPublicKey
1479+
structure, an RFC 5280
1480+
`SubjectPublicKeyInfo <https://tools.ietf.org/html/rfc5280#section-4.1>`__
1481+
or a PEM-encoded X.509 certificate signing request (CSR). If
1482+
a
1483+
`SubjectPublicKeyInfo <https://tools.ietf.org/html/rfc5280#section-4.1>`__
1484+
is specified, it can contain a A PEM-encoded PKCS#1/RFC 3447
1485+
RSAPublicKey or a NIST P-256/secp256r1/prime256v1 or P-384
1486+
key. If a CSR is specified, it will used solely for the
1487+
purpose of extracting the public key. When generated by the
1488+
service, it will always be an RFC 5280
1489+
`SubjectPublicKeyInfo <https://tools.ietf.org/html/rfc5280#section-4.1>`__
1490+
structure containing an algorithm identifier and a key.
13071491
"""
13081492
KEY_FORMAT_UNSPECIFIED = 0
13091493
PEM = 1
@@ -1942,6 +2126,46 @@ class KnownCertificateExtension(proto.Enum):
19422126
including the
19432127
[SubjectAltNames][google.cloud.security.privateca.v1.SubjectAltNames]
19442128
extension.
2129+
2130+
Values:
2131+
KNOWN_CERTIFICATE_EXTENSION_UNSPECIFIED (0):
2132+
Not specified.
2133+
BASE_KEY_USAGE (1):
2134+
Refers to a certificate's Key Usage extension, as described
2135+
in `RFC 5280 section
2136+
4.2.1.3 <https://tools.ietf.org/html/rfc5280#section-4.2.1.3>`__.
2137+
This corresponds to the
2138+
[KeyUsage.base_key_usage][google.cloud.security.privateca.v1.KeyUsage.base_key_usage]
2139+
field.
2140+
EXTENDED_KEY_USAGE (2):
2141+
Refers to a certificate's Extended Key Usage extension, as
2142+
described in `RFC 5280 section
2143+
4.2.1.12 <https://tools.ietf.org/html/rfc5280#section-4.2.1.12>`__.
2144+
This corresponds to the
2145+
[KeyUsage.extended_key_usage][google.cloud.security.privateca.v1.KeyUsage.extended_key_usage]
2146+
message.
2147+
CA_OPTIONS (3):
2148+
Refers to a certificate's Basic Constraints extension, as
2149+
described in `RFC 5280 section
2150+
4.2.1.9 <https://tools.ietf.org/html/rfc5280#section-4.2.1.9>`__.
2151+
This corresponds to the
2152+
[X509Parameters.ca_options][google.cloud.security.privateca.v1.X509Parameters.ca_options]
2153+
field.
2154+
POLICY_IDS (4):
2155+
Refers to a certificate's Policy object identifiers, as
2156+
described in `RFC 5280 section
2157+
4.2.1.4 <https://tools.ietf.org/html/rfc5280#section-4.2.1.4>`__.
2158+
This corresponds to the
2159+
[X509Parameters.policy_ids][google.cloud.security.privateca.v1.X509Parameters.policy_ids]
2160+
field.
2161+
AIA_OCSP_SERVERS (5):
2162+
Refers to OCSP servers in a certificate's Authority
2163+
Information Access extension, as described in `RFC 5280
2164+
section
2165+
4.2.2.1 <https://tools.ietf.org/html/rfc5280#section-4.2.2.1>`__,
2166+
This corresponds to the
2167+
[X509Parameters.aia_ocsp_servers][google.cloud.security.privateca.v1.X509Parameters.aia_ocsp_servers]
2168+
field.
19452169
"""
19462170
KNOWN_CERTIFICATE_EXTENSION_UNSPECIFIED = 0
19472171
BASE_KEY_USAGE = 1

packages/google-cloud-private-ca/google/cloud/security/privateca_v1beta1/services/certificate_authority_service/client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3016,7 +3016,7 @@ def sample_list_reusable_configs():
30163016
# Done; return the response.
30173017
return response
30183018

3019-
def __enter__(self):
3019+
def __enter__(self) -> "CertificateAuthorityServiceClient":
30203020
return self
30213021

30223022
def __exit__(self, type, value, traceback):

0 commit comments

Comments
 (0)