samplehc 0.17.0__py3-none-any.whl → 0.19.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 (154) hide show
  1. samplehc/_base_client.py +5 -2
  2. samplehc/_client.py +1 -38
  3. samplehc/_compat.py +3 -3
  4. samplehc/_utils/_json.py +35 -0
  5. samplehc/_version.py +1 -1
  6. samplehc/resources/__init__.py +0 -14
  7. samplehc/resources/v2/__init__.py +0 -98
  8. samplehc/resources/v2/async_results.py +0 -79
  9. samplehc/resources/v2/documents/__init__.py +0 -14
  10. samplehc/resources/v2/documents/documents.py +44 -196
  11. samplehc/resources/v2/v2.py +0 -224
  12. samplehc/types/__init__.py +0 -5
  13. samplehc/types/v2/__init__.py +0 -53
  14. samplehc/types/v2/document_extract_params.py +20 -1
  15. samplehc/types/v2/documents/__init__.py +0 -3
  16. {samplehc-0.17.0.dist-info → samplehc-0.19.0.dist-info}/METADATA +22 -27
  17. samplehc-0.19.0.dist-info/RECORD +93 -0
  18. samplehc/resources/v1/__init__.py +0 -19
  19. samplehc/resources/v1/v1.py +0 -298
  20. samplehc/resources/v2/clearinghouse/__init__.py +0 -47
  21. samplehc/resources/v2/clearinghouse/claim.py +0 -407
  22. samplehc/resources/v2/clearinghouse/clearinghouse.py +0 -844
  23. samplehc/resources/v2/clearinghouse/payers.py +0 -224
  24. samplehc/resources/v2/documents/pdf_template.py +0 -165
  25. samplehc/resources/v2/hie/__init__.py +0 -47
  26. samplehc/resources/v2/hie/adt.py +0 -249
  27. samplehc/resources/v2/hie/documents.py +0 -390
  28. samplehc/resources/v2/hie/hie.py +0 -134
  29. samplehc/resources/v2/integrations/__init__.py +0 -131
  30. samplehc/resources/v2/integrations/bank/__init__.py +0 -33
  31. samplehc/resources/v2/integrations/bank/bank.py +0 -102
  32. samplehc/resources/v2/integrations/bank/transactions.py +0 -185
  33. samplehc/resources/v2/integrations/careviso.py +0 -372
  34. samplehc/resources/v2/integrations/glidian/__init__.py +0 -33
  35. samplehc/resources/v2/integrations/glidian/glidian.py +0 -425
  36. samplehc/resources/v2/integrations/glidian/prior_authorizations/__init__.py +0 -33
  37. samplehc/resources/v2/integrations/glidian/prior_authorizations/clinical_questions.py +0 -276
  38. samplehc/resources/v2/integrations/glidian/prior_authorizations/prior_authorizations.py +0 -527
  39. samplehc/resources/v2/integrations/integrations.py +0 -326
  40. samplehc/resources/v2/integrations/kno2/__init__.py +0 -33
  41. samplehc/resources/v2/integrations/kno2/kno2.py +0 -102
  42. samplehc/resources/v2/integrations/kno2/messages.py +0 -260
  43. samplehc/resources/v2/integrations/salesforce.py +0 -277
  44. samplehc/resources/v2/integrations/snowflake.py +0 -173
  45. samplehc/resources/v2/integrations/wellsky/__init__.py +0 -33
  46. samplehc/resources/v2/integrations/wellsky/patients.py +0 -324
  47. samplehc/resources/v2/integrations/wellsky/wellsky.py +0 -102
  48. samplehc/resources/v2/integrations/xcures.py +0 -197
  49. samplehc/resources/v2/policies.py +0 -655
  50. samplehc/resources/v2/tasks/__init__.py +0 -33
  51. samplehc/resources/v2/tasks/state.py +0 -266
  52. samplehc/resources/v2/tasks/tasks.py +0 -754
  53. samplehc/resources/v2/workflow_runs/__init__.py +0 -33
  54. samplehc/resources/v2/workflow_runs/step.py +0 -169
  55. samplehc/resources/v2/workflow_runs/workflow_runs.py +0 -479
  56. samplehc/resources/v2/workflows.py +0 -377
  57. samplehc/types/v1/__init__.py +0 -3
  58. samplehc/types/v1_query_audit_logs_params.py +0 -12
  59. samplehc/types/v1_query_audit_logs_response.py +0 -16
  60. samplehc/types/v1_sql_execute_params.py +0 -27
  61. samplehc/types/v1_sql_execute_response.py +0 -27
  62. samplehc/types/v2/async_result_retrieve_response.py +0 -18
  63. samplehc/types/v2/clearinghouse/__init__.py +0 -9
  64. samplehc/types/v2/clearinghouse/claim_submit_params.py +0 -2693
  65. samplehc/types/v2/clearinghouse/claim_submit_response.py +0 -23
  66. samplehc/types/v2/clearinghouse/payer_list_response.py +0 -27
  67. samplehc/types/v2/clearinghouse/payer_search_params.py +0 -12
  68. samplehc/types/v2/clearinghouse/payer_search_response.py +0 -33
  69. samplehc/types/v2/clearinghouse_calculate_patient_cost_params.py +0 -3129
  70. samplehc/types/v2/clearinghouse_check_claim_status_params.py +0 -41
  71. samplehc/types/v2/clearinghouse_check_eligibility_params.py +0 -36
  72. samplehc/types/v2/clearinghouse_check_eligibility_response.py +0 -15
  73. samplehc/types/v2/clearinghouse_coordination_of_benefits_params.py +0 -35
  74. samplehc/types/v2/clearinghouse_run_discovery_params.py +0 -59
  75. samplehc/types/v2/clearinghouse_run_discovery_response.py +0 -13
  76. samplehc/types/v2/document_unzip_async_response.py +0 -12
  77. samplehc/types/v2/document_unzip_response.py +0 -20
  78. samplehc/types/v2/documents/pdf_template_retrieve_metadata_response.py +0 -17
  79. samplehc/types/v2/hie/__init__.py +0 -8
  80. samplehc/types/v2/hie/adt_subscribe_params.py +0 -92
  81. samplehc/types/v2/hie/document_query_params.py +0 -92
  82. samplehc/types/v2/hie/document_query_response.py +0 -16
  83. samplehc/types/v2/hie/document_upload_params.py +0 -54
  84. samplehc/types/v2/integrations/__init__.py +0 -23
  85. samplehc/types/v2/integrations/bank/__init__.py +0 -6
  86. samplehc/types/v2/integrations/bank/transaction_sync_params.py +0 -15
  87. samplehc/types/v2/integrations/bank/transaction_sync_response.py +0 -26
  88. samplehc/types/v2/integrations/careviso_get_payers_response.py +0 -19
  89. samplehc/types/v2/integrations/careviso_submit_prior_authorization_params.py +0 -90
  90. samplehc/types/v2/integrations/glidian/__init__.py +0 -20
  91. samplehc/types/v2/integrations/glidian/prior_authorization_create_draft_params.py +0 -32
  92. samplehc/types/v2/integrations/glidian/prior_authorization_create_draft_response.py +0 -24
  93. samplehc/types/v2/integrations/glidian/prior_authorization_retrieve_record_response.py +0 -13
  94. samplehc/types/v2/integrations/glidian/prior_authorization_submit_response.py +0 -16
  95. samplehc/types/v2/integrations/glidian/prior_authorization_update_record_params.py +0 -20
  96. samplehc/types/v2/integrations/glidian/prior_authorization_update_record_response.py +0 -16
  97. samplehc/types/v2/integrations/glidian/prior_authorizations/__init__.py +0 -7
  98. samplehc/types/v2/integrations/glidian/prior_authorizations/clinical_question_list_response.py +0 -42
  99. samplehc/types/v2/integrations/glidian/prior_authorizations/clinical_question_update_params.py +0 -23
  100. samplehc/types/v2/integrations/glidian/prior_authorizations/clinical_question_update_response.py +0 -19
  101. samplehc/types/v2/integrations/glidian_get_submission_requirements_params.py +0 -17
  102. samplehc/types/v2/integrations/glidian_get_submission_requirements_response.py +0 -31
  103. samplehc/types/v2/integrations/glidian_list_payers_params.py +0 -11
  104. samplehc/types/v2/integrations/glidian_list_payers_response.py +0 -17
  105. samplehc/types/v2/integrations/glidian_list_services_params.py +0 -13
  106. samplehc/types/v2/integrations/glidian_list_services_response.py +0 -19
  107. samplehc/types/v2/integrations/kno2/__init__.py +0 -6
  108. samplehc/types/v2/integrations/kno2/message_get_attachment_response.py +0 -15
  109. samplehc/types/v2/integrations/kno2/message_retrieve_response.py +0 -13
  110. samplehc/types/v2/integrations/salesforce_run_crud_action_params.py +0 -22
  111. samplehc/types/v2/integrations/salesforce_run_soql_query_params.py +0 -11
  112. samplehc/types/v2/integrations/snowflake_query_params.py +0 -12
  113. samplehc/types/v2/integrations/snowflake_query_response.py +0 -8
  114. samplehc/types/v2/integrations/wellsky/__init__.py +0 -6
  115. samplehc/types/v2/integrations/wellsky/patient_add_params.py +0 -13
  116. samplehc/types/v2/integrations/wellsky/patient_search_params.py +0 -32
  117. samplehc/types/v2/integrations/xcure_make_request_params.py +0 -18
  118. samplehc/types/v2/ledger/__init__.py +0 -3
  119. samplehc/types/v2/policy_list_companies_params.py +0 -18
  120. samplehc/types/v2/policy_list_companies_response.py +0 -24
  121. samplehc/types/v2/policy_list_params.py +0 -47
  122. samplehc/types/v2/policy_list_plans_params.py +0 -18
  123. samplehc/types/v2/policy_list_plans_response.py +0 -30
  124. samplehc/types/v2/policy_list_response.py +0 -67
  125. samplehc/types/v2/policy_retrieve_presigned_url_response.py +0 -17
  126. samplehc/types/v2/policy_retrieve_text_response.py +0 -12
  127. samplehc/types/v2/task_cancel_response.py +0 -12
  128. samplehc/types/v2/task_complete_params.py +0 -12
  129. samplehc/types/v2/task_complete_response.py +0 -16
  130. samplehc/types/v2/task_get_suspended_payload_response.py +0 -8
  131. samplehc/types/v2/task_retrieve_response.py +0 -22
  132. samplehc/types/v2/task_retry_response.py +0 -10
  133. samplehc/types/v2/task_update_column_params.py +0 -19
  134. samplehc/types/v2/task_update_column_response.py +0 -9
  135. samplehc/types/v2/task_update_screen_time_params.py +0 -14
  136. samplehc/types/v2/task_update_screen_time_response.py +0 -8
  137. samplehc/types/v2/tasks/__init__.py +0 -7
  138. samplehc/types/v2/tasks/state_get_response.py +0 -8
  139. samplehc/types/v2/tasks/state_update_params.py +0 -13
  140. samplehc/types/v2/tasks/state_update_response.py +0 -9
  141. samplehc/types/v2/workflow_deploy_response.py +0 -12
  142. samplehc/types/v2/workflow_query_params.py +0 -12
  143. samplehc/types/v2/workflow_query_response.py +0 -8
  144. samplehc/types/v2/workflow_run_get_start_data_response.py +0 -14
  145. samplehc/types/v2/workflow_run_resume_when_complete_params.py +0 -14
  146. samplehc/types/v2/workflow_run_resume_when_complete_response.py +0 -12
  147. samplehc/types/v2/workflow_run_retrieve_response.py +0 -16
  148. samplehc/types/v2/workflow_runs/__init__.py +0 -5
  149. samplehc/types/v2/workflow_runs/step_get_output_response.py +0 -14
  150. samplehc/types/v2/workflow_start_params.py +0 -25
  151. samplehc/types/v2/workflow_start_response.py +0 -25
  152. samplehc-0.17.0.dist-info/RECORD +0 -226
  153. {samplehc-0.17.0.dist-info → samplehc-0.19.0.dist-info}/WHEEL +0 -0
  154. {samplehc-0.17.0.dist-info → samplehc-0.19.0.dist-info}/licenses/LICENSE +0 -0
