@@ -38,150 +38,6 @@ class HttpMethod(enum.IntEnum):
38
38
DELETE = 5
39
39
40
40
41
- class Code (enum .IntEnum ):
42
- """
43
- The canonical error codes for Google APIs.
44
-
45
- Sometimes multiple error codes may apply. Services should return the
46
- most specific error code that applies. For example, prefer
47
- ``OUT_OF_RANGE`` over ``FAILED_PRECONDITION`` if both codes apply.
48
- Similarly prefer ``NOT_FOUND`` or ``ALREADY_EXISTS`` over
49
- ``FAILED_PRECONDITION``.
50
-
51
- Attributes:
52
- OK (int): Not an error; returned on success
53
-
54
- HTTP Mapping: 200 OK
55
- CANCELLED (int): The operation was cancelled, typically by the caller.
56
-
57
- HTTP Mapping: 499 Client Closed Request
58
- UNKNOWN (int): Unknown error. For example, this error may be returned when a ``Status``
59
- value received from another address space belongs to an error space that
60
- is not known in this address space. Also errors raised by APIs that do
61
- not return enough error information may be converted to this error.
62
-
63
- HTTP Mapping: 500 Internal Server Error
64
- INVALID_ARGUMENT (int): The client specified an invalid argument. Note that this differs from
65
- ``FAILED_PRECONDITION``. ``INVALID_ARGUMENT`` indicates arguments that
66
- are problematic regardless of the state of the system (e.g., a malformed
67
- file name).
68
-
69
- HTTP Mapping: 400 Bad Request
70
- DEADLINE_EXCEEDED (int): The deadline expired before the operation could complete. For operations
71
- that change the state of the system, this error may be returned
72
- even if the operation has completed successfully. For example, a
73
- successful response from a server could have been delayed long
74
- enough for the deadline to expire.
75
-
76
- HTTP Mapping: 504 Gateway Timeout
77
- NOT_FOUND (int): Some requested entity (e.g., file or directory) was not found.
78
-
79
- Note to server developers: if a request is denied for an entire class of
80
- users, such as gradual feature rollout or undocumented whitelist,
81
- ``NOT_FOUND`` may be used. If a request is denied for some users within
82
- a class of users, such as user-based access control,
83
- ``PERMISSION_DENIED`` must be used.
84
-
85
- HTTP Mapping: 404 Not Found
86
- ALREADY_EXISTS (int): The entity that a client attempted to create (e.g., file or directory)
87
- already exists.
88
-
89
- HTTP Mapping: 409 Conflict
90
- PERMISSION_DENIED (int): The caller does not have permission to execute the specified operation.
91
- ``PERMISSION_DENIED`` must not be used for rejections caused by
92
- exhausting some resource (use ``RESOURCE_EXHAUSTED`` instead for those
93
- errors). ``PERMISSION_DENIED`` must not be used if the caller can not be
94
- identified (use ``UNAUTHENTICATED`` instead for those errors). This
95
- error code does not imply the request is valid or the requested entity
96
- exists or satisfies other pre-conditions.
97
-
98
- HTTP Mapping: 403 Forbidden
99
- UNAUTHENTICATED (int): The request does not have valid authentication credentials for the
100
- operation.
101
-
102
- HTTP Mapping: 401 Unauthorized
103
- RESOURCE_EXHAUSTED (int): Some resource has been exhausted, perhaps a per-user quota, or
104
- perhaps the entire file system is out of space.
105
-
106
- HTTP Mapping: 429 Too Many Requests
107
- FAILED_PRECONDITION (int): The operation was rejected because the system is not in a state required
108
- for the operation's execution. For example, the directory to be deleted
109
- is non-empty, an rmdir operation is applied to a non-directory, etc.
110
-
111
- Service implementors can use the following guidelines to decide between
112
- ``FAILED_PRECONDITION``, ``ABORTED``, and ``UNAVAILABLE``: (a) Use
113
- ``UNAVAILABLE`` if the client can retry just the failing call. (b) Use
114
- ``ABORTED`` if the client should retry at a higher level (e.g., when a
115
- client-specified test-and-set fails, indicating the client should
116
- restart a read-modify-write sequence). (c) Use ``FAILED_PRECONDITION``
117
- if the client should not retry until the system state has been
118
- explicitly fixed. E.g., if an "rmdir" fails because the directory is
119
- non-empty, ``FAILED_PRECONDITION`` should be returned since the client
120
- should not retry unless the files are deleted from the directory.
121
-
122
- HTTP Mapping: 400 Bad Request
123
- ABORTED (int): The operation was aborted, typically due to a concurrency issue such as
124
- a sequencer check failure or transaction abort.
125
-
126
- See the guidelines above for deciding between ``FAILED_PRECONDITION``,
127
- ``ABORTED``, and ``UNAVAILABLE``.
128
-
129
- HTTP Mapping: 409 Conflict
130
- OUT_OF_RANGE (int): The operation was attempted past the valid range. E.g., seeking or
131
- reading past end-of-file.
132
-
133
- Unlike ``INVALID_ARGUMENT``, this error indicates a problem that may be
134
- fixed if the system state changes. For example, a 32-bit file system
135
- will generate ``INVALID_ARGUMENT`` if asked to read at an offset that is
136
- not in the range [0,2^32-1], but it will generate ``OUT_OF_RANGE`` if
137
- asked to read from an offset past the current file size.
138
-
139
- There is a fair bit of overlap between ``FAILED_PRECONDITION`` and
140
- ``OUT_OF_RANGE``. We recommend using ``OUT_OF_RANGE`` (the more specific
141
- error) when it applies so that callers who are iterating through a space
142
- can easily look for an ``OUT_OF_RANGE`` error to detect when they are
143
- done.
144
-
145
- HTTP Mapping: 400 Bad Request
146
- UNIMPLEMENTED (int): The operation is not implemented or is not supported/enabled in this
147
- service.
148
-
149
- HTTP Mapping: 501 Not Implemented
150
- INTERNAL (int): Internal errors. This means that some invariants expected by the
151
- underlying system have been broken. This error code is reserved
152
- for serious errors.
153
-
154
- HTTP Mapping: 500 Internal Server Error
155
- UNAVAILABLE (int): The service is currently unavailable. This is most likely a transient
156
- condition, which can be corrected by retrying with a backoff.
157
-
158
- See the guidelines above for deciding between ``FAILED_PRECONDITION``,
159
- ``ABORTED``, and ``UNAVAILABLE``.
160
-
161
- HTTP Mapping: 503 Service Unavailable
162
- DATA_LOSS (int): Unrecoverable data loss or corruption.
163
-
164
- HTTP Mapping: 500 Internal Server Error
165
- """
166
- OK = 0
167
- CANCELLED = 1
168
- UNKNOWN = 2
169
- INVALID_ARGUMENT = 3
170
- DEADLINE_EXCEEDED = 4
171
- NOT_FOUND = 5
172
- ALREADY_EXISTS = 6
173
- PERMISSION_DENIED = 7
174
- UNAUTHENTICATED = 16
175
- RESOURCE_EXHAUSTED = 8
176
- FAILED_PRECONDITION = 9
177
- ABORTED = 10
178
- OUT_OF_RANGE = 11
179
- UNIMPLEMENTED = 12
180
- INTERNAL = 13
181
- UNAVAILABLE = 14
182
- DATA_LOSS = 15
183
-
184
-
185
41
class Queue (object ):
186
42
class State (enum .IntEnum ):
187
43
"""
0 commit comments