Skip to content

Commit

Permalink
re-generate mypy stubs for protobuf (#20)
Browse files Browse the repository at this point in the history
  • Loading branch information
andriykohut authored Aug 30, 2022
1 parent d7be6b6 commit c8a2583
Show file tree
Hide file tree
Showing 13 changed files with 1,756 additions and 1,216 deletions.
341 changes: 211 additions & 130 deletions esdb/generated/cluster_pb2.pyi

Large diffs are not rendered by default.

60 changes: 22 additions & 38 deletions esdb/generated/code_pb2.pyi
Original file line number Diff line number Diff line change
@@ -1,32 +1,49 @@
"""
@generated by mypy-protobuf. Do not edit manually!
isort:skip_file
Copyright 2020 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
http://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.
"""
import builtins
import google.protobuf.descriptor
import google.protobuf.internal.enum_type_wrapper
import sys
import typing
import typing_extensions

if sys.version_info >= (3, 10):
import typing as typing_extensions
else:
import typing_extensions

DESCRIPTOR: google.protobuf.descriptor.FileDescriptor

class _Code:
ValueType = typing.NewType('ValueType', builtins.int)
ValueType = typing.NewType("ValueType", builtins.int)
V: typing_extensions.TypeAlias = ValueType
class _CodeEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[_Code.ValueType], builtins.type):

class _CodeEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[_Code.ValueType], builtins.type): # noqa: F821
DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor
OK: _Code.ValueType # 0
"""Not an error; returned on success
HTTP Mapping: 200 OK
"""

CANCELLED: _Code.ValueType # 1
"""The operation was cancelled, typically by the caller.
HTTP Mapping: 499 Client Closed Request
"""

UNKNOWN: _Code.ValueType # 2
"""Unknown error. For example, this error may be returned when
a `Status` value received from another address space belongs to
Expand All @@ -36,7 +53,6 @@ class _CodeEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeW
HTTP Mapping: 500 Internal Server Error
"""

INVALID_ARGUMENT: _Code.ValueType # 3
"""The client specified an invalid argument. Note that this differs
from `FAILED_PRECONDITION`. `INVALID_ARGUMENT` indicates arguments
Expand All @@ -45,7 +61,6 @@ class _CodeEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeW
HTTP Mapping: 400 Bad Request
"""

DEADLINE_EXCEEDED: _Code.ValueType # 4
"""The deadline expired before the operation could complete. For operations
that change the state of the system, this error may be returned
Expand All @@ -55,7 +70,6 @@ class _CodeEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeW
HTTP Mapping: 504 Gateway Timeout
"""

NOT_FOUND: _Code.ValueType # 5
"""Some requested entity (e.g., file or directory) was not found.
Expand All @@ -67,14 +81,12 @@ class _CodeEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeW
HTTP Mapping: 404 Not Found
"""

ALREADY_EXISTS: _Code.ValueType # 6
"""The entity that a client attempted to create (e.g., file or directory)
already exists.
HTTP Mapping: 409 Conflict
"""

PERMISSION_DENIED: _Code.ValueType # 7
"""The caller does not have permission to execute the specified
operation. `PERMISSION_DENIED` must not be used for rejections
Expand All @@ -87,21 +99,18 @@ class _CodeEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeW
HTTP Mapping: 403 Forbidden
"""

UNAUTHENTICATED: _Code.ValueType # 16
"""The request does not have valid authentication credentials for the
operation.
HTTP Mapping: 401 Unauthorized
"""

RESOURCE_EXHAUSTED: _Code.ValueType # 8
"""Some resource has been exhausted, perhaps a per-user quota, or
perhaps the entire file system is out of space.
HTTP Mapping: 429 Too Many Requests
"""

FAILED_PRECONDITION: _Code.ValueType # 9
"""The operation was rejected because the system is not in a state
required for the operation's execution. For example, the directory
Expand All @@ -122,7 +131,6 @@ class _CodeEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeW
HTTP Mapping: 400 Bad Request
"""

ABORTED: _Code.ValueType # 10
"""The operation was aborted, typically due to a concurrency issue such as
a sequencer check failure or transaction abort.
Expand All @@ -132,7 +140,6 @@ class _CodeEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeW
HTTP Mapping: 409 Conflict
"""

OUT_OF_RANGE: _Code.ValueType # 11
"""The operation was attempted past the valid range. E.g., seeking or
reading past end-of-file.
Expand All @@ -152,22 +159,19 @@ class _CodeEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeW
HTTP Mapping: 400 Bad Request
"""

UNIMPLEMENTED: _Code.ValueType # 12
"""The operation is not implemented or is not supported/enabled in this
service.
HTTP Mapping: 501 Not Implemented
"""

INTERNAL: _Code.ValueType # 13
"""Internal errors. This means that some invariants expected by the
underlying system have been broken. This error code is reserved
for serious errors.
HTTP Mapping: 500 Internal Server Error
"""

