amigo_sdk 0.58.0__py3-none-any.whl → 0.70.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
amigo_sdk/__init__.py CHANGED
@@ -1,4 +1,4 @@
1
- __version__ = "0.58.0"
1
+ __version__ = "0.70.0"
2
2
  from .sdk_client import AmigoClient, AsyncAmigoClient
3
3
 
4
4
  __all__ = ["__version__", "AmigoClient", "AsyncAmigoClient"]
amigo_sdk/_retry_utils.py CHANGED
@@ -1,12 +1,11 @@
1
1
  import datetime as dt
2
2
  import random
3
3
  from email.utils import parsedate_to_datetime
4
- from typing import Optional
5
4
 
6
5
  DEFAULT_RETRYABLE_STATUS: set[int] = {429, 500, 502, 503, 504}
7
6
 
8
7
 
9
- def parse_retry_after_seconds(retry_after: Optional[str]) -> float | None:
8
+ def parse_retry_after_seconds(retry_after: str | None) -> float | None:
10
9
  """Parse Retry-After header into seconds.
11
10
 
12
11
  Supports both numeric seconds and HTTP-date formats. Returns None when
@@ -55,7 +54,7 @@ def compute_retry_delay_seconds(
55
54
  attempt: int,
56
55
  backoff_base: float,
57
56
  max_delay_seconds: float,
58
- retry_after_header: Optional[str],
57
+ retry_after_header: str | None,
59
58
  ) -> float:
60
59
  """Compute delay for a given retry attempt.
61
60
 
amigo_sdk/errors.py CHANGED
@@ -1,4 +1,4 @@
1
- from typing import Any, Optional
1
+ from typing import Any
2
2
 
3
3
 
4
4
  class AmigoError(Exception):
@@ -10,9 +10,9 @@ class AmigoError(Exception):
10
10
  self,
11
11
  message: str,
12
12
  *,
13
- status_code: Optional[int] = None,
14
- error_code: Optional[str] = None,
15
- response_body: Optional[Any] = None,
13
+ status_code: int | None = None,
14
+ error_code: str | None = None,
15
+ response_body: Any | None = None,
16
16
  ) -> None:
17
17
  super().__init__(message)
18
18
  self.status_code = status_code
@@ -55,7 +55,7 @@ class RateLimitError(AmigoError): # 429
55
55
 
56
56
  # ---- Validation / semantic errors ------------------------------------------
57
57
  class ValidationError(BadRequestError): # 422 or 400 with `errors` list
58
- def __init__(self, *args, field_errors: Optional[dict[str, str]] = None, **kwargs):
58
+ def __init__(self, *args, field_errors: dict[str, str] | None = None, **kwargs):
59
59
  super().__init__(*args, **kwargs)
60
60
  self.field_errors = field_errors or {}
61
61