turquoisehealth-api 3.2.59__tar.gz

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 (95) hide show
  1. turquoisehealth_api-3.2.59/.fern/metadata.json +10 -0
  2. turquoisehealth_api-3.2.59/.fernignore +14 -0
  3. turquoisehealth_api-3.2.59/.gitignore +29 -0
  4. turquoisehealth_api-3.2.59/PKG-INFO +10 -0
  5. turquoisehealth_api-3.2.59/__init__.py +238 -0
  6. turquoisehealth_api-3.2.59/client.py +139 -0
  7. turquoisehealth_api-3.2.59/consumer_pricing/__init__.py +58 -0
  8. turquoisehealth_api-3.2.59/consumer_pricing/client.py +1476 -0
  9. turquoisehealth_api-3.2.59/consumer_pricing/raw_client.py +3143 -0
  10. turquoisehealth_api-3.2.59/consumer_pricing/types/__init__.py +60 -0
  11. turquoisehealth_api-3.2.59/consumer_pricing/types/v3prices_compare_request_pricing.py +42 -0
  12. turquoisehealth_api-3.2.59/consumer_pricing/types/v3prices_query_request_pricing.py +42 -0
  13. turquoisehealth_api-3.2.59/consumer_pricing/types/v3prices_query_request_sort_direction.py +5 -0
  14. turquoisehealth_api-3.2.59/core/__init__.py +105 -0
  15. turquoisehealth_api-3.2.59/core/api_error.py +23 -0
  16. turquoisehealth_api-3.2.59/core/client_wrapper.py +92 -0
  17. turquoisehealth_api-3.2.59/core/datetime_utils.py +28 -0
  18. turquoisehealth_api-3.2.59/core/file.py +67 -0
  19. turquoisehealth_api-3.2.59/core/force_multipart.py +18 -0
  20. turquoisehealth_api-3.2.59/core/http_client.py +640 -0
  21. turquoisehealth_api-3.2.59/core/http_response.py +55 -0
  22. turquoisehealth_api-3.2.59/core/http_sse/__init__.py +42 -0
  23. turquoisehealth_api-3.2.59/core/http_sse/_api.py +112 -0
  24. turquoisehealth_api-3.2.59/core/http_sse/_decoders.py +61 -0
  25. turquoisehealth_api-3.2.59/core/http_sse/_exceptions.py +7 -0
  26. turquoisehealth_api-3.2.59/core/http_sse/_models.py +17 -0
  27. turquoisehealth_api-3.2.59/core/jsonable_encoder.py +100 -0
  28. turquoisehealth_api-3.2.59/core/pydantic_utilities.py +260 -0
  29. turquoisehealth_api-3.2.59/core/query_encoder.py +58 -0
  30. turquoisehealth_api-3.2.59/core/remove_none_from_dict.py +11 -0
  31. turquoisehealth_api-3.2.59/core/request_options.py +35 -0
  32. turquoisehealth_api-3.2.59/core/serialization.py +276 -0
  33. turquoisehealth_api-3.2.59/errors/__init__.py +50 -0
  34. turquoisehealth_api-3.2.59/errors/bad_request_error.py +11 -0
  35. turquoisehealth_api-3.2.59/errors/internal_server_error.py +11 -0
  36. turquoisehealth_api-3.2.59/errors/not_found_error.py +11 -0
  37. turquoisehealth_api-3.2.59/errors/too_many_requests_error.py +11 -0
  38. turquoisehealth_api-3.2.59/errors/unprocessable_entity_error.py +11 -0
  39. turquoisehealth_api-3.2.59/lib/__init__.py +8 -0
  40. turquoisehealth_api-3.2.59/lib/api_auth_handler.py +255 -0
  41. turquoisehealth_api-3.2.59/pyproject.toml +30 -0
  42. turquoisehealth_api-3.2.59/tests/__init__.py +1 -0
  43. turquoisehealth_api-3.2.59/tests/requirements-test.txt +3 -0
  44. turquoisehealth_api-3.2.59/tests/test_integration.py +126 -0
  45. turquoisehealth_api-3.2.59/types/__init__.py +185 -0
  46. turquoisehealth_api-3.2.59/types/consumer_pricing_v2error_code.py +22 -0
  47. turquoisehealth_api-3.2.59/types/v3billing_code.py +33 -0
  48. turquoisehealth_api-3.2.59/types/v3comparison_stats.py +25 -0
  49. turquoisehealth_api-3.2.59/types/v3consumer_pricing_v2error_code.py +22 -0
  50. turquoisehealth_api-3.2.59/types/v3entity_ref.py +35 -0
  51. turquoisehealth_api-3.2.59/types/v3error_code.py +20 -0
  52. turquoisehealth_api-3.2.59/types/v3error_payload.py +48 -0
  53. turquoisehealth_api-3.2.59/types/v3error_response.py +20 -0
  54. turquoisehealth_api-3.2.59/types/v3line_item.py +46 -0
  55. turquoisehealth_api-3.2.59/types/v3list_envelope_line_item.py +34 -0
  56. turquoisehealth_api-3.2.59/types/v3list_envelope_line_item_object.py +5 -0
  57. turquoisehealth_api-3.2.59/types/v3list_envelope_network.py +34 -0
  58. turquoisehealth_api-3.2.59/types/v3list_envelope_network_object.py +5 -0
  59. turquoisehealth_api-3.2.59/types/v3list_envelope_package.py +34 -0
  60. turquoisehealth_api-3.2.59/types/v3list_envelope_package_object.py +5 -0
  61. turquoisehealth_api-3.2.59/types/v3list_envelope_payer.py +34 -0
  62. turquoisehealth_api-3.2.59/types/v3list_envelope_payer_object.py +5 -0
  63. turquoisehealth_api-3.2.59/types/v3list_envelope_provider.py +34 -0
  64. turquoisehealth_api-3.2.59/types/v3list_envelope_provider_object.py +5 -0
  65. turquoisehealth_api-3.2.59/types/v3list_envelope_provider_package_price.py +34 -0
  66. turquoisehealth_api-3.2.59/types/v3list_envelope_provider_package_price_object.py +5 -0
  67. turquoisehealth_api-3.2.59/types/v3location.py +30 -0
  68. turquoisehealth_api-3.2.59/types/v3location_near.py +32 -0
  69. turquoisehealth_api-3.2.59/types/v3location_within.py +36 -0
  70. turquoisehealth_api-3.2.59/types/v3match_context.py +31 -0
  71. turquoisehealth_api-3.2.59/types/v3money.py +36 -0
  72. turquoisehealth_api-3.2.59/types/v3network.py +41 -0
  73. turquoisehealth_api-3.2.59/types/v3network_object.py +5 -0
  74. turquoisehealth_api-3.2.59/types/v3no_data_reason.py +5 -0
  75. turquoisehealth_api-3.2.59/types/v3package.py +53 -0
  76. turquoisehealth_api-3.2.59/types/v3package_object.py +5 -0
  77. turquoisehealth_api-3.2.59/types/v3package_type.py +5 -0
  78. turquoisehealth_api-3.2.59/types/v3page_meta.py +32 -0
  79. turquoisehealth_api-3.2.59/types/v3payer.py +35 -0
  80. turquoisehealth_api-3.2.59/types/v3payer_object.py +5 -0
  81. turquoisehealth_api-3.2.59/types/v3price_comparison.py +34 -0
  82. turquoisehealth_api-3.2.59/types/v3price_comparison_object.py +5 -0
  83. turquoisehealth_api-3.2.59/types/v3price_expand.py +5 -0
  84. turquoisehealth_api-3.2.59/types/v3price_sort.py +5 -0
  85. turquoisehealth_api-3.2.59/types/v3pricing_cash.py +17 -0
  86. turquoisehealth_api-3.2.59/types/v3pricing_negotiated.py +22 -0
  87. turquoisehealth_api-3.2.59/types/v3pricing_resolved.py +28 -0
  88. turquoisehealth_api-3.2.59/types/v3pricing_resolved_type.py +5 -0
  89. turquoisehealth_api-3.2.59/types/v3provider.py +47 -0
  90. turquoisehealth_api-3.2.59/types/v3provider_address.py +42 -0
  91. turquoisehealth_api-3.2.59/types/v3provider_object.py +5 -0
  92. turquoisehealth_api-3.2.59/types/v3provider_package_price.py +53 -0
  93. turquoisehealth_api-3.2.59/types/v3provider_package_price_object.py +5 -0
  94. turquoisehealth_api-3.2.59/types/v3response_meta.py +22 -0
  95. turquoisehealth_api-3.2.59/types/v3search_context.py +26 -0
