samplehc 0.18.0__py3-none-any.whl → 0.20.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.
samplehc/_base_client.py CHANGED
@@ -86,6 +86,7 @@ from ._exceptions import (
86
86
  APIConnectionError,
87
87
  APIResponseValidationError,
88
88
  )
89
+ from ._utils._json import openapi_dumps
89
90
 
90
91
  log: logging.Logger = logging.getLogger(__name__)
91
92
 
@@ -554,8 +555,10 @@ class BaseClient(Generic[_HttpxClientT, _DefaultStreamT]):
554
555
  kwargs["content"] = options.content
555
556
  elif isinstance(json_data, bytes):
556
557
  kwargs["content"] = json_data
557
- else:
558
- kwargs["json"] = json_data if is_given(json_data) else None
558
+ elif not files:
559
+ # Don't set content when JSON is sent as multipart/form-data,
560
+ # since httpx's content param overrides other body arguments
561
+ kwargs["content"] = openapi_dumps(json_data) if is_given(json_data) and json_data is not None else None
559
562
  kwargs["files"] = files
560
563
  else:
561
564
  headers.pop("Content-Type", None)
samplehc/_compat.py CHANGED
@@ -139,6 +139,7 @@ def model_dump(
139
139
  exclude_defaults: bool = False,
140
140
  warnings: bool = True,
141
141
  mode: Literal["json", "python"] = "python",
142
+ by_alias: bool | None = None,
142
143
  ) -> dict[str, Any]:
143
144
  if (not PYDANTIC_V1) or hasattr(model, "model_dump"):
