-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #29 from LiamAttClarke/fix/health-service-stubs
Added missing grpc.health.v1 stubs
- Loading branch information
Showing
2 changed files
with
129 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
""" | ||
@generated by mypy-protobuf. Do not edit manually! | ||
isort:skip_file | ||
""" | ||
from builtins import ( | ||
int, | ||
type, | ||
) | ||
|
||
from google.protobuf.descriptor import ( | ||
Descriptor, | ||
EnumDescriptor, | ||
FileDescriptor, | ||
) | ||
|
||
from google.protobuf.internal.enum_type_wrapper import ( | ||
_EnumTypeWrapper, | ||
) | ||
|
||
from google.protobuf.message import ( | ||
Message, | ||
) | ||
|
||
from typing import ( | ||
NewType, | ||
Text, | ||
) | ||
|
||
from typing_extensions import ( | ||
Literal, | ||
TypeAlias, | ||
) | ||
|
||
|
||
DESCRIPTOR: FileDescriptor | ||
|
||
class HealthCheckRequest(Message): | ||
DESCRIPTOR: Descriptor | ||
SERVICE_FIELD_NUMBER: int | ||
service: Text | ||
def __init__(self, | ||
*, | ||
service: Text = ..., | ||
) -> None: ... | ||
def ClearField(self, field_name: Literal["service",b"service"]) -> None: ... | ||
|
||
class HealthCheckResponse(Message): | ||
DESCRIPTOR: Descriptor | ||
class _ServingStatus: | ||
ValueType = NewType('ValueType', int) | ||
V: TypeAlias = ValueType | ||
class _ServingStatusEnumTypeWrapper(_EnumTypeWrapper[HealthCheckResponse._ServingStatus.ValueType], type): | ||
DESCRIPTOR: EnumDescriptor | ||
UNKNOWN: HealthCheckResponse._ServingStatus.ValueType # 0 | ||
SERVING: HealthCheckResponse._ServingStatus.ValueType # 1 | ||
NOT_SERVING: HealthCheckResponse._ServingStatus.ValueType # 2 | ||
SERVICE_UNKNOWN: HealthCheckResponse._ServingStatus.ValueType # 3 | ||
"""Used only by the Watch method.""" | ||
|
||
class ServingStatus(_ServingStatus, metaclass=_ServingStatusEnumTypeWrapper): | ||
pass | ||
|
||
UNKNOWN: HealthCheckResponse.ServingStatus.ValueType # 0 | ||
SERVING: HealthCheckResponse.ServingStatus.ValueType # 1 | ||
NOT_SERVING: HealthCheckResponse.ServingStatus.ValueType # 2 | ||
SERVICE_UNKNOWN: HealthCheckResponse.ServingStatus.ValueType # 3 | ||
"""Used only by the Watch method.""" | ||
|
||
|
||
STATUS_FIELD_NUMBER: int | ||
status: HealthCheckResponse.ServingStatus.ValueType | ||
def __init__(self, | ||
*, | ||
status: HealthCheckResponse.ServingStatus.ValueType = ..., | ||
) -> None: ... | ||
def ClearField(self, field_name: Literal["status",b"status"]) -> None: ... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
""" | ||
@generated by mypy-protobuf. Do not edit manually! | ||
isort:skip_file | ||
""" | ||
from abc import ( | ||
ABCMeta, | ||
abstractmethod, | ||
) | ||
|
||
from grpc import ( | ||
Channel, | ||
Server, | ||
ServicerContext, | ||
UnaryStreamMultiCallable, | ||
UnaryUnaryMultiCallable, | ||
) | ||
|
||
from grpc.health.v1.health_service_pb2 import ( | ||
HealthCheckRequest, | ||
HealthCheckResponse, | ||
) | ||
|
||
from typing import ( | ||
Iterator, | ||
) | ||
|
||
|
||
class HealthStub: | ||
def __init__(self, channel: Channel) -> None: ... | ||
Check: UnaryUnaryMultiCallable[ | ||
HealthCheckRequest, | ||
HealthCheckResponse] | ||
|
||
Watch: UnaryStreamMultiCallable[ | ||
HealthCheckRequest, | ||
HealthCheckResponse] | ||
|
||
|
||
class HealthServicer(metaclass=ABCMeta): | ||
@abstractmethod | ||
def Check(self, | ||
request: HealthCheckRequest, | ||
context: ServicerContext, | ||
) -> HealthCheckResponse: ... | ||
|
||
@abstractmethod | ||
def Watch(self, | ||
request: HealthCheckRequest, | ||
context: ServicerContext, | ||
) -> Iterator[HealthCheckResponse]: ... | ||
|
||
|
||
def add_HealthServicer_to_server(servicer: HealthServicer, server: Server) -> None: ... |