onebusaway 1.11.1__py3-none-any.whl → 1.12.1__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.
@@ -960,6 +960,9 @@ class SyncAPIClient(BaseClient[httpx.Client, Stream[Any]]):
960
960
  if self.custom_auth is not None:
961
961
  kwargs["auth"] = self.custom_auth
962
962
 
963
+ if options.follow_redirects is not None:
964
+ kwargs["follow_redirects"] = options.follow_redirects
965
+
963
966
  log.debug("Sending HTTP Request: %s %s", request.method, request.url)
964
967
 
965
968
  response = None
@@ -1068,7 +1071,14 @@ class SyncAPIClient(BaseClient[httpx.Client, Stream[Any]]):
1068
1071
  ) -> ResponseT:
1069
1072
  origin = get_origin(cast_to) or cast_to
1070
1073
 
1071
- if inspect.isclass(origin) and issubclass(origin, BaseAPIResponse):
1074
+ if (
1075
+ inspect.isclass(origin)
1076
+ and issubclass(origin, BaseAPIResponse)
1077
+ # we only want to actually return the custom BaseAPIResponse class if we're
1078
+ # returning the raw response, or if we're not streaming SSE, as if we're streaming
1079
+ # SSE then `cast_to` doesn't actively reflect the type we need to parse into
1080
+ and (not stream or bool(response.request.headers.get(RAW_RESPONSE_HEADER)))
1081
+ ):
1072
1082
  if not issubclass(origin, APIResponse):
1073
1083
  raise TypeError(f"API Response types must subclass {APIResponse}; Received {origin}")
1074
1084
 
@@ -1460,6 +1470,9 @@ class AsyncAPIClient(BaseClient[httpx.AsyncClient, AsyncStream[Any]]):
1460
1470
  if self.custom_auth is not None:
1461
1471
  kwargs["auth"] = self.custom_auth
1462
1472
 
1473
+ if options.follow_redirects is not None:
1474
+ kwargs["follow_redirects"] = options.follow_redirects
1475
+
1463
1476
  log.debug("Sending HTTP Request: %s %s", request.method, request.url)
1464
1477
 
1465
1478
  response = None
@@ -1568,7 +1581,14 @@ class AsyncAPIClient(BaseClient[httpx.AsyncClient, AsyncStream[Any]]):
1568
1581
  ) -> ResponseT:
1569
1582
  origin = get_origin(cast_to) or cast_to
1570
1583
 
1571
- if inspect.isclass(origin) and issubclass(origin, BaseAPIResponse):
1584
+ if (
1585
+ inspect.isclass(origin)
1586
+ and issubclass(origin, BaseAPIResponse)
1587
+ # we only want to actually return the custom BaseAPIResponse class if we're
1588
+ # returning the raw response, or if we're not streaming SSE, as if we're streaming
1589
+ # SSE then `cast_to` doesn't actively reflect the type we need to parse into
1590
+ and (not stream or bool(response.request.headers.get(RAW_RESPONSE_HEADER)))
1591
+ ):
1572
1592
  if not issubclass(origin, AsyncAPIResponse):
1573
1593
  raise TypeError(f"API Response types must subclass {AsyncAPIResponse}; Received {origin}")
1574
1594
 
onebusaway/_models.py CHANGED
@@ -737,6 +737,7 @@ class FinalRequestOptionsInput(TypedDict, total=False):
737
737
  idempotency_key: str
738
738
  json_data: Body
739
739
  extra_json: AnyMapping
740
+ follow_redirects: bool
740
741
 
741
742
 
742
743
  @final
@@ -750,6 +751,7 @@ class FinalRequestOptions(pydantic.BaseModel):
750
751
  files: Union[HttpxRequestFiles, None] = None
751
752
  idempotency_key: Union[str, None] = None
752
753
  post_parser: Union[Callable[[Any], Any], NotGiven] = NotGiven()
754
+ follow_redirects: Union[bool, None] = None
753
755
 
754
756
  # It should be noted that we cannot use `json` here as that would override
755
757
  # a BaseModel method in an incompatible fashion.
onebusaway/_types.py CHANGED
@@ -100,6 +100,7 @@ class RequestOptions(TypedDict, total=False):
100
100
  params: Query
101
101
  extra_json: AnyMapping
102
102
  idempotency_key: str
103
+ follow_redirects: bool
103
104
 
104
105
 
105
106
  # Sentinel class used until PEP 0661 is accepted
@@ -215,3 +216,4 @@ class _GenericAlias(Protocol):
215
216
 
216
217
  class HttpxSendArgs(TypedDict, total=False):
217
218
  auth: httpx.Auth
219
+ follow_redirects: bool
onebusaway/_version.py CHANGED
@@ -1,4 +1,4 @@
1
1
  # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
2
 
3
3
  __title__ = "onebusaway"
4
- __version__ = "1.11.1" # x-release-please-version
4
+ __version__ = "1.12.1" # x-release-please-version
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: onebusaway
3
- Version: 1.11.1
3
+ Version: 1.12.1
4
4
  Summary: The official Python library for the onebusaway-sdk API
5
5
  Project-URL: Homepage, https://github.com/OneBusAway/python-sdk
6
6
  Project-URL: Repository, https://github.com/OneBusAway/python-sdk
