mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-09 13:34:58 +08:00
Add parameter types to docker's NetworkCollection create (#12190)
This commit is contained in:
@@ -1,4 +1,6 @@
|
||||
from typing import Any
|
||||
from typing import Any, Literal
|
||||
|
||||
from docker.types import IPAMConfig
|
||||
|
||||
from .containers import Container
|
||||
from .resource import Collection, Model
|
||||
@@ -14,7 +16,20 @@ class Network(Model):
|
||||
|
||||
class NetworkCollection(Collection[Network]):
|
||||
model: type[Network]
|
||||
def create(self, name: str, *args, **kwargs) -> Network: ... # type:ignore[override]
|
||||
def create( # type:ignore[override]
|
||||
self,
|
||||
name: str,
|
||||
driver: str | None = None,
|
||||
options: dict[str, Any] | None = None,
|
||||
ipam: IPAMConfig | None = None,
|
||||
check_duplicate: bool | None = None,
|
||||
internal: bool = False,
|
||||
labels: dict[str, Any] | None = None,
|
||||
enable_ipv6: bool = False,
|
||||
attachable: bool | None = None,
|
||||
scope: Literal["local", "global", "swarm"] | None = None,
|
||||
ingress: bool | None = None,
|
||||
) -> Network: ...
|
||||
def get(self, network_id: str, *args, **kwargs) -> Network: ... # type:ignore[override]
|
||||
def list(self, *args, **kwargs) -> list[Network]: ...
|
||||
def prune(self, filters: dict[str, Any] | None = None) -> dict[str, Any]: ...
|
||||
|
||||
Reference in New Issue
Block a user