samplehc 0.15.0__py3-none-any.whl → 0.16.0__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.
@@ -1,381 +0,0 @@
1
- # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
-
3
- from __future__ import annotations
4
-
5
- from typing import Dict, Union
6
- from typing_extensions import Literal
7
-
8
- import httpx
9
-
10
- from ...._types import Body, Omit, Query, Headers, NotGiven, omit, not_given
11
- from ...._utils import maybe_transform, strip_not_given, async_maybe_transform
12
- from ...._compat import cached_property
13
- from ...._resource import SyncAPIResource, AsyncAPIResource
14
- from ...._response import (
15
- to_raw_response_wrapper,
16
- to_streamed_response_wrapper,
17
- async_to_raw_response_wrapper,
18
- async_to_streamed_response_wrapper,
19
- )
20
- from ...._base_client import make_request_options
21
- from ....types.v2.ledger import entry_post_params, entry_reverse_params
22
- from ....types.v2.ledger.entry_post_response import EntryPostResponse
23
- from ....types.v2.ledger.entry_reverse_response import EntryReverseResponse
24
-
25
- __all__ = ["EntryResource", "AsyncEntryResource"]
26
-
27
-
28
- class EntryResource(SyncAPIResource):
29
- @cached_property
30
- def with_raw_response(self) -> EntryResourceWithRawResponse:
31
- """
32
- This property can be used as a prefix for any HTTP method call to return
33
- the raw response object instead of the parsed content.
34
-
35
- For more information, see https://www.github.com/samplehc/samplehc-python#accessing-raw-response-data-eg-headers
36
- """
37
- return EntryResourceWithRawResponse(self)
38
-
39
- @cached_property
40
- def with_streaming_response(self) -> EntryResourceWithStreamingResponse:
41
- """
42
- An alternative to `.with_raw_response` that doesn't eagerly read the response body.
43
-
44
- For more information, see https://www.github.com/samplehc/samplehc-python#with_streaming_response
45
- """
46
- return EntryResourceWithStreamingResponse(self)
47
-
48
- def post(
49
- self,
50
- *,
51
- amount_usd_cents: float,
52
- entry_category: Literal["charge", "payment", "adjustment"],
53
- line_item_id: str,
54
- order_id: str,
55
- description: str | Omit = omit,
56
- entry_type: Union[
57
- Literal[
58
- "insurance-payment",
59
- "institution-payment",
60
- "patient-payment",
61
- "write-off",
62
- "institution-discount",
63
- "contracted-payer-adjustment",
64
- "patient-pay-adjustment",
65
- "charge",
66
- "payment",
67
- "adjustment",
68
- ],
69
- object,
70
- ]
71
- | Omit = omit,
72
- metadata: Dict[str, object] | Omit = omit,
73
- payment_source: str | Omit = omit,
74
- posted_at: str | Omit = omit,
75
- idempotency_key: str | Omit = omit,
76
- # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
77
- # The extra values given here take precedence over values defined on the client or passed to this method.
78
- extra_headers: Headers | None = None,
79
- extra_query: Query | None = None,
80
- extra_body: Body | None = None,
81
- timeout: float | httpx.Timeout | None | NotGiven = not_given,
82
- ) -> EntryPostResponse:
83
- """
84
- Create diagnostics ledger entry
85
-
86
- Args:
87
- amount_usd_cents: The amount of the ledger entry in cents. Positive for charges, negative for
88
- payments.
89
-
90
- line_item_id: The line item ID associated with the ledger entry.
91
-
92
- order_id: The order ID associated with the ledger entry.
93
-
94
- description: The description of the ledger entry.
95
-
96
- entry_type: The type of ledger entry.
97
-
98
- metadata: Any optional metadata to associate with the ledger entry.
99
-
100
- payment_source: The source of the payment, e.g. payer ID, patient ID, etc.
101
-
102
- posted_at: The date and time the ledger entry was posted.
103
-
104
- extra_headers: Send extra headers
105
-
106
- extra_query: Add additional query parameters to the request
107
-
108
- extra_body: Add additional JSON properties to the request
109
-
110
- timeout: Override the client-level default timeout for this request, in seconds
111
- """
112
- extra_headers = {**strip_not_given({"idempotency-key": idempotency_key}), **(extra_headers or {})}
113
- return self._post(
114
- "/api/v2/ledger/entry",
115
- body=maybe_transform(
116
- {
117
- "amount_usd_cents": amount_usd_cents,
118
- "entry_category": entry_category,
119
- "line_item_id": line_item_id,
120
- "order_id": order_id,
121
- "description": description,
122
- "entry_type": entry_type,
123
- "metadata": metadata,
124
- "payment_source": payment_source,
125
- "posted_at": posted_at,
126
- },
127
- entry_post_params.EntryPostParams,
128
- ),
129
- options=make_request_options(
130
- extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
131
- ),
132
- cast_to=EntryPostResponse,
133
- )
134
-
135
- def reverse(
136
- self,
137
- id: str,
138
- *,
139
- metadata: Dict[str, object] | Omit = omit,
140
- posted_at: str | Omit = omit,
141
- # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
142
- # The extra values given here take precedence over values defined on the client or passed to this method.
143
- extra_headers: Headers | None = None,
144
- extra_query: Query | None = None,
145
- extra_body: Body | None = None,
146
- timeout: float | httpx.Timeout | None | NotGiven = not_given,
147
- ) -> EntryReverseResponse:
148
- """
149
- Reverse diagnostics ledger entry
150
-
151
- Args:
152
- metadata: Any optional metadata to associate with the reversal entry.
153
-
154
- posted_at: The date and time the reversal entry was posted.
155
-
156
- extra_headers: Send extra headers
157
-
158
- extra_query: Add additional query parameters to the request
159
-
160
- extra_body: Add additional JSON properties to the request
161
-
162
- timeout: Override the client-level default timeout for this request, in seconds
163
- """
164
- if not id:
165
- raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
166
- return self._post(
167
- f"/api/v2/ledger/entry/{id}/reverse",
168
- body=maybe_transform(
169
- {
170
- "metadata": metadata,
171
- "posted_at": posted_at,
172
- },
173
- entry_reverse_params.EntryReverseParams,
174
- ),
175
- options=make_request_options(
176
- extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
177
- ),
178
- cast_to=EntryReverseResponse,
179
- )
180
-
181
-
182
- class AsyncEntryResource(AsyncAPIResource):
183
- @cached_property
184
- def with_raw_response(self) -> AsyncEntryResourceWithRawResponse:
185
- """
186
- This property can be used as a prefix for any HTTP method call to return
187
- the raw response object instead of the parsed content.
188
-
189
- For more information, see https://www.github.com/samplehc/samplehc-python#accessing-raw-response-data-eg-headers
190
- """
191
- return AsyncEntryResourceWithRawResponse(self)
192
-
193
- @cached_property
194
- def with_streaming_response(self) -> AsyncEntryResourceWithStreamingResponse:
195
- """
196
- An alternative to `.with_raw_response` that doesn't eagerly read the response body.
197
-
198
- For more information, see https://www.github.com/samplehc/samplehc-python#with_streaming_response
199
- """
200
- return AsyncEntryResourceWithStreamingResponse(self)
201
-
202
- async def post(
203
- self,
204
- *,
205
- amount_usd_cents: float,
206
- entry_category: Literal["charge", "payment", "adjustment"],
207
- line_item_id: str,
208
- order_id: str,
209
- description: str | Omit = omit,
210
- entry_type: Union[
211
- Literal[
212
- "insurance-payment",
213
- "institution-payment",
214
- "patient-payment",
215
- "write-off",
216
- "institution-discount",
217
- "contracted-payer-adjustment",
218
- "patient-pay-adjustment",
219
- "charge",
220
- "payment",
221
- "adjustment",
222
- ],
223
- object,
224
- ]
225
- | Omit = omit,
226
- metadata: Dict[str, object] | Omit = omit,
227
- payment_source: str | Omit = omit,
228
- posted_at: str | Omit = omit,
229
- idempotency_key: str | Omit = omit,
230
- # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
231
- # The extra values given here take precedence over values defined on the client or passed to this method.
232
- extra_headers: Headers | None = None,
233
- extra_query: Query | None = None,
234
- extra_body: Body | None = None,
235
- timeout: float | httpx.Timeout | None | NotGiven = not_given,
236
- ) -> EntryPostResponse:
237
- """
238
- Create diagnostics ledger entry
239
-
240
- Args:
241
- amount_usd_cents: The amount of the ledger entry in cents. Positive for charges, negative for
242
- payments.
243
-
244
- line_item_id: The line item ID associated with the ledger entry.
245
-
246
- order_id: The order ID associated with the ledger entry.
247
-
248
- description: The description of the ledger entry.
249
-
250
- entry_type: The type of ledger entry.
251
-
252
- metadata: Any optional metadata to associate with the ledger entry.
253
-
254
- payment_source: The source of the payment, e.g. payer ID, patient ID, etc.
255
-
256
- posted_at: The date and time the ledger entry was posted.
257
-
258
- extra_headers: Send extra headers
259
-
260
- extra_query: Add additional query parameters to the request
261
-
262
- extra_body: Add additional JSON properties to the request
263
-
264
- timeout: Override the client-level default timeout for this request, in seconds
265
- """
266
- extra_headers = {**strip_not_given({"idempotency-key": idempotency_key}), **(extra_headers or {})}
267
- return await self._post(
268
- "/api/v2/ledger/entry",
269
- body=await async_maybe_transform(
270
- {
271
- "amount_usd_cents": amount_usd_cents,
272
- "entry_category": entry_category,
273
- "line_item_id": line_item_id,
274
- "order_id": order_id,
275
- "description": description,
276
- "entry_type": entry_type,
277
- "metadata": metadata,
278
- "payment_source": payment_source,
279
- "posted_at": posted_at,
280
- },
281
- entry_post_params.EntryPostParams,
282
- ),
283
- options=make_request_options(
284
- extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
285
- ),
286
- cast_to=EntryPostResponse,
287
- )
288
-
289
- async def reverse(
290
- self,
291
- id: str,
292
- *,
293
- metadata: Dict[str, object] | Omit = omit,
294
- posted_at: str | Omit = omit,
295
- # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
296
- # The extra values given here take precedence over values defined on the client or passed to this method.
297
- extra_headers: Headers | None = None,
298
- extra_query: Query | None = None,
299
- extra_body: Body | None = None,
300
- timeout: float | httpx.Timeout | None | NotGiven = not_given,
301
- ) -> EntryReverseResponse:
302
- """
303
- Reverse diagnostics ledger entry
304
-
305
- Args:
306
- metadata: Any optional metadata to associate with the reversal entry.
307
-
308
- posted_at: The date and time the reversal entry was posted.
309
-
310
- extra_headers: Send extra headers
311
-
312
- extra_query: Add additional query parameters to the request
313
-
314
- extra_body: Add additional JSON properties to the request
315
-
316
- timeout: Override the client-level default timeout for this request, in seconds
317
- """
318
- if not id:
319
- raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
320
- return await self._post(
321
- f"/api/v2/ledger/entry/{id}/reverse",
322
- body=await async_maybe_transform(
323
- {
324
- "metadata": metadata,
325
- "posted_at": posted_at,
326
- },
327
- entry_reverse_params.EntryReverseParams,
328
- ),
329
- options=make_request_options(
330
- extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
331
- ),
332
- cast_to=EntryReverseResponse,
333
- )
334
-
335
-
336
- class EntryResourceWithRawResponse:
337
- def __init__(self, entry: EntryResource) -> None:
338
- self._entry = entry
339
-
340
- self.post = to_raw_response_wrapper(
341
- entry.post,
342
- )
343
- self.reverse = to_raw_response_wrapper(
344
- entry.reverse,
345
- )
346
-
347
-
348
- class AsyncEntryResourceWithRawResponse:
349
- def __init__(self, entry: AsyncEntryResource) -> None:
350
- self._entry = entry
351
-
352
- self.post = async_to_raw_response_wrapper(
353
- entry.post,
354
- )
355
- self.reverse = async_to_raw_response_wrapper(
356
- entry.reverse,
357
- )
358
-
359
-
360
- class EntryResourceWithStreamingResponse:
361
- def __init__(self, entry: EntryResource) -> None:
362
- self._entry = entry
363
-
364
- self.post = to_streamed_response_wrapper(
365
- entry.post,
366
- )
367
- self.reverse = to_streamed_response_wrapper(
368
- entry.reverse,
369
- )
370
-
371
-
372
- class AsyncEntryResourceWithStreamingResponse:
373
- def __init__(self, entry: AsyncEntryResource) -> None:
374
- self._entry = entry
375
-
376
- self.post = async_to_streamed_response_wrapper(
377
- entry.post,
378
- )
379
- self.reverse = async_to_streamed_response_wrapper(
380
- entry.reverse,
381
- )
@@ -1,134 +0,0 @@
1
- # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
-
3
- from __future__ import annotations
4
-
5
- from .entry import (
6
- EntryResource,
7
- AsyncEntryResource,
8
- EntryResourceWithRawResponse,
9
- AsyncEntryResourceWithRawResponse,
10
- EntryResourceWithStreamingResponse,
11
- AsyncEntryResourceWithStreamingResponse,
12
- )
13
- from .account import (
14
- AccountResource,
15
- AsyncAccountResource,
16
- AccountResourceWithRawResponse,
17
- AsyncAccountResourceWithRawResponse,
18
- AccountResourceWithStreamingResponse,
19
- AsyncAccountResourceWithStreamingResponse,
20
- )
21
- from ...._compat import cached_property
22
- from ...._resource import SyncAPIResource, AsyncAPIResource
23
-
24
- __all__ = ["LedgerResource", "AsyncLedgerResource"]
25
-
26
-
27
- class LedgerResource(SyncAPIResource):
28
- @cached_property
29
- def entry(self) -> EntryResource:
30
- return EntryResource(self._client)
31
-
32
- @cached_property
33
- def account(self) -> AccountResource:
34
- return AccountResource(self._client)
35
-
36
- @cached_property
37
- def with_raw_response(self) -> LedgerResourceWithRawResponse:
38
- """
39
- This property can be used as a prefix for any HTTP method call to return
40
- the raw response object instead of the parsed content.
41
-
42
- For more information, see https://www.github.com/samplehc/samplehc-python#accessing-raw-response-data-eg-headers
43
- """
44
- return LedgerResourceWithRawResponse(self)
45
-
46
- @cached_property
47
- def with_streaming_response(self) -> LedgerResourceWithStreamingResponse:
48
- """
49
- An alternative to `.with_raw_response` that doesn't eagerly read the response body.
50
-
51
- For more information, see https://www.github.com/samplehc/samplehc-python#with_streaming_response
52
- """
53
- return LedgerResourceWithStreamingResponse(self)
54
-
55
-
56
- class AsyncLedgerResource(AsyncAPIResource):
57
- @cached_property
58
- def entry(self) -> AsyncEntryResource:
59
- return AsyncEntryResource(self._client)
60
-
61
- @cached_property
62
- def account(self) -> AsyncAccountResource:
63
- return AsyncAccountResource(self._client)
64
-
65
- @cached_property
66
- def with_raw_response(self) -> AsyncLedgerResourceWithRawResponse:
67
- """
68
- This property can be used as a prefix for any HTTP method call to return
69
- the raw response object instead of the parsed content.
70
-
71
- For more information, see https://www.github.com/samplehc/samplehc-python#accessing-raw-response-data-eg-headers
72
- """
73
- return AsyncLedgerResourceWithRawResponse(self)
74
-
75
- @cached_property
76
- def with_streaming_response(self) -> AsyncLedgerResourceWithStreamingResponse:
77
- """
78
- An alternative to `.with_raw_response` that doesn't eagerly read the response body.
79
-
80
- For more information, see https://www.github.com/samplehc/samplehc-python#with_streaming_response
81
- """
82
- return AsyncLedgerResourceWithStreamingResponse(self)
83
-
84
-
85
- class LedgerResourceWithRawResponse:
86
- def __init__(self, ledger: LedgerResource) -> None:
87
- self._ledger = ledger
88
-
89
- @cached_property
90
- def entry(self) -> EntryResourceWithRawResponse:
91
- return EntryResourceWithRawResponse(self._ledger.entry)
92
-
93
- @cached_property
94
- def account(self) -> AccountResourceWithRawResponse:
95
- return AccountResourceWithRawResponse(self._ledger.account)
96
-
97
-
98
- class AsyncLedgerResourceWithRawResponse:
99
- def __init__(self, ledger: AsyncLedgerResource) -> None:
100
- self._ledger = ledger
101
-
102
- @cached_property
103
- def entry(self) -> AsyncEntryResourceWithRawResponse:
104
- return AsyncEntryResourceWithRawResponse(self._ledger.entry)
105
-
106
- @cached_property
107
- def account(self) -> AsyncAccountResourceWithRawResponse:
108
- return AsyncAccountResourceWithRawResponse(self._ledger.account)
109
-
110
-
111
- class LedgerResourceWithStreamingResponse:
112
- def __init__(self, ledger: LedgerResource) -> None:
113
- self._ledger = ledger
114
-
115
- @cached_property
116
- def entry(self) -> EntryResourceWithStreamingResponse:
117
- return EntryResourceWithStreamingResponse(self._ledger.entry)
118
-
119
- @cached_property
120
- def account(self) -> AccountResourceWithStreamingResponse:
121
- return AccountResourceWithStreamingResponse(self._ledger.account)
122
-
123
-
124
- class AsyncLedgerResourceWithStreamingResponse:
125
- def __init__(self, ledger: AsyncLedgerResource) -> None:
126
- self._ledger = ledger
127
-
128
- @cached_property
129
- def entry(self) -> AsyncEntryResourceWithStreamingResponse:
130
- return AsyncEntryResourceWithStreamingResponse(self._ledger.entry)
131
-
132
- @cached_property
133
- def account(self) -> AsyncAccountResourceWithStreamingResponse:
134
- return AsyncAccountResourceWithStreamingResponse(self._ledger.account)
@@ -1,23 +0,0 @@
1
- # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
-
3
- from __future__ import annotations
4
-
5
- from typing import Dict
6
- from typing_extensions import Required, Annotated, TypedDict
7
-
8
- from ...._utils import PropertyInfo
9
-
10
- __all__ = ["AccountWriteoffParams"]
11
-
12
-
13
- class AccountWriteoffParams(TypedDict, total=False):
14
- order_id: Required[Annotated[str, PropertyInfo(alias="orderId")]]
15
-
16
- description: Required[str]
17
- """The description of the write-off."""
18
-
19
- metadata: Dict[str, object]
20
- """Any optional metadata to associate with the write-off."""
21
-
22
- posted_at: Annotated[str, PropertyInfo(alias="postedAt")]
23
- """The date and time to post the write-off."""
@@ -1,12 +0,0 @@
1
- # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
-
3
- from typing_extensions import Literal
4
-
5
- from ...._models import BaseModel
6
-
7
- __all__ = ["AccountWriteoffResponse"]
8
-
9
-
10
- class AccountWriteoffResponse(BaseModel):
11
- success: Literal[True]
12
- """Write-off posted successfully."""
@@ -1,60 +0,0 @@
1
- # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
-
3
- from __future__ import annotations
4
-
5
- from typing import Dict, Union
6
- from typing_extensions import Literal, Required, Annotated, TypedDict
7
-
8
- from ...._utils import PropertyInfo
9
-
10
- __all__ = ["EntryPostParams"]
11
-
12
-
13
- class EntryPostParams(TypedDict, total=False):
14
- amount_usd_cents: Required[Annotated[float, PropertyInfo(alias="amountUsdCents")]]
15
- """The amount of the ledger entry in cents.
16
-
17
- Positive for charges, negative for payments.
18
- """
19
-
20
- entry_category: Required[Annotated[Literal["charge", "payment", "adjustment"], PropertyInfo(alias="entryCategory")]]
21
-
22
- line_item_id: Required[Annotated[str, PropertyInfo(alias="lineItemId")]]
23
- """The line item ID associated with the ledger entry."""
24
-
25
- order_id: Required[Annotated[str, PropertyInfo(alias="orderId")]]
26
- """The order ID associated with the ledger entry."""
27
-
28
- description: str
29
- """The description of the ledger entry."""
30
-
31
- entry_type: Annotated[
32
- Union[
33
- Literal[
34
- "insurance-payment",
35
- "institution-payment",
36
- "patient-payment",
37
- "write-off",
38
- "institution-discount",
39
- "contracted-payer-adjustment",
40
- "patient-pay-adjustment",
41
- "charge",
42
- "payment",
43
- "adjustment",
44
- ],
45
- object,
46
- ],
47
- PropertyInfo(alias="entryType"),
48
- ]
49
- """The type of ledger entry."""
50
-
51
- metadata: Dict[str, object]
52
- """Any optional metadata to associate with the ledger entry."""
53
-
54
- payment_source: Annotated[str, PropertyInfo(alias="paymentSource")]
55
- """The source of the payment, e.g. payer ID, patient ID, etc."""
56
-
57
- posted_at: Annotated[str, PropertyInfo(alias="postedAt")]
58
- """The date and time the ledger entry was posted."""
59
-
60
- idempotency_key: Annotated[str, PropertyInfo(alias="idempotency-key")]
@@ -1,10 +0,0 @@
1
- # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
-
3
- from ...._models import BaseModel
4
-
5
- __all__ = ["EntryPostResponse"]
6
-
7
-
8
- class EntryPostResponse(BaseModel):
9
- success: bool
10
- """Whether the event was emitted successfully."""
@@ -1,18 +0,0 @@
1
- # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
-
3
- from __future__ import annotations
4
-
5
- from typing import Dict
6
- from typing_extensions import Annotated, TypedDict
7
-
8
- from ...._utils import PropertyInfo
9
-
10
- __all__ = ["EntryReverseParams"]
11
-
12
-
13
- class EntryReverseParams(TypedDict, total=False):
14
- metadata: Dict[str, object]
15
- """Any optional metadata to associate with the reversal entry."""
16
-
17
- posted_at: Annotated[str, PropertyInfo(alias="postedAt")]
18
- """The date and time the reversal entry was posted."""
@@ -1,10 +0,0 @@
1
- # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
-
3
- from ...._models import BaseModel
4
-
5
- __all__ = ["EntryReverseResponse"]
6
-
7
-
8
- class EntryReverseResponse(BaseModel):
9
- success: bool
10
- """Whether the reversal entry was created successfully."""