UNAVAILABLE: _Code.ValueType # 14
"""The service is currently unavailable. This is most likely a
transient condition, which can be corrected by retrying with
Expand All @@ -179,7 +183,6 @@ class _CodeEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeW
HTTP Mapping: 503 Service Unavailable
"""

DATA_LOSS: _Code.ValueType # 15
"""Unrecoverable data loss or corruption.
Expand All @@ -195,20 +198,17 @@ class Code(_Code, metaclass=_CodeEnumTypeWrapper):
`OUT_OF_RANGE` over `FAILED_PRECONDITION` if both codes apply.
Similarly prefer `NOT_FOUND` or `ALREADY_EXISTS` over `FAILED_PRECONDITION`.
"""
pass

OK: Code.ValueType # 0
"""Not an error; returned on success
HTTP Mapping: 200 OK
"""

CANCELLED: Code.ValueType # 1
"""The operation was cancelled, typically by the caller.
HTTP Mapping: 499 Client Closed Request
"""

UNKNOWN: Code.ValueType # 2
"""Unknown error. For example, this error may be returned when
a `Status` value received from another address space belongs to
Expand All @@ -218,7 +218,6 @@ may be converted to this error.
HTTP Mapping: 500 Internal Server Error
"""

INVALID_ARGUMENT: Code.ValueType # 3
"""The client specified an invalid argument. Note that this differs
from `FAILED_PRECONDITION`. `INVALID_ARGUMENT` indicates arguments
Expand All @@ -227,7 +226,6 @@ that are problematic regardless of the state of the system
HTTP Mapping: 400 Bad Request
"""

DEADLINE_EXCEEDED: Code.ValueType # 4
"""The deadline expired before the operation could complete. For operations
that change the state of the system, this error may be returned
Expand All @@ -237,7 +235,6 @@ enough for the deadline to expire.
HTTP Mapping: 504 Gateway Timeout
"""

NOT_FOUND: Code.ValueType # 5
"""Some requested entity (e.g., file or directory) was not found.
Expand All @@ -249,14 +246,12 @@ must be used.
HTTP Mapping: 404 Not Found
"""

ALREADY_EXISTS: Code.ValueType # 6
"""The entity that a client attempted to create (e.g., file or directory)
already exists.
HTTP Mapping: 409 Conflict
"""

PERMISSION_DENIED: Code.ValueType # 7
"""The caller does not have permission to execute the specified
operation. `PERMISSION_DENIED` must not be used for rejections
Expand All @@ -269,21 +264,18 @@ other pre-conditions.
HTTP Mapping: 403 Forbidden
"""

UNAUTHENTICATED: Code.ValueType # 16
"""The request does not have valid authentication credentials for the
operation.
HTTP Mapping: 401 Unauthorized
"""

RESOURCE_EXHAUSTED: Code.ValueType # 8
"""Some resource has been exhausted, perhaps a per-user quota, or
perhaps the entire file system is out of space.
HTTP Mapping: 429 Too Many Requests
"""

FAILED_PRECONDITION: Code.ValueType # 9
"""The operation was rejected because the system is not in a state
required for the operation's execution. For example, the directory
Expand All @@ -304,7 +296,6 @@ between `FAILED_PRECONDITION`, `ABORTED`, and `UNAVAILABLE`:
HTTP Mapping: 400 Bad Request
"""

ABORTED: Code.ValueType # 10
"""The operation was aborted, typically due to a concurrency issue such as
a sequencer check failure or transaction abort.
Expand All @@ -314,7 +305,6 @@ See the guidelines above for deciding between `FAILED_PRECONDITION`,
HTTP Mapping: 409 Conflict
"""

OUT_OF_RANGE: Code.ValueType # 11
"""The operation was attempted past the valid range. E.g., seeking or
reading past end-of-file.
Expand All @@ -334,22 +324,19 @@ they are done.
HTTP Mapping: 400 Bad Request
"""

UNIMPLEMENTED: Code.ValueType # 12
"""The operation is not implemented or is not supported/enabled in this
service.
HTTP Mapping: 501 Not Implemented
"""

INTERNAL: Code.ValueType # 13
"""Internal errors. This means that some invariants expected by the
underlying system have been broken. This error code is reserved
for serious errors.
HTTP Mapping: 500 Internal Server Error
"""

UNAVAILABLE: Code.ValueType # 14
"""The service is currently unavailable. This is most likely a
transient condition, which can be corrected by retrying with
Expand All @@ -361,12 +348,9 @@ See the guidelines above for deciding between `FAILED_PRECONDITION`,
HTTP Mapping: 503 Service Unavailable
"""

DATA_LOSS: Code.ValueType # 15
"""Unrecoverable data loss or corruption.
HTTP Mapping: 500 Internal Server Error
"""

global___Code = Code

Loading

0 comments on commit c8a2583

Please sign in to comment.