144
145
  return model.model_dump(
@@ -148,13 +149,12 @@ def model_dump(
148
149
  exclude_defaults=exclude_defaults,
149
150
  # warnings are not supported in Pydantic v1
150
151
  warnings=True if PYDANTIC_V1 else warnings,
152
+ by_alias=by_alias,
151
153
  )
152
154
  return cast(
153
155
  "dict[str, Any]",
154
156
  model.dict( # pyright: ignore[reportDeprecated, reportUnnecessaryCast]
155
- exclude=exclude,
156
- exclude_unset=exclude_unset,
157
- exclude_defaults=exclude_defaults,
157
+ exclude=exclude, exclude_unset=exclude_unset, exclude_defaults=exclude_defaults, by_alias=bool(by_alias)
158
158
  ),
159
159
  )
160
160
 
@@ -0,0 +1,35 @@
1
+ import json
2
+ from typing import Any
3
+ from datetime import datetime
4
+ from typing_extensions import override
5
+
6
+ import pydantic
7
+
8
+ from .._compat import model_dump
9
+
10
+
11
+ def openapi_dumps(obj: Any) -> bytes:
12
+ """
13
+ Serialize an object to UTF-8 encoded JSON bytes.
14
+
15
+ Extends the standard json.dumps with support for additional types
16
+ commonly used in the SDK, such as `datetime`, `pydantic.BaseModel`, etc.
17
+ """
18
+ return json.dumps(
19
+ obj,
20
+ cls=_CustomEncoder,
21
+ # Uses the same defaults as httpx's JSON serialization
22
+ ensure_ascii=False,
23
+ separators=(",", ":"),
24
+ allow_nan=False,
25
+ ).encode()
26
+
27
+
28
+ class _CustomEncoder(json.JSONEncoder):
29
+ @override
30
+ def default(self, o: Any) -> Any:
31
+ if isinstance(o, datetime):
32
+ return o.isoformat()
33
+ if isinstance(o, pydantic.BaseModel):
34
+ return model_dump(o, exclude_unset=True, mode="json", by_alias=True)
35
+ return super().default(o)
samplehc/_version.py CHANGED
@@ -1,4 +1,4 @@
1
1
  # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
2
 
3
3
  __title__ = "samplehc"
4
- __version__ = "0.18.0" # x-release-please-version
4
+ __version__ = "0.20.0" # x-release-please-version
@@ -48,8 +48,22 @@ from .communication import (
48
48
  CommunicationResourceWithStreamingResponse,
49
49
  AsyncCommunicationResourceWithStreamingResponse,
50
50
  )
51
+ from .workflow_runs import (
52
+ WorkflowRunsResource,
53
+ AsyncWorkflowRunsResource,
54
+ WorkflowRunsResourceWithRawResponse,
55
+ AsyncWorkflowRunsResourceWithRawResponse,
56
+ WorkflowRunsResourceWithStreamingResponse,
57
+ AsyncWorkflowRunsResourceWithStreamingResponse,
58
+ )
51
59
 
52
60
  __all__ = [
61
+ "WorkflowRunsResource",
62
+ "AsyncWorkflowRunsResource",
63
+ "WorkflowRunsResourceWithRawResponse",
64
+ "AsyncWorkflowRunsResourceWithRawResponse",
65
+ "WorkflowRunsResourceWithStreamingResponse",
66
+ "AsyncWorkflowRunsResourceWithStreamingResponse",
53
67
  "AsyncResultsResource",
54
68
  "AsyncAsyncResultsResource",
55
69
  "AsyncResultsResourceWithRawResponse",
@@ -278,8 +278,26 @@ class DocumentsResource(SyncAPIResource):
278
278
  documents: Iterable[document_extract_params.Document],
279
279
  prompt: str,
280
280
  response_json_schema: Dict[str, object],
281
- model: Literal["reasoning-3-mini", "reasoning-3", "base-5", "base-5-mini", "base-5-nano"] | Omit = omit,
281
+ model: Literal[
282
+ "reasoning-3-mini",
283
+ "reasoning-3",
284
+ "base-5",
285
+ "base-5-mini",
286
+ "base-5-nano",
287
+ "base-4.1",
288
+ "base-4.1-mini",
289
+ "base-4.1-nano",
290
+ "base-5.2",
291
+ "base-5.2-chat-latest",
292
+ "gemini-3-pro",
293
+ "gemini-3-flash",
294
+ "gemini-2.5-pro",
295
+ "gemini-2.5-flash",
296
+ "gemini-2.5-flash-lite",
297
+ ]
298
+ | Omit = omit,
282
299
  ocr_enhance: document_extract_params.OcrEnhance | Omit = omit,
300
+ ocr_quality: Literal["high", "low"] | Omit = omit,
283
301
  priority: Literal["interactive", "non-interactive"] | Omit = omit,
284
302
  reasoning_effort: Literal["low", "medium", "high"] | Omit = omit,
285
303
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -304,6 +322,8 @@ class DocumentsResource(SyncAPIResource):
304
322
 
305
323
  ocr_enhance: OCR enhancement configuration for figure and text analysis.
306
324
 
325
+ ocr_quality: OCR quality setting
326
+
307
327
  priority: The priority of the extraction task. Non-interactive is lower priority.
308
328
 
309
329
  reasoning_effort: Optional control over the reasoning effort for extraction.
@@ -325,6 +345,7 @@ class DocumentsResource(SyncAPIResource):
325
345
  "response_json_schema": response_json_schema,
326
346
  "model": model,
327
347
  "ocr_enhance": ocr_enhance,
348
+ "ocr_quality": ocr_quality,
328
349
  "priority": priority,
329
350
  "reasoning_effort": reasoning_effort,
330
351
  },
@@ -850,8 +871,26 @@ class AsyncDocumentsResource(AsyncAPIResource):
850
871
  documents: Iterable[document_extract_params.Document],
851
872
  prompt: str,
852
873
  response_json_schema: Dict[str, object],
853
- model: Literal["reasoning-3-mini", "reasoning-3", "base-5", "base-5-mini", "base-5-nano"] | Omit = omit,
874
+ model: Literal[
875
+ "reasoning-3-mini",
876
+ "reasoning-3",
877
+ "base-5",
878
+ "base-5-mini",
879
+ "base-5-nano",
880
+ "base-4.1",
881
+ "base-4.1-mini",
882
+ "base-4.1-nano",
883
+ "base-5.2",
884
+ "base-5.2-chat-latest",
885
+ "gemini-3-pro",
886
+ "gemini-3-flash",
887
+ "gemini-2.5-pro",
888
+ "gemini-2.5-flash",
889
+ "gemini-2.5-flash-lite",
890
+ ]
891
+ | Omit = omit,
854
892
  ocr_enhance: document_extract_params.OcrEnhance | Omit = omit,
893
+ ocr_quality: Literal["high", "low"] | Omit = omit,
855
894
  priority: Literal["interactive", "non-interactive"] | Omit = omit,
856
895
  reasoning_effort: Literal["low", "medium", "high"] | Omit = omit,
857
896
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -876,6 +915,8 @@ class AsyncDocumentsResource(AsyncAPIResource):
876
915
 
877
916
  ocr_enhance: OCR enhancement configuration for figure and text analysis.
878
917
 
918
+ ocr_quality: OCR quality setting
919
+
879
920
  priority: The priority of the extraction task. Non-interactive is lower priority.
880
921
 
881
922
  reasoning_effort: Optional control over the reasoning effort for extraction.
@@ -897,6 +938,7 @@ class AsyncDocumentsResource(AsyncAPIResource):
897
938
  "response_json_schema": response_json_schema,
898
939
  "model": model,
899
940
  "ocr_enhance": ocr_enhance,
941
+ "ocr_quality": ocr_quality,
900
942
  "priority": priority,
901
943
  "reasoning_effort": reasoning_effort,
902
944
  },
@@ -36,6 +36,14 @@ from .communication import (
36
36
  CommunicationResourceWithStreamingResponse,
37
37
  AsyncCommunicationResourceWithStreamingResponse,
38
38
  )
