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

Commit 51b64ba

Browse files
docs: Add documentation for enums (#371)
* 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 da645f9 commit 51b64ba

File tree

3 files changed

+225
-10
lines changed

3 files changed

+225
-10
lines changed

google/cloud/devtools/cloudbuild_v1/services/cloud_build/client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2981,7 +2981,7 @@ def sample_list_worker_pools():
29812981
# Done; return the response.
29822982
return response
29832983

2984-
def __enter__(self):
2984+
def __enter__(self) -> "CloudBuildClient":
29852985
return self
29862986

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

google/cloud/devtools/cloudbuild_v1/types/cloudbuild.py

Lines changed: 223 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -903,7 +903,35 @@ class Build(proto.Message):
903903
"""
904904

905905
class Status(proto.Enum):
906-
r"""Possible status of a build or build step."""
906+
r"""Possible status of a build or build step.
907+
908+
Values:
909+
STATUS_UNKNOWN (0):
910+
Status of the build is unknown.
911+
PENDING (10):
912+
Build has been created and is pending
913+
execution and queuing. It has not been queued.
914+
QUEUED (1):
915+
Build or step is queued; work has not yet
916+
begun.
917+
WORKING (2):
918+
Build or step is being executed.
919+
SUCCESS (3):
920+
Build or step finished successfully.
921+
FAILURE (4):
922+
Build or step failed to complete
923+
successfully.
924+
INTERNAL_ERROR (5):
925+
Build or step failed due to an internal
926+
cause.
927+
TIMEOUT (6):
928+
Build or step took longer than was allowed.
929+
CANCELLED (7):
930+
Build or step was canceled by a user.
931+
EXPIRED (9):
932+
Build was enqueued for longer than the value of
933+
``queue_ttl``.
934+
"""
907935
STATUS_UNKNOWN = 0
908936
PENDING = 10
909937
QUEUED = 1
@@ -927,7 +955,21 @@ class Warning(proto.Message):
927955
"""
928956

929957
class Priority(proto.Enum):
930-
r"""The relative importance of this warning."""
958+
r"""The relative importance of this warning.
959+
960+
Values:
961+
PRIORITY_UNSPECIFIED (0):
962+
Should not be used.
963+
INFO (1):
964+
e.g. deprecation warnings and alternative
965+
feature highlights.
966+
WARNING (2):
967+
e.g. automated detection of possible issues
968+
with the build.
969+
ALERT (3):
970+
e.g. alerts that a feature used in the build
971+
is pending removal
972+
"""
931973
PRIORITY_UNSPECIFIED = 0
932974
INFO = 1
933975
WARNING = 2
@@ -958,6 +1000,22 @@ class FailureInfo(proto.Message):
9581000
class FailureType(proto.Enum):
9591001
r"""The name of a fatal problem encountered during the execution
9601002
of the build.
1003+
1004+
Values:
1005+
FAILURE_TYPE_UNSPECIFIED (0):
1006+
Type unspecified
1007+
PUSH_FAILED (1):
1008+
Unable to push the image to the repository.
1009+
PUSH_IMAGE_NOT_FOUND (2):
1010+
Final image not found.
1011+
PUSH_NOT_AUTHORIZED (3):
1012+
Unauthorized push of the final image.
1013+
LOGGING_FAILURE (4):
1014+
Backend logging failures. Should retry.
1015+
USER_BUILD_STEP (5):
1016+
A build step has failed.
1017+
FETCH_SOURCE_FAILED (6):
1018+
The source fetching has failed.
9611019
"""
9621020
FAILURE_TYPE_UNSPECIFIED = 0
9631021
PUSH_FAILED = 1
@@ -1418,7 +1476,16 @@ class Hash(proto.Message):
14181476
"""
14191477

14201478
class HashType(proto.Enum):
1421-
r"""Specifies the hash algorithm, if any."""
1479+
r"""Specifies the hash algorithm, if any.
1480+
1481+
Values:
1482+
NONE (0):
1483+
No hash requested.
1484+
SHA256 (1):
1485+
Use a sha256 hash.
1486+
MD5 (2):
1487+
Use a md5 hash.
1488+
"""
14221489
NONE = 0
14231490
SHA256 = 1
14241491
MD5 = 2
@@ -1742,7 +1809,21 @@ class BuildApproval(proto.Message):
17421809
"""
17431810

17441811
class State(proto.Enum):
1745-
r"""Specifies the current state of a build's approval."""
1812+
r"""Specifies the current state of a build's approval.
1813+
1814+
Values:
1815+
STATE_UNSPECIFIED (0):
1816+
Default enum type. This should not be used.
1817+
PENDING (1):
1818+
Build approval is pending.
1819+
APPROVED (2):
1820+
Build approval has been approved.
1821+
REJECTED (3):
1822+
Build approval has been rejected.
1823+
CANCELLED (5):
1824+
Build was cancelled while it was still
1825+
pending approval.
1826+
"""
17461827
STATE_UNSPECIFIED = 0
17471828
PENDING = 1
17481829
APPROVED = 2
@@ -1814,6 +1895,14 @@ class ApprovalResult(proto.Message):
18141895
class Decision(proto.Enum):
18151896
r"""Specifies whether or not this manual approval result is to
18161897
approve or reject a build.
1898+
1899+
Values:
1900+
DECISION_UNSPECIFIED (0):
1901+
Default enum type. This should not be used.
1902+
APPROVED (1):
1903+
Build is approved.
1904+
REJECTED (2):
1905+
Build is rejected.
18171906
"""
18181907
DECISION_UNSPECIFIED = 0
18191908
APPROVED = 1
@@ -2137,6 +2226,21 @@ class PubsubConfig(proto.Message):
21372226
class State(proto.Enum):
21382227
r"""Enumerates potential issues with the underlying Pub/Sub
21392228
subscription configuration.
2229+
2230+
Values:
2231+
STATE_UNSPECIFIED (0):
2232+
The subscription configuration has not been
2233+
checked.
2234+
OK (1):
2235+
The Pub/Sub subscription is properly
2236+
configured.
2237+
SUBSCRIPTION_DELETED (2):
2238+
The subscription has been deleted.
2239+
TOPIC_DELETED (3):
2240+
The topic has been deleted.
2241+
SUBSCRIPTION_MISCONFIGURED (4):
2242+
Some of the subscription's field are
2243+
misconfigured.
21402244
"""
21412245
STATE_UNSPECIFIED = 0
21422246
OK = 1
@@ -2186,6 +2290,15 @@ class WebhookConfig(proto.Message):
21862290
class State(proto.Enum):
21872291
r"""Enumerates potential issues with the Secret Manager secret
21882292
provided by the user.
2293+
2294+
Values:
2295+
STATE_UNSPECIFIED (0):
2296+
The webhook auth configuration not been
2297+
checked.
2298+
OK (1):
2299+
The auth configuration is properly setup.
2300+
SECRET_DELETED (2):
2301+
The secret provided in auth_method has been deleted.
21892302
"""
21902303
STATE_UNSPECIFIED = 0
21912304
OK = 1
@@ -2227,7 +2340,22 @@ class PullRequestFilter(proto.Message):
22272340
"""
22282341

22292342
class CommentControl(proto.Enum):
2230-
r"""Controls behavior of Pull Request comments."""
2343+
r"""Controls behavior of Pull Request comments.
2344+
2345+
Values:
2346+
COMMENTS_DISABLED (0):
2347+
Do not require comments on Pull Requests
2348+
before builds are triggered.
2349+
COMMENTS_ENABLED (1):
2350+
Enforce that repository owners or
2351+
collaborators must comment on Pull Requests
2352+
before builds are triggered.
2353+
COMMENTS_ENABLED_FOR_EXTERNAL_CONTRIBUTORS_ONLY (2):
2354+
Enforce that repository owners or
2355+
collaborators must comment on external
2356+
contributors' Pull Requests before builds are
2357+
triggered.
2358+
"""
22312359
COMMENTS_DISABLED = 0
22322360
COMMENTS_ENABLED = 1
22332361
COMMENTS_ENABLED_FOR_EXTERNAL_CONTRIBUTORS_ONLY = 2
@@ -2549,6 +2677,12 @@ class BuildOptions(proto.Message):
25492677
class VerifyOption(proto.Enum):
25502678
r"""Specifies the manner in which the build should be verified,
25512679
if at all.
2680+
2681+
Values:
2682+
NOT_VERIFIED (0):
2683+
Not a verifiable build. (default)
2684+
VERIFIED (1):
2685+
Verified build.
25522686
"""
25532687
NOT_VERIFIED = 0
25542688
VERIFIED = 1
@@ -2557,6 +2691,18 @@ class MachineType(proto.Enum):
25572691
r"""Supported Compute Engine machine types. For more information, see
25582692
`Machine
25592693
types <https://cloud.google.com/compute/docs/machine-types>`__.
2694+
2695+
Values:
2696+
UNSPECIFIED (0):
2697+
Standard machine type.
2698+
N1_HIGHCPU_8 (1):
2699+
Highcpu machine with 8 CPUs.
2700+
N1_HIGHCPU_32 (2):
2701+
Highcpu machine with 32 CPUs.
2702+
E2_HIGHCPU_8 (5):
2703+
Highcpu e2 machine with 8 CPUs.
2704+
E2_HIGHCPU_32 (6):
2705+
Highcpu e2 machine with 32 CPUs.
25602706
"""
25612707
UNSPECIFIED = 0
25622708
N1_HIGHCPU_8 = 1
@@ -2567,20 +2713,63 @@ class MachineType(proto.Enum):
25672713
class SubstitutionOption(proto.Enum):
25682714
r"""Specifies the behavior when there is an error in the
25692715
substitution checks.
2716+
2717+
Values:
2718+
MUST_MATCH (0):
2719+
Fails the build if error in substitutions
2720+
checks, like missing a substitution in the
2721+
template or in the map.
2722+
ALLOW_LOOSE (1):
2723+
Do not fail the build if error in
2724+
substitutions checks.
25702725
"""
25712726
MUST_MATCH = 0
25722727
ALLOW_LOOSE = 1
25732728

25742729
class LogStreamingOption(proto.Enum):
25752730
r"""Specifies the behavior when writing build logs to Google
25762731
Cloud Storage.
2732+
2733+
Values:
2734+
STREAM_DEFAULT (0):
2735+
Service may automatically determine build log
2736+
streaming behavior.
2737+
STREAM_ON (1):
2738+
Build logs should be streamed to Google Cloud
2739+
Storage.
2740+
STREAM_OFF (2):
2741+
Build logs should not be streamed to Google
2742+
Cloud Storage; they will be written when the
2743+
build is completed.
25772744
"""
25782745
STREAM_DEFAULT = 0
25792746
STREAM_ON = 1
25802747
STREAM_OFF = 2
25812748

25822749
class LoggingMode(proto.Enum):
2583-
r"""Specifies the logging mode."""
2750+
r"""Specifies the logging mode.
2751+
2752+
Values:
2753+
LOGGING_UNSPECIFIED (0):
2754+
The service determines the logging mode. The default is
2755+
``LEGACY``. Do not rely on the default logging behavior as
2756+
it may change in the future.
2757+
LEGACY (1):
2758+
Cloud Logging and Cloud Storage logging are
2759+
enabled.
2760+
GCS_ONLY (2):
2761+
Only Cloud Storage logging is enabled.
2762+
STACKDRIVER_ONLY (3):
2763+
This option is the same as CLOUD_LOGGING_ONLY.
2764+
CLOUD_LOGGING_ONLY (5):
2765+
Only Cloud Logging is enabled. Note that logs
2766+
for both the Cloud Console UI and Cloud SDK are
2767+
based on Cloud Storage logs, so neither will
2768+
provide logs if this option is chosen.
2769+
NONE (4):
2770+
Turn off all logging. No build logs will be
2771+
captured.
2772+
"""
25842773
LOGGING_UNSPECIFIED = 0
25852774
LEGACY = 1
25862775
GCS_ONLY = 2
@@ -2783,7 +2972,21 @@ class WorkerPool(proto.Message):
27832972
"""
27842973

27852974
class State(proto.Enum):
2786-
r"""State of the ``WorkerPool``."""
2975+
r"""State of the ``WorkerPool``.
2976+
2977+
Values:
2978+
STATE_UNSPECIFIED (0):
2979+
State of the ``WorkerPool`` is unknown.
2980+
CREATING (1):
2981+
``WorkerPool`` is being created.
2982+
RUNNING (2):
2983+
``WorkerPool`` is running.
2984+
DELETING (3):
2985+
``WorkerPool`` is being deleted: cancelling builds and
2986+
draining workers.
2987+
DELETED (4):
2988+
``WorkerPool`` is deleted.
2989+
"""
27872990
STATE_UNSPECIFIED = 0
27882991
CREATING = 1
27892992
RUNNING = 2
@@ -2897,7 +3100,19 @@ class NetworkConfig(proto.Message):
28973100
"""
28983101

28993102
class EgressOption(proto.Enum):
2900-
r"""Defines the egress option for the pool."""
3103+
r"""Defines the egress option for the pool.
3104+
3105+
Values:
3106+
EGRESS_OPTION_UNSPECIFIED (0):
3107+
If set, defaults to PUBLIC_EGRESS.
3108+
NO_PUBLIC_EGRESS (1):
3109+
If set, workers are created without any
3110+
public address, which prevents network egress to
3111+
public IPs unless a network proxy is configured.
3112+
PUBLIC_EGRESS (2):
3113+
If set, workers are created with a public
3114+
address which allows for public internet egress.
3115+
"""
29013116
EGRESS_OPTION_UNSPECIFIED = 0
29023117
NO_PUBLIC_EGRESS = 1
29033118
PUBLIC_EGRESS = 2

samples/generated_samples/snippet_metadata_google.devtools.cloudbuild.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-build",
11-
"version": "3.11.0"
11+
"version": "0.1.0"
1212
},
1313
"snippets": [
1414
{

0 commit comments

Comments
 (0)