motor-python-sdk 0.0.2__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.
Files changed (60) hide show
  1. motor_python_sdk-0.0.2.dist-info/METADATA +230 -0
  2. motor_python_sdk-0.0.2.dist-info/RECORD +60 -0
  3. motor_python_sdk-0.0.2.dist-info/WHEEL +4 -0
  4. yasminaai/__init__.py +113 -0
  5. yasminaai/_default_clients.py +32 -0
  6. yasminaai/client.py +255 -0
  7. yasminaai/core/__init__.py +127 -0
  8. yasminaai/core/api_error.py +23 -0
  9. yasminaai/core/client_wrapper.py +119 -0
  10. yasminaai/core/datetime_utils.py +70 -0
  11. yasminaai/core/file.py +67 -0
  12. yasminaai/core/force_multipart.py +18 -0
  13. yasminaai/core/http_client.py +839 -0
  14. yasminaai/core/http_response.py +59 -0
  15. yasminaai/core/http_sse/__init__.py +42 -0
  16. yasminaai/core/http_sse/_api.py +170 -0
  17. yasminaai/core/http_sse/_decoders.py +61 -0
  18. yasminaai/core/http_sse/_exceptions.py +7 -0
  19. yasminaai/core/http_sse/_models.py +17 -0
  20. yasminaai/core/jsonable_encoder.py +120 -0
  21. yasminaai/core/logging.py +107 -0
  22. yasminaai/core/parse_error.py +36 -0
  23. yasminaai/core/pydantic_utilities.py +508 -0
  24. yasminaai/core/query_encoder.py +58 -0
  25. yasminaai/core/remove_none_from_dict.py +11 -0
  26. yasminaai/core/request_options.py +35 -0
  27. yasminaai/core/serialization.py +347 -0
  28. yasminaai/environment.py +7 -0
  29. yasminaai/errors/__init__.py +42 -0
  30. yasminaai/errors/bad_request_error.py +10 -0
  31. yasminaai/errors/not_found_error.py +10 -0
  32. yasminaai/errors/unauthorized_error.py +10 -0
  33. yasminaai/errors/unprocessable_entity_error.py +10 -0
  34. yasminaai/ot_ps/__init__.py +4 -0
  35. yasminaai/ot_ps/client.py +278 -0
  36. yasminaai/ot_ps/raw_client.py +355 -0
  37. yasminaai/policies/__init__.py +4 -0
  38. yasminaai/policies/client.py +393 -0
  39. yasminaai/policies/raw_client.py +493 -0
  40. yasminaai/py.typed +0 -0
  41. yasminaai/quotes/__init__.py +49 -0
  42. yasminaai/quotes/client.py +438 -0
  43. yasminaai/quotes/raw_client.py +548 -0
  44. yasminaai/quotes/types/__init__.py +47 -0
  45. yasminaai/quotes/types/delete_quote_requests_id_response.py +19 -0
  46. yasminaai/quotes/types/get_quote_requests_response.py +37 -0
  47. yasminaai/quotes/types/get_quote_requests_response_links_item.py +21 -0
  48. yasminaai/quotes/types/post_quote_requests_request_drivers_item.py +33 -0
  49. yasminaai/types/__init__.py +65 -0
  50. yasminaai/types/bad_request_error_body.py +20 -0
  51. yasminaai/types/benefit.py +24 -0
  52. yasminaai/types/company_quote.py +23 -0
  53. yasminaai/types/error.py +20 -0
  54. yasminaai/types/policy.py +33 -0
  55. yasminaai/types/quote_price.py +24 -0
  56. yasminaai/types/quote_response.py +90 -0
  57. yasminaai/types/quote_response_drivers_item.py +33 -0
  58. yasminaai/types/quote_response_quotes_item.py +30 -0
  59. yasminaai/types/unauthorized_error_body.py +20 -0
  60. yasminaai/version.py +3 -0