39
+ from .workflow_runs import (
40
+ WorkflowRunsResource,
41
+ AsyncWorkflowRunsResource,
42
+ WorkflowRunsResourceWithRawResponse,
43
+ AsyncWorkflowRunsResourceWithRawResponse,
44
+ WorkflowRunsResourceWithStreamingResponse,
45
+ AsyncWorkflowRunsResourceWithStreamingResponse,
46
+ )
39
47
  from .documents.documents import (
40
48
  DocumentsResource,
41
49
  AsyncDocumentsResource,
@@ -49,6 +57,10 @@ __all__ = ["V2Resource", "AsyncV2Resource"]
49
57
 
50
58
 
51
59
  class V2Resource(SyncAPIResource):
60
+ @cached_property
61
+ def workflow_runs(self) -> WorkflowRunsResource:
62
+ return WorkflowRunsResource(self._client)
63
+
52
64
  @cached_property
53
65
  def async_results(self) -> AsyncResultsResource:
54
66
  return AsyncResultsResource(self._client)
@@ -90,6 +102,10 @@ class V2Resource(SyncAPIResource):
90
102
 
91
103
 
92
104
  class AsyncV2Resource(AsyncAPIResource):
105
+ @cached_property
106
+ def workflow_runs(self) -> AsyncWorkflowRunsResource:
107
+ return AsyncWorkflowRunsResource(self._client)
108
+
93
109
  @cached_property
94
110
  def async_results(self) -> AsyncAsyncResultsResource:
95
111
  return AsyncAsyncResultsResource(self._client)
@@ -134,6 +150,10 @@ class V2ResourceWithRawResponse:
134
150
  def __init__(self, v2: V2Resource) -> None:
135
151
  self._v2 = v2
136
152
 
153
+ @cached_property
154
+ def workflow_runs(self) -> WorkflowRunsResourceWithRawResponse:
155
+ return WorkflowRunsResourceWithRawResponse(self._v2.workflow_runs)
156
+
137
157
  @cached_property
138
158
  def async_results(self) -> AsyncResultsResourceWithRawResponse:
139
159
  return AsyncResultsResourceWithRawResponse(self._v2.async_results)
@@ -159,6 +179,10 @@ class AsyncV2ResourceWithRawResponse:
159
179
  def __init__(self, v2: AsyncV2Resource) -> None:
160
180
  self._v2 = v2
161
181
 
182
+ @cached_property
183
+ def workflow_runs(self) -> AsyncWorkflowRunsResourceWithRawResponse:
184
+ return AsyncWorkflowRunsResourceWithRawResponse(self._v2.workflow_runs)
185
+
162
186
  @cached_property
163
187
  def async_results(self) -> AsyncAsyncResultsResourceWithRawResponse:
164
188
  return AsyncAsyncResultsResourceWithRawResponse(self._v2.async_results)
@@ -184,6 +208,10 @@ class V2ResourceWithStreamingResponse:
184
208
  def __init__(self, v2: V2Resource) -> None:
185
209
  self._v2 = v2
186
210
 
211
+ @cached_property
212
+ def workflow_runs(self) -> WorkflowRunsResourceWithStreamingResponse:
213
+ return WorkflowRunsResourceWithStreamingResponse(self._v2.workflow_runs)
214
+
187
215
  @cached_property
188
216
  def async_results(self) -> AsyncResultsResourceWithStreamingResponse:
189
217
  return AsyncResultsResourceWithStreamingResponse(self._v2.async_results)
@@ -209,6 +237,10 @@ class AsyncV2ResourceWithStreamingResponse:
209
237
  def __init__(self, v2: AsyncV2Resource) -> None:
210
238
  self._v2 = v2
211
239
 
240
+ @cached_property
241
+ def workflow_runs(self) -> AsyncWorkflowRunsResourceWithStreamingResponse:
242
+ return AsyncWorkflowRunsResourceWithStreamingResponse(self._v2.workflow_runs)
243
+
212
244
  @cached_property
213
245
  def async_results(self) -> AsyncAsyncResultsResourceWithStreamingResponse:
214
246
  return AsyncAsyncResultsResourceWithStreamingResponse(self._v2.async_results)
@@ -0,0 +1,177 @@
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 ..._utils import maybe_transform, async_maybe_transform
9
+ from ..._compat import cached_property
10
+ from ...types.v2 import workflow_run_resume_when_complete_params
11
+ from ..._resource import SyncAPIResource, AsyncAPIResource
12
+ from ..._response import (
13
+ to_raw_response_wrapper,
14
+ to_streamed_response_wrapper,
15
+ async_to_raw_response_wrapper,
16
+ async_to_streamed_response_wrapper,
17
+ )
18
+ from ..._base_client import make_request_options
19
+ from ...types.v2.workflow_run_resume_when_complete_response import WorkflowRunResumeWhenCompleteResponse
20
+
21
+ __all__ = ["WorkflowRunsResource", "AsyncWorkflowRunsResource"]
22
+
23
+
24
+ class WorkflowRunsResource(SyncAPIResource):
25
+ @cached_property
26
+ def with_raw_response(self) -> WorkflowRunsResourceWithRawResponse:
27
+ """
28
+ This property can be used as a prefix for any HTTP method call to return
29
+ the raw response object instead of the parsed content.
30
+
31
+ For more information, see https://www.github.com/samplehc/samplehc-python#accessing-raw-response-data-eg-headers
32
+ """
33
+ return WorkflowRunsResourceWithRawResponse(self)
34
+
35
+ @cached_property
36
+ def with_streaming_response(self) -> WorkflowRunsResourceWithStreamingResponse:
37
+ """
38
+ An alternative to `.with_raw_response` that doesn't eagerly read the response body.
39
+
40
+ For more information, see https://www.github.com/samplehc/samplehc-python#with_streaming_response
41
+ """
42
+ return WorkflowRunsResourceWithStreamingResponse(self)
43
+
44
+ def resume_when_complete(
45
+ self,
46
+ *,
47
+ async_result_id: 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
+ ) -> WorkflowRunResumeWhenCompleteResponse:
55
+ """
56
+ Registers an asynchronous task's result ID to resume a workflow run upon its
57
+ completion. This endpoint requires an ExecuteStepRequestContext with
58
+ `workflowRunId` and `stepAddr`.
59
+
60
+ Args:
61
+ async_result_id: The unique identifier of the asynchronous result to monitor before resuming.
62
+
63
+ extra_headers: Send extra headers
64
+
65
+ extra_query: Add additional query parameters to the request
66
+
67
+ extra_body: Add additional JSON properties to the request
68
+
69
+ timeout: Override the client-level default timeout for this request, in seconds
70
+ """
71
+ return self._post(
72
+ "/api/v2/workflow-runs/resume-when-complete",
73
+ body=maybe_transform(
74
+ {"async_result_id": async_result_id},
75
+ workflow_run_resume_when_complete_params.WorkflowRunResumeWhenCompleteParams,
76
+ ),
77
+ options=make_request_options(
78
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
79
+ ),
80
+ cast_to=WorkflowRunResumeWhenCompleteResponse,
81
+ )
82
+
83
+
84
+ class AsyncWorkflowRunsResource(AsyncAPIResource):
85
+ @cached_property
86
+ def with_raw_response(self) -> AsyncWorkflowRunsResourceWithRawResponse:
87
+ """
88
+ This property can be used as a prefix for any HTTP method call to return
89
+ the raw response object instead of the parsed content.
90
+
91
+ For more information, see https://www.github.com/samplehc/samplehc-python#accessing-raw-response-data-eg-headers
92
+ """
93
+ return AsyncWorkflowRunsResourceWithRawResponse(self)
94
+
95
+ @cached_property
96
+ def with_streaming_response(self) -> AsyncWorkflowRunsResourceWithStreamingResponse:
97
+ """
98
+ An alternative to `.with_raw_response` that doesn't eagerly read the response body.
99
+
100
+ For more information, see https://www.github.com/samplehc/samplehc-python#with_streaming_response
101
+ """
102
+ return AsyncWorkflowRunsResourceWithStreamingResponse(self)
103
+
104
+ async def resume_when_complete(
105
+ self,
106
+ *,
107
+ async_result_id: str,
108
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
109
+ # The extra values given here take precedence over values defined on the client or passed to this method.
110
+ extra_headers: Headers | None = None,
111
+ extra_query: Query | None = None,
112
+ extra_body: Body | None = None,
113
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
114
+ ) -> WorkflowRunResumeWhenCompleteResponse:
115
+ """
116
+ Registers an asynchronous task's result ID to resume a workflow run upon its
117
+ completion. This endpoint requires an ExecuteStepRequestContext with
118
+ `workflowRunId` and `stepAddr`.
119
+
120
+ Args:
121
+ async_result_id: The unique identifier of the asynchronous result to monitor before resuming.
122
+
123
+ extra_headers: Send extra headers
124
+
125
+ extra_query: Add additional query parameters to the request
126
+
127
+ extra_body: Add additional JSON properties to the request
128
+
129
+ timeout: Override the client-level default timeout for this request, in seconds
130
+ """
131
+ return await self._post(
132
+ "/api/v2/workflow-runs/resume-when-complete",
133
+ body=await async_maybe_transform(
134
+ {"async_result_id": async_result_id},
135
+ workflow_run_resume_when_complete_params.WorkflowRunResumeWhenCompleteParams,
136
+ ),
137
+ options=make_request_options(
138
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
139
+ ),
140
+ cast_to=WorkflowRunResumeWhenCompleteResponse,
141
+ )
142
+
143
+
144
+ class WorkflowRunsResourceWithRawResponse:
145
+ def __init__(self, workflow_runs: WorkflowRunsResource) -> None:
146
+ self._workflow_runs = workflow_runs
147
+
148
+ self.resume_when_complete = to_raw_response_wrapper(
149
+ workflow_runs.resume_when_complete,
150
+ )
151
+
152
+
153
+ class AsyncWorkflowRunsResourceWithRawResponse:
154
+ def __init__(self, workflow_runs: AsyncWorkflowRunsResource) -> None:
155
+ self._workflow_runs = workflow_runs
156
+
157
+ self.resume_when_complete = async_to_raw_response_wrapper(
158
+ workflow_runs.resume_when_complete,
159
+ )
160
+
161
+
162
+ class WorkflowRunsResourceWithStreamingResponse:
163
+ def __init__(self, workflow_runs: WorkflowRunsResource) -> None:
164
+ self._workflow_runs = workflow_runs
165
+
166
+ self.resume_when_complete = to_streamed_response_wrapper(
167
+ workflow_runs.resume_when_complete,
168
+ )
169
+
170
+
171
+ class AsyncWorkflowRunsResourceWithStreamingResponse:
172
+ def __init__(self, workflow_runs: AsyncWorkflowRunsResource) -> None:
173
+ self._workflow_runs = workflow_runs
174
+
175
+ self.resume_when_complete = async_to_streamed_response_wrapper(
176
+ workflow_runs.resume_when_complete,
177
+ )
@@ -43,3 +43,9 @@ from .document_transform_json_to_html_params import (
43
43
  from .document_transform_json_to_html_response import (
44
44
  DocumentTransformJsonToHTMLResponse as DocumentTransformJsonToHTMLResponse,
45
45
  )
46
+ from .workflow_run_resume_when_complete_params import (
47
+ WorkflowRunResumeWhenCompleteParams as WorkflowRunResumeWhenCompleteParams,
48
+ )
49
+ from .workflow_run_resume_when_complete_response import (
50
+ WorkflowRunResumeWhenCompleteResponse as WorkflowRunResumeWhenCompleteResponse,
51
+ )
@@ -27,12 +27,31 @@ class DocumentExtractParams(TypedDict, total=False):
27
27
  response_json_schema: Required[Annotated[Dict[str, object], PropertyInfo(alias="responseJsonSchema")]]
28
28
  """A JSON schema defining the structure of the desired extraction output."""
29
29
 
30
- model: Literal["reasoning-3-mini", "reasoning-3", "base-5", "base-5-mini", "base-5-nano"]
30
+ model: Literal[
31
+ "reasoning-3-mini",
32
+ "reasoning-3",
33
+ "base-5",
34
+ "base-5-mini",
35
+ "base-5-nano",
36
+ "base-4.1",
37
+ "base-4.1-mini",
38
+ "base-4.1-nano",
39
+ "base-5.2",
40
+ "base-5.2-chat-latest",
41
+ "gemini-3-pro",
42
+ "gemini-3-flash",
43
+ "gemini-2.5-pro",
44
+ "gemini-2.5-flash",
45
+ "gemini-2.5-flash-lite",
46
+ ]
31
47
  """The model to use for extraction."""
32
48
 
33
49
  ocr_enhance: Annotated[OcrEnhance, PropertyInfo(alias="ocrEnhance")]
34
50
  """OCR enhancement configuration for figure and text analysis."""
35
51
 
52
+ ocr_quality: Annotated[Literal["high", "low"], PropertyInfo(alias="ocrQuality")]
53
+ """OCR quality setting"""
54
+
36
55
  priority: Literal["interactive", "non-interactive"]
37
56
  """The priority of the extraction task. Non-interactive is lower priority."""
38
57
 
@@ -0,0 +1,14 @@
1
+ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ from __future__ import annotations
4
+
5
+ from typing_extensions import Required, Annotated, TypedDict
6
+
7
+ from ..._utils import PropertyInfo
8
+
9
+ __all__ = ["WorkflowRunResumeWhenCompleteParams"]
10
+
11
+
12
+ class WorkflowRunResumeWhenCompleteParams(TypedDict, total=False):
13
+ async_result_id: Required[Annotated[str, PropertyInfo(alias="asyncResultId")]]
14
+ """The unique identifier of the asynchronous result to monitor before resuming."""
@@ -0,0 +1,12 @@
1
+ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ from ..._models import BaseModel
4
+
5
+ __all__ = ["WorkflowRunResumeWhenCompleteResponse"]
6
+
7
+
8
+ class WorkflowRunResumeWhenCompleteResponse(BaseModel):
9
+ """Request accepted, processing to resume workflow has been initiated."""
10
+
11
+ message: str
12
+ """A message indicating the request has been accepted for processing."""
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: samplehc
3
- Version: 0.18.0
3
+ Version: 0.20.0
4
4
  Summary: The official Python library for the Sample Healthcare API
5
5
  Project-URL: Homepage, https://github.com/samplehc/samplehc-python
6
6
  Project-URL: Repository, https://github.com/samplehc/samplehc-python
@@ -67,10 +67,10 @@ client = SampleHealthcare(
67
67
  api_key=os.environ.get("SAMPLEHC_API_KEY"), # This is the default and can be omitted
68
68
  )
69
69
 
70
- response = client.v2.async_results.sleep(
71
- delay=1,
70
+ response = client.v2.workflow_runs.resume_when_complete(
71
+ async_result_id="asyncResultId",
72
72
  )
73
- print(response.async_result_id)
73
+ print(response.message)
74
74
  ```
75
75
 
76
76
  While you can provide an `api_key` keyword argument,
@@ -93,10 +93,10 @@ client = AsyncSampleHealthcare(
93
93
 
94
94
 
95
95
  async def main() -> None:
96
- response = await client.v2.async_results.sleep(
97
- delay=1,
96
+ response = await client.v2.workflow_runs.resume_when_complete(
97
+ async_result_id="asyncResultId",
98
98
  )
99
- print(response.async_result_id)
99
+ print(response.message)
100
100
 
101
101
 
102
102
  asyncio.run(main())
@@ -129,10 +129,10 @@ async def main() -> None:
129
129
  api_key=os.environ.get("SAMPLEHC_API_KEY"), # This is the default and can be omitted
130
130
  http_client=DefaultAioHttpClient(),
131
131
  ) as client:
132
- response = await client.v2.async_results.sleep(
133
- delay=1,
132
+ response = await client.v2.workflow_runs.resume_when_complete(
133
+ async_result_id="asyncResultId",
134
134
  )
135
- print(response.async_result_id)
135
+ print(response.message)
136
136
 
137
137
 
138
138
  asyncio.run(main())
@@ -182,8 +182,8 @@ from samplehc import SampleHealthcare
182
182
  client = SampleHealthcare()
183
183
 
184
184
  try:
185
- client.v2.async_results.sleep(
186
- delay=1,
185
+ client.v2.workflow_runs.resume_when_complete(
186
+ async_result_id="asyncResultId",
187
187
  )
188
188
  except samplehc.APIConnectionError as e:
189
189
  print("The server could not be reached")
@@ -227,8 +227,8 @@ client = SampleHealthcare(
227
227
  )
228
228
 
229
229
  # Or, configure per-request:
230
- client.with_options(max_retries=5).v2.async_results.sleep(
231
- delay=1,
230
+ client.with_options(max_retries=5).v2.workflow_runs.resume_when_complete(
231
+ async_result_id="asyncResultId",
232
232
  )
233
233
  ```
234
234
 
@@ -252,8 +252,8 @@ client = SampleHealthcare(
252
252
  )
253
253
 
254
254
  # Override per-request:
255
- client.with_options(timeout=5.0).v2.async_results.sleep(
256
- delay=1,
255
+ client.with_options(timeout=5.0).v2.workflow_runs.resume_when_complete(
256
+ async_result_id="asyncResultId",
257
257
  )
258
258
  ```
259
259
 
@@ -295,13 +295,13 @@ The "raw" Response object can be accessed by prefixing `.with_raw_response.` to
295
295
  from samplehc import SampleHealthcare
296
296
 
297
297
  client = SampleHealthcare()
298
- response = client.v2.async_results.with_raw_response.sleep(
299
- delay=1,
298
+ response = client.v2.workflow_runs.with_raw_response.resume_when_complete(
299
+ async_result_id="asyncResultId",
300
300
  )
301
301
  print(response.headers.get('X-My-Header'))
302
302
 
303
- async_result = response.parse() # get the object that `v2.async_results.sleep()` would have returned
304
- print(async_result.async_result_id)
303
+ workflow_run = response.parse() # get the object that `v2.workflow_runs.resume_when_complete()` would have returned
304
+ print(workflow_run.message)
305
305
  ```
306
306
 
307
307
  These methods return an [`APIResponse`](https://github.com/samplehc/samplehc-python/tree/main/src/samplehc/_response.py) object.
@@ -315,8 +315,8 @@ The above interface eagerly reads the full response body when you make the reque
315
315
  To stream the response body, use `.with_streaming_response` instead, which requires a context manager and only reads the response body once you call `.read()`, `.text()`, `.json()`, `.iter_bytes()`, `.iter_text()`, `.iter_lines()` or `.parse()`. In the async client, these are async methods.
316
316
 
317
317
  ```python
318
- with client.v2.async_results.with_streaming_response.sleep(
319
- delay=1,
318
+ with client.v2.workflow_runs.with_streaming_response.resume_when_complete(
319
+ async_result_id="asyncResultId",
320
320
  ) as response:
321
321
  print(response.headers.get("X-My-Header"))
322
322
 
@@ -1,7 +1,7 @@
1
1
  samplehc/__init__.py,sha256=Kze-TKDp8j_TYknemcBAyGIxn7a_RUlisf07X8IYIVI,2731
2
- samplehc/_base_client.py,sha256=ooaPntKjp5cnswE1QYfWraRZ2j7m2ctk3ypSUQZyfqQ,73411
2
+ samplehc/_base_client.py,sha256=SdMJDhn67yatN8KvVlRaqegWGv7ICogzbSBNkhe3pys,73660
3
3
  samplehc/_client.py,sha256=-VgT2RjwwXmWayeZy98IhH_F-AkMOt6zOidBZIbrHCE,16714
4
- samplehc/_compat.py,sha256=DQBVORjFb33zch24jzkhM14msvnzY7mmSmgDLaVFUM8,6562
4
+ samplehc/_compat.py,sha256=teO44AYozpv2wFRrUi7brcZfGPpFSERQZ4fcdX6zVvs,6627
5
5
  samplehc/_constants.py,sha256=S14PFzyN9-I31wiV7SmIlL5Ga0MLHxdvegInGdXH7tM,462
6
6
  samplehc/_exceptions.py,sha256=MxVd0pThtjM7aV1xjQcQ6nGSfxJMa5xPhoLsmtSxQgU,3240
7
7
  samplehc/_files.py,sha256=KnEzGi_O756MvKyJ4fOCW_u3JhOeWPQ4RsmDvqihDQU,3545
@@ -11,11 +11,12 @@ samplehc/_resource.py,sha256=Mdg6fhf_5wYd2K2JZ4BQIJMPqJOWetqpJE3h3MmGZJE,1160
11
11
  samplehc/_response.py,sha256=UzsuYRbic274gcdUWq9ShPkdRt7VrzkjaqwSwdxqWIs,28816
12
12
  samplehc/_streaming.py,sha256=Wsd0pUQJT1ZW9v_iBIFKDS9lukt3M0X96f3Enqx1PYY,10261
13
13
  samplehc/_types.py,sha256=j9OfrgjmrZOU2T8RbK9QKC0plnD1UCUWuH5oRR2oY3c,7596
14
- samplehc/_version.py,sha256=6eoQXV_WNfNVXJINJgx0fIOBOKFngeWrIJuGHHiq7Og,161
14
+ samplehc/_version.py,sha256=M3icE_EQYuYD5NmqCpfuaQ098PViLuEof6OJY1aRSMM,161
15
15
  samplehc/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
16
16
  samplehc/_utils/__init__.py,sha256=7fch0GT9zpNnErbciSpUNa-SjTxxjY6kxHxKMOM4AGs,2305
17
17
  samplehc/_utils/_compat.py,sha256=D8gtAvjJQrDWt9upS0XaG9Rr5l1QhiAx_I_1utT_tt0,1195
18
18
  samplehc/_utils/_datetime_parse.py,sha256=bABTs0Bc6rabdFvnIwXjEhWL15TcRgWZ_6XGTqN8xUk,4204
19
+ samplehc/_utils/_json.py,sha256=bl95uuIWwgSfXX-gP1trK_lDAPwJujYfJ05Cxo2SEC4,962
19
20
  samplehc/_utils/_logs.py,sha256=EEt3P1dtoGlkVTZOwVml4xf3j9DvdDTzG2TpBjcQINc,789
20
21
  samplehc/_utils/_proxy.py,sha256=aglnj2yBTDyGX9Akk2crZHrl10oqRmceUy2Zp008XEs,1975
21
22
  samplehc/_utils/_reflection.py,sha256=ZmGkIgT_PuwedyNBrrKGbxoWtkpytJNU1uU4QHnmEMU,1364
@@ -27,19 +28,20 @@ samplehc/_utils/_typing.py,sha256=N_5PPuFNsaygbtA_npZd98SVN1LQQvFTKL6bkWPBZGU,47
27
28
  samplehc/_utils/_utils.py,sha256=ugfUaneOK7I8h9b3656flwf5u_kthY0gvNuqvgOLoSU,12252
28
29
  samplehc/lib/.keep,sha256=wuNrz-5SXo3jJaJOJgz4vFHM41YH_g20F5cRQo0vLes,224
29
30
  samplehc/resources/__init__.py,sha256=ADMc9HzQlsVyP-m8qS4BV71h91vHtlVqhZnJVOAI2Og,500
30
- samplehc/resources/v2/__init__.py,sha256=YPfxz80s9XhSRRH9RUq0K4TFrwXDz73P6ogRbTV-0uE,2985
31
+ samplehc/resources/v2/__init__.py,sha256=lGOMXNr9qaoABUxk9f42NLo7nRyEiQObPKAUzqNXUNQ,3514
31
32
  samplehc/resources/v2/async_results.py,sha256=cZ-PWCSo7dM0y9FD1P-LwkvsMIp9e6_gSc5jl7T3d60,10353
32
33
  samplehc/resources/v2/communication.py,sha256=fHM2kBpKvOpzROfVKIx2Nmuw-iSs6nSH-IZJZdte3M8,21239
33
34
  samplehc/resources/v2/database.py,sha256=lFLepM70TzkRBaejyfU5GmE3PfgIaBi_liRTpJs2lzM,7950
34
35
  samplehc/resources/v2/events.py,sha256=Kdx2fSNGr21YA7fAHvs9huMGDRra8bsvnxiO1B1ZlSE,6658
35
- samplehc/resources/v2/v2.py,sha256=9cVu2WRE07VCDJrQZIhdjJkzcvuyLrWHLamWGhZnNiY,8210
36
+ samplehc/resources/v2/v2.py,sha256=V3BaQH2AZCEEvv3jQTzzTnP9CrK4GpSU0MTeZmxnZNI,9448
37
+ samplehc/resources/v2/workflow_runs.py,sha256=vF06ASKOr4ldWvAGGSyoG5_P6gUHWxmHeYuqKq3tkdM,7203
36
38
  samplehc/resources/v2/documents/__init__.py,sha256=wGPR6hdfmDxt-nXn0cDIud1eZAEs_j3kZd4KrxnuoEg,1993
37
- samplehc/resources/v2/documents/documents.py,sha256=rto1sIAT1Oz_FbgB3rwBXsXaGOAT353wRP6_4l4doys,56630
39
+ samplehc/resources/v2/documents/documents.py,sha256=5bp9x9SZ4mOqnYgwv9l7CWlUsCxcURFgDcpkAiXdWqk,57688
38
40
  samplehc/resources/v2/documents/formats.py,sha256=lB60NUBPBceC1XUbL04lsGIsyVWlqsOE8kQkw5oKIM0,6993
39
41
  samplehc/resources/v2/documents/legacy.py,sha256=CbDfHJK_U-sDW1rIp8Hj7pTKKHscwmdijSx4mWALQk8,14095
40
42
  samplehc/resources/v2/documents/templates.py,sha256=P6gbC8JxEKXN05yCO2NUXGv-ooLBkwQvDpOy4KccprY,17115
41
43
  samplehc/types/__init__.py,sha256=OKfJYcKb4NObdiRObqJV_dOyDQ8feXekDUge2o_4pXQ,122
42
- samplehc/types/v2/__init__.py,sha256=e2G4aZMEyN94eF5XkH0G7yDB30-KawWnxqywESEW75s,3443
44
+ samplehc/types/v2/__init__.py,sha256=lP7SzZN0S-FDGj7uT-neDuLe1cOVurm3r9MpiZDSoHk,3725
43
45
  samplehc/types/v2/async_result_sleep_params.py,sha256=vdhEdUP6vA9Y44waJBU2p_PEC-rzWBOr4RkE1F2eTHs,729
44
46
  samplehc/types/v2/async_result_sleep_response.py,sha256=nAUL4IVyG9RjVZtNyMnn_sp1mcwatJCEBjBCDf6bDtM,366
45
47
  samplehc/types/v2/communication_send_email_params.py,sha256=thNaWdxK4JwOk4JQ0zvb3rab9AlOfkDbaweP_7vXsIg,1638
@@ -56,7 +58,7 @@ samplehc/types/v2/document_combine_params.py,sha256=U4VK6S19oy0n8-ZF6jWFWwwQweWj
56
58
  samplehc/types/v2/document_combine_response.py,sha256=SVnRhWvEA-p2MuRJiJLiaVnutlw185xAAwcCp5-xP3w,559
57
59
  samplehc/types/v2/document_create_from_splits_params.py,sha256=XVmvzvrYPQY_Z8omsLnFx0zeMvPcKnA9chC_KLTIpkc,878
58
60
  samplehc/types/v2/document_create_from_splits_response.py,sha256=VJQCsIWz839BeXyht8fVSmrvfknMiXJDPt7ZAclGKP4,900
59
- samplehc/types/v2/document_extract_params.py,sha256=CSsMnbzknkT81zLpxIL_Wb_4FidzyIr_ek0NwWbcKTc,2393
61
+ samplehc/types/v2/document_extract_params.py,sha256=DVjKrkMcjiTsmoMyEORDjQOzVfeyNFuwZe52BvvL5xU,2815
60
62
  samplehc/types/v2/document_extract_response.py,sha256=k4nKL53ZSLoAmMdlCPZIpjkTdRuOGqG3u-qJyW1kmD4,424
61
63
  samplehc/types/v2/document_generate_csv_params.py,sha256=N_GL20AyXcSG0QAkIJBbtyoq9ZW7RESAyhURmagzOTc,1063
62
64
  samplehc/types/v2/document_generate_csv_response.py,sha256=n8jk3gbEU6rASKTVNCtY7Z9dDxYOWFm4nqFgbfBOcJM,539
@@ -73,6 +75,8 @@ samplehc/types/v2/document_transform_json_to_html_params.py,sha256=0bRUKlxD2-JB5
73
75
  samplehc/types/v2/document_transform_json_to_html_response.py,sha256=ca5EIuwV1pywWDnIgy2e6vW_QunxA-PDHh69jurvcS0,268
74
76
  samplehc/types/v2/event_emit_params.py,sha256=SU1pC9tVh84OmyXWsEjxmBMnkTHqHQXQaMZihEZoX2w,506
75
77
  samplehc/types/v2/event_emit_response.py,sha256=Md9mWenySbRoqz2tWrY4jyXS-oWirz5VVdpg9W2gPM8,263
78
+ samplehc/types/v2/workflow_run_resume_when_complete_params.py,sha256=2EhKTL1vPZnnAF6t6s4iTen5EzGzc25D0VFQwdlFE9A,510
79
+ samplehc/types/v2/workflow_run_resume_when_complete_response.py,sha256=JkBz04MX9Ka6FE1IHVhyE39W48-bprNbmcBg0elS3us,404
76
80
  samplehc/types/v2/documents/__init__.py,sha256=m-DTAbY9msEuebxJrffYI5vi_m8baFX7im5aCucdUUk,1265
77
81
  samplehc/types/v2/documents/format_create_pdf_params.py,sha256=OgteE7CfhVP-CAw5RGZlSoXz50rdfxohA-9fJA_9t0Q,458
78
82
  samplehc/types/v2/documents/format_create_pdf_response.py,sha256=XBhC9fjEEbWeDnioXh43z_ySNJKEIycxipucZLDCoPY,362
@@ -86,7 +90,7 @@ samplehc/types/v2/documents/template_generate_document_async_params.py,sha256=5a
86
90
  samplehc/types/v2/documents/template_generate_document_async_response.py,sha256=xFivOxAB8jahS6vKcr-3TGR4IhF0INDH37nivTVoHSk,402
87
91
  samplehc/types/v2/documents/template_render_document_params.py,sha256=egYW79gF_UNjE8wTmiwtbgOozqVDa6i8Db0yjwt5IXE,905
88
92
  samplehc/types/v2/documents/template_render_document_response.py,sha256=yN2JLDHszpaA9RZq8INdJIue_JkrLON3xqWMh-z3MCc,367
89
- samplehc-0.18.0.dist-info/METADATA,sha256=jdA0us5nK5NL0MxjbbpVdpPDLX0-F2R5qy2c-BbTylI,14336
90
- samplehc-0.18.0.dist-info/WHEEL,sha256=C2FUgwZgiLbznR-k0b_5k3Ai_1aASOXDss3lzCUsUug,87
91
- samplehc-0.18.0.dist-info/licenses/LICENSE,sha256=ll_q1imgsIlRXL5pk6VmrO0f_L0thzOlPI2cc7qcqc0,11347
92
- samplehc-0.18.0.dist-info/RECORD,,
93
+ samplehc-0.20.0.dist-info/METADATA,sha256=8qRxyAYZdPM7h5eTnoQ0S7KMCw1d1ub_mLO9l5jmNX0,14631
94
+ samplehc-0.20.0.dist-info/WHEEL,sha256=C2FUgwZgiLbznR-k0b_5k3Ai_1aASOXDss3lzCUsUug,87
95
+ samplehc-0.20.0.dist-info/licenses/LICENSE,sha256=ll_q1imgsIlRXL5pk6VmrO0f_L0thzOlPI2cc7qcqc0,11347
96
+ samplehc-0.20.0.dist-info/RECORD,,