From 802e85e523db5d2e0d94f1db5085c0c1d1d350d8 Mon Sep 17 00:00:00 2001 From: Stainless Bot <107565488+stainless-bot@users.noreply.github.com> Date: Tue, 17 Oct 2023 20:53:26 +0100 Subject: [PATCH] feat(client): support passing httpx.URL instances to base_url (#237) --- src/modern_treasury/_base_client.py | 6 +++--- src/modern_treasury/_client.py | 10 +++++----- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/modern_treasury/_base_client.py b/src/modern_treasury/_base_client.py index 62e2ba76..68fcd131 100644 --- a/src/modern_treasury/_base_client.py +++ b/src/modern_treasury/_base_client.py @@ -331,7 +331,7 @@ def __init__( self, *, version: str, - base_url: str, + base_url: str | URL, _strict_response_validation: bool, max_retries: int = DEFAULT_MAX_RETRIES, timeout: float | Timeout | None = DEFAULT_TIMEOUT, @@ -739,7 +739,7 @@ def __init__( self, *, version: str, - base_url: str, + base_url: str | URL, max_retries: int = DEFAULT_MAX_RETRIES, timeout: float | Timeout | None | NotGiven = NOT_GIVEN, transport: Transport | None = None, @@ -1145,7 +1145,7 @@ def __init__( self, *, version: str, - base_url: str, + base_url: str | URL, _strict_response_validation: bool, max_retries: int = DEFAULT_MAX_RETRIES, timeout: float | Timeout | None | NotGiven = NOT_GIVEN, diff --git a/src/modern_treasury/_client.py b/src/modern_treasury/_client.py index a81fbe1c..3143369f 100644 --- a/src/modern_treasury/_client.py +++ b/src/modern_treasury/_client.py @@ -5,7 +5,7 @@ import os import base64 import asyncio -from typing import Union, Mapping, Optional +from typing import Union, Mapping import httpx @@ -95,7 +95,7 @@ def __init__( api_key: str | None = None, organization_id: str | None = None, webhook_key: str | None = None, - base_url: Optional[str] = None, + base_url: str | httpx.URL | None = None, timeout: Union[float, Timeout, None, NotGiven] = NOT_GIVEN, max_retries: int = DEFAULT_MAX_RETRIES, default_headers: Mapping[str, str] | None = None, @@ -213,7 +213,7 @@ def copy( api_key: str | None = None, organization_id: str | None = None, webhook_key: str | None = None, - base_url: str | None = None, + base_url: str | httpx.URL | None = None, timeout: float | Timeout | None | NotGiven = NOT_GIVEN, http_client: httpx.Client | None = None, connection_pool_limits: httpx.Limits | None = None, @@ -392,7 +392,7 @@ def __init__( api_key: str | None = None, organization_id: str | None = None, webhook_key: str | None = None, - base_url: Optional[str] = None, + base_url: str | httpx.URL | None = None, timeout: Union[float, Timeout, None, NotGiven] = NOT_GIVEN, max_retries: int = DEFAULT_MAX_RETRIES, default_headers: Mapping[str, str] | None = None, @@ -510,7 +510,7 @@ def copy( api_key: str | None = None, organization_id: str | None = None, webhook_key: str | None = None, - base_url: str | None = None, + base_url: str | httpx.URL | None = None, timeout: float | Timeout | None | NotGiven = NOT_GIVEN, http_client: httpx.AsyncClient | None = None, connection_pool_limits: httpx.Limits | None = None,