@@ -0,0 +1,230 @@
1
+ Metadata-Version: 2.1
2
+ Name: motor-python-sdk
3
+ Version: 0.0.2
4
+ Summary:
5
+ Requires-Python: >=3.10,<4.0
6
+ Classifier: Intended Audience :: Developers
7
+ Classifier: Operating System :: MacOS
8
+ Classifier: Operating System :: Microsoft :: Windows
9
+ Classifier: Operating System :: OS Independent
10
+ Classifier: Operating System :: POSIX
11
+ Classifier: Operating System :: POSIX :: Linux
12
+ Classifier: Programming Language :: Python
13
+ Classifier: Programming Language :: Python :: 3
14
+ Classifier: Programming Language :: Python :: 3.10
15
+ Classifier: Programming Language :: Python :: 3.11
16
+ Classifier: Programming Language :: Python :: 3.12
17
+ Classifier: Programming Language :: Python :: 3.13
18
+ Classifier: Programming Language :: Python :: 3.14
19
+ Classifier: Programming Language :: Python :: 3.15
20
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
21
+ Classifier: Typing :: Typed
22
+ Provides-Extra: aiohttp
23
+ Requires-Dist: aiohttp (>=3.14.0,<4) ; (python_version >= "3.10") and (extra == "aiohttp")
24
+ Requires-Dist: httpx (>=0.21.2)
25
+ Requires-Dist: httpx-aiohttp (==0.1.8) ; (python_version >= "3.10") and (extra == "aiohttp")
26
+ Requires-Dist: pydantic (>=1.9.2)
27
+ Requires-Dist: pydantic-core (>=2.18.2,<3.0.0)
28
+ Requires-Dist: typing_extensions (>=4.0.0)
29
+ Project-URL: Repository, https://github.com/YasminaAI/motor-python-sdk
30
+ Description-Content-Type: text/markdown
31
+
32
+ # Yasminaai Python Library
33
+
34
+ [![fern shield](https://img.shields.io/badge/%F0%9F%8C%BF-Built%20with%20Fern-brightgreen)](https://buildwithfern.com?utm_source=github&utm_medium=github&utm_campaign=readme&utm_source=https%3A%2F%2Fgithub.com%2FYasminaAI%2Fmotor-python-sdk)
35
+ [![pypi](https://img.shields.io/pypi/v/motor-python-sdk)](https://pypi.python.org/pypi/motor-python-sdk)
36
+
37
+ The Yasminaai Python library provides convenient access to the Yasminaai APIs from Python.
38
+
39
+ ## Table of Contents
40
+
41
+ - [Installation](#installation)
42
+ - [Reference](#reference)
43
+ - [Usage](#usage)
44
+ - [Environments](#environments)
45
+ - [Async Client](#async-client)
46
+ - [Exception Handling](#exception-handling)
47
+ - [Advanced](#advanced)
48
+ - [Access Raw Response Data](#access-raw-response-data)
49
+ - [Retries](#retries)
50
+ - [Timeouts](#timeouts)
51
+ - [Custom Client](#custom-client)
52
+ - [Contributing](#contributing)
53
+
54
+ ## Installation
55
+
56
+ ```sh
57
+ pip install motor-python-sdk
58
+ ```
59
+
60
+ ## Reference
61
+
62
+ A full reference for this library is available [here](https://github.com/YasminaAI/motor-python-sdk/blob/HEAD/./reference.md).
63
+
64
+ ## Usage
65
+
66
+ Instantiate and use the client with the following:
67
+
68
+ ```python
69
+ from yasminaai import YasminaaiApi
70
+ import datetime
71
+
72
+ client = YasminaaiApi(
73
+ token="<token>",
74
+ )
75
+
76
+ client.quotes.request_quotes(
77
+ owner_id="owner_id",
78
+ phone="phone",
79
+ birthdate=datetime.date.fromisoformat("2023-01-15"),
80
+ car_sequence_number="car_sequence_number",
81
+ car_estimated_cost=1.1,
82
+ )
83
+ ```
84
+
85
+ ## Environments
86
+
87
+ This SDK allows you to configure different environments for API requests.
88
+
89
+ ```python
90
+ from yasminaai import YasminaaiApi
91
+ from yasminaai.environment import YasminaaiApiEnvironment
92
+
93
+ client = YasminaaiApi(
94
+ environment=YasminaaiApiEnvironment.DEFAULT,
95
+ )
96
+ ```
97
+
98
+ ## Async Client
99
+
100
+ The SDK also exports an `async` client so that you can make non-blocking calls to our API. Note that if you are constructing an Async httpx client class to pass into this client, use `httpx.AsyncClient()` instead of `httpx.Client()` (e.g. for the `httpx_client` parameter of this client).
101
+
102
+ ```python
103
+ import asyncio
104
+ import datetime
105
+
106
+ from yasminaai import AsyncYasminaaiApi
107
+
108
+ client = AsyncYasminaaiApi(
109
+ token="<token>",
110
+ )
111
+
112
+
113
+ async def main() -> None:
114
+ await client.quotes.request_quotes(
115
+ owner_id="owner_id",
116
+ phone="phone",
117
+ birthdate=datetime.date.fromisoformat("2023-01-15"),
118
+ car_sequence_number="car_sequence_number",
119
+ car_estimated_cost=1.1,
120
+ )
121
+
122
+
123
+ asyncio.run(main())
124
+ ```
125
+
126
+ ## Exception Handling
127
+
128
+ When the API returns a non-success status code (4xx or 5xx response), a subclass of the following error
129
+ will be thrown.
130
+
131
+ ```python
132
+ from yasminaai.core.api_error import ApiError
133
+
134
+ try:
135
+ client.quotes.request_quotes(...)
136
+ except ApiError as e:
137
+ print(e.status_code)
138
+ print(e.body)
139
+ ```
140
+
141
+ ## Advanced
142
+
143
+ ### Access Raw Response Data
144
+
145
+ The SDK provides access to raw response data, including headers, through the `.with_raw_response` property.
146
+ The `.with_raw_response` property returns a "raw" client that can be used to access the `.headers` and `.data` attributes.
147
+
148
+ ```python
149
+ from yasminaai import YasminaaiApi
150
+
151
+ client = YasminaaiApi(...)
152
+ response = client.quotes.with_raw_response.request_quotes(...)
153
+ print(response.headers) # access the response headers
154
+ print(response.status_code) # access the response status code
155
+ print(response.data) # access the underlying object
156
+ ```
157
+
158
+ ### Retries
159
+
160
+ The SDK is instrumented with automatic retries with exponential backoff. A request will be retried as long
161
+ as the request is deemed retryable and the number of retry attempts has not grown larger than the configured
162
+ retry limit (default: 2).
163
+
164
+ Which status codes are retried depends on the `retryStatusCodes` generator configuration:
165
+
166
+ **`legacy`** (current default): retries on
167
+ - [408](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/408) (Timeout)
168
+ - [409](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/409) (Conflict)
169
+ - [429](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/429) (Too Many Requests)
170
+ - [5XX](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status#server_error_responses) (All server errors, including 500)
171
+
172
+ **`recommended`**: retries on
173
+ - [408](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/408) (Timeout)
174
+ - [409](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/409) (Conflict)
175
+ - [429](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/429) (Too Many Requests)
176
+ - [502](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/502) (Bad Gateway)
177
+ - [503](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/503) (Service Unavailable)
178
+ - [504](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/504) (Gateway Timeout)
179
+
180
+ Use the `max_retries` request option to configure this behavior.
181
+
182
+ ```python
183
+ client.quotes.request_quotes(..., request_options={
184
+ "max_retries": 1
185
+ })
186
+ ```
187
+
188
+ ### Timeouts
189
+
190
+ The SDK defaults to a 60 second timeout. You can configure this with a timeout option at the client or request level.
191
+
192
+ ```python
193
+ from yasminaai import YasminaaiApi
194
+
195
+ client = YasminaaiApi(..., timeout=20.0)
196
+
197
+ # Override timeout for a specific method
198
+ client.quotes.request_quotes(..., request_options={
199
+ "timeout_in_seconds": 1
200
+ })
201
+ ```
202
+
203
+ ### Custom Client
204
+
205
+ You can override the `httpx` client to customize it for your use-case. Some common use-cases include support for proxies
206
+ and transports.
207
+
208
+ ```python
209
+ import httpx
210
+ from yasminaai import YasminaaiApi
211
+
212
+ client = YasminaaiApi(
213
+ ...,
214
+ httpx_client=httpx.Client(
215
+ proxy="http://my.test.proxy.example.com",
216
+ transport=httpx.HTTPTransport(local_address="0.0.0.0"),
217
+ ),
218
+ )
219
+ ```
220
+
221
+ ## Contributing
222
+
223
+ While we value open-source contributions to this SDK, this library is generated programmatically.
224
+ Additions made directly to this library would have to be moved over to our generation code,
225
+ otherwise they would be overwritten upon the next generated release. Feel free to open a PR as
226
+ a proof of concept, but know that we will not be able to merge it as-is. We suggest opening
227
+ an issue first to discuss with us!
228
+
229
+ On the other hand, contributions to the README are always very welcome!
230
+
@@ -0,0 +1,60 @@
1
+ yasminaai/__init__.py,sha256=m7i-IvfET7DWBQI7cJ-agdSFOrt8L_evi8OIxF0xKTY,3472
2
+ yasminaai/_default_clients.py,sha256=oY3cKyyx7robMW30ldRQIl6wu2LWaRN4r3tBzYd_MgQ,1042
3
+ yasminaai/client.py,sha256=UMtxsd5d76Mjw7xIQmF0Mj007y-s3PYu19z_ATX3HNQ,10473
4
+ yasminaai/core/__init__.py,sha256=103ZnffsdqGZ7Y9uxirEu3sEhBGZxFdRy2HBjH15R2Y,4369
5
+ yasminaai/core/api_error.py,sha256=44vPoTyWN59gonCIZMdzw7M1uspygiLnr3GNFOoVL2Q,614
6
+ yasminaai/core/client_wrapper.py,sha256=g08bT4qaMaHdOd_LEUPRv90C3YwQ1qtvEk49pBMe1GA,4104
7
+ yasminaai/core/datetime_utils.py,sha256=ubW9ID5Is8Mz-4y_VXUpaExmvmknYFP3nSI1fCo6e6s,2498
8
+ yasminaai/core/file.py,sha256=d4NNbX8XvXP32z8KpK2Xovv33nFfruIrpz0QWxlgpZk,2663
9
+ yasminaai/core/force_multipart.py,sha256=cH981xLy0kZVKiZZkFoeUjgJ2Zuq7KXB2aRAnmHzRDc,477
10
+ yasminaai/core/http_client.py,sha256=GGFHg_FVsnaYdKnULuEUXrE9YgD3nOkVV23ZATghnzM,31555
11
+ yasminaai/core/http_response.py,sha256=-628gqtkXE8wozoeiJvgh6_HAFwPk7GPtERgO4Kaaq0,1437
12
+ yasminaai/core/http_sse/__init__.py,sha256=vE7RxBmzIfV9SmFDw4YCuDN9DaPuJb3FAnoFDo7bqww,1350
13
+ yasminaai/core/http_sse/_api.py,sha256=CMTWL4_6drvCoiD9rMfmv-Uprz5s5a896pifj0BDxZQ,5941
14
+ yasminaai/core/http_sse/_decoders.py,sha256=tY3L5TZ0y-pgz0Lu1q8ro5Ljz43q4lYyuec73u9WfNw,1733
15
+ yasminaai/core/http_sse/_exceptions.py,sha256=o8Tp-e8Lvmtn_5MVSYbkW9rVrpwFg5pnKbOcHfrHH14,127
16
+ yasminaai/core/http_sse/_models.py,sha256=kKvCCm8e6gCilulJpiHv4f2OPVxo9CydLboEqMhplPI,397
17
+ yasminaai/core/jsonable_encoder.py,sha256=TyA2STyLG19741sWjOltlDowfuNytu-dEfti9v4idfo,4329
18
+ yasminaai/core/logging.py,sha256=_rzxS8Bps4VNxKgz-tk39Czs4oFFXB818bNS7-1ZQl4,3244
19
+ yasminaai/core/parse_error.py,sha256=VqCFdcXqqqomql18zSkpYvj5Kx4yZciNXy4zg9ZIXno,1111
20
+ yasminaai/core/pydantic_utilities.py,sha256=6m7DLSv1rxBMiqq5pskxQEE0Vd4DHpLwPGbtTNcz0vM,20048
21
+ yasminaai/core/query_encoder.py,sha256=ekulqNd0j8TgD7ox-Qbz7liqX8-KP9blvT9DsRCenYM,2144
22
+ yasminaai/core/remove_none_from_dict.py,sha256=EU9SGgYidWq7SexuJbNs4-PZ-5Bl3Vppd864mS6vQZw,342
23
+ yasminaai/core/request_options.py,sha256=h0QUNCFVdCW_7GclVySCAY2w4NhtXVBUCmHgmzaxpcg,1681
24
+ yasminaai/core/serialization.py,sha256=KbN6cX6jd0RlHgGOgcmpV04WnUqcVyJ7wZiodYkIkTE,12962
25
+ yasminaai/environment.py,sha256=AP7ZDRLOX7uvE33gLCnRvAWf8lsQb1DzPvchE3XOHAc,180
26
+ yasminaai/errors/__init__.py,sha256=lB7Uc4ktf3EDpobZHrFitDa3vaTcTxTCLgLd9RSxySg,1484
27
+ yasminaai/errors/bad_request_error.py,sha256=rmt2UyKLfCwaztIVmSogAAcv1dlEBZHjo06QurKWmiw,321
28
+ yasminaai/errors/not_found_error.py,sha256=7GQ0iCCRpVeg55InQsDsMMD3HomNjc4d-dHYWkUnZLw,319
29
+ yasminaai/errors/unauthorized_error.py,sha256=cDi1t15echZjvUjgAAUi-LwZozyBxKT4kw30tWL0x8U,323
30
+ yasminaai/errors/unprocessable_entity_error.py,sha256=pS8wFZZpwvcy0YofOjjFIjd1XkkluGF08iNGeGbHR48,348
31
+ yasminaai/ot_ps/__init__.py,sha256=_VhToAyIt_5axN6CLJwtxg3-CO7THa_23pbUzqhXJa4,85
32
+ yasminaai/ot_ps/client.py,sha256=pWDitOoUzXOdqlhX9XxWOfWG_6Boq0JM-gX912dTwMo,8282
33
+ yasminaai/ot_ps/raw_client.py,sha256=0OK33C26tyP7iNz_mrEnWbXbvsDtgALvW1CHkH_tAnk,13122
34
+ yasminaai/policies/__init__.py,sha256=_VhToAyIt_5axN6CLJwtxg3-CO7THa_23pbUzqhXJa4,85
35
+ yasminaai/policies/client.py,sha256=bmL7xvanGciqCht_ydSwb0WxvjmVyk5k_p7UDe3C0ig,11414
36
+ yasminaai/policies/raw_client.py,sha256=HgMLOvBkVRI-Rldw6vC1UGQoGZi-bZ6WV-NhitsiV9w,18401
37
+ yasminaai/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
38
+ yasminaai/quotes/__init__.py,sha256=_9S6YmAnBpLYysqwkS9m0sg_CGO-rqTH13zwPPFpt5A,1522
39
+ yasminaai/quotes/client.py,sha256=cHj9Vc8LGLAyhrxvEDfC7PRJo_NtGXjvPAe9HI56mvA,13161
40
+ yasminaai/quotes/raw_client.py,sha256=dQ15e2-MWFWskazzi1Jh1DmYOEL8JWQoRaQXdDlWmfU,21873
41
+ yasminaai/quotes/types/__init__.py,sha256=8DPf989aw6iI1WZhrHHEzPCTpj8aDpfvm1SV8SBk5Ec,1783
42
+ yasminaai/quotes/types/delete_quote_requests_id_response.py,sha256=VvxAA6axL3WT0TmH5UBs8K1WAU47SBgyeu6dPTCLmgY,564
43
+ yasminaai/quotes/types/get_quote_requests_response.py,sha256=I_BmmfhrGqXpEABLo-qPXHPZRz_FYbS3Zs6jLIaDUvE,1444
44
+ yasminaai/quotes/types/get_quote_requests_response_links_item.py,sha256=XcyXqgO2OB2anQdC318BTVth2pxQ6CmNI7USBoXAjEE,644
45
+ yasminaai/quotes/types/post_quote_requests_request_drivers_item.py,sha256=phnpIld1jnDoyVFm41Z_g9geM6kaheoCTkQVCPzCWek,974
46
+ yasminaai/types/__init__.py,sha256=32tUJkzACRM83cHXSUQ3JkbRPHonn0qK-j9U9FfiGcw,2112
47
+ yasminaai/types/bad_request_error_body.py,sha256=de8eDyaFq8ZuFUTEdKLzg0qj2crO6MXiVhWG1ycO2nQ,591
48
+ yasminaai/types/benefit.py,sha256=vkyJU5zTYPkrf6JFRC7UKLvyoslOlxXJ1zhBguf-q6A,742
49
+ yasminaai/types/company_quote.py,sha256=XBRGqGRHveMYtSLy_sbz2AB-xPWJLfW_nepRNi0Y_vE,735
50
+ yasminaai/types/error.py,sha256=Lmx9JDEDjTzKFkFuo90zB4pkNQRGSHhdXp3zzRcxGvk,577
51
+ yasminaai/types/policy.py,sha256=xcA7Cc_rTZ3MYv2b4VEWaK9RhWhpsuYl5YZRTkcTZmE,1202
52
+ yasminaai/types/quote_price.py,sha256=u3_VL69vqki_4Rl-U2hQ5wkmkHyUrphzZpDZH1KIFRE,771
53
+ yasminaai/types/quote_response.py,sha256=2iKnLzVSt5knIQku24MiaL4eHqeH6f3IR-Cx6K3FZeM,2764
54
+ yasminaai/types/quote_response_drivers_item.py,sha256=M6nOICrbg8RW5BhEYzTHtoxGaugWcUrR17Ua6IBbAD4,971
55
+ yasminaai/types/quote_response_quotes_item.py,sha256=2yBLf9byq3J1v5tNgxYWtSYf3TLEuIqRAvkEEVsn33M,1063
56
+ yasminaai/types/unauthorized_error_body.py,sha256=GdMlvfvNZARGVTjXbaCSAmAcbE9X92J7Pkph6HbYQL4,593
57
+ yasminaai/version.py,sha256=-AnRkmNoAtTFG7W3hiL_Cd0EvQbpJCVs6T06E7TWRBQ,83
58
+ motor_python_sdk-0.0.2.dist-info/METADATA,sha256=FMnJe4hxgQbPmXsbIRjKpMwtcyoc0VZUr9C0QJrEoDY,7441
59
+ motor_python_sdk-0.0.2.dist-info/WHEEL,sha256=Zb28QaM1gQi8f4VCBhsUklF61CTlNYfs9YAZn-TOGFk,88
60
+ motor_python_sdk-0.0.2.dist-info/RECORD,,
@@ -0,0 +1,4 @@
1
+ Wheel-Version: 1.0
2
+ Generator: poetry-core 1.6.1
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
yasminaai/__init__.py ADDED
@@ -0,0 +1,113 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ # isort: skip_file
4
+
5
+ import typing
6
+ from importlib import import_module
7
+
8
+ if typing.TYPE_CHECKING:
9
+ from .types import (
10
+ BadRequestErrorBody,
11
+ Benefit,
12
+ CompanyQuote,
13
+ Error,
14
+ Policy,
15
+ QuotePrice,
16
+ QuoteResponse,
17
+ QuoteResponseDriversItem,
18
+ QuoteResponseQuotesItem,
19
+ UnauthorizedErrorBody,
20
+ )
21
+ from .errors import BadRequestError, NotFoundError, UnauthorizedError, UnprocessableEntityError
22
+ from . import ot_ps, policies, quotes
23
+ from ._default_clients import DefaultAioHttpClient, DefaultAsyncHttpxClient
24
+ from .client import AsyncYasminaaiApi, YasminaaiApi
25
+ from .environment import YasminaaiApiEnvironment
26
+ from .quotes import (
27
+ DeleteQuoteRequestsIdResponse,
28
+ GetQuoteRequestsResponse,
29
+ GetQuoteRequestsResponseLinksItem,
30
+ PostQuoteRequestsRequestDriversItem,
31
+ )
32
+ from .version import __version__
33
+ _dynamic_imports: typing.Dict[str, str] = {
34
+ "AsyncYasminaaiApi": ".client",
35
+ "BadRequestError": ".errors",
36
+ "BadRequestErrorBody": ".types",
37
+ "Benefit": ".types",
38
+ "CompanyQuote": ".types",
39
+ "DefaultAioHttpClient": "._default_clients",
40
+ "DefaultAsyncHttpxClient": "._default_clients",
41
+ "DeleteQuoteRequestsIdResponse": ".quotes",
42
+ "Error": ".types",
43
+ "GetQuoteRequestsResponse": ".quotes",
44
+ "GetQuoteRequestsResponseLinksItem": ".quotes",
45
+ "NotFoundError": ".errors",
46
+ "Policy": ".types",
47
+ "PostQuoteRequestsRequestDriversItem": ".quotes",
48
+ "QuotePrice": ".types",
49
+ "QuoteResponse": ".types",
50
+ "QuoteResponseDriversItem": ".types",
51
+ "QuoteResponseQuotesItem": ".types",
52
+ "UnauthorizedError": ".errors",
53
+ "UnauthorizedErrorBody": ".types",
54
+ "UnprocessableEntityError": ".errors",
55
+ "YasminaaiApi": ".client",
56
+ "YasminaaiApiEnvironment": ".environment",
57
+ "__version__": ".version",
58
+ "ot_ps": ".ot_ps",
59
+ "policies": ".policies",
60
+ "quotes": ".quotes",
61
+ }
62
+
63
+
64
+ def __getattr__(attr_name: str) -> typing.Any:
65
+ module_name = _dynamic_imports.get(attr_name)
66
+ if module_name is None:
67
+ raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}")
68
+ try:
69
+ module = import_module(module_name, __package__)
70
+ if module_name == f".{attr_name}":
71
+ return module
72
+ else:
73
+ return getattr(module, attr_name)
74
+ except ImportError as e:
75
+ raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e
76
+ except AttributeError as e:
77
+ raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e
78
+
79
+
80
+ def __dir__():
81
+ lazy_attrs = list(_dynamic_imports.keys())
82
+ return sorted(lazy_attrs)
83
+
84
+
85
+ __all__ = [
86
+ "AsyncYasminaaiApi",
87
+ "BadRequestError",
88
+ "BadRequestErrorBody",
89
+ "Benefit",
90
+ "CompanyQuote",
91
+ "DefaultAioHttpClient",
92
+ "DefaultAsyncHttpxClient",
93
+ "DeleteQuoteRequestsIdResponse",
94
+ "Error",
95
+ "GetQuoteRequestsResponse",
96
+ "GetQuoteRequestsResponseLinksItem",
97
+ "NotFoundError",
98
+ "Policy",
99
+ "PostQuoteRequestsRequestDriversItem",
100
+ "QuotePrice",
101
+ "QuoteResponse",
102
+ "QuoteResponseDriversItem",
103
+ "QuoteResponseQuotesItem",
104
+ "UnauthorizedError",
105
+ "UnauthorizedErrorBody",
106
+ "UnprocessableEntityError",
107
+ "YasminaaiApi",
108
+ "YasminaaiApiEnvironment",
109
+ "__version__",
110
+ "ot_ps",
111
+ "policies",
112
+ "quotes",
113
+ ]
@@ -0,0 +1,32 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import typing
4
+
5
+ import httpx
6
+
7
+ SDK_DEFAULT_TIMEOUT = 60
8
+
9
+ try:
10
+ import httpx_aiohttp # type: ignore[import-not-found]
11
+ except ImportError:
12
+
13
+ class DefaultAioHttpClient(httpx.AsyncClient): # type: ignore
14
+ def __init__(self, **kwargs: typing.Any) -> None:
15
+ raise RuntimeError(
16
+ "To use the aiohttp client, install the aiohttp extra: pip install motor-python-sdk[aiohttp]"
17
+ )
18
+
19
+ else:
20
+
21
+ class DefaultAioHttpClient(httpx_aiohttp.HttpxAiohttpClient): # type: ignore
22
+ def __init__(self, **kwargs: typing.Any) -> None:
23
+ kwargs.setdefault("timeout", SDK_DEFAULT_TIMEOUT)
24
+ kwargs.setdefault("follow_redirects", True)
25
+ super().__init__(**kwargs)
26
+
27
+
28
+ class DefaultAsyncHttpxClient(httpx.AsyncClient):
29
+ def __init__(self, **kwargs: typing.Any) -> None:
30
+ kwargs.setdefault("timeout", SDK_DEFAULT_TIMEOUT)
31
+ kwargs.setdefault("follow_redirects", True)
32
+ super().__init__(**kwargs)