Skip to content

Commit

Permalink
Merge pull request #29 from LiamAttClarke/fix/health-service-stubs
Browse files Browse the repository at this point in the history
Added missing grpc.health.v1 stubs
  • Loading branch information
shabbyrobe committed Mar 28, 2022
2 parents 6c59660 + 9e7c887 commit a4dabe5
Show file tree
Hide file tree
Showing 2 changed files with 129 additions and 0 deletions.
76 changes: 76 additions & 0 deletions grpc_health-stubs/v1/health_pb2.pyi
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: ...
53 changes: 53 additions & 0 deletions grpc_health-stubs/v1/health_pb2_grpc.pyi
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: ...

0 comments on commit a4dabe5

Please sign in to comment.