Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ def with_cookies(self, cookies: dict[str, str]) -> "Client":
return evolve(self, cookies={**self._cookies, **cookies})

def with_timeout(self, timeout: httpx.Timeout) -> "Client":
"""Get a new client matching this one with a new timeout (in seconds)"""
"""Get a new client matching this one with a new timeout configuration"""
if self._client is not None:
self._client.timeout = timeout
if self._async_client is not None:
Expand Down Expand Up @@ -97,7 +97,7 @@ def __exit__(self, *args: Any, **kwargs: Any) -> None:
self.get_httpx_client().__exit__(*args, **kwargs)

def set_async_httpx_client(self, async_client: httpx.AsyncClient) -> "Client":
"""Manually the underlying httpx.AsyncClient
"""Manually set the underlying httpx.AsyncClient

**NOTE**: This will override any other settings on the client, including cookies, headers, and timeout.
"""
Expand Down Expand Up @@ -188,7 +188,7 @@ def with_cookies(self, cookies: dict[str, str]) -> "AuthenticatedClient":
return evolve(self, cookies={**self._cookies, **cookies})

def with_timeout(self, timeout: httpx.Timeout) -> "AuthenticatedClient":
"""Get a new client matching this one with a new timeout (in seconds)"""
"""Get a new client matching this one with a new timeout configuration"""
if self._client is not None:
self._client.timeout = timeout
if self._async_client is not None:
Expand Down Expand Up @@ -228,7 +228,7 @@ def __exit__(self, *args: Any, **kwargs: Any) -> None:
self.get_httpx_client().__exit__(*args, **kwargs)

def set_async_httpx_client(self, async_client: httpx.AsyncClient) -> "AuthenticatedClient":
"""Manually the underlying httpx.AsyncClient
"""Manually set the underlying httpx.AsyncClient

**NOTE**: This will override any other settings on the client, including cookies, headers, and timeout.
"""
Expand Down
8 changes: 4 additions & 4 deletions end_to_end_tests/golden-record/my_test_api_client/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ def with_cookies(self, cookies: dict[str, str]) -> "Client":
return evolve(self, cookies={**self._cookies, **cookies})

def with_timeout(self, timeout: httpx.Timeout) -> "Client":
"""Get a new client matching this one with a new timeout (in seconds)"""
"""Get a new client matching this one with a new timeout configuration"""
if self._client is not None:
self._client.timeout = timeout
if self._async_client is not None:
Expand Down Expand Up @@ -101,7 +101,7 @@ def __exit__(self, *args: Any, **kwargs: Any) -> None:
self.get_httpx_client().__exit__(*args, **kwargs)

def set_async_httpx_client(self, async_client: httpx.AsyncClient) -> "Client":
"""Manually the underlying httpx.AsyncClient
"""Manually set the underlying httpx.AsyncClient

**NOTE**: This will override any other settings on the client, including cookies, headers, and timeout.
"""
Expand Down Expand Up @@ -196,7 +196,7 @@ def with_cookies(self, cookies: dict[str, str]) -> "AuthenticatedClient":
return evolve(self, cookies={**self._cookies, **cookies})

def with_timeout(self, timeout: httpx.Timeout) -> "AuthenticatedClient":
"""Get a new client matching this one with a new timeout (in seconds)"""
"""Get a new client matching this one with a new timeout configuration"""
if self._client is not None:
self._client.timeout = timeout
if self._async_client is not None:
Expand Down Expand Up @@ -236,7 +236,7 @@ def __exit__(self, *args: Any, **kwargs: Any) -> None:
self.get_httpx_client().__exit__(*args, **kwargs)

def set_async_httpx_client(self, async_client: httpx.AsyncClient) -> "AuthenticatedClient":
"""Manually the underlying httpx.AsyncClient
"""Manually set the underlying httpx.AsyncClient

**NOTE**: This will override any other settings on the client, including cookies, headers, and timeout.
"""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ def with_cookies(self, cookies: dict[str, str]) -> "Client":
return evolve(self, cookies={**self._cookies, **cookies})

def with_timeout(self, timeout: httpx.Timeout) -> "Client":
"""Get a new client matching this one with a new timeout (in seconds)"""
"""Get a new client matching this one with a new timeout configuration"""
if self._client is not None:
self._client.timeout = timeout
if self._async_client is not None:
Expand Down Expand Up @@ -101,7 +101,7 @@ def __exit__(self, *args: Any, **kwargs: Any) -> None:
self.get_httpx_client().__exit__(*args, **kwargs)

def set_async_httpx_client(self, async_client: httpx.AsyncClient) -> "Client":
"""Manually the underlying httpx.AsyncClient
"""Manually set the underlying httpx.AsyncClient

