Add parameter types to docker's NetworkCollection create (#12190)

This commit is contained in:
Adam Dangoor
2024-06-24 10:28:24 +01:00
committed by GitHub
parent 8cdda79ae3
commit c8898742e0

View File

@@ -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]: ...