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

Commit e50be06

Browse files
docs: Add documentation for enums (#239)
* 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: https://github.com/googleapis/googleapis-gen/commit/0080f830dec37c3384157082bce279e37079ea58 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 dced57a commit e50be06

File tree

7 files changed

+213
-13
lines changed

7 files changed

+213
-13
lines changed

google/cloud/functions_v1/services/cloud_functions_service/client.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1751,7 +1751,7 @@ def sample_test_iam_permissions():
17511751
# Done; return the response.
17521752
return response
17531753

1754-
def __enter__(self):
1754+
def __enter__(self) -> "CloudFunctionsServiceClient":
17551755
return self
17561756

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

google/cloud/functions_v1/types/functions.py

+74-2
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,27 @@
4848

4949

5050
class CloudFunctionStatus(proto.Enum):
51-
r"""Describes the current stage of a deployment."""
51+
r"""Describes the current stage of a deployment.
52+
53+
Values:
54+
CLOUD_FUNCTION_STATUS_UNSPECIFIED (0):
55+
Not specified. Invalid state.
56+
ACTIVE (1):
57+
Function has been successfully deployed and
58+
is serving.
59+
OFFLINE (2):
60+
Function deployment failed and the function
61+
isn’t serving.
62+
DEPLOY_IN_PROGRESS (3):
63+
Function is being created or updated.
64+
DELETE_IN_PROGRESS (4):
65+
Function is being deleted.
66+
UNKNOWN (5):
67+
Function deployment failed and the function
68+
serving state is undefined. The function should
69+
be updated or deleted to move it out of this
70+
state.
71+
"""
5272
CLOUD_FUNCTION_STATUS_UNSPECIFIED = 0
5373
ACTIVE = 1
5474
OFFLINE = 2
@@ -294,6 +314,16 @@ class VpcConnectorEgressSettings(proto.Enum):
294314
295315
This controls what traffic is diverted through the VPC Access
296316
Connector resource. By default PRIVATE_RANGES_ONLY will be used.
317+
318+
Values:
319+
VPC_CONNECTOR_EGRESS_SETTINGS_UNSPECIFIED (0):
320+
Unspecified.
321+
PRIVATE_RANGES_ONLY (1):
322+
Use the VPC Access Connector only for private
323+
IP space from RFC1918.
324+
ALL_TRAFFIC (2):
325+
Force the use of VPC Access Connector for all
326+
egress traffic from the function.
297327
"""
298328
VPC_CONNECTOR_EGRESS_SETTINGS_UNSPECIFIED = 0
299329
PRIVATE_RANGES_ONLY = 1
@@ -305,14 +335,42 @@ class IngressSettings(proto.Enum):
305335
This controls what traffic can reach the function.
306336
307337
If unspecified, ALLOW_ALL will be used.
338+
339+
Values:
340+
INGRESS_SETTINGS_UNSPECIFIED (0):
341+
Unspecified.
342+
ALLOW_ALL (1):
343+
Allow HTTP traffic from public and private
344+
sources.
345+
ALLOW_INTERNAL_ONLY (2):
346+
Allow HTTP traffic from only private VPC
347+
sources.
348+
ALLOW_INTERNAL_AND_GCLB (3):
349+
Allow HTTP traffic from private VPC sources
350+
and through GCLB.
308351
"""
309352
INGRESS_SETTINGS_UNSPECIFIED = 0
310353
ALLOW_ALL = 1
311354
ALLOW_INTERNAL_ONLY = 2
312355
ALLOW_INTERNAL_AND_GCLB = 3
313356

314357
class DockerRegistry(proto.Enum):
315-
r"""Docker Registry to use for storing function Docker images."""
358+
r"""Docker Registry to use for storing function Docker images.
359+
360+
Values:
361+
DOCKER_REGISTRY_UNSPECIFIED (0):
362+
Unspecified.
363+
CONTAINER_REGISTRY (1):
364+
Docker images will be stored in multi-regional Container
365+
Registry repositories named ``gcf``.
366+
ARTIFACT_REGISTRY (2):
367+
Docker images will be stored in regional Artifact Registry
368+
repositories. By default, GCF will create and use
369+
repositories named ``gcf-artifacts`` in every region in
370+
which a function is deployed. But the repository to use can
371+
also be specified by the user using the
372+
``docker_repository`` field.
373+
"""
316374
DOCKER_REGISTRY_UNSPECIFIED = 0
317375
CONTAINER_REGISTRY = 1
318376
ARTIFACT_REGISTRY = 2
@@ -525,6 +583,20 @@ class SecurityLevel(proto.Enum):
525583
This controls the methods to enforce security (HTTPS) on a URL.
526584
527585
If unspecified, SECURE_OPTIONAL will be used.
586+
587+
Values:
588+
SECURITY_LEVEL_UNSPECIFIED (0):
589+
Unspecified.
590+
SECURE_ALWAYS (1):
591+
Requests for a URL that match this handler
592+
that do not use HTTPS are automatically
593+
redirected to the HTTPS URL with the same path.
594+
Query parameters are reserved for the redirect.
595+
SECURE_OPTIONAL (2):
596+
Both HTTP and HTTPS requests with URLs that
597+
match the handler succeed without redirects. The
598+
application can examine the request to determine
599+
which protocol was used and respond accordingly.
528600
"""
529601
SECURITY_LEVEL_UNSPECIFIED = 0
530602
SECURE_ALWAYS = 1

google/cloud/functions_v1/types/operations.py

+12-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,18 @@
2929

3030

3131
class OperationType(proto.Enum):
32-
r"""A type of an operation."""
32+
r"""A type of an operation.
33+
34+
Values:
35+
OPERATION_UNSPECIFIED (0):
36+
Unknown operation type.
37+
CREATE_FUNCTION (1):
38+
Triggered by CreateFunction call
39+
UPDATE_FUNCTION (2):
40+
Triggered by UpdateFunction call
41+
DELETE_FUNCTION (3):
42+
Triggered by DeleteFunction call.
43+
"""
3344
OPERATION_UNSPECIFIED = 0
3445
CREATE_FUNCTION = 1
3546
UPDATE_FUNCTION = 2

google/cloud/functions_v2/services/function_service/client.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1546,7 +1546,7 @@ def sample_list_runtimes():
15461546
# Done; return the response.
15471547
return response
15481548

1549-
def __enter__(self):
1549+
def __enter__(self) -> "FunctionServiceClient":
15501550
return self
15511551

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

google/cloud/functions_v2/types/functions.py

+123-6
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,16 @@
5555

5656

5757
class Environment(proto.Enum):
58-
r"""The environment the function is hosted on."""
58+
r"""The environment the function is hosted on.
59+
60+
Values:
61+
ENVIRONMENT_UNSPECIFIED (0):
62+
Unspecified
63+
GEN_1 (1):
64+
Gen 1
65+
GEN_2 (2):
66+
Gen 2
67+
"""
5968
ENVIRONMENT_UNSPECIFIED = 0
6069
GEN_1 = 1
6170
GEN_2 = 2
@@ -100,7 +109,27 @@ class Function(proto.Message):
100109
"""
101110

102111
class State(proto.Enum):
103-
r"""Describes the current state of the function."""
112+
r"""Describes the current state of the function.
113+
114+
Values:
115+
STATE_UNSPECIFIED (0):
116+
Not specified. Invalid state.
117+
ACTIVE (1):
118+
Function has been successfully deployed and
119+
is serving.
120+
FAILED (2):
121+
Function deployment failed and the function
122+
is not serving.
123+
DEPLOYING (3):
124+
Function is being created or updated.
125+
DELETING (4):
126+
Function is being deleted.
127+
UNKNOWN (5):
128+
Function deployment failed and the function
129+
serving state is undefined. The function should
130+
be updated or deleted to move it out of this
131+
state.
132+
"""
104133
STATE_UNSPECIFIED = 0
105134
ACTIVE = 1
106135
FAILED = 2
@@ -172,7 +201,18 @@ class StateMessage(proto.Message):
172201
"""
173202

174203
class Severity(proto.Enum):
175-
r"""Severity of the state message."""
204+
r"""Severity of the state message.
205+
206+
Values:
207+
SEVERITY_UNSPECIFIED (0):
208+
Not specified. Invalid severity.
209+
ERROR (1):
210+
ERROR-level severity.
211+
WARNING (2):
212+
WARNING-level severity.
213+
INFO (3):
214+
INFO-level severity.
215+
"""
176216
SEVERITY_UNSPECIFIED = 0
177217
ERROR = 1
178218
WARNING = 2
@@ -555,6 +595,16 @@ class VpcConnectorEgressSettings(proto.Enum):
555595
556596
This controls what traffic is diverted through the VPC Access
557597
Connector resource. By default PRIVATE_RANGES_ONLY will be used.
598+
599+
Values:
600+
VPC_CONNECTOR_EGRESS_SETTINGS_UNSPECIFIED (0):
601+
Unspecified.
602+
PRIVATE_RANGES_ONLY (1):
603+
Use the VPC Access Connector only for private
604+
IP space from RFC1918.
605+
ALL_TRAFFIC (2):
606+
Force the use of VPC Access Connector for all
607+
egress traffic from the function.
558608
"""
559609
VPC_CONNECTOR_EGRESS_SETTINGS_UNSPECIFIED = 0
560610
PRIVATE_RANGES_ONLY = 1
@@ -566,6 +616,19 @@ class IngressSettings(proto.Enum):
566616
This controls what traffic can reach the function.
567617
568618
If unspecified, ALLOW_ALL will be used.
619+
620+
Values:
621+
INGRESS_SETTINGS_UNSPECIFIED (0):
622+
Unspecified.
623+
ALLOW_ALL (1):
624+
Allow HTTP traffic from public and private
625+
sources.
626+
ALLOW_INTERNAL_ONLY (2):
627+
Allow HTTP traffic from only private VPC
628+
sources.
629+
ALLOW_INTERNAL_AND_GCLB (3):
630+
Allow HTTP traffic from private VPC sources
631+
and through GCLB.
569632
"""
570633
INGRESS_SETTINGS_UNSPECIFIED = 0
571634
ALLOW_ALL = 1
@@ -806,6 +869,15 @@ class EventTrigger(proto.Message):
806869
class RetryPolicy(proto.Enum):
807870
r"""Describes the retry policy in case of function's execution
808871
failure. Retried execution is charged as any other execution.
872+
873+
Values:
874+
RETRY_POLICY_UNSPECIFIED (0):
875+
Not specified.
876+
RETRY_POLICY_DO_NOT_RETRY (1):
877+
Do not retry.
878+
RETRY_POLICY_RETRY (2):
879+
Retry on any failure, retry up to 7 days with
880+
an exponential backoff (capped at 10 seconds).
809881
"""
810882
RETRY_POLICY_UNSPECIFIED = 0
811883
RETRY_POLICY_DO_NOT_RETRY = 1
@@ -1168,7 +1240,24 @@ class ListRuntimesResponse(proto.Message):
11681240
"""
11691241

11701242
class RuntimeStage(proto.Enum):
1171-
r"""The various stages that a runtime can be in."""
1243+
r"""The various stages that a runtime can be in.
1244+
1245+
Values:
1246+
RUNTIME_STAGE_UNSPECIFIED (0):
1247+
Not specified.
1248+
DEVELOPMENT (1):
1249+
The runtime is in development.
1250+
ALPHA (2):
1251+
The runtime is in the Alpha stage.
1252+
BETA (3):
1253+
The runtime is in the Beta stage.
1254+
GA (4):
1255+
The runtime is generally available.
1256+
DEPRECATED (5):
1257+
The runtime is deprecated.
1258+
DECOMMISSIONED (6):
1259+
The runtime is no longer supported.
1260+
"""
11721261
RUNTIME_STAGE_UNSPECIFIED = 0
11731262
DEVELOPMENT = 1
11741263
ALPHA = 2
@@ -1321,7 +1410,24 @@ class Stage(proto.Message):
13211410
"""
13221411

13231412
class Name(proto.Enum):
1324-
r"""Possible names for a Stage"""
1413+
r"""Possible names for a Stage
1414+
1415+
Values:
1416+
NAME_UNSPECIFIED (0):
1417+
Not specified. Invalid name.
1418+
ARTIFACT_REGISTRY (1):
1419+
Artifact Regsitry Stage
1420+
BUILD (2):
1421+
Build Stage
1422+
SERVICE (3):
1423+
Service Stage
1424+
TRIGGER (4):
1425+
Trigger Stage
1426+
SERVICE_ROLLBACK (5):
1427+
Service Rollback Stage
1428+
TRIGGER_ROLLBACK (6):
1429+
Trigger Rollback Stage
1430+
"""
13251431
NAME_UNSPECIFIED = 0
13261432
ARTIFACT_REGISTRY = 1
13271433
BUILD = 2
@@ -1331,7 +1437,18 @@ class Name(proto.Enum):
13311437
TRIGGER_ROLLBACK = 6
13321438

13331439
class State(proto.Enum):
1334-
r"""Possible states for a Stage"""
1440+
r"""Possible states for a Stage
1441+
1442+
Values:
1443+
STATE_UNSPECIFIED (0):
1444+
Not specified. Invalid state.
1445+
NOT_STARTED (1):
1446+
Stage has not started.
1447+
IN_PROGRESS (2):
1448+
Stage is in progress.
1449+
COMPLETE (3):
1450+
Stage has completed.
1451+
"""
13351452
STATE_UNSPECIFIED = 0
13361453
NOT_STARTED = 1
13371454
IN_PROGRESS = 2

samples/generated_samples/snippet_metadata_google.cloud.functions.v1.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
],
99
"language": "PYTHON",
1010
"name": "google-cloud-functions",
11-
"version": "1.10.0"
11+
"version": "0.1.0"
1212
},
1313
"snippets": [
1414
{

samples/generated_samples/snippet_metadata_google.cloud.functions.v2.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
],
99
"language": "PYTHON",
1010
"name": "google-cloud-functions",
11-
"version": "1.10.0"
11+
"version": "0.1.0"
1212
},
1313
"snippets": [
1414
{

0 commit comments

Comments
 (0)