samplehc 0.10.0__py3-none-any.whl → 0.12.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.
Files changed (132) hide show
  1. samplehc/__init__.py +3 -1
  2. samplehc/_base_client.py +12 -12
  3. samplehc/_client.py +8 -8
  4. samplehc/_compat.py +48 -48
  5. samplehc/_models.py +50 -44
  6. samplehc/_qs.py +7 -7
  7. samplehc/_types.py +53 -12
  8. samplehc/_utils/__init__.py +9 -2
  9. samplehc/_utils/_compat.py +45 -0
  10. samplehc/_utils/_datetime_parse.py +136 -0
  11. samplehc/_utils/_transform.py +13 -3
  12. samplehc/_utils/_typing.py +6 -1
  13. samplehc/_utils/_utils.py +4 -5
  14. samplehc/_version.py +1 -1
  15. samplehc/resources/v1/v1.py +9 -9
  16. samplehc/resources/v2/async_results.py +13 -13
  17. samplehc/resources/v2/browser_agents/__init__.py +33 -0
  18. samplehc/resources/v2/{browser_agents.py → browser_agents/browser_agents.py} +44 -12
  19. samplehc/resources/v2/browser_agents/runs/__init__.py +33 -0
  20. samplehc/resources/v2/browser_agents/runs/help_requests.py +191 -0
  21. samplehc/resources/v2/browser_agents/runs/runs.py +102 -0
  22. samplehc/resources/v2/browser_automation/availity.py +3 -3
  23. samplehc/resources/v2/clearinghouse/claim.py +29 -29
  24. samplehc/resources/v2/clearinghouse/clearinghouse.py +36 -36
  25. samplehc/resources/v2/clearinghouse/payers.py +5 -5
  26. samplehc/resources/v2/communication.py +29 -29
  27. samplehc/resources/v2/database.py +5 -5
  28. samplehc/resources/v2/documents/documents.py +152 -37
  29. samplehc/resources/v2/documents/formats.py +3 -3
  30. samplehc/resources/v2/documents/legacy.py +91 -6
  31. samplehc/resources/v2/documents/pdf_template.py +3 -3
  32. samplehc/resources/v2/documents/templates.py +27 -27
  33. samplehc/resources/v2/{events/events.py → events.py} +14 -46
  34. samplehc/resources/v2/hie/adt.py +7 -7
  35. samplehc/resources/v2/hie/documents.py +15 -15
  36. samplehc/resources/v2/integrations/__init__.py +28 -0
  37. samplehc/resources/v2/integrations/bank/transactions.py +5 -5
  38. samplehc/resources/v2/integrations/careviso.py +36 -36
  39. samplehc/resources/v2/integrations/glidian/glidian.py +13 -13
  40. samplehc/resources/v2/integrations/glidian/prior_authorizations/clinical_questions.py +5 -5
  41. samplehc/resources/v2/integrations/glidian/prior_authorizations/prior_authorizations.py +19 -19
  42. samplehc/resources/v2/integrations/integrations.py +64 -0
  43. samplehc/resources/v2/integrations/kno2/messages.py +5 -5
  44. samplehc/resources/v2/integrations/salesforce.py +193 -0
  45. samplehc/resources/v2/integrations/snowflake.py +3 -3
  46. samplehc/resources/v2/{events/integrations → integrations}/xcures.py +13 -13
  47. samplehc/resources/v2/ledger/__init__.py +27 -55
  48. samplehc/resources/v2/ledger/{orders.py → account.py} +123 -86
  49. samplehc/resources/v2/ledger/entry.py +381 -0
  50. samplehc/resources/v2/ledger/ledger.py +38 -1560
  51. samplehc/resources/v2/policies.py +47 -47
  52. samplehc/resources/v2/tasks/state.py +7 -7
  53. samplehc/resources/v2/tasks/tasks.py +15 -15
  54. samplehc/resources/v2/v2.py +16 -16
  55. samplehc/resources/v2/workflow_runs/step.py +3 -3
  56. samplehc/resources/v2/workflow_runs/workflow_runs.py +11 -11
  57. samplehc/resources/v2/workflows.py +13 -13
  58. samplehc/types/v2/__init__.py +1 -28
  59. samplehc/types/v2/browser_agents/runs/__init__.py +6 -0
  60. samplehc/types/v2/browser_agents/runs/help_request_resolve_params.py +18 -0
  61. samplehc/types/v2/browser_agents/runs/help_request_resolve_response.py +28 -0
  62. samplehc/types/v2/clearinghouse/claim_submit_params.py +10 -9
  63. samplehc/types/v2/clearinghouse_calculate_patient_cost_params.py +3 -2
  64. samplehc/types/v2/clearinghouse_check_eligibility_params.py +2 -2
  65. samplehc/types/v2/communication_send_letter_params.py +4 -3
  66. samplehc/types/v2/document_classify_params.py +3 -2
  67. samplehc/types/v2/document_extract_params.py +4 -1
  68. samplehc/types/v2/document_generate_csv_params.py +3 -2
  69. samplehc/types/v2/document_split_params.py +16 -1
  70. samplehc/types/v2/document_unzip_async_response.py +12 -0
  71. samplehc/types/v2/documents/__init__.py +2 -0
  72. samplehc/types/v2/documents/legacy_extract_params.py +8 -7
  73. samplehc/types/v2/documents/legacy_split_params.py +20 -0
  74. samplehc/types/v2/documents/legacy_split_response.py +12 -0
  75. samplehc/types/v2/documents/template_render_document_params.py +17 -5
  76. samplehc/types/v2/integrations/__init__.py +2 -0
  77. samplehc/types/v2/integrations/careviso_submit_prior_authorization_params.py +6 -5
  78. samplehc/types/v2/integrations/glidian/prior_authorizations/clinical_question_update_params.py +3 -2
  79. samplehc/types/v2/integrations/salesforce_run_crud_action_params.py +22 -0
  80. samplehc/types/v2/ledger/__init__.py +6 -17
  81. samplehc/types/v2/ledger/account_writeoff_params.py +23 -0
  82. samplehc/types/v2/ledger/account_writeoff_response.py +12 -0
  83. samplehc/types/v2/ledger/entry_post_params.py +60 -0
  84. samplehc/types/v2/ledger/entry_post_response.py +10 -0
  85. samplehc/types/v2/ledger/entry_reverse_params.py +18 -0
  86. samplehc/types/v2/ledger/entry_reverse_response.py +10 -0
  87. {samplehc-0.10.0.dist-info → samplehc-0.12.0.dist-info}/METADATA +1 -1
  88. {samplehc-0.10.0.dist-info → samplehc-0.12.0.dist-info}/RECORD +92 -111
  89. samplehc/resources/v2/events/__init__.py +0 -33
  90. samplehc/resources/v2/events/integrations/__init__.py +0 -33
  91. samplehc/resources/v2/events/integrations/integrations.py +0 -102
  92. samplehc/resources/v2/ledger/institutions/__init__.py +0 -33
  93. samplehc/resources/v2/ledger/institutions/institutions.py +0 -258
  94. samplehc/resources/v2/ledger/institutions/orders.py +0 -169
  95. samplehc/resources/v2/ledger/insurance.py +0 -141
  96. samplehc/resources/v2/ledger/patients.py +0 -141
  97. samplehc/types/v2/events/integrations/__init__.py +0 -5
  98. samplehc/types/v2/ledger/institution_list_outstanding_accounts_response.py +0 -25
  99. samplehc/types/v2/ledger/institution_retrieve_outstanding_orders_response.py +0 -25
  100. samplehc/types/v2/ledger/institutions/__init__.py +0 -5
  101. samplehc/types/v2/ledger/institutions/order_retrieve_balance_response.py +0 -12
  102. samplehc/types/v2/ledger/insurance_list_outstanding_accounts_response.py +0 -25
  103. samplehc/types/v2/ledger/order_retrieve_balances_response.py +0 -31
  104. samplehc/types/v2/ledger/order_retrieve_batch_balances_params.py +0 -15
  105. samplehc/types/v2/ledger/order_retrieve_batch_balances_response.py +0 -38
  106. samplehc/types/v2/ledger/patient_list_outstanding_accounts_response.py +0 -22
  107. samplehc/types/v2/ledger_assign_invoice_params.py +0 -34
  108. samplehc/types/v2/ledger_assign_invoice_response.py +0 -12
  109. samplehc/types/v2/ledger_claim_adjustment_params.py +0 -34
  110. samplehc/types/v2/ledger_claim_adjustment_response.py +0 -12
  111. samplehc/types/v2/ledger_claim_payment_params.py +0 -34
  112. samplehc/types/v2/ledger_claim_payment_response.py +0 -12
  113. samplehc/types/v2/ledger_institution_adjustment_params.py +0 -31
  114. samplehc/types/v2/ledger_institution_adjustment_response.py +0 -12
  115. samplehc/types/v2/ledger_institution_payment_params.py +0 -31
  116. samplehc/types/v2/ledger_institution_payment_response.py +0 -12
  117. samplehc/types/v2/ledger_new_order_params.py +0 -22
  118. samplehc/types/v2/ledger_new_order_response.py +0 -12
  119. samplehc/types/v2/ledger_order_writeoff_params.py +0 -28
  120. samplehc/types/v2/ledger_order_writeoff_response.py +0 -12
  121. samplehc/types/v2/ledger_patient_adjustment_params.py +0 -31
  122. samplehc/types/v2/ledger_patient_adjustment_response.py +0 -12
  123. samplehc/types/v2/ledger_patient_payment_params.py +0 -28
  124. samplehc/types/v2/ledger_patient_payment_response.py +0 -12
  125. samplehc/types/v2/ledger_post_remittance_accepted_params.py +0 -37
  126. samplehc/types/v2/ledger_post_remittance_accepted_response.py +0 -12
  127. samplehc/types/v2/ledger_reverse_entry_params.py +0 -12
  128. samplehc/types/v2/ledger_reverse_entry_response.py +0 -12
  129. /samplehc/types/v2/{events → browser_agents}/__init__.py +0 -0
  130. /samplehc/types/v2/{events/integrations → integrations}/xcure_make_request_params.py +0 -0
  131. {samplehc-0.10.0.dist-info → samplehc-0.12.0.dist-info}/WHEEL +0 -0
  132. {samplehc-0.10.0.dist-info → samplehc-0.12.0.dist-info}/licenses/LICENSE +0 -0