**NOTE**: This will override any other settings on the client, including cookies, headers, and timeout.
"""
Expand Down Expand Up @@ -196,7 +196,7 @@ def with_cookies(self, cookies: dict[str, str]) -> "AuthenticatedClient":
return evolve(self, cookies={**self._cookies, **cookies})

def with_timeout(self, timeout: httpx.Timeout) -> "AuthenticatedClient":
"""Get a new client matching this one with a new timeout (in seconds)"""
"""Get a new client matching this one with a new timeout configuration"""
if self._client is not None:
self._client.timeout = timeout
if self._async_client is not None:
Expand Down Expand Up @@ -236,7 +236,7 @@ def __exit__(self, *args: Any, **kwargs: Any) -> None:
self.get_httpx_client().__exit__(*args, **kwargs)

def set_async_httpx_client(self, async_client: httpx.AsyncClient) -> "AuthenticatedClient":
"""Manually the underlying httpx.AsyncClient
"""Manually set the underlying httpx.AsyncClient

**NOTE**: This will override any other settings on the client, including cookies, headers, and timeout.
"""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ def with_cookies(self, cookies: dict[str, str]) -> "Client":
return evolve(self, cookies={**self._cookies, **cookies})

def with_timeout(self, timeout: httpx.Timeout) -> "Client":
"""Get a new client matching this one with a new timeout (in seconds)"""
"""Get a new client matching this one with a new timeout configuration"""
if self._client is not None:
self._client.timeout = timeout
if self._async_client is not None:
Expand Down Expand Up @@ -101,7 +101,7 @@ def __exit__(self, *args: Any, **kwargs: Any) -> None:
self.get_httpx_client().__exit__(*args, **kwargs)

def set_async_httpx_client(self, async_client: httpx.AsyncClient) -> "Client":
"""Manually the underlying httpx.AsyncClient
"""Manually set the underlying httpx.AsyncClient

**NOTE**: This will override any other settings on the client, including cookies, headers, and timeout.
"""
Expand Down Expand Up @@ -196,7 +196,7 @@ def with_cookies(self, cookies: dict[str, str]) -> "AuthenticatedClient":
return evolve(self, cookies={**self._cookies, **cookies})

def with_timeout(self, timeout: httpx.Timeout) -> "AuthenticatedClient":
"""Get a new client matching this one with a new timeout (in seconds)"""
"""Get a new client matching this one with a new timeout configuration"""
if self._client is not None:
self._client.timeout = timeout
if self._async_client is not None:
Expand Down Expand Up @@ -236,7 +236,7 @@ def __exit__(self, *args: Any, **kwargs: Any) -> None:
self.get_httpx_client().__exit__(*args, **kwargs)

def set_async_httpx_client(self, async_client: httpx.AsyncClient) -> "AuthenticatedClient":
"""Manually the underlying httpx.AsyncClient
"""Manually set the underlying httpx.AsyncClient

**NOTE**: This will override any other settings on the client, including cookies, headers, and timeout.
"""
Expand Down
8 changes: 4 additions & 4 deletions integration-tests/integration_tests/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ def with_cookies(self, cookies: dict[str, str]) -> "Client":
return evolve(self, cookies={**self._cookies, **cookies})

def with_timeout(self, timeout: httpx.Timeout) -> "Client":
"""Get a new client matching this one with a new timeout (in seconds)"""
"""Get a new client matching this one with a new timeout configuration"""
if self._client is not None:
self._client.timeout = timeout
if self._async_client is not None:
Expand Down Expand Up @@ -101,7 +101,7 @@ def __exit__(self, *args: Any, **kwargs: Any) -> None:
self.get_httpx_client().__exit__(*args, **kwargs)

def set_async_httpx_client(self, async_client: httpx.AsyncClient) -> "Client":
"""Manually the underlying httpx.AsyncClient
"""Manually set the underlying httpx.AsyncClient

**NOTE**: This will override any other settings on the client, including cookies, headers, and timeout.
"""
Expand Down Expand Up @@ -196,7 +196,7 @@ def with_cookies(self, cookies: dict[str, str]) -> "AuthenticatedClient":
return evolve(self, cookies={**self._cookies, **cookies})

def with_timeout(self, timeout: httpx.Timeout) -> "AuthenticatedClient":
"""Get a new client matching this one with a new timeout (in seconds)"""
"""Get a new client matching this one with a new timeout configuration"""
if self._client is not None:
self._client.timeout = timeout
if self._async_client is not None:
Expand Down Expand Up @@ -236,7 +236,7 @@ def __exit__(self, *args: Any, **kwargs: Any) -> None:
self.get_httpx_client().__exit__(*args, **kwargs)

def set_async_httpx_client(self, async_client: httpx.AsyncClient) -> "AuthenticatedClient":
"""Manually the underlying httpx.AsyncClient
"""Manually set the underlying httpx.AsyncClient

**NOTE**: This will override any other settings on the client, including cookies, headers, and timeout.
"""
Expand Down
4 changes: 2 additions & 2 deletions openapi_python_client/templates/client.py.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ class Client:
return evolve(self, cookies={**self._cookies, **cookies})

def with_timeout(self, timeout: httpx.Timeout) -> "{{ self }}":
"""Get a new client matching this one with a new timeout (in seconds)"""
"""Get a new client matching this one with a new timeout configuration"""
if self._client is not None:
self._client.timeout = timeout
if self._async_client is not None:
Expand Down Expand Up @@ -133,7 +133,7 @@ class Client:
self.get_httpx_client().__exit__(*args, **kwargs)

def set_async_httpx_client(self, async_client: httpx.AsyncClient) -> "{{ name }}":
"""Manually the underlying httpx.AsyncClient
"""Manually set the underlying httpx.AsyncClient

**NOTE**: This will override any other settings on the client, including cookies, headers, and timeout.
"""
Expand Down