mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-20 02:41:16 +08:00
Add return type for Docker Container wait (#12036)
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import datetime
|
||||
from _typeshed import Incomplete
|
||||
from typing import Literal, TypedDict, overload, type_check_only
|
||||
from typing_extensions import TypeAlias
|
||||
from typing_extensions import NotRequired, TypeAlias
|
||||
|
||||
from docker.types.daemon import CancellableStream
|
||||
|
||||
@@ -15,6 +15,21 @@ class _HasId(TypedDict):
|
||||
class _HasID(TypedDict):
|
||||
ID: str
|
||||
|
||||
@type_check_only
|
||||
class _WaitErrorDetails(TypedDict):
|
||||
Message: str
|
||||
|
||||
@type_check_only
|
||||
class _WaitContainerExistsResponse(TypedDict):
|
||||
StatusCode: int
|
||||
Error: NotRequired[_WaitErrorDetails]
|
||||
|
||||
@type_check_only
|
||||
class _WaitNoSuchContainerErrorResponse(TypedDict):
|
||||
message: str
|
||||
|
||||
_WaitContainerResponseType: TypeAlias = _WaitContainerExistsResponse | _WaitNoSuchContainerErrorResponse
|
||||
|
||||
_Container: TypeAlias = _HasId | _HasID | str
|
||||
|
||||
class ContainerApiMixin:
|
||||
@@ -164,4 +179,4 @@ class ContainerApiMixin:
|
||||
container: _Container,
|
||||
timeout: int | None = None,
|
||||
condition: Literal["not-running", "next-exit", "removed"] | None = None,
|
||||
): ...
|
||||
) -> _WaitContainerResponseType: ...
|
||||
|
||||
Reference in New Issue
Block a user