@@ -1,17 +1,17 @@
1
1
  onebusaway/__init__.py,sha256=ku3rAJ6hbPMCdJIRExmanIm3dbFgnYN0uQsNyd7IIsU,2623
2
- onebusaway/_base_client.py,sha256=t0u0UlX0OBQUHOHKzcgPm0AmLhHzADjED07_vgX_nH0,64848
2
+ onebusaway/_base_client.py,sha256=r8AanDIn8oBTvs_PTcDdcrNq5YGVAn6y_hnZUJ4Y6QM,65888
3
3
  onebusaway/_client.py,sha256=dGw5u-pBQRdxZLFdYVOATktwqgNSIWv3y2PyH_ziaKU,37100
4
4
  onebusaway/_compat.py,sha256=VWemUKbj6DDkQ-O4baSpHVLJafotzeXmCQGJugfVTIw,6580
5
5
  onebusaway/_constants.py,sha256=S14PFzyN9-I31wiV7SmIlL5Ga0MLHxdvegInGdXH7tM,462
6
6
  onebusaway/_exceptions.py,sha256=gTu5ksHyugfhJpvafbM_-qHkhFuUnvb5cDvGPqMPhfE,3234
7
7
  onebusaway/_files.py,sha256=mf4dOgL4b0ryyZlbqLhggD3GVgDf6XxdGFAgce01ugE,3549
8
- onebusaway/_models.py,sha256=mB2r2VWQq49jG-F0RIXDrBxPp3v-Eg12wMOtVTNxtv4,29057
8
+ onebusaway/_models.py,sha256=G1vczEodX0vUySeVKbF-mbzlaObNL1oVAYH4c65agRk,29131
9
9
  onebusaway/_qs.py,sha256=AOkSz4rHtK4YI3ZU_kzea-zpwBUgEY8WniGmTPyEimc,4846
10
10
  onebusaway/_resource.py,sha256=t-CkWpnm2UyE1uiv87GODlyRcQ_8h5eXmSVoE-1u35w,1142
11
11
  onebusaway/_response.py,sha256=x_FC3ZoD8JnfQRtZibna0wxoBtNzKcVictes8B7N6NQ,28848
12
12
  onebusaway/_streaming.py,sha256=PC8tKxRCeoJn8xKBBxXTlppGSI4TOMYVNfxrabFkRfc,10128
13
- onebusaway/_types.py,sha256=0_0SyC6C04EO6vdf-4N0dmeiXHEP2P62r7CQpTOpPAY,6147
14
- onebusaway/_version.py,sha256=okjYfnJ4BwPfDh5B57TkZLbuT1RxmcrDbBMwMDLCmX8,163
13
+ onebusaway/_types.py,sha256=OUYNO_zPft2ZRZXakg0aIsBjCoAJLRet90u8LO8WBB4,6201
14
+ onebusaway/_version.py,sha256=yv8Bemchd8506KyJnzvt7rX3_3lmK8mW76cxj5mSINc,163
15
15
  onebusaway/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
16
16
  onebusaway/_utils/__init__.py,sha256=PNZ_QJuzZEgyYXqkO1HVhGkj5IU9bglVUcw7H-Knjzw,2062
17
17
  onebusaway/_utils/_logs.py,sha256=tVIAhl7_vbQL4nJ8QdLAHJ0YzQYbW2gTATmjneY_JxI,790
@@ -104,7 +104,7 @@ onebusaway/types/vehicles_for_agency_list_response.py,sha256=IUX2zHummRU2ChQsGYt
104
104
  onebusaway/types/shared/__init__.py,sha256=ui9M5r_ahasuyksUJVAHHYtdXvg3L_uxVgJY6LMdiPY,201
105
105
  onebusaway/types/shared/references.py,sha256=By29adWfDkZwH6_80NFuvP5NPKOcz9JUqUzaq-iAjQw,7317
106
106
  onebusaway/types/shared/response_wrapper.py,sha256=0i161M7PC8iPq2RzNt8DxZFlvSvdgD9xBcs0ugER0rY,331
107
- onebusaway-1.11.1.dist-info/METADATA,sha256=CxsqeEIDzgzHTyPDL7ZY1feUrTmEJep3p1YRVVtxG7E,12727
108
- onebusaway-1.11.1.dist-info/WHEEL,sha256=C2FUgwZgiLbznR-k0b_5k3Ai_1aASOXDss3lzCUsUug,87
109
- onebusaway-1.11.1.dist-info/licenses/LICENSE,sha256=czZkEz_7Kzvn7AGsFsY_RUYL132SXtB5Mcrjoq29Vfo,11344
110
- onebusaway-1.11.1.dist-info/RECORD,,
107
+ onebusaway-1.12.1.dist-info/METADATA,sha256=qq_KYX2bxFAymeWQZ-JhQv8C0gl1sljwQ0lUzbZ03rk,12727
108
+ onebusaway-1.12.1.dist-info/WHEEL,sha256=C2FUgwZgiLbznR-k0b_5k3Ai_1aASOXDss3lzCUsUug,87
109
+ onebusaway-1.12.1.dist-info/licenses/LICENSE,sha256=czZkEz_7Kzvn7AGsFsY_RUYL132SXtB5Mcrjoq29Vfo,11344
110
+ onebusaway-1.12.1.dist-info/RECORD,,