@@ -1,102 +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 .xcures import (
6
- XcuresResource,
7
- AsyncXcuresResource,
8
- XcuresResourceWithRawResponse,
9
- AsyncXcuresResourceWithRawResponse,
10
- XcuresResourceWithStreamingResponse,
11
- AsyncXcuresResourceWithStreamingResponse,
12
- )
13
- from ....._compat import cached_property
14
- from ....._resource import SyncAPIResource, AsyncAPIResource
15
-
16
- __all__ = ["IntegrationsResource", "AsyncIntegrationsResource"]
17
-
18
-
19
- class IntegrationsResource(SyncAPIResource):
20
- @cached_property
21
- def xcures(self) -> XcuresResource:
22
- return XcuresResource(self._client)
23
-
24
- @cached_property
25
- def with_raw_response(self) -> IntegrationsResourceWithRawResponse:
26
- """
27
- This property can be used as a prefix for any HTTP method call to return
28
- the raw response object instead of the parsed content.
29
-
30
- For more information, see https://www.github.com/samplehc/samplehc-python#accessing-raw-response-data-eg-headers
31
- """
32
- return IntegrationsResourceWithRawResponse(self)
33
-
34
- @cached_property
35
- def with_streaming_response(self) -> IntegrationsResourceWithStreamingResponse:
36
- """
37
- An alternative to `.with_raw_response` that doesn't eagerly read the response body.
38
-
39
- For more information, see https://www.github.com/samplehc/samplehc-python#with_streaming_response
40
- """
41
- return IntegrationsResourceWithStreamingResponse(self)
42
-
43
-
44
- class AsyncIntegrationsResource(AsyncAPIResource):
45
- @cached_property
46
- def xcures(self) -> AsyncXcuresResource:
47
- return AsyncXcuresResource(self._client)
48
-
49
- @cached_property
50
- def with_raw_response(self) -> AsyncIntegrationsResourceWithRawResponse:
51
- """
52
- This property can be used as a prefix for any HTTP method call to return
53
- the raw response object instead of the parsed content.
54
-
55
- For more information, see https://www.github.com/samplehc/samplehc-python#accessing-raw-response-data-eg-headers
56
- """
57
- return AsyncIntegrationsResourceWithRawResponse(self)
58
-
59
- @cached_property
60
- def with_streaming_response(self) -> AsyncIntegrationsResourceWithStreamingResponse:
61
- """
62
- An alternative to `.with_raw_response` that doesn't eagerly read the response body.
63
-
64
- For more information, see https://www.github.com/samplehc/samplehc-python#with_streaming_response
65
- """
66
- return AsyncIntegrationsResourceWithStreamingResponse(self)
67
-
68
-
69
- class IntegrationsResourceWithRawResponse:
70
- def __init__(self, integrations: IntegrationsResource) -> None:
71
- self._integrations = integrations
72
-
73
- @cached_property
74
- def xcures(self) -> XcuresResourceWithRawResponse:
75
- return XcuresResourceWithRawResponse(self._integrations.xcures)
76
-
77
-
78
- class AsyncIntegrationsResourceWithRawResponse:
79
- def __init__(self, integrations: AsyncIntegrationsResource) -> None:
80
- self._integrations = integrations
81
-
82
- @cached_property
83
- def xcures(self) -> AsyncXcuresResourceWithRawResponse:
84
- return AsyncXcuresResourceWithRawResponse(self._integrations.xcures)
85
-
86
-
87
- class IntegrationsResourceWithStreamingResponse:
88
- def __init__(self, integrations: IntegrationsResource) -> None:
89
- self._integrations = integrations
90
-
91
- @cached_property
92
- def xcures(self) -> XcuresResourceWithStreamingResponse:
93
- return XcuresResourceWithStreamingResponse(self._integrations.xcures)
94
-
95
-
96
- class AsyncIntegrationsResourceWithStreamingResponse:
97
- def __init__(self, integrations: AsyncIntegrationsResource) -> None:
98
- self._integrations = integrations
99
-
100
- @cached_property
101
- def xcures(self) -> AsyncXcuresResourceWithStreamingResponse:
102
- return AsyncXcuresResourceWithStreamingResponse(self._integrations.xcures)
@@ -1,33 +0,0 @@
1
- # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
-
3
- from .orders import (
4
- OrdersResource,
5
- AsyncOrdersResource,
6
- OrdersResourceWithRawResponse,
7
- AsyncOrdersResourceWithRawResponse,
8
- OrdersResourceWithStreamingResponse,
9
- AsyncOrdersResourceWithStreamingResponse,
10
- )
11
- from .institutions import (
12
- InstitutionsResource,
13
- AsyncInstitutionsResource,
14
- InstitutionsResourceWithRawResponse,
15
- AsyncInstitutionsResourceWithRawResponse,
16
- InstitutionsResourceWithStreamingResponse,
17
- AsyncInstitutionsResourceWithStreamingResponse,
18
- )
19
-
20
- __all__ = [
21
- "OrdersResource",
22
- "AsyncOrdersResource",
23
- "OrdersResourceWithRawResponse",
24
- "AsyncOrdersResourceWithRawResponse",
25
- "OrdersResourceWithStreamingResponse",
26
- "AsyncOrdersResourceWithStreamingResponse",
27
- "InstitutionsResource",
28
- "AsyncInstitutionsResource",
29
- "InstitutionsResourceWithRawResponse",
30
- "AsyncInstitutionsResourceWithRawResponse",
31
- "InstitutionsResourceWithStreamingResponse",
32
- "AsyncInstitutionsResourceWithStreamingResponse",
33
- ]
@@ -1,258 +0,0 @@
1
- # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
-
3
- from __future__ import annotations
4
-
5
- import httpx
6
-
7
- from .orders import (
8
- OrdersResource,
9
- AsyncOrdersResource,
10
- OrdersResourceWithRawResponse,
11
- AsyncOrdersResourceWithRawResponse,
12
- OrdersResourceWithStreamingResponse,
13
- AsyncOrdersResourceWithStreamingResponse,
14
- )
15
- from ....._types import NOT_GIVEN, Body, Query, Headers, NotGiven
16
- from ....._compat import cached_property
17
- from ....._resource import SyncAPIResource, AsyncAPIResource
18
- from ....._response import (
19
- to_raw_response_wrapper,
20
- to_streamed_response_wrapper,
21
- async_to_raw_response_wrapper,
22
- async_to_streamed_response_wrapper,
23
- )
24
- from ....._base_client import make_request_options
25
- from .....types.v2.ledger.institution_list_outstanding_accounts_response import (
26
- InstitutionListOutstandingAccountsResponse,
27
- )
28
- from .....types.v2.ledger.institution_retrieve_outstanding_orders_response import (
29
- InstitutionRetrieveOutstandingOrdersResponse,
30
- )
31
-
32
- __all__ = ["InstitutionsResource", "AsyncInstitutionsResource"]
33
-
34
-
35
- class InstitutionsResource(SyncAPIResource):
36
- @cached_property
37
- def orders(self) -> OrdersResource:
38
- return OrdersResource(self._client)
39
-
40
- @cached_property
41
- def with_raw_response(self) -> InstitutionsResourceWithRawResponse:
42
- """
43
- This property can be used as a prefix for any HTTP method call to return
44
- the raw response object instead of the parsed content.
45
-
46
- For more information, see https://www.github.com/samplehc/samplehc-python#accessing-raw-response-data-eg-headers
47
- """
48
- return InstitutionsResourceWithRawResponse(self)
49
-
50
- @cached_property
51
- def with_streaming_response(self) -> InstitutionsResourceWithStreamingResponse:
52
- """
53
- An alternative to `.with_raw_response` that doesn't eagerly read the response body.
54
-
55
- For more information, see https://www.github.com/samplehc/samplehc-python#with_streaming_response
56
- """
57
- return InstitutionsResourceWithStreamingResponse(self)
58
-
59
- def list_outstanding_accounts(
60
- self,
61
- *,
62
- # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
63
- # The extra values given here take precedence over values defined on the client or passed to this method.
64
- extra_headers: Headers | None = None,
65
- extra_query: Query | None = None,
66
- extra_body: Body | None = None,
67
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
68
- ) -> InstitutionListOutstandingAccountsResponse:
69
- """
70
- Retrieves all outstanding institutional accounts across all institutions
71
- (accounts with non-zero balances).
72
- """
73
- return self._get(
74
- "/api/v2/ledger/institutions/outstanding-accounts",
75
- options=make_request_options(
76
- extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
77
- ),
78
- cast_to=InstitutionListOutstandingAccountsResponse,
79
- )
80
-
81
- def retrieve_outstanding_orders(
82
- self,
83
- institution_id: str,
84
- *,
85
- # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
86
- # The extra values given here take precedence over values defined on the client or passed to this method.
87
- extra_headers: Headers | None = None,
88
- extra_query: Query | None = None,
89
- extra_body: Body | None = None,
90
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
91
- ) -> InstitutionRetrieveOutstandingOrdersResponse:
92
- """
93
- Retrieves all outstanding orders for a specific institution (accounts with
94
- non-zero balances).
95
-
96
- Args:
97
- extra_headers: Send extra headers
98
-
99
- extra_query: Add additional query parameters to the request
100
-
101
- extra_body: Add additional JSON properties to the request
102
-
103
- timeout: Override the client-level default timeout for this request, in seconds
104
- """
105
- if not institution_id:
106
- raise ValueError(f"Expected a non-empty value for `institution_id` but received {institution_id!r}")
107
- return self._get(
108
- f"/api/v2/ledger/institutions/{institution_id}/outstanding-orders",
109
- options=make_request_options(
110
- extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
111
- ),
112
- cast_to=InstitutionRetrieveOutstandingOrdersResponse,
113
- )
114
-
115
-
116
- class AsyncInstitutionsResource(AsyncAPIResource):
117
- @cached_property
118
- def orders(self) -> AsyncOrdersResource:
119
- return AsyncOrdersResource(self._client)
120
-
121
- @cached_property
122
- def with_raw_response(self) -> AsyncInstitutionsResourceWithRawResponse:
123
- """
124
- This property can be used as a prefix for any HTTP method call to return
125
- the raw response object instead of the parsed content.
126
-
127
- For more information, see https://www.github.com/samplehc/samplehc-python#accessing-raw-response-data-eg-headers
128
- """
129
- return AsyncInstitutionsResourceWithRawResponse(self)
130
-
131
- @cached_property
132
- def with_streaming_response(self) -> AsyncInstitutionsResourceWithStreamingResponse:
133
- """
134
- An alternative to `.with_raw_response` that doesn't eagerly read the response body.
135
-
136
- For more information, see https://www.github.com/samplehc/samplehc-python#with_streaming_response
137
- """
138
- return AsyncInstitutionsResourceWithStreamingResponse(self)
139
-
140
- async def list_outstanding_accounts(
141
- self,
142
- *,
143
- # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
144
- # The extra values given here take precedence over values defined on the client or passed to this method.
145
- extra_headers: Headers | None = None,
146
- extra_query: Query | None = None,
147
- extra_body: Body | None = None,
148
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
149
- ) -> InstitutionListOutstandingAccountsResponse:
150
- """
151
- Retrieves all outstanding institutional accounts across all institutions
152
- (accounts with non-zero balances).
153
- """
154
- return await self._get(
155
- "/api/v2/ledger/institutions/outstanding-accounts",
156
- options=make_request_options(
157
- extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
158
- ),
159
- cast_to=InstitutionListOutstandingAccountsResponse,
160
- )
161
-
162
- async def retrieve_outstanding_orders(
163
- self,
164
- institution_id: str,
165
- *,
166
- # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
167
- # The extra values given here take precedence over values defined on the client or passed to this method.
168
- extra_headers: Headers | None = None,
169
- extra_query: Query | None = None,
170
- extra_body: Body | None = None,
171
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
172
- ) -> InstitutionRetrieveOutstandingOrdersResponse:
173
- """
174
- Retrieves all outstanding orders for a specific institution (accounts with
175
- non-zero balances).
176
-
177
- Args:
178
- extra_headers: Send extra headers
179
-
180
- extra_query: Add additional query parameters to the request
181
-
182
- extra_body: Add additional JSON properties to the request
183
-
184
- timeout: Override the client-level default timeout for this request, in seconds
185
- """
186
- if not institution_id:
187
- raise ValueError(f"Expected a non-empty value for `institution_id` but received {institution_id!r}")
188
- return await self._get(
189
- f"/api/v2/ledger/institutions/{institution_id}/outstanding-orders",
190
- options=make_request_options(
191
- extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
192
- ),
193
- cast_to=InstitutionRetrieveOutstandingOrdersResponse,
194
- )
195
-
196
-
197
- class InstitutionsResourceWithRawResponse:
198
- def __init__(self, institutions: InstitutionsResource) -> None:
199
- self._institutions = institutions
200
-
201
- self.list_outstanding_accounts = to_raw_response_wrapper(
202
- institutions.list_outstanding_accounts,
203
- )
204
- self.retrieve_outstanding_orders = to_raw_response_wrapper(
205
- institutions.retrieve_outstanding_orders,
206
- )
207
-
208
- @cached_property
209
- def orders(self) -> OrdersResourceWithRawResponse:
210
- return OrdersResourceWithRawResponse(self._institutions.orders)
211
-
212
-
213
- class AsyncInstitutionsResourceWithRawResponse:
214
- def __init__(self, institutions: AsyncInstitutionsResource) -> None:
215
- self._institutions = institutions
216
-
217
- self.list_outstanding_accounts = async_to_raw_response_wrapper(
218
- institutions.list_outstanding_accounts,
219
- )
220
- self.retrieve_outstanding_orders = async_to_raw_response_wrapper(
221
- institutions.retrieve_outstanding_orders,
222
- )
223
-
224
- @cached_property
225
- def orders(self) -> AsyncOrdersResourceWithRawResponse:
226
- return AsyncOrdersResourceWithRawResponse(self._institutions.orders)
227
-
228
-
229
- class InstitutionsResourceWithStreamingResponse:
230
- def __init__(self, institutions: InstitutionsResource) -> None:
231
- self._institutions = institutions
232
-
233
- self.list_outstanding_accounts = to_streamed_response_wrapper(
234
- institutions.list_outstanding_accounts,
235
- )
236
- self.retrieve_outstanding_orders = to_streamed_response_wrapper(
237
- institutions.retrieve_outstanding_orders,
238
- )
239
-
240
- @cached_property
241
- def orders(self) -> OrdersResourceWithStreamingResponse:
242
- return OrdersResourceWithStreamingResponse(self._institutions.orders)
243
-
244
-
245
- class AsyncInstitutionsResourceWithStreamingResponse:
246
- def __init__(self, institutions: AsyncInstitutionsResource) -> None:
247
- self._institutions = institutions
248
-
249
- self.list_outstanding_accounts = async_to_streamed_response_wrapper(
250
- institutions.list_outstanding_accounts,
251
- )
252
- self.retrieve_outstanding_orders = async_to_streamed_response_wrapper(
253
- institutions.retrieve_outstanding_orders,
254
- )
255
-
256
- @cached_property
257
- def orders(self) -> AsyncOrdersResourceWithStreamingResponse:
258
- return AsyncOrdersResourceWithStreamingResponse(self._institutions.orders)
@@ -1,169 +0,0 @@
1
- # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
-
3
- from __future__ import annotations
4
-
5
- import httpx
6
-
7
- from ....._types import NOT_GIVEN, Body, Query, Headers, NotGiven
8
- from ....._compat import cached_property
9
- from ....._resource import SyncAPIResource, AsyncAPIResource
10
- from ....._response import (
11
- to_raw_response_wrapper,
12
- to_streamed_response_wrapper,
13
- async_to_raw_response_wrapper,
14
- async_to_streamed_response_wrapper,
15
- )
16
- from ....._base_client import make_request_options
17
- from .....types.v2.ledger.institutions.order_retrieve_balance_response import OrderRetrieveBalanceResponse
18
-
19
- __all__ = ["OrdersResource", "AsyncOrdersResource"]
20
-
21
-
22
- class OrdersResource(SyncAPIResource):
23
- @cached_property
24
- def with_raw_response(self) -> OrdersResourceWithRawResponse:
25
- """
26
- This property can be used as a prefix for any HTTP method call to return
27
- the raw response object instead of the parsed content.
28
-
29
- For more information, see https://www.github.com/samplehc/samplehc-python#accessing-raw-response-data-eg-headers
30
- """
31
- return OrdersResourceWithRawResponse(self)
32
-
33
- @cached_property
34
- def with_streaming_response(self) -> OrdersResourceWithStreamingResponse:
35
- """
36
- An alternative to `.with_raw_response` that doesn't eagerly read the response body.
37
-
38
- For more information, see https://www.github.com/samplehc/samplehc-python#with_streaming_response
39
- """
40
- return OrdersResourceWithStreamingResponse(self)
41
-
42
- def retrieve_balance(
43
- self,
44
- order_id: str,
45
- *,
46
- institution_id: str,
47
- # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
48
- # The extra values given here take precedence over values defined on the client or passed to this method.
49
- extra_headers: Headers | None = None,
50
- extra_query: Query | None = None,
51
- extra_body: Body | None = None,
52
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
53
- ) -> OrderRetrieveBalanceResponse:
54
- """
55
- Retrieves the balance for a specific institutional order.
56
-
57
- Args:
58
- extra_headers: Send extra headers
59
-
60
- extra_query: Add additional query parameters to the request
61
-
62
- extra_body: Add additional JSON properties to the request
63
-
64
- timeout: Override the client-level default timeout for this request, in seconds
65
- """
66
- if not institution_id:
67
- raise ValueError(f"Expected a non-empty value for `institution_id` but received {institution_id!r}")
68
- if not order_id:
69
- raise ValueError(f"Expected a non-empty value for `order_id` but received {order_id!r}")
70
- return self._get(
71
- f"/api/v2/ledger/institutions/{institution_id}/orders/{order_id}/balance",
72
- options=make_request_options(
73
- extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
74
- ),
75
- cast_to=OrderRetrieveBalanceResponse,
76
- )
77
-
78
-
79
- class AsyncOrdersResource(AsyncAPIResource):
80
- @cached_property
81
- def with_raw_response(self) -> AsyncOrdersResourceWithRawResponse:
82
- """
83
- This property can be used as a prefix for any HTTP method call to return
84
- the raw response object instead of the parsed content.
85
-
86
- For more information, see https://www.github.com/samplehc/samplehc-python#accessing-raw-response-data-eg-headers
87
- """
88
- return AsyncOrdersResourceWithRawResponse(self)
89
-
90
- @cached_property
91
- def with_streaming_response(self) -> AsyncOrdersResourceWithStreamingResponse:
92
- """
93
- An alternative to `.with_raw_response` that doesn't eagerly read the response body.
94
-
95
- For more information, see https://www.github.com/samplehc/samplehc-python#with_streaming_response
96
- """
97
- return AsyncOrdersResourceWithStreamingResponse(self)
98
-
99
- async def retrieve_balance(
100
- self,
101
- order_id: str,
102
- *,
103
- institution_id: str,
104
- # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
105
- # The extra values given here take precedence over values defined on the client or passed to this method.
106
- extra_headers: Headers | None = None,
107
- extra_query: Query | None = None,
108
- extra_body: Body | None = None,
109
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
110
- ) -> OrderRetrieveBalanceResponse:
111
- """
112
- Retrieves the balance for a specific institutional order.
113
-
114
- Args:
115
- extra_headers: Send extra headers
116
-
117
- extra_query: Add additional query parameters to the request
118
-
119
- extra_body: Add additional JSON properties to the request
120
-
121
- timeout: Override the client-level default timeout for this request, in seconds
122
- """
123
- if not institution_id:
124
- raise ValueError(f"Expected a non-empty value for `institution_id` but received {institution_id!r}")
125
- if not order_id:
126
- raise ValueError(f"Expected a non-empty value for `order_id` but received {order_id!r}")
127
- return await self._get(
128
- f"/api/v2/ledger/institutions/{institution_id}/orders/{order_id}/balance",
129
- options=make_request_options(
130
- extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
131
- ),
132
- cast_to=OrderRetrieveBalanceResponse,
133
- )
134
-
135
-
136
- class OrdersResourceWithRawResponse:
137
- def __init__(self, orders: OrdersResource) -> None:
138
- self._orders = orders
139
-
140
- self.retrieve_balance = to_raw_response_wrapper(
141
- orders.retrieve_balance,
142
- )
143
-
144
-
145
- class AsyncOrdersResourceWithRawResponse:
146
- def __init__(self, orders: AsyncOrdersResource) -> None:
147
- self._orders = orders
148
-
149
- self.retrieve_balance = async_to_raw_response_wrapper(
150
- orders.retrieve_balance,
151
- )
152
-
153
-
154
- class OrdersResourceWithStreamingResponse:
155
- def __init__(self, orders: OrdersResource) -> None:
156
- self._orders = orders
157
-
158
- self.retrieve_balance = to_streamed_response_wrapper(
159
- orders.retrieve_balance,
160
- )
161
-
162
-
163
- class AsyncOrdersResourceWithStreamingResponse:
164
- def __init__(self, orders: AsyncOrdersResource) -> None:
165
- self._orders = orders
166
-
167
- self.retrieve_balance = async_to_streamed_response_wrapper(
168
- orders.retrieve_balance,
169
- )