-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Expand file tree
/
Copy pathenums.py
More file actions
185 lines (148 loc) · 5.53 KB
/
enums.py
File metadata and controls
185 lines (148 loc) · 5.53 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
# -*- coding: utf-8 -*-
#
# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""Wrappers for protocol buffer enum types."""
import enum
class Build(object):
class Status(enum.IntEnum):
"""
Possible status of a build or build step.
Attributes:
STATUS_UNKNOWN (int): Status of the build is unknown.
QUEUED (int): Build or step is queued; work has not yet begun.
WORKING (int): Build or step is being executed.
SUCCESS (int): Build or step finished successfully.
FAILURE (int): Build or step failed to complete successfully.
INTERNAL_ERROR (int): Build or step failed due to an internal cause.
TIMEOUT (int): Build or step took longer than was allowed.
CANCELLED (int): Build or step was canceled by a user.
"""
STATUS_UNKNOWN = 0
QUEUED = 1
WORKING = 2
SUCCESS = 3
FAILURE = 4
INTERNAL_ERROR = 5
TIMEOUT = 6
CANCELLED = 7
class BuildOptions(object):
class LogStreamingOption(enum.IntEnum):
"""
Specifies the behavior when writing build logs to Google Cloud Storage.
Attributes:
STREAM_DEFAULT (int): Service may automatically determine build log streaming behavior.
STREAM_ON (int): Build logs should be streamed to Google Cloud Storage.
STREAM_OFF (int): Build logs should not be streamed to Google Cloud Storage; they will be
written when the build is completed.
"""
STREAM_DEFAULT = 0
STREAM_ON = 1
STREAM_OFF = 2
class LoggingMode(enum.IntEnum):
"""
Specifies the logging mode.
Attributes:
LOGGING_UNSPECIFIED (int): The service determines the logging mode. The default is ``LEGACY``. Do
not rely on the default logging behavior as it may change in the future.
LEGACY (int): Stackdriver logging and Cloud Storage logging are enabled.
GCS_ONLY (int): Only Cloud Storage logging is enabled.
"""
LOGGING_UNSPECIFIED = 0
LEGACY = 1
GCS_ONLY = 2
class MachineType(enum.IntEnum):
"""
Supported VM sizes.
Attributes:
UNSPECIFIED (int): Standard machine type.
N1_HIGHCPU_8 (int): Highcpu machine with 8 CPUs.
N1_HIGHCPU_32 (int): Highcpu machine with 32 CPUs.
"""
UNSPECIFIED = 0
N1_HIGHCPU_8 = 1
N1_HIGHCPU_32 = 2
class SubstitutionOption(enum.IntEnum):
"""
Specifies the behavior when there is an error in the substitution checks.
Attributes:
MUST_MATCH (int): Fails the build if error in substitutions checks, like missing
a substitution in the template or in the map.
ALLOW_LOOSE (int): Do not fail the build if error in substitutions checks.
"""
MUST_MATCH = 0
ALLOW_LOOSE = 1
class VerifyOption(enum.IntEnum):
"""
Specifies the manner in which the build should be verified, if at all.
Attributes:
NOT_VERIFIED (int): Not a verifiable build. (default)
VERIFIED (int): Verified build.
"""
NOT_VERIFIED = 0
VERIFIED = 1
class Hash(object):
class HashType(enum.IntEnum):
"""
Specifies the hash algorithm, if any.
Attributes:
NONE (int): No hash requested.
SHA256 (int): Use a sha256 hash.
MD5 (int): Use a md5 hash.
"""
NONE = 0
SHA256 = 1
MD5 = 2
class PullRequestFilter(object):
class CommentControl(enum.IntEnum):
"""
Controls behavior of Pull Request comments.
Attributes:
COMMENTS_DISABLED (int): Do not require comments on Pull Requests before builds are triggered.
COMMENTS_ENABLED (int): Enforce that repository owners or collaborators must comment on Pull
Requests before builds are triggered.
"""
COMMENTS_DISABLED = 0
COMMENTS_ENABLED = 1
class WorkerPool(object):
class Region(enum.IntEnum):
"""
Supported GCP regions to create the ``WorkerPool``.
Attributes:
REGION_UNSPECIFIED (int): no region
US_CENTRAL1 (int): us-central1 region
US_WEST1 (int): us-west1 region
US_EAST1 (int): us-east1 region
US_EAST4 (int): us-east4 region
"""
REGION_UNSPECIFIED = 0
US_CENTRAL1 = 1
US_WEST1 = 2
US_EAST1 = 3
US_EAST4 = 4
class Status(enum.IntEnum):
"""
``WorkerPool`` status
Attributes:
STATUS_UNSPECIFIED (int): Status of the ``WorkerPool`` is unknown.
CREATING (int): ``WorkerPool`` is being created.
RUNNING (int): ``WorkerPool`` is running.
DELETING (int): ``WorkerPool`` is being deleted: cancelling builds and draining workers.
DELETED (int): ``WorkerPool`` is deleted.
"""
STATUS_UNSPECIFIED = 0
CREATING = 1
RUNNING = 2
DELETING = 3
DELETED = 4