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,33 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import datetime as dt
4
+ import typing
5
+
6
+ import pydantic
7
+ from ...core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
8
+
9
+
10
+ class PostQuoteRequestsRequestDriversItem(UniversalBaseModel):
11
+ owner_id: str = pydantic.Field()
12
+ """
13
+ Driver's national ID. Must be 10 digits starting with 1, 2, or 7.
14
+ """
15
+
16
+ birthdate: dt.date = pydantic.Field()
17
+ """
18
+ Driver's birthdate in YYYY-MM-DD format.
19
+ """
20
+
21
+ driving_percentage: int = pydantic.Field()
22
+ """
23
+ Percentage of driving for this driver. Valid values are 25, 50, 75, or 100. The sum of all drivers' percentages must equal 100.
24
+ """
25
+
26
+ if IS_PYDANTIC_V2:
27
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
28
+ else:
29
+
30
+ class Config:
31
+ frozen = True
32
+ smart_union = True
33
+ extra = pydantic.Extra.allow
@@ -0,0 +1,65 @@
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 .bad_request_error_body import BadRequestErrorBody
10
+ from .benefit import Benefit
11
+ from .company_quote import CompanyQuote
12
+ from .error import Error
13
+ from .policy import Policy
14
+ from .quote_price import QuotePrice
15
+ from .quote_response import QuoteResponse
16
+ from .quote_response_drivers_item import QuoteResponseDriversItem
17
+ from .quote_response_quotes_item import QuoteResponseQuotesItem
18
+ from .unauthorized_error_body import UnauthorizedErrorBody
19
+ _dynamic_imports: typing.Dict[str, str] = {
20
+ "BadRequestErrorBody": ".bad_request_error_body",
21
+ "Benefit": ".benefit",
22
+ "CompanyQuote": ".company_quote",
23
+ "Error": ".error",
24
+ "Policy": ".policy",
25
+ "QuotePrice": ".quote_price",
26
+ "QuoteResponse": ".quote_response",
27
+ "QuoteResponseDriversItem": ".quote_response_drivers_item",
28
+ "QuoteResponseQuotesItem": ".quote_response_quotes_item",
29
+ "UnauthorizedErrorBody": ".unauthorized_error_body",
30
+ }
31
+
32
+
33
+ def __getattr__(attr_name: str) -> typing.Any:
34
+ module_name = _dynamic_imports.get(attr_name)
35
+ if module_name is None:
36
+ raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}")
37
+ try:
38
+ module = import_module(module_name, __package__)
39
+ if module_name == f".{attr_name}":
40
+ return module
41
+ else:
42
+ return getattr(module, attr_name)
43
+ except ImportError as e:
44
+ raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e
45
+ except AttributeError as e:
46
+ raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e
47
+
48
+
49
+ def __dir__():
50
+ lazy_attrs = list(_dynamic_imports.keys())
51
+ return sorted(lazy_attrs)
52
+
53
+
54
+ __all__ = [
55
+ "BadRequestErrorBody",
56
+ "Benefit",
57
+ "CompanyQuote",
58
+ "Error",
59
+ "Policy",
60
+ "QuotePrice",
61
+ "QuoteResponse",
62
+ "QuoteResponseDriversItem",
63
+ "QuoteResponseQuotesItem",
64
+ "UnauthorizedErrorBody",
65
+ ]
@@ -0,0 +1,20 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import typing
4
+
5
+ import pydantic
6
+ from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
7
+
8
+
9
+ class BadRequestErrorBody(UniversalBaseModel):
10
+ code: typing.Optional[str] = None
11
+ message: typing.Optional[str] = None
12
+
13
+ if IS_PYDANTIC_V2:
14
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
15
+ else:
16
+
17
+ class Config:
18
+ frozen = True
19
+ smart_union = True
20
+ extra = pydantic.Extra.allow
@@ -0,0 +1,24 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import typing
4
+
5
+ import pydantic
6
+ from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
7
+
8
+
9
+ class Benefit(UniversalBaseModel):
10
+ quote_benefit_id: typing.Optional[str] = None
11
+ id: typing.Optional[str] = None
12
+ name: typing.Optional[str] = None
13
+ amount: typing.Optional[float] = None
14
+ vat: typing.Optional[float] = None
15
+ url: typing.Optional[str] = None
16
+
17
+ if IS_PYDANTIC_V2:
18
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
19
+ else:
20
+
21
+ class Config:
22
+ frozen = True
23
+ smart_union = True
24
+ extra = pydantic.Extra.allow
@@ -0,0 +1,23 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import typing
4
+
5
+ import pydantic
6
+ from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
7
+ from .benefit import Benefit
8
+ from .quote_price import QuotePrice
9
+
10
+
11
+ class CompanyQuote(UniversalBaseModel):
12
+ company_name: typing.Optional[str] = None
13
+ prices: typing.Optional[typing.List[QuotePrice]] = None
14
+ benefits: typing.Optional[typing.List[Benefit]] = None
15
+
16
+ if IS_PYDANTIC_V2:
17
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
18
+ else:
19
+
20
+ class Config:
21
+ frozen = True
22
+ smart_union = True
23
+ extra = pydantic.Extra.allow
@@ -0,0 +1,20 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import typing
4
+
5
+ import pydantic
6
+ from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
7
+
8
+
9
+ class Error(UniversalBaseModel):
10
+ code: typing.Optional[str] = None
11
+ message: typing.Optional[str] = None
12
+
13
+ if IS_PYDANTIC_V2:
14
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
15
+ else:
16
+
17
+ class Config:
18
+ frozen = True
19
+ smart_union = True
20
+ extra = pydantic.Extra.allow
@@ -0,0 +1,33 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import typing
4
+
5
+ import pydantic
6
+ from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
7
+
8
+
9
+ class Policy(UniversalBaseModel):
10
+ id: typing.Optional[int] = None
11
+ meta_data: typing.Optional[typing.Dict[str, typing.Any]] = None
12
+ start_date: typing.Optional[str] = None
13
+ provider_policy_id: typing.Optional[int] = None
14
+ provider_policy: typing.Optional[str] = None
15
+ order_status: typing.Optional[int] = None
16
+ approval_status: typing.Optional[int] = None
17
+ end_date: typing.Optional[str] = None
18
+ is_claimed: typing.Optional[bool] = None
19
+ created_at: typing.Optional[str] = None
20
+ updated_at: typing.Optional[str] = None
21
+ client_id: typing.Optional[str] = None
22
+ canceled_at: typing.Optional[str] = None
23
+ invoice: typing.Optional[str] = None
24
+ cancellation_document: typing.Optional[str] = None
25
+
26
+ if IS_PYDANTIC_V2:
27
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
28
+ else:
29
+
30
+ class Config:
31
+ frozen = True
32
+ smart_union = True
33
+ extra = pydantic.Extra.allow
@@ -0,0 +1,24 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import typing
4
+
5
+ import pydantic
6
+ from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
7
+
8
+
9
+ class QuotePrice(UniversalBaseModel):
10
+ quote_price_id: typing.Optional[str] = None
11
+ deductible: typing.Optional[float] = None
12
+ subtotal: typing.Optional[float] = None
13
+ vat_percentage: typing.Optional[float] = None
14
+ vat: typing.Optional[float] = None
15
+ total: typing.Optional[float] = None
16
+
17
+ if IS_PYDANTIC_V2:
18
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
19
+ else:
20
+
21
+ class Config:
22
+ frozen = True
23
+ smart_union = True
24
+ extra = pydantic.Extra.allow
@@ -0,0 +1,90 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import datetime as dt
4
+ import typing
5
+
6
+ import pydantic
7
+ from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
8
+ from .quote_response_drivers_item import QuoteResponseDriversItem
9
+ from .quote_response_quotes_item import QuoteResponseQuotesItem
10
+
11
+
12
+ class QuoteResponse(UniversalBaseModel):
13
+ owner_id: typing.Optional[int] = pydantic.Field(default=None)
14
+ """
15
+ The owner’s national ID or Iqama ID
16
+ """
17
+
18
+ phone: typing.Optional[str] = pydantic.Field(default=None)
19
+ """
20
+ The owner's phone number
21
+ """
22
+
23
+ birthdate: typing.Optional[dt.date] = pydantic.Field(default=None)
24
+ """
25
+ The owner's birthdate. Hijri for Saudi nationals, Gregorian for others
26
+ """
27
+
28
+ car_sequence_number: typing.Optional[int] = pydantic.Field(default=None)
29
+ """
30
+ The car sequence number from 9 digits
31
+ """
32
+
33
+ is_ownership_transfer: typing.Optional[bool] = pydantic.Field(default=None)
34
+ """
35
+ Whether it was a car transfer or not
36
+ """
37
+
38
+ car_estimated_cost: typing.Optional[float] = pydantic.Field(default=None)
39
+ """
40
+ The estimated cost of the car
41
+ """
42
+
43
+ car_model_year: typing.Optional[int] = pydantic.Field(default=None)
44
+ """
45
+ The car model year
46
+ """
47
+
48
+ start_date: typing.Optional[dt.date] = pydantic.Field(default=None)
49
+ """
50
+ Requested policy start date in YYYY-MM-DD. Returned if provided in the quote request.
51
+ """
52
+
53
+ drivers: typing.Optional[typing.List[QuoteResponseDriversItem]] = pydantic.Field(default=None)
54
+ """
55
+ List of drivers associated with this quote request. Returned if drivers were provided in the request.
56
+ """
57
+
58
+ quotes: typing.Optional[typing.List[QuoteResponseQuotesItem]] = pydantic.Field(default=None)
59
+ """
60
+ An array representing each insurance company quote. Each item has the company name, the prices, and the benefits.
61
+ """
62
+
63
+ client_id: typing.Optional[str] = pydantic.Field(default=None)
64
+ """
65
+ Your own client ID
66
+ """
67
+
68
+ updated_at: typing.Optional[dt.datetime] = pydantic.Field(default=None)
69
+ """
70
+ In case of an update on this quote, this date will change
71
+ """
72
+
73
+ created_at: typing.Optional[dt.datetime] = pydantic.Field(default=None)
74
+ """
75
+ When was the quote requested
76
+ """
77
+
78
+ id: typing.Optional[int] = pydantic.Field(default=None)
79
+ """
80
+ Yasmina ID for the quote. You can use it to delete items or showing it again to the customer
81
+ """
82
+
83
+ if IS_PYDANTIC_V2:
84
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
85
+ else:
86
+
87
+ class Config:
88
+ frozen = True
89
+ smart_union = True
90
+ extra = pydantic.Extra.allow
@@ -0,0 +1,33 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import datetime as dt
4
+ import typing
5
+
6
+ import pydantic
7
+ from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
8
+
9
+
10
+ class QuoteResponseDriversItem(UniversalBaseModel):
11
+ owner_id: typing.Optional[str] = pydantic.Field(default=None)
12
+ """
13
+ Driver's national ID (10 digits starting with 1, 2, or 7)
14
+ """
15
+
16
+ birthdate: typing.Optional[dt.date] = pydantic.Field(default=None)
17
+ """
18
+ Driver's birthdate in YYYY-MM-DD format
19
+ """
20
+
21
+ driving_percentage: typing.Optional[int] = pydantic.Field(default=None)
22
+ """
23
+ Percentage of driving for this driver (25, 50, 75, or 100)
24
+ """
25
+
26
+ if IS_PYDANTIC_V2:
27
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
28
+ else:
29
+
30
+ class Config:
31
+ frozen = True
32
+ smart_union = True
33
+ extra = pydantic.Extra.allow
@@ -0,0 +1,30 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import typing
4
+
5
+ import pydantic
6
+ from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
7
+ from .benefit import Benefit
8
+ from .quote_price import QuotePrice
9
+
10
+
11
+ class QuoteResponseQuotesItem(UniversalBaseModel):
12
+ company_name: typing.Optional[str] = None
13
+ prices: typing.Optional[typing.List[QuotePrice]] = pydantic.Field(default=None)
14
+ """
15
+ An array representing each price. This will have the premium and the deductible
16
+ """
17
+
18
+ benefits: typing.Optional[typing.List[Benefit]] = pydantic.Field(default=None)
19
+ """
20
+ An array representing the different benefits offered by the company. Some of them are free and comes with the insurance, some are paid and optional
21
+ """
22
+
23
+ if IS_PYDANTIC_V2:
24
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
25
+ else:
26
+
27
+ class Config:
28
+ frozen = True
29
+ smart_union = True
30
+ extra = pydantic.Extra.allow
@@ -0,0 +1,20 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import typing
4
+
5
+ import pydantic
6
+ from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
7
+
8
+
9
+ class UnauthorizedErrorBody(UniversalBaseModel):
10
+ code: typing.Optional[str] = None
11
+ message: typing.Optional[str] = None
12
+
13
+ if IS_PYDANTIC_V2:
14
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
15
+ else:
16
+
17
+ class Config:
18
+ frozen = True
19
+ smart_union = True
20
+ extra = pydantic.Extra.allow
yasminaai/version.py ADDED
@@ -0,0 +1,3 @@
1
+ from importlib import metadata
2
+
3
+ __version__ = metadata.version("motor-python-sdk")