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,393 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import typing
4
+
5
+ from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
6
+ from ..core.request_options import RequestOptions
7
+ from ..types.policy import Policy
8
+ from .raw_client import AsyncRawPoliciesClient, RawPoliciesClient
9
+
10
+ # this is used as the default value for optional parameters
11
+ OMIT = typing.cast(typing.Any, ...)
12
+
13
+
14
+ class PoliciesClient:
15
+ def __init__(self, *, client_wrapper: SyncClientWrapper):
16
+ self._raw_client = RawPoliciesClient(client_wrapper=client_wrapper)
17
+
18
+ @property
19
+ def with_raw_response(self) -> RawPoliciesClient:
20
+ """
21
+ Retrieves a raw implementation of this client that returns raw responses.
22
+
23
+ Returns
24
+ -------
25
+ RawPoliciesClient
26
+ """
27
+ return self._raw_client
28
+
29
+ def show_policy(self, car_policy: int, *, request_options: typing.Optional[RequestOptions] = None) -> Policy:
30
+ """
31
+ Show a specific policy
32
+
33
+ Parameters
34
+ ----------
35
+ car_policy : int
36
+
37
+ request_options : typing.Optional[RequestOptions]
38
+ Request-specific configuration.
39
+
40
+ Returns
41
+ -------
42
+ Policy
43
+ Success
44
+
45
+ Examples
46
+ --------
47
+ from yasminaai import YasminaaiApi
48
+
49
+ client = YasminaaiApi(
50
+ token="YOUR_TOKEN",
51
+ )
52
+ client.policies.show_policy(
53
+ car_policy=1,
54
+ )
55
+ """
56
+ _response = self._raw_client.show_policy(car_policy, request_options=request_options)
57
+ return _response.data
58
+
59
+ def list_policies(
60
+ self,
61
+ *,
62
+ quote_request_id: typing.Optional[int] = None,
63
+ quote_price_id: typing.Optional[str] = None,
64
+ provider_policy_id: typing.Optional[int] = None,
65
+ car_sequence_number: typing.Optional[str] = None,
66
+ new_owner_id: typing.Optional[str] = None,
67
+ previous_owner_id: typing.Optional[str] = None,
68
+ status: typing.Optional[int] = None,
69
+ min_price: typing.Optional[float] = None,
70
+ max_price: typing.Optional[float] = None,
71
+ per_page: typing.Optional[int] = None,
72
+ request_options: typing.Optional[RequestOptions] = None,
73
+ ) -> typing.List[Policy]:
74
+ """
75
+ Listing requested policies
76
+
77
+ Parameters
78
+ ----------
79
+ quote_request_id : typing.Optional[int]
80
+
81
+ quote_price_id : typing.Optional[str]
82
+
83
+ provider_policy_id : typing.Optional[int]
84
+
85
+ car_sequence_number : typing.Optional[str]
86
+
87
+ new_owner_id : typing.Optional[str]
88
+
89
+ previous_owner_id : typing.Optional[str]
90
+
91
+ status : typing.Optional[int]
92
+
93
+ min_price : typing.Optional[float]
94
+
95
+ max_price : typing.Optional[float]
96
+
97
+ per_page : typing.Optional[int]
98
+
99
+ request_options : typing.Optional[RequestOptions]
100
+ Request-specific configuration.
101
+
102
+ Returns
103
+ -------
104
+ typing.List[Policy]
105
+ Success
106
+
107
+ Examples
108
+ --------
109
+ from yasminaai import YasminaaiApi
110
+
111
+ client = YasminaaiApi(
112
+ token="YOUR_TOKEN",
113
+ )
114
+ client.policies.list_policies()
115
+ """
116
+ _response = self._raw_client.list_policies(
117
+ quote_request_id=quote_request_id,
118
+ quote_price_id=quote_price_id,
119
+ provider_policy_id=provider_policy_id,
120
+ car_sequence_number=car_sequence_number,
121
+ new_owner_id=new_owner_id,
122
+ previous_owner_id=previous_owner_id,
123
+ status=status,
124
+ min_price=min_price,
125
+ max_price=max_price,
126
+ per_page=per_page,
127
+ request_options=request_options,
128
+ )
129
+ return _response.data
130
+
131
+ def issue_policy(
132
+ self,
133
+ *,
134
+ quote_request_id: int,
135
+ quote_reference_id: str,
136
+ quote_price_id: str,
137
+ benefits: typing.Optional[typing.Sequence[str]] = OMIT,
138
+ extra_fields: typing.Optional[typing.Dict[str, typing.Any]] = OMIT,
139
+ request_options: typing.Optional[RequestOptions] = None,
140
+ ) -> Policy:
141
+ """
142
+ For issuing a new policy
143
+
144
+ Parameters
145
+ ----------
146
+ quote_request_id : int
147
+ ID of the car quote request
148
+
149
+ quote_reference_id : str
150
+ Unique identifier for the quote reference ID (coming from POST /quote-requests)
151
+
152
+ quote_price_id : str
153
+ Unique identifier for the quote price ID that exists inside a quote item (coming from POST /quote-requests)
154
+
155
+ benefits : typing.Optional[typing.Sequence[str]]
156
+ List of benefit UUIDs
157
+
158
+ extra_fields : typing.Optional[typing.Dict[str, typing.Any]]
159
+ Optional free-form object with additional fields. Total JSON-encoded size must not exceed 255 characters.
160
+
161
+ request_options : typing.Optional[RequestOptions]
162
+ Request-specific configuration.
163
+
164
+ Returns
165
+ -------
166
+ Policy
167
+ Created
168
+
169
+ Examples
170
+ --------
171
+ from yasminaai import YasminaaiApi
172
+
173
+ client = YasminaaiApi(
174
+ token="YOUR_TOKEN",
175
+ )
176
+ client.policies.issue_policy(
177
+ quote_request_id=123,
178
+ quote_reference_id="550e8400-e29b-41d4-a716-446655440000",
179
+ quote_price_id="550e8400-e29b-41d4-a716-446655440001",
180
+ )
181
+ """
182
+ _response = self._raw_client.issue_policy(
183
+ quote_request_id=quote_request_id,
184
+ quote_reference_id=quote_reference_id,
185
+ quote_price_id=quote_price_id,
186
+ benefits=benefits,
187
+ extra_fields=extra_fields,
188
+ request_options=request_options,
189
+ )
190
+ return _response.data
191
+
192
+
193
+ class AsyncPoliciesClient:
194
+ def __init__(self, *, client_wrapper: AsyncClientWrapper):
195
+ self._raw_client = AsyncRawPoliciesClient(client_wrapper=client_wrapper)
196
+
197
+ @property
198
+ def with_raw_response(self) -> AsyncRawPoliciesClient:
199
+ """
200
+ Retrieves a raw implementation of this client that returns raw responses.
201
+
202
+ Returns
203
+ -------
204
+ AsyncRawPoliciesClient
205
+ """
206
+ return self._raw_client
207
+
208
+ async def show_policy(self, car_policy: int, *, request_options: typing.Optional[RequestOptions] = None) -> Policy:
209
+ """
210
+ Show a specific policy
211
+
212
+ Parameters
213
+ ----------
214
+ car_policy : int
215
+
216
+ request_options : typing.Optional[RequestOptions]
217
+ Request-specific configuration.
218
+
219
+ Returns
220
+ -------
221
+ Policy
222
+ Success
223
+
224
+ Examples
225
+ --------
226
+ import asyncio
227
+
228
+ from yasminaai import AsyncYasminaaiApi
229
+
230
+ client = AsyncYasminaaiApi(
231
+ token="YOUR_TOKEN",
232
+ )
233
+
234
+
235
+ async def main() -> None:
236
+ await client.policies.show_policy(
237
+ car_policy=1,
238
+ )
239
+
240
+
241
+ asyncio.run(main())
242
+ """
243
+ _response = await self._raw_client.show_policy(car_policy, request_options=request_options)
244
+ return _response.data
245
+
246
+ async def list_policies(
247
+ self,
248
+ *,
249
+ quote_request_id: typing.Optional[int] = None,
250
+ quote_price_id: typing.Optional[str] = None,
251
+ provider_policy_id: typing.Optional[int] = None,
252
+ car_sequence_number: typing.Optional[str] = None,
253
+ new_owner_id: typing.Optional[str] = None,
254
+ previous_owner_id: typing.Optional[str] = None,
255
+ status: typing.Optional[int] = None,
256
+ min_price: typing.Optional[float] = None,
257
+ max_price: typing.Optional[float] = None,
258
+ per_page: typing.Optional[int] = None,
259
+ request_options: typing.Optional[RequestOptions] = None,
260
+ ) -> typing.List[Policy]:
261
+ """
262
+ Listing requested policies
263
+
264
+ Parameters
265
+ ----------
266
+ quote_request_id : typing.Optional[int]
267
+
268
+ quote_price_id : typing.Optional[str]
269
+
270
+ provider_policy_id : typing.Optional[int]
271
+
272
+ car_sequence_number : typing.Optional[str]
273
+
274
+ new_owner_id : typing.Optional[str]
275
+
276
+ previous_owner_id : typing.Optional[str]
277
+
278
+ status : typing.Optional[int]
279
+
280
+ min_price : typing.Optional[float]
281
+
282
+ max_price : typing.Optional[float]
283
+
284
+ per_page : typing.Optional[int]
285
+
286
+ request_options : typing.Optional[RequestOptions]
287
+ Request-specific configuration.
288
+
289
+ Returns
290
+ -------
291
+ typing.List[Policy]
292
+ Success
293
+
294
+ Examples
295
+ --------
296
+ import asyncio
297
+
298
+ from yasminaai import AsyncYasminaaiApi
299
+
300
+ client = AsyncYasminaaiApi(
301
+ token="YOUR_TOKEN",
302
+ )
303
+
304
+
305
+ async def main() -> None:
306
+ await client.policies.list_policies()
307
+
308
+
309
+ asyncio.run(main())
310
+ """
311
+ _response = await self._raw_client.list_policies(
312
+ quote_request_id=quote_request_id,
313
+ quote_price_id=quote_price_id,
314
+ provider_policy_id=provider_policy_id,
315
+ car_sequence_number=car_sequence_number,
316
+ new_owner_id=new_owner_id,
317
+ previous_owner_id=previous_owner_id,
318
+ status=status,
319
+ min_price=min_price,
320
+ max_price=max_price,
321
+ per_page=per_page,
322
+ request_options=request_options,
323
+ )
324
+ return _response.data
325
+
326
+ async def issue_policy(
327
+ self,
328
+ *,
329
+ quote_request_id: int,
330
+ quote_reference_id: str,
331
+ quote_price_id: str,
332
+ benefits: typing.Optional[typing.Sequence[str]] = OMIT,
333
+ extra_fields: typing.Optional[typing.Dict[str, typing.Any]] = OMIT,
334
+ request_options: typing.Optional[RequestOptions] = None,
335
+ ) -> Policy:
336
+ """
337
+ For issuing a new policy
338
+
339
+ Parameters
340
+ ----------
341
+ quote_request_id : int
342
+ ID of the car quote request
343
+
344
+ quote_reference_id : str
345
+ Unique identifier for the quote reference ID (coming from POST /quote-requests)
346
+
347
+ quote_price_id : str
348
+ Unique identifier for the quote price ID that exists inside a quote item (coming from POST /quote-requests)
349
+
350
+ benefits : typing.Optional[typing.Sequence[str]]
351
+ List of benefit UUIDs
352
+
353
+ extra_fields : typing.Optional[typing.Dict[str, typing.Any]]
354
+ Optional free-form object with additional fields. Total JSON-encoded size must not exceed 255 characters.
355
+
356
+ request_options : typing.Optional[RequestOptions]
357
+ Request-specific configuration.
358
+
359
+ Returns
360
+ -------
361
+ Policy
362
+ Created
363
+
364
+ Examples
365
+ --------
366
+ import asyncio
367
+
368
+ from yasminaai import AsyncYasminaaiApi
369
+
370
+ client = AsyncYasminaaiApi(
371
+ token="YOUR_TOKEN",
372
+ )
373
+
374
+
375
+ async def main() -> None:
376
+ await client.policies.issue_policy(
377
+ quote_request_id=123,
378
+ quote_reference_id="550e8400-e29b-41d4-a716-446655440000",
379
+ quote_price_id="550e8400-e29b-41d4-a716-446655440001",
380
+ )
381
+
382
+
383
+ asyncio.run(main())
384
+ """
385
+ _response = await self._raw_client.issue_policy(
386
+ quote_request_id=quote_request_id,
387
+ quote_reference_id=quote_reference_id,
388
+ quote_price_id=quote_price_id,
389
+ benefits=benefits,
390
+ extra_fields=extra_fields,
391
+ request_options=request_options,
392
+ )
393
+ return _response.data