@@ -1,260 +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 Body, Query, Headers, NotGiven, not_given
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.integrations.kno2.message_retrieve_response import MessageRetrieveResponse
18
- from .....types.v2.integrations.kno2.message_get_attachment_response import MessageGetAttachmentResponse
19
-
20
- __all__ = ["MessagesResource", "AsyncMessagesResource"]
21
-
22
-
23
- class MessagesResource(SyncAPIResource):
24
- @cached_property
25
- def with_raw_response(self) -> MessagesResourceWithRawResponse:
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 MessagesResourceWithRawResponse(self)
33
-
34
- @cached_property
35
- def with_streaming_response(self) -> MessagesResourceWithStreamingResponse:
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 MessagesResourceWithStreamingResponse(self)
42
-
43
- def retrieve(
44
- self,
45
- message_id: str,
46
- *,
47
- slug: str,
48
- # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
49
- # The extra values given here take precedence over values defined on the client or passed to this method.
50
- extra_headers: Headers | None = None,
51
- extra_query: Query | None = None,
52
- extra_body: Body | None = None,
53
- timeout: float | httpx.Timeout | None | NotGiven = not_given,
54
- ) -> MessageRetrieveResponse:
55
- """
56
- Retrieve a specific message for a Kno2 connection.
57
-
58
- Args:
59
- extra_headers: Send extra headers
60
-
61
- extra_query: Add additional query parameters to the request
62
-
63
- extra_body: Add additional JSON properties to the request
64
-
65
- timeout: Override the client-level default timeout for this request, in seconds
66
- """
67
- if not slug:
68
- raise ValueError(f"Expected a non-empty value for `slug` but received {slug!r}")
69
- if not message_id:
70
- raise ValueError(f"Expected a non-empty value for `message_id` but received {message_id!r}")
71
- return self._get(
72
- f"/api/v2/integrations/kno2/{slug}/messages/{message_id}",
73
- options=make_request_options(
74
- extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
75
- ),
76
- cast_to=MessageRetrieveResponse,
77
- )
78
-
79
- def get_attachment(
80
- self,
81
- attachment_id: str,
82
- *,
83
- slug: str,
84
- message_id: str,
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
- ) -> MessageGetAttachmentResponse:
92
- """
93
- Retrieve a specific attachment for a Kno2 message.
94
-
95
- Args:
96
- extra_headers: Send extra headers
97
-
98
- extra_query: Add additional query parameters to the request
99
-
100
- extra_body: Add additional JSON properties to the request
101
-
102
- timeout: Override the client-level default timeout for this request, in seconds
103
- """
104
- if not slug:
105
- raise ValueError(f"Expected a non-empty value for `slug` but received {slug!r}")
106
- if not message_id:
107
- raise ValueError(f"Expected a non-empty value for `message_id` but received {message_id!r}")
108
- if not attachment_id:
109
- raise ValueError(f"Expected a non-empty value for `attachment_id` but received {attachment_id!r}")
110
- return self._get(
111
- f"/api/v2/integrations/kno2/{slug}/messages/{message_id}/attachments/{attachment_id}",
112
- options=make_request_options(
113
- extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
114
- ),
115
- cast_to=MessageGetAttachmentResponse,
116
- )
117
-
118
-
119
- class AsyncMessagesResource(AsyncAPIResource):
120
- @cached_property
121
- def with_raw_response(self) -> AsyncMessagesResourceWithRawResponse:
122
- """
123
- This property can be used as a prefix for any HTTP method call to return
124
- the raw response object instead of the parsed content.
125
-
126
- For more information, see https://www.github.com/samplehc/samplehc-python#accessing-raw-response-data-eg-headers
127
- """
128
- return AsyncMessagesResourceWithRawResponse(self)
129
-
130
- @cached_property
131
- def with_streaming_response(self) -> AsyncMessagesResourceWithStreamingResponse:
132
- """
133
- An alternative to `.with_raw_response` that doesn't eagerly read the response body.
134
-
135
- For more information, see https://www.github.com/samplehc/samplehc-python#with_streaming_response
136
- """
137
- return AsyncMessagesResourceWithStreamingResponse(self)
138
-
139
- async def retrieve(
140
- self,
141
- message_id: str,
142
- *,
143
- slug: str,
144
- # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
145
- # The extra values given here take precedence over values defined on the client or passed to this method.
146
- extra_headers: Headers | None = None,
147
- extra_query: Query | None = None,
148
- extra_body: Body | None = None,
149
- timeout: float | httpx.Timeout | None | NotGiven = not_given,
150
- ) -> MessageRetrieveResponse:
151
- """
152
- Retrieve a specific message for a Kno2 connection.
153
-
154
- Args:
155
- extra_headers: Send extra headers
156
-
157
- extra_query: Add additional query parameters to the request
158
-
159
- extra_body: Add additional JSON properties to the request
160
-
161
- timeout: Override the client-level default timeout for this request, in seconds
162
- """
163
- if not slug:
164
- raise ValueError(f"Expected a non-empty value for `slug` but received {slug!r}")
165
- if not message_id:
166
- raise ValueError(f"Expected a non-empty value for `message_id` but received {message_id!r}")
167
- return await self._get(
168
- f"/api/v2/integrations/kno2/{slug}/messages/{message_id}",
169
- options=make_request_options(
170
- extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
171
- ),
172
- cast_to=MessageRetrieveResponse,
173
- )
174
-
175
- async def get_attachment(
176
- self,
177
- attachment_id: str,
178
- *,
179
- slug: str,
180
- message_id: str,
181
- # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
182
- # The extra values given here take precedence over values defined on the client or passed to this method.
183
- extra_headers: Headers | None = None,
184
- extra_query: Query | None = None,
185
- extra_body: Body | None = None,
186
- timeout: float | httpx.Timeout | None | NotGiven = not_given,
187
- ) -> MessageGetAttachmentResponse:
188
- """
189
- Retrieve a specific attachment for a Kno2 message.
190
-
191
- Args:
192
- extra_headers: Send extra headers
193
-
194
- extra_query: Add additional query parameters to the request
195
-
196
- extra_body: Add additional JSON properties to the request
197
-
198
- timeout: Override the client-level default timeout for this request, in seconds
199
- """
200
- if not slug:
201
- raise ValueError(f"Expected a non-empty value for `slug` but received {slug!r}")
202
- if not message_id:
203
- raise ValueError(f"Expected a non-empty value for `message_id` but received {message_id!r}")
204
- if not attachment_id:
205
- raise ValueError(f"Expected a non-empty value for `attachment_id` but received {attachment_id!r}")
206
- return await self._get(
207
- f"/api/v2/integrations/kno2/{slug}/messages/{message_id}/attachments/{attachment_id}",
208
- options=make_request_options(
209
- extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
210
- ),
211
- cast_to=MessageGetAttachmentResponse,
212
- )
213
-
214
-
215
- class MessagesResourceWithRawResponse:
216
- def __init__(self, messages: MessagesResource) -> None:
217
- self._messages = messages
218
-
219
- self.retrieve = to_raw_response_wrapper(
220
- messages.retrieve,
221
- )
222
- self.get_attachment = to_raw_response_wrapper(
223
- messages.get_attachment,
224
- )
225
-
226
-
227
- class AsyncMessagesResourceWithRawResponse:
228
- def __init__(self, messages: AsyncMessagesResource) -> None:
229
- self._messages = messages
230
-
231
- self.retrieve = async_to_raw_response_wrapper(
232
- messages.retrieve,
233
- )
234
- self.get_attachment = async_to_raw_response_wrapper(
235
- messages.get_attachment,
236
- )
237
-
238
-
239
- class MessagesResourceWithStreamingResponse:
240
- def __init__(self, messages: MessagesResource) -> None:
241
- self._messages = messages
242
-
243
- self.retrieve = to_streamed_response_wrapper(
244
- messages.retrieve,
245
- )
246
- self.get_attachment = to_streamed_response_wrapper(
247
- messages.get_attachment,
248
- )
249
-
250
-
251
- class AsyncMessagesResourceWithStreamingResponse:
252
- def __init__(self, messages: AsyncMessagesResource) -> None:
253
- self._messages = messages
254
-
255
- self.retrieve = async_to_streamed_response_wrapper(
256
- messages.retrieve,
257
- )
258
- self.get_attachment = async_to_streamed_response_wrapper(
259
- messages.get_attachment,
260
- )
@@ -1,277 +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 Literal
7
-
8
- import httpx
9
-
10
- from ...._types import Body, Omit, Query, Headers, NotGiven, omit, not_given
11
- from ...._utils import maybe_transform, 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.integrations import salesforce_run_soql_query_params, salesforce_run_crud_action_params
22
-
23
- __all__ = ["SalesforceResource", "AsyncSalesforceResource"]
24
-
25
-
26
- class SalesforceResource(SyncAPIResource):
27
- @cached_property
28
- def with_raw_response(self) -> SalesforceResourceWithRawResponse:
29
- """
30
- This property can be used as a prefix for any HTTP method call to return
31
- the raw response object instead of the parsed content.
32
-
33
- For more information, see https://www.github.com/samplehc/samplehc-python#accessing-raw-response-data-eg-headers
34
- """
35
- return SalesforceResourceWithRawResponse(self)
36
-
37
- @cached_property
38
- def with_streaming_response(self) -> SalesforceResourceWithStreamingResponse:
39
- """
40
- An alternative to `.with_raw_response` that doesn't eagerly read the response body.
41
-
42
- For more information, see https://www.github.com/samplehc/samplehc-python#with_streaming_response
43
- """
44
- return SalesforceResourceWithStreamingResponse(self)
45
-
46
- def run_crud_action(
47
- self,
48
- slug: str,
49
- *,
50
- crud_action_type: Literal["create", "update", "upsert", "delete", "retrieve"],
51
- resource_type: str,
52
- resource_body: Dict[str, object] | Omit = omit,
53
- resource_id: str | Omit = omit,
54
- # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
55
- # The extra values given here take precedence over values defined on the client or passed to this method.
56
- extra_headers: Headers | None = None,
57
- extra_query: Query | None = None,
58
- extra_body: Body | None = None,
59
- timeout: float | httpx.Timeout | None | NotGiven = not_given,
60
- ) -> object:
61
- """
62
- Resolve connection by slug and run a CRUD action on a Salesforce sObject.
63
-
64
- Args:
65
- extra_headers: Send extra headers
66
-
67
- extra_query: Add additional query parameters to the request
68
-
69
- extra_body: Add additional JSON properties to the request
70
-
71
- timeout: Override the client-level default timeout for this request, in seconds
72
- """
73
- if not slug:
74
- raise ValueError(f"Expected a non-empty value for `slug` but received {slug!r}")
75
- return self._post(
76
- f"/api/v2/integrations/salesforce/{slug}/crud-action",
77
- body=maybe_transform(
78
- {
79
- "crud_action_type": crud_action_type,
80
- "resource_type": resource_type,
81
- "resource_body": resource_body,
82
- "resource_id": resource_id,
83
- },
84
- salesforce_run_crud_action_params.SalesforceRunCrudActionParams,
85
- ),
86
- options=make_request_options(
87
- extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
88
- ),
89
- cast_to=object,
90
- )
91
-
92
- def run_soql_query(
93
- self,
94
- slug: str,
95
- *,
96
- query: str,
97
- # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
98
- # The extra values given here take precedence over values defined on the client or passed to this method.
99
- extra_headers: Headers | None = None,
100
- extra_query: Query | None = None,
101
- extra_body: Body | None = None,
102
- timeout: float | httpx.Timeout | None | NotGiven = not_given,
103
- ) -> object:
104
- """
105
- Resolve connection by slug and run a SOQL query on Salesforce.
106
-
107
- Args:
108
- extra_headers: Send extra headers
109
-
110
- extra_query: Add additional query parameters to the request
111
-
112
- extra_body: Add additional JSON properties to the request
113
-
114
- timeout: Override the client-level default timeout for this request, in seconds
115
- """
116
- if not slug:
117
- raise ValueError(f"Expected a non-empty value for `slug` but received {slug!r}")
118
- return self._post(
119
- f"/api/v2/integrations/salesforce/{slug}/soql-query",
120
- body=maybe_transform({"query": query}, salesforce_run_soql_query_params.SalesforceRunSoqlQueryParams),
121
- options=make_request_options(
122
- extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
123
- ),
124
- cast_to=object,
125
- )
126
-
127
-
128
- class AsyncSalesforceResource(AsyncAPIResource):
129
- @cached_property
130
- def with_raw_response(self) -> AsyncSalesforceResourceWithRawResponse:
131
- """
132
- This property can be used as a prefix for any HTTP method call to return
133
- the raw response object instead of the parsed content.
134
-
135
- For more information, see https://www.github.com/samplehc/samplehc-python#accessing-raw-response-data-eg-headers
136
- """
137
- return AsyncSalesforceResourceWithRawResponse(self)
138
-
139
- @cached_property
140
- def with_streaming_response(self) -> AsyncSalesforceResourceWithStreamingResponse:
141
- """
142
- An alternative to `.with_raw_response` that doesn't eagerly read the response body.
143
-
144
- For more information, see https://www.github.com/samplehc/samplehc-python#with_streaming_response
145
- """
146
- return AsyncSalesforceResourceWithStreamingResponse(self)
147
-
148
- async def run_crud_action(
149
- self,
150
- slug: str,
151
- *,
152
- crud_action_type: Literal["create", "update", "upsert", "delete", "retrieve"],
153
- resource_type: str,
154
- resource_body: Dict[str, object] | Omit = omit,
155
- resource_id: str | Omit = omit,
156
- # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
157
- # The extra values given here take precedence over values defined on the client or passed to this method.
158
- extra_headers: Headers | None = None,
159
- extra_query: Query | None = None,
160
- extra_body: Body | None = None,
161
- timeout: float | httpx.Timeout | None | NotGiven = not_given,
162
- ) -> object:
163
- """
164
- Resolve connection by slug and run a CRUD action on a Salesforce sObject.
165
-
166
- Args:
167
- extra_headers: Send extra headers
168
-
169
- extra_query: Add additional query parameters to the request
170
-
171
- extra_body: Add additional JSON properties to the request
172
-
173
- timeout: Override the client-level default timeout for this request, in seconds
174
- """
175
- if not slug:
176
- raise ValueError(f"Expected a non-empty value for `slug` but received {slug!r}")
177
- return await self._post(
178
- f"/api/v2/integrations/salesforce/{slug}/crud-action",
179
- body=await async_maybe_transform(
180
- {
181
- "crud_action_type": crud_action_type,
182
- "resource_type": resource_type,
183
- "resource_body": resource_body,
184
- "resource_id": resource_id,
185
- },
186
- salesforce_run_crud_action_params.SalesforceRunCrudActionParams,
187
- ),
188
- options=make_request_options(
189
- extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
190
- ),
191
- cast_to=object,
192
- )
193
-
194
- async def run_soql_query(
195
- self,
196
- slug: str,
197
- *,
198
- query: str,
199
- # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
200
- # The extra values given here take precedence over values defined on the client or passed to this method.
201
- extra_headers: Headers | None = None,
202
- extra_query: Query | None = None,
203
- extra_body: Body | None = None,
204
- timeout: float | httpx.Timeout | None | NotGiven = not_given,
205
- ) -> object:
206
- """
207
- Resolve connection by slug and run a SOQL query on Salesforce.
208
-
209
- Args:
210
- extra_headers: Send extra headers
211
-
212
- extra_query: Add additional query parameters to the request
213
-
214
- extra_body: Add additional JSON properties to the request
215
-
216
- timeout: Override the client-level default timeout for this request, in seconds
217
- """
218
- if not slug:
219
- raise ValueError(f"Expected a non-empty value for `slug` but received {slug!r}")
220
- return await self._post(
221
- f"/api/v2/integrations/salesforce/{slug}/soql-query",
222
- body=await async_maybe_transform(
223
- {"query": query}, salesforce_run_soql_query_params.SalesforceRunSoqlQueryParams
224
- ),
225
- options=make_request_options(
226
- extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
227
- ),
228
- cast_to=object,
229
- )
230
-
231
-
232
- class SalesforceResourceWithRawResponse:
233
- def __init__(self, salesforce: SalesforceResource) -> None:
234
- self._salesforce = salesforce
235
-
236
- self.run_crud_action = to_raw_response_wrapper(
237
- salesforce.run_crud_action,
238
- )
239
- self.run_soql_query = to_raw_response_wrapper(
240
- salesforce.run_soql_query,
241
- )
242
-
243
-
244
- class AsyncSalesforceResourceWithRawResponse:
245
- def __init__(self, salesforce: AsyncSalesforceResource) -> None:
246
- self._salesforce = salesforce
247
-
248
- self.run_crud_action = async_to_raw_response_wrapper(
249
- salesforce.run_crud_action,
250
- )
251
- self.run_soql_query = async_to_raw_response_wrapper(
252
- salesforce.run_soql_query,
253
- )
254
-
255
-
256
- class SalesforceResourceWithStreamingResponse:
257
- def __init__(self, salesforce: SalesforceResource) -> None:
258
- self._salesforce = salesforce
259
-
260
- self.run_crud_action = to_streamed_response_wrapper(
261
- salesforce.run_crud_action,
262
- )
263
- self.run_soql_query = to_streamed_response_wrapper(
264
- salesforce.run_soql_query,
265
- )
266
-
267
-
268
- class AsyncSalesforceResourceWithStreamingResponse:
269
- def __init__(self, salesforce: AsyncSalesforceResource) -> None:
270
- self._salesforce = salesforce
271
-
272
- self.run_crud_action = async_to_streamed_response_wrapper(
273
- salesforce.run_crud_action,
274
- )
275
- self.run_soql_query = async_to_streamed_response_wrapper(
276
- salesforce.run_soql_query,
277
- )