@@ -0,0 +1,10 @@
1
+ {
2
+ "cliVersion": "5.45.3",
3
+ "generatorName": "fernapi/fern-python-sdk",
4
+ "generatorVersion": "4.46.3",
5
+ "generatorConfig": {
6
+ "package_name": "turquoisehealth-api",
7
+ "client_class_name": "TurquoiseHealth"
8
+ },
9
+ "originGitCommit": "0b38fe94ddca81e6b36d1a7c6ac445a290bf01f7"
10
+ }
@@ -0,0 +1,14 @@
1
+ # Fern ignore file - prevents Fern from deleting custom/manual code
2
+ # Add paths relative to the output directory that should not be deleted during generation
3
+
4
+ # Protect manually-coded library directories
5
+ lib/
6
+ lib/**
7
+
8
+ # Protect integration tests
9
+ tests/
10
+ tests/**
11
+
12
+ # Protect packaging manifest (Fern's local-file-system output does
13
+ # not generate a pyproject.toml)
14
+ pyproject.toml
@@ -0,0 +1,29 @@
1
+ # Generated by Fern — committed intentionally for browsability
2
+ # python/
3
+ # typescript/
4
+ # csharp/
5
+
6
+ # Python
7
+ __pycache__/
8
+ *.py[cod]
9
+ *.egg-info/
10
+ dist/
11
+ build/
12
+ .venv/
13
+ venv/
14
+ .env
15
+
16
+ # TypeScript
17
+ node_modules/
18
+ *.tsbuildinfo
19
+
20
+ # C#
21
+ bin/
22
+ obj/
23
+ *.user
24
+ *.suo
25
+ .vs/
26
+
27
+ # OS
28
+ .DS_Store
29
+ Thumbs.db
@@ -0,0 +1,10 @@
1
+ Metadata-Version: 2.4
2
+ Name: turquoisehealth-api
3
+ Version: 3.2.59
4
+ Summary: Official Python client for the Turquoise Health Consumer Pricing API
5
+ Project-URL: Repository, https://github.com/turquoisehealth/turquoise-api-client
6
+ License-Expression: MIT
7
+ Requires-Python: >=3.8
8
+ Requires-Dist: httpx>=0.21.2
9
+ Requires-Dist: pydantic>=1.9.2
10
+ Requires-Dist: typing-extensions>=4.0.0
@@ -0,0 +1,238 @@
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
+ ConsumerPricingV2ErrorCode,
11
+ V3BillingCode,
12
+ V3ComparisonStats,
13
+ V3ConsumerPricingV2ErrorCode,
14
+ V3EntityRef,
15
+ V3ErrorCode,
16
+ V3ErrorPayload,
17
+ V3ErrorResponse,
18
+ V3LineItem,
19
+ V3ListEnvelopeLineItem,
20
+ V3ListEnvelopeLineItemObject,
21
+ V3ListEnvelopeNetwork,
22
+ V3ListEnvelopeNetworkObject,
23
+ V3ListEnvelopePackage,
24
+ V3ListEnvelopePackageObject,
25
+ V3ListEnvelopePayer,
26
+ V3ListEnvelopePayerObject,
27
+ V3ListEnvelopeProvider,
28
+ V3ListEnvelopeProviderObject,
29
+ V3ListEnvelopeProviderPackagePrice,
30
+ V3ListEnvelopeProviderPackagePriceObject,
31
+ V3Location,
32
+ V3LocationNear,
33
+ V3LocationWithin,
34
+ V3MatchContext,
35
+ V3Money,
36
+ V3Network,
37
+ V3NetworkObject,
38
+ V3NoDataReason,
39
+ V3Package,
40
+ V3PackageObject,
41
+ V3PackageType,
42
+ V3PageMeta,
43
+ V3Payer,
44
+ V3PayerObject,
45
+ V3PriceComparison,
46
+ V3PriceComparisonObject,
47
+ V3PriceExpand,
48
+ V3PriceSort,
49
+ V3PricingCash,
50
+ V3PricingNegotiated,
51
+ V3PricingResolved,
52
+ V3PricingResolvedType,
53
+ V3Provider,
54
+ V3ProviderAddress,
55
+ V3ProviderObject,
56
+ V3ProviderPackagePrice,
57
+ V3ProviderPackagePriceObject,
58
+ V3ResponseMeta,
59
+ V3SearchContext,
60
+ )
61
+ from .errors import (
62
+ BadRequestError,
63
+ InternalServerError,
64
+ NotFoundError,
65
+ TooManyRequestsError,
66
+ UnprocessableEntityError,
67
+ )
68
+ from . import consumer_pricing
69
+ from .client import AsyncTurquoiseHealth, TurquoiseHealth
70
+ from .consumer_pricing import (
71
+ V3PricesCompareRequestPricing,
72
+ V3PricesCompareRequestPricing_Cash,
73
+ V3PricesCompareRequestPricing_Negotiated,
74
+ V3PricesQueryRequestPricing,
75
+ V3PricesQueryRequestPricing_Cash,
76
+ V3PricesQueryRequestPricing_Negotiated,
77
+ V3PricesQueryRequestSortDirection,
78
+ )
79
+ _dynamic_imports: typing.Dict[str, str] = {
80
+ "APIAuthHandler": ".lib",
81
+ "AsyncTurquoiseHealth": ".client",
82
+ "BadRequestError": ".errors",
83
+ "ConsumerPricingV2ErrorCode": ".types",
84
+ "InternalServerError": ".errors",
85
+ "NotFoundError": ".errors",
86
+ "TooManyRequestsError": ".errors",
87
+ "TurquoiseHealth": ".client",
88
+ "UnprocessableEntityError": ".errors",
89
+ "V3BillingCode": ".types",
90
+ "V3ComparisonStats": ".types",
91
+ "V3ConsumerPricingV2ErrorCode": ".types",
92
+ "V3EntityRef": ".types",
93
+ "V3ErrorCode": ".types",
94
+ "V3ErrorPayload": ".types",
95
+ "V3ErrorResponse": ".types",
96
+ "V3LineItem": ".types",
97
+ "V3ListEnvelopeLineItem": ".types",
98
+ "V3ListEnvelopeLineItemObject": ".types",
99
+ "V3ListEnvelopeNetwork": ".types",
100
+ "V3ListEnvelopeNetworkObject": ".types",
101
+ "V3ListEnvelopePackage": ".types",
102
+ "V3ListEnvelopePackageObject": ".types",
103
+ "V3ListEnvelopePayer": ".types",
104
+ "V3ListEnvelopePayerObject": ".types",
105
+ "V3ListEnvelopeProvider": ".types",
106
+ "V3ListEnvelopeProviderObject": ".types",
107
+ "V3ListEnvelopeProviderPackagePrice": ".types",
108
+ "V3ListEnvelopeProviderPackagePriceObject": ".types",
109
+ "V3Location": ".types",
110
+ "V3LocationNear": ".types",
111
+ "V3LocationWithin": ".types",
112
+ "V3MatchContext": ".types",
113
+ "V3Money": ".types",
114
+ "V3Network": ".types",
115
+ "V3NetworkObject": ".types",
116
+ "V3NoDataReason": ".types",
117
+ "V3Package": ".types",
118
+ "V3PackageObject": ".types",
119
+ "V3PackageType": ".types",
120
+ "V3PageMeta": ".types",
121
+ "V3Payer": ".types",
122
+ "V3PayerObject": ".types",
123
+ "V3PriceComparison": ".types",
124
+ "V3PriceComparisonObject": ".types",
125
+ "V3PriceExpand": ".types",
126
+ "V3PriceSort": ".types",
127
+ "V3PricesCompareRequestPricing": ".consumer_pricing",
128
+ "V3PricesCompareRequestPricing_Cash": ".consumer_pricing",
129
+ "V3PricesCompareRequestPricing_Negotiated": ".consumer_pricing",
130
+ "V3PricesQueryRequestPricing": ".consumer_pricing",
131
+ "V3PricesQueryRequestPricing_Cash": ".consumer_pricing",
132
+ "V3PricesQueryRequestPricing_Negotiated": ".consumer_pricing",
133
+ "V3PricesQueryRequestSortDirection": ".consumer_pricing",
134
+ "V3PricingCash": ".types",
135
+ "V3PricingNegotiated": ".types",
136
+ "V3PricingResolved": ".types",
137
+ "V3PricingResolvedType": ".types",
138
+ "V3Provider": ".types",
139
+ "V3ProviderAddress": ".types",
140
+ "V3ProviderObject": ".types",
141
+ "V3ProviderPackagePrice": ".types",
142
+ "V3ProviderPackagePriceObject": ".types",
143
+ "V3ResponseMeta": ".types",
144
+ "V3SearchContext": ".types",
145
+ "consumer_pricing": ".consumer_pricing",
146
+ "lib": ".lib",
147
+ }
148
+
149
+
150
+ def __getattr__(attr_name: str) -> typing.Any:
151
+ module_name = _dynamic_imports.get(attr_name)
152
+ if module_name is None:
153
+ raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}")
154
+ try:
155
+ module = import_module(module_name, __package__)
156
+ if module_name == f".{attr_name}":
157
+ return module
158
+ else:
159
+ return getattr(module, attr_name)
160
+ except ImportError as e:
161
+ raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e
162
+ except AttributeError as e:
163
+ raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e
164
+
165
+
166
+ def __dir__():
167
+ lazy_attrs = list(_dynamic_imports.keys())
168
+ return sorted(lazy_attrs)
169
+
170
+
171
+ __all__ = [
172
+ "AsyncTurquoiseHealth",
173
+ "BadRequestError",
174
+ "ConsumerPricingV2ErrorCode",
175
+ "InternalServerError",
176
+ "NotFoundError",
177
+ "TooManyRequestsError",
178
+ "TurquoiseHealth",
179
+ "UnprocessableEntityError",
180
+ "V3BillingCode",
181
+ "V3ComparisonStats",
182
+ "V3ConsumerPricingV2ErrorCode",
183
+ "V3EntityRef",
184
+ "V3ErrorCode",
185
+ "V3ErrorPayload",
186
+ "V3ErrorResponse",
187
+ "V3LineItem",
188
+ "V3ListEnvelopeLineItem",
189
+ "V3ListEnvelopeLineItemObject",
190
+ "V3ListEnvelopeNetwork",
191
+ "V3ListEnvelopeNetworkObject",
192
+ "V3ListEnvelopePackage",
193
+ "V3ListEnvelopePackageObject",
194
+ "V3ListEnvelopePayer",
195
+ "V3ListEnvelopePayerObject",
196
+ "V3ListEnvelopeProvider",
197
+ "V3ListEnvelopeProviderObject",
198
+ "V3ListEnvelopeProviderPackagePrice",
199
+ "V3ListEnvelopeProviderPackagePriceObject",
200
+ "V3Location",
201
+ "V3LocationNear",
202
+ "V3LocationWithin",
203
+ "V3MatchContext",
204
+ "V3Money",
205
+ "V3Network",
206
+ "V3NetworkObject",
207
+ "V3NoDataReason",
208
+ "V3Package",
209
+ "V3PackageObject",
210
+ "V3PackageType",
211
+ "V3PageMeta",
212
+ "V3Payer",
213
+ "V3PayerObject",
214
+ "V3PriceComparison",
215
+ "V3PriceComparisonObject",
216
+ "V3PriceExpand",
217
+ "V3PriceSort",
218
+ "V3PricesCompareRequestPricing",
219
+ "V3PricesCompareRequestPricing_Cash",
220
+ "V3PricesCompareRequestPricing_Negotiated",
221
+ "V3PricesQueryRequestPricing",
222
+ "V3PricesQueryRequestPricing_Cash",
223
+ "V3PricesQueryRequestPricing_Negotiated",
224
+ "V3PricesQueryRequestSortDirection",
225
+ "V3PricingCash",
226
+ "V3PricingNegotiated",
227
+ "V3PricingResolved",
228
+ "V3PricingResolvedType",
229
+ "V3Provider",
230
+ "V3ProviderAddress",
231
+ "V3ProviderObject",
232
+ "V3ProviderPackagePrice",
233
+ "V3ProviderPackagePriceObject",
234
+ "V3ResponseMeta",
235
+ "V3SearchContext",
236
+ "consumer_pricing",
237
+ "lib",
238
+ ]
@@ -0,0 +1,139 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ from __future__ import annotations
4
+
5
+ import typing
6
+
7
+ import httpx
8
+ from .core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
9
+
10
+ if typing.TYPE_CHECKING:
11
+ from .consumer_pricing.client import AsyncConsumerPricingClient, ConsumerPricingClient
12
+
13
+
14
+ class TurquoiseHealth:
15
+ """
16
+ Use this class to access the different functions within the SDK. You can instantiate any number of clients with different configuration that will propagate to these functions.
17
+
18
+ Parameters
19
+ ----------
20
+ base_url : str
21
+ The base url to use for requests from the client.
22
+
23
+ token : typing.Union[str, typing.Callable[[], str]]
24
+ headers : typing.Optional[typing.Dict[str, str]]
25
+ Additional headers to send with every request.
26
+
27
+ timeout : typing.Optional[float]
28
+ The timeout to be used, in seconds, for requests. By default the timeout is 60 seconds, unless a custom httpx client is used, in which case this default is not enforced.
29
+
30
+ follow_redirects : typing.Optional[bool]
31
+ Whether the default httpx client follows redirects or not, this is irrelevant if a custom httpx client is passed in.
32
+
33
+ httpx_client : typing.Optional[httpx.Client]
34
+ The httpx client to use for making requests, a preconfigured client is used by default, however this is useful should you want to pass in any custom httpx configuration.
35
+
36
+ Examples
37
+ --------
38
+ from turquoisehealth-api import TurquoiseHealth
39
+
40
+ client = TurquoiseHealth(token="YOUR_TOKEN", base_url="https://yourhost.com/path/to/api", )
41
+ """
42
+
43
+ def __init__(
44
+ self,
45
+ *,
46
+ base_url: str,
47
+ token: typing.Union[str, typing.Callable[[], str]],
48
+ headers: typing.Optional[typing.Dict[str, str]] = None,
49
+ timeout: typing.Optional[float] = None,
50
+ follow_redirects: typing.Optional[bool] = True,
51
+ httpx_client: typing.Optional[httpx.Client] = None,
52
+ ):
53
+ _defaulted_timeout = (
54
+ timeout if timeout is not None else 60 if httpx_client is None else httpx_client.timeout.read
55
+ )
56
+ self._client_wrapper = SyncClientWrapper(
57
+ base_url=base_url,
58
+ token=token,
59
+ headers=headers,
60
+ httpx_client=httpx_client
61
+ if httpx_client is not None
62
+ else httpx.Client(timeout=_defaulted_timeout, follow_redirects=follow_redirects)
63
+ if follow_redirects is not None
64
+ else httpx.Client(timeout=_defaulted_timeout),
65
+ timeout=_defaulted_timeout,
66
+ )
67
+ self._consumer_pricing: typing.Optional[ConsumerPricingClient] = None
68
+
69
+ @property
70
+ def consumer_pricing(self):
71
+ if self._consumer_pricing is None:
72
+ from .consumer_pricing.client import ConsumerPricingClient # noqa: E402
73
+
74
+ self._consumer_pricing = ConsumerPricingClient(client_wrapper=self._client_wrapper)
75
+ return self._consumer_pricing
76
+
77
+
78
+ class AsyncTurquoiseHealth:
79
+ """
80
+ Use this class to access the different functions within the SDK. You can instantiate any number of clients with different configuration that will propagate to these functions.
81
+
82
+ Parameters
83
+ ----------
84
+ base_url : str
85
+ The base url to use for requests from the client.
86
+
87
+ token : typing.Union[str, typing.Callable[[], str]]
88
+ headers : typing.Optional[typing.Dict[str, str]]
89
+ Additional headers to send with every request.
90
+
91
+ timeout : typing.Optional[float]
92
+ The timeout to be used, in seconds, for requests. By default the timeout is 60 seconds, unless a custom httpx client is used, in which case this default is not enforced.
93
+
94
+ follow_redirects : typing.Optional[bool]
95
+ Whether the default httpx client follows redirects or not, this is irrelevant if a custom httpx client is passed in.
96
+
97
+ httpx_client : typing.Optional[httpx.AsyncClient]
98
+ The httpx client to use for making requests, a preconfigured client is used by default, however this is useful should you want to pass in any custom httpx configuration.
99
+
100
+ Examples
101
+ --------
102
+ from turquoisehealth-api import AsyncTurquoiseHealth
103
+
104
+ client = AsyncTurquoiseHealth(token="YOUR_TOKEN", base_url="https://yourhost.com/path/to/api", )
105
+ """
106
+
107
+ def __init__(
108
+ self,
109
+ *,
110
+ base_url: str,
111
+ token: typing.Union[str, typing.Callable[[], str]],
112
+ headers: typing.Optional[typing.Dict[str, str]] = None,
113
+ timeout: typing.Optional[float] = None,
114
+ follow_redirects: typing.Optional[bool] = True,
115
+ httpx_client: typing.Optional[httpx.AsyncClient] = None,
116
+ ):
117
+ _defaulted_timeout = (
118
+ timeout if timeout is not None else 60 if httpx_client is None else httpx_client.timeout.read
119
+ )
120
+ self._client_wrapper = AsyncClientWrapper(
121
+ base_url=base_url,
122
+ token=token,
123
+ headers=headers,
124
+ httpx_client=httpx_client
125
+ if httpx_client is not None
126
+ else httpx.AsyncClient(timeout=_defaulted_timeout, follow_redirects=follow_redirects)
127
+ if follow_redirects is not None
128
+ else httpx.AsyncClient(timeout=_defaulted_timeout),
129
+ timeout=_defaulted_timeout,
130
+ )
131
+ self._consumer_pricing: typing.Optional[AsyncConsumerPricingClient] = None
132
+
133
+ @property
134
+ def consumer_pricing(self):
135
+ if self._consumer_pricing is None:
136
+ from .consumer_pricing.client import AsyncConsumerPricingClient # noqa: E402
137
+
138
+ self._consumer_pricing = AsyncConsumerPricingClient(client_wrapper=self._client_wrapper)
139
+ return self._consumer_pricing
@@ -0,0 +1,58 @@
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
+ V3PricesCompareRequestPricing,
11
+ V3PricesCompareRequestPricing_Cash,
12
+ V3PricesCompareRequestPricing_Negotiated,
13
+ V3PricesQueryRequestPricing,
14
+ V3PricesQueryRequestPricing_Cash,
15
+ V3PricesQueryRequestPricing_Negotiated,
16
+ V3PricesQueryRequestSortDirection,
17
+ )
18
+ _dynamic_imports: typing.Dict[str, str] = {
19
+ "V3PricesCompareRequestPricing": ".types",
20
+ "V3PricesCompareRequestPricing_Cash": ".types",
21
+ "V3PricesCompareRequestPricing_Negotiated": ".types",
22
+ "V3PricesQueryRequestPricing": ".types",
23
+ "V3PricesQueryRequestPricing_Cash": ".types",
24
+ "V3PricesQueryRequestPricing_Negotiated": ".types",
25
+ "V3PricesQueryRequestSortDirection": ".types",
26
+ }
27
+
28
+
29
+ def __getattr__(attr_name: str) -> typing.Any:
30
+ module_name = _dynamic_imports.get(attr_name)
31
+ if module_name is None:
32
+ raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}")
33
+ try:
34
+ module = import_module(module_name, __package__)
35
+ if module_name == f".{attr_name}":
36
+ return module
37
+ else:
38
+ return getattr(module, attr_name)
39
+ except ImportError as e:
40
+ raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e
41
+ except AttributeError as e:
42
+ raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e
43
+
44
+
45
+ def __dir__():
46
+ lazy_attrs = list(_dynamic_imports.keys())
47
+ return sorted(lazy_attrs)
48
+
49
+
50
+ __all__ = [
51
+ "V3PricesCompareRequestPricing",
52
+ "V3PricesCompareRequestPricing_Cash",
53
+ "V3PricesCompareRequestPricing_Negotiated",
54
+ "V3PricesQueryRequestPricing",
55
+ "V3PricesQueryRequestPricing_Cash",
56
+ "V3PricesQueryRequestPricing_Negotiated",
57
+ "V3PricesQueryRequestSortDirection",
58
+ ]