samplehc 0.18.0__tar.gz → 0.20.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (140) hide show
  1. samplehc-0.20.0/.release-please-manifest.json +3 -0
  2. {samplehc-0.18.0 → samplehc-0.20.0}/CHANGELOG.md +24 -0
  3. {samplehc-0.18.0 → samplehc-0.20.0}/PKG-INFO +22 -22
  4. {samplehc-0.18.0 → samplehc-0.20.0}/README.md +21 -21
  5. {samplehc-0.18.0 → samplehc-0.20.0}/api.md +12 -0
  6. {samplehc-0.18.0 → samplehc-0.20.0}/pyproject.toml +1 -1
  7. {samplehc-0.18.0 → samplehc-0.20.0}/src/samplehc/_base_client.py +5 -2
  8. {samplehc-0.18.0 → samplehc-0.20.0}/src/samplehc/_compat.py +3 -3
  9. samplehc-0.20.0/src/samplehc/_utils/_json.py +35 -0
  10. {samplehc-0.18.0 → samplehc-0.20.0}/src/samplehc/_version.py +1 -1
  11. {samplehc-0.18.0 → samplehc-0.20.0}/src/samplehc/resources/v2/__init__.py +14 -0
  12. {samplehc-0.18.0 → samplehc-0.20.0}/src/samplehc/resources/v2/documents/documents.py +44 -2
  13. {samplehc-0.18.0 → samplehc-0.20.0}/src/samplehc/resources/v2/v2.py +32 -0
  14. samplehc-0.20.0/src/samplehc/resources/v2/workflow_runs.py +177 -0
  15. {samplehc-0.18.0 → samplehc-0.20.0}/src/samplehc/types/v2/__init__.py +6 -0
  16. {samplehc-0.18.0 → samplehc-0.20.0}/src/samplehc/types/v2/document_extract_params.py +20 -1
  17. samplehc-0.20.0/src/samplehc/types/v2/workflow_run_resume_when_complete_params.py +14 -0
  18. samplehc-0.20.0/src/samplehc/types/v2/workflow_run_resume_when_complete_response.py +12 -0
  19. {samplehc-0.18.0 → samplehc-0.20.0}/tests/api_resources/v2/test_documents.py +2 -0
  20. samplehc-0.20.0/tests/api_resources/v2/test_workflow_runs.py +92 -0
  21. {samplehc-0.18.0 → samplehc-0.20.0}/tests/test_client.py +36 -24
  22. samplehc-0.20.0/tests/test_utils/test_json.py +126 -0
  23. samplehc-0.18.0/.release-please-manifest.json +0 -3
  24. {samplehc-0.18.0 → samplehc-0.20.0}/.gitignore +0 -0
  25. {samplehc-0.18.0 → samplehc-0.20.0}/CONTRIBUTING.md +0 -0
  26. {samplehc-0.18.0 → samplehc-0.20.0}/LICENSE +0 -0
  27. {samplehc-0.18.0 → samplehc-0.20.0}/SECURITY.md +0 -0
  28. {samplehc-0.18.0 → samplehc-0.20.0}/bin/check-release-environment +0 -0
  29. {samplehc-0.18.0 → samplehc-0.20.0}/bin/publish-pypi +0 -0
  30. {samplehc-0.18.0 → samplehc-0.20.0}/examples/.keep +0 -0
  31. {samplehc-0.18.0 → samplehc-0.20.0}/noxfile.py +0 -0
  32. {samplehc-0.18.0 → samplehc-0.20.0}/release-please-config.json +0 -0
  33. {samplehc-0.18.0 → samplehc-0.20.0}/requirements-dev.lock +0 -0
  34. {samplehc-0.18.0 → samplehc-0.20.0}/requirements.lock +0 -0
  35. {samplehc-0.18.0 → samplehc-0.20.0}/src/samplehc/__init__.py +0 -0
  36. {samplehc-0.18.0 → samplehc-0.20.0}/src/samplehc/_client.py +0 -0
  37. {samplehc-0.18.0 → samplehc-0.20.0}/src/samplehc/_constants.py +0 -0
  38. {samplehc-0.18.0 → samplehc-0.20.0}/src/samplehc/_exceptions.py +0 -0
  39. {samplehc-0.18.0 → samplehc-0.20.0}/src/samplehc/_files.py +0 -0
  40. {samplehc-0.18.0 → samplehc-0.20.0}/src/samplehc/_models.py +0 -0
  41. {samplehc-0.18.0 → samplehc-0.20.0}/src/samplehc/_qs.py +0 -0
  42. {samplehc-0.18.0 → samplehc-0.20.0}/src/samplehc/_resource.py +0 -0
  43. {samplehc-0.18.0 → samplehc-0.20.0}/src/samplehc/_response.py +0 -0
  44. {samplehc-0.18.0 → samplehc-0.20.0}/src/samplehc/_streaming.py +0 -0
  45. {samplehc-0.18.0 → samplehc-0.20.0}/src/samplehc/_types.py +0 -0
  46. {samplehc-0.18.0 → samplehc-0.20.0}/src/samplehc/_utils/__init__.py +0 -0
  47. {samplehc-0.18.0 → samplehc-0.20.0}/src/samplehc/_utils/_compat.py +0 -0
  48. {samplehc-0.18.0 → samplehc-0.20.0}/src/samplehc/_utils/_datetime_parse.py +0 -0
  49. {samplehc-0.18.0 → samplehc-0.20.0}/src/samplehc/_utils/_logs.py +0 -0
  50. {samplehc-0.18.0 → samplehc-0.20.0}/src/samplehc/_utils/_proxy.py +0 -0
  51. {samplehc-0.18.0 → samplehc-0.20.0}/src/samplehc/_utils/_reflection.py +0 -0
  52. {samplehc-0.18.0 → samplehc-0.20.0}/src/samplehc/_utils/_resources_proxy.py +0 -0
  53. {samplehc-0.18.0 → samplehc-0.20.0}/src/samplehc/_utils/_streams.py +0 -0
  54. {samplehc-0.18.0 → samplehc-0.20.0}/src/samplehc/_utils/_sync.py +0 -0
  55. {samplehc-0.18.0 → samplehc-0.20.0}/src/samplehc/_utils/_transform.py +0 -0
  56. {samplehc-0.18.0 → samplehc-0.20.0}/src/samplehc/_utils/_typing.py +0 -0
  57. {samplehc-0.18.0 → samplehc-0.20.0}/src/samplehc/_utils/_utils.py +0 -0
  58. {samplehc-0.18.0 → samplehc-0.20.0}/src/samplehc/lib/.keep +0 -0
  59. {samplehc-0.18.0 → samplehc-0.20.0}/src/samplehc/py.typed +0 -0
  60. {samplehc-0.18.0 → samplehc-0.20.0}/src/samplehc/resources/__init__.py +0 -0
  61. {samplehc-0.18.0 → samplehc-0.20.0}/src/samplehc/resources/v2/async_results.py +0 -0
  62. {samplehc-0.18.0 → samplehc-0.20.0}/src/samplehc/resources/v2/communication.py +0 -0
  63. {samplehc-0.18.0 → samplehc-0.20.0}/src/samplehc/resources/v2/database.py +0 -0
  64. {samplehc-0.18.0 → samplehc-0.20.0}/src/samplehc/resources/v2/documents/__init__.py +0 -0
  65. {samplehc-0.18.0 → samplehc-0.20.0}/src/samplehc/resources/v2/documents/formats.py +0 -0
  66. {samplehc-0.18.0 → samplehc-0.20.0}/src/samplehc/resources/v2/documents/legacy.py +0 -0
  67. {samplehc-0.18.0 → samplehc-0.20.0}/src/samplehc/resources/v2/documents/templates.py +0 -0
  68. {samplehc-0.18.0 → samplehc-0.20.0}/src/samplehc/resources/v2/events.py +0 -0
  69. {samplehc-0.18.0 → samplehc-0.20.0}/src/samplehc/types/__init__.py +0 -0
  70. {samplehc-0.18.0 → samplehc-0.20.0}/src/samplehc/types/v2/async_result_sleep_params.py +0 -0
  71. {samplehc-0.18.0 → samplehc-0.20.0}/src/samplehc/types/v2/async_result_sleep_response.py +0 -0
  72. {samplehc-0.18.0 → samplehc-0.20.0}/src/samplehc/types/v2/communication_send_email_params.py +0 -0
  73. {samplehc-0.18.0 → samplehc-0.20.0}/src/samplehc/types/v2/communication_send_email_response.py +0 -0
  74. {samplehc-0.18.0 → samplehc-0.20.0}/src/samplehc/types/v2/communication_send_fax_params.py +0 -0
  75. {samplehc-0.18.0 → samplehc-0.20.0}/src/samplehc/types/v2/communication_send_fax_response.py +0 -0
  76. {samplehc-0.18.0 → samplehc-0.20.0}/src/samplehc/types/v2/communication_send_letter_params.py +0 -0
  77. {samplehc-0.18.0 → samplehc-0.20.0}/src/samplehc/types/v2/communication_send_letter_response.py +0 -0
  78. {samplehc-0.18.0 → samplehc-0.20.0}/src/samplehc/types/v2/database_execute_sql_params.py +0 -0
  79. {samplehc-0.18.0 → samplehc-0.20.0}/src/samplehc/types/v2/database_execute_sql_response.py +0 -0
  80. {samplehc-0.18.0 → samplehc-0.20.0}/src/samplehc/types/v2/document_classify_params.py +0 -0
  81. {samplehc-0.18.0 → samplehc-0.20.0}/src/samplehc/types/v2/document_classify_response.py +0 -0
  82. {samplehc-0.18.0 → samplehc-0.20.0}/src/samplehc/types/v2/document_combine_params.py +0 -0
  83. {samplehc-0.18.0 → samplehc-0.20.0}/src/samplehc/types/v2/document_combine_response.py +0 -0
  84. {samplehc-0.18.0 → samplehc-0.20.0}/src/samplehc/types/v2/document_create_from_splits_params.py +0 -0
  85. {samplehc-0.18.0 → samplehc-0.20.0}/src/samplehc/types/v2/document_create_from_splits_response.py +0 -0
  86. {samplehc-0.18.0 → samplehc-0.20.0}/src/samplehc/types/v2/document_extract_response.py +0 -0
  87. {samplehc-0.18.0 → samplehc-0.20.0}/src/samplehc/types/v2/document_generate_csv_params.py +0 -0
  88. {samplehc-0.18.0 → samplehc-0.20.0}/src/samplehc/types/v2/document_generate_csv_response.py +0 -0
  89. {samplehc-0.18.0 → samplehc-0.20.0}/src/samplehc/types/v2/document_presigned_upload_url_params.py +0 -0
  90. {samplehc-0.18.0 → samplehc-0.20.0}/src/samplehc/types/v2/document_presigned_upload_url_response.py +0 -0
  91. {samplehc-0.18.0 → samplehc-0.20.0}/src/samplehc/types/v2/document_retrieve_csv_content_response.py +0 -0
  92. {samplehc-0.18.0 → samplehc-0.20.0}/src/samplehc/types/v2/document_retrieve_metadata_response.py +0 -0
  93. {samplehc-0.18.0 → samplehc-0.20.0}/src/samplehc/types/v2/document_retrieve_response.py +0 -0
  94. {samplehc-0.18.0 → samplehc-0.20.0}/src/samplehc/types/v2/document_search_params.py +0 -0
  95. {samplehc-0.18.0 → samplehc-0.20.0}/src/samplehc/types/v2/document_search_response.py +0 -0
  96. {samplehc-0.18.0 → samplehc-0.20.0}/src/samplehc/types/v2/document_split_params.py +0 -0
  97. {samplehc-0.18.0 → samplehc-0.20.0}/src/samplehc/types/v2/document_split_response.py +0 -0
  98. {samplehc-0.18.0 → samplehc-0.20.0}/src/samplehc/types/v2/document_transform_json_to_html_params.py +0 -0
  99. {samplehc-0.18.0 → samplehc-0.20.0}/src/samplehc/types/v2/document_transform_json_to_html_response.py +0 -0
  100. {samplehc-0.18.0 → samplehc-0.20.0}/src/samplehc/types/v2/documents/__init__.py +0 -0
  101. {samplehc-0.18.0 → samplehc-0.20.0}/src/samplehc/types/v2/documents/format_create_pdf_params.py +0 -0
  102. {samplehc-0.18.0 → samplehc-0.20.0}/src/samplehc/types/v2/documents/format_create_pdf_response.py +0 -0
  103. {samplehc-0.18.0 → samplehc-0.20.0}/src/samplehc/types/v2/documents/legacy_extract_params.py +0 -0
  104. {samplehc-0.18.0 → samplehc-0.20.0}/src/samplehc/types/v2/documents/legacy_extract_response.py +0 -0
  105. {samplehc-0.18.0 → samplehc-0.20.0}/src/samplehc/types/v2/documents/legacy_reason_params.py +0 -0
  106. {samplehc-0.18.0 → samplehc-0.20.0}/src/samplehc/types/v2/documents/legacy_reason_response.py +0 -0
  107. {samplehc-0.18.0 → samplehc-0.20.0}/src/samplehc/types/v2/documents/legacy_split_params.py +0 -0
  108. {samplehc-0.18.0 → samplehc-0.20.0}/src/samplehc/types/v2/documents/legacy_split_response.py +0 -0
  109. {samplehc-0.18.0 → samplehc-0.20.0}/src/samplehc/types/v2/documents/template_generate_document_async_params.py +0 -0
  110. {samplehc-0.18.0 → samplehc-0.20.0}/src/samplehc/types/v2/documents/template_generate_document_async_response.py +0 -0
  111. {samplehc-0.18.0 → samplehc-0.20.0}/src/samplehc/types/v2/documents/template_render_document_params.py +0 -0
  112. {samplehc-0.18.0 → samplehc-0.20.0}/src/samplehc/types/v2/documents/template_render_document_response.py +0 -0
  113. {samplehc-0.18.0 → samplehc-0.20.0}/src/samplehc/types/v2/event_emit_params.py +0 -0
  114. {samplehc-0.18.0 → samplehc-0.20.0}/src/samplehc/types/v2/event_emit_response.py +0 -0
  115. {samplehc-0.18.0 → samplehc-0.20.0}/tests/__init__.py +0 -0
  116. {samplehc-0.18.0 → samplehc-0.20.0}/tests/api_resources/__init__.py +0 -0
  117. {samplehc-0.18.0 → samplehc-0.20.0}/tests/api_resources/v2/__init__.py +0 -0
  118. {samplehc-0.18.0 → samplehc-0.20.0}/tests/api_resources/v2/documents/__init__.py +0 -0
  119. {samplehc-0.18.0 → samplehc-0.20.0}/tests/api_resources/v2/documents/test_formats.py +0 -0
  120. {samplehc-0.18.0 → samplehc-0.20.0}/tests/api_resources/v2/documents/test_legacy.py +0 -0
  121. {samplehc-0.18.0 → samplehc-0.20.0}/tests/api_resources/v2/documents/test_templates.py +0 -0
  122. {samplehc-0.18.0 → samplehc-0.20.0}/tests/api_resources/v2/test_async_results.py +0 -0
  123. {samplehc-0.18.0 → samplehc-0.20.0}/tests/api_resources/v2/test_communication.py +0 -0
  124. {samplehc-0.18.0 → samplehc-0.20.0}/tests/api_resources/v2/test_database.py +0 -0
  125. {samplehc-0.18.0 → samplehc-0.20.0}/tests/api_resources/v2/test_events.py +0 -0
  126. {samplehc-0.18.0 → samplehc-0.20.0}/tests/conftest.py +0 -0
  127. {samplehc-0.18.0 → samplehc-0.20.0}/tests/sample_file.txt +0 -0
  128. {samplehc-0.18.0 → samplehc-0.20.0}/tests/test_deepcopy.py +0 -0
  129. {samplehc-0.18.0 → samplehc-0.20.0}/tests/test_extract_files.py +0 -0
  130. {samplehc-0.18.0 → samplehc-0.20.0}/tests/test_files.py +0 -0
  131. {samplehc-0.18.0 → samplehc-0.20.0}/tests/test_models.py +0 -0
  132. {samplehc-0.18.0 → samplehc-0.20.0}/tests/test_qs.py +0 -0
  133. {samplehc-0.18.0 → samplehc-0.20.0}/tests/test_required_args.py +0 -0
  134. {samplehc-0.18.0 → samplehc-0.20.0}/tests/test_response.py +0 -0
  135. {samplehc-0.18.0 → samplehc-0.20.0}/tests/test_streaming.py +0 -0
  136. {samplehc-0.18.0 → samplehc-0.20.0}/tests/test_transform.py +0 -0
  137. {samplehc-0.18.0 → samplehc-0.20.0}/tests/test_utils/test_datetime_parse.py +0 -0
  138. {samplehc-0.18.0 → samplehc-0.20.0}/tests/test_utils/test_proxy.py +0 -0
  139. {samplehc-0.18.0 → samplehc-0.20.0}/tests/test_utils/test_typing.py +0 -0
  140. {samplehc-0.18.0 → samplehc-0.20.0}/tests/utils.py +0 -0
@@ -0,0 +1,3 @@
1
+ {
2
+ ".": "0.20.0"
3
+ }
@@ -1,5 +1,29 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.20.0 (2026-02-03)
4
+
5
+ Full Changelog: [v0.19.0...v0.20.0](https://github.com/samplehc/samplehc-python/compare/v0.19.0...v0.20.0)
6
+
7
+ ### Features
8
+
9
+ * **api:** manual updates ([e398ad8](https://github.com/samplehc/samplehc-python/commit/e398ad8aee71fc730ccd91aa2d9db5bbe74e15f6))
10
+
11
+ ## 0.19.0 (2026-02-03)
12
+
13
+ Full Changelog: [v0.18.0...v0.19.0](https://github.com/samplehc/samplehc-python/compare/v0.18.0...v0.19.0)
14
+
15
+ ### Features
16
+
17
+ * **api:** api update ([5690ad0](https://github.com/samplehc/samplehc-python/commit/5690ad076a7117489783a902c86823bd131007e0))
18
+ * **api:** api update ([907015e](https://github.com/samplehc/samplehc-python/commit/907015e44e80c084a433cc168cbbd3f8936de9a8))
19
+ * **api:** api update ([a894f7d](https://github.com/samplehc/samplehc-python/commit/a894f7dfb69e26535b858f010a47664a2649ffc8))
20
+ * **client:** add custom JSON encoder for extended type support ([61b182a](https://github.com/samplehc/samplehc-python/commit/61b182a434c0b6488cd1d64bd8aeaafe4ef6c477))
21
+
22
+
23
+ ### Chores
24
+
25
+ * **ci:** upgrade `actions/github-script` ([17e3e4f](https://github.com/samplehc/samplehc-python/commit/17e3e4fb991e6fd0a6fd9adcb9f50eea85e3046c))
26
+
3
27
  ## 0.18.0 (2026-01-23)
4
28
 
5
29
  Full Changelog: [v0.17.0...v0.18.0](https://github.com/samplehc/samplehc-python/compare/v0.17.0...v0.18.0)
@@ -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
 
@@ -32,10 +32,10 @@ client = SampleHealthcare(
32
32
  api_key=os.environ.get("SAMPLEHC_API_KEY"), # This is the default and can be omitted
33
33
  )
34
34
 
35
- response = client.v2.async_results.sleep(
36
- delay=1,
35
+ response = client.v2.workflow_runs.resume_when_complete(
36
+ async_result_id="asyncResultId",
37
37
  )
38
- print(response.async_result_id)
38
+ print(response.message)
39
39
  ```
40
40
 
41
41
  While you can provide an `api_key` keyword argument,
@@ -58,10 +58,10 @@ client = AsyncSampleHealthcare(
58
58
 
59
59
 
60
60
  async def main() -> None:
61
- response = await client.v2.async_results.sleep(
62
- delay=1,
61
+ response = await client.v2.workflow_runs.resume_when_complete(
62
+ async_result_id="asyncResultId",
63
63
  )
64
- print(response.async_result_id)
64
+ print(response.message)
65
65
 
66
66
 
67
67
  asyncio.run(main())
@@ -94,10 +94,10 @@ async def main() -> None:
94
94
  api_key=os.environ.get("SAMPLEHC_API_KEY"), # This is the default and can be omitted
95
95
  http_client=DefaultAioHttpClient(),
96
96
  ) as client:
97
- response = await client.v2.async_results.sleep(
98
- delay=1,
97
+ response = await client.v2.workflow_runs.resume_when_complete(
98
+ async_result_id="asyncResultId",
99
99
  )
100
- print(response.async_result_id)
100
+ print(response.message)
101
101
 
102
102
 
103
103
  asyncio.run(main())
@@ -147,8 +147,8 @@ from samplehc import SampleHealthcare
147
147
  client = SampleHealthcare()
148
148
 
149
149
  try:
150
- client.v2.async_results.sleep(
151
- delay=1,
150
+ client.v2.workflow_runs.resume_when_complete(
151
+ async_result_id="asyncResultId",
152
152
  )
153
153
  except samplehc.APIConnectionError as e:
154
154
  print("The server could not be reached")
@@ -192,8 +192,8 @@ client = SampleHealthcare(
192
192
  )
193
193
 
194
194
  # Or, configure per-request:
195
- client.with_options(max_retries=5).v2.async_results.sleep(
196
- delay=1,
195
+ client.with_options(max_retries=5).v2.workflow_runs.resume_when_complete(
196
+ async_result_id="asyncResultId",
197
197
  )
198
198
  ```
199
199
 
@@ -217,8 +217,8 @@ client = SampleHealthcare(
217
217
  )
218
218
 
219
219
  # Override per-request:
220
- client.with_options(timeout=5.0).v2.async_results.sleep(
221
- delay=1,
220
+ client.with_options(timeout=5.0).v2.workflow_runs.resume_when_complete(
221
+ async_result_id="asyncResultId",
222
222
  )
223
223
  ```
224
224
 
@@ -260,13 +260,13 @@ The "raw" Response object can be accessed by prefixing `.with_raw_response.` to
260
260
  from samplehc import SampleHealthcare
261
261
 
262
262
  client = SampleHealthcare()
263
- response = client.v2.async_results.with_raw_response.sleep(
264
- delay=1,
263
+ response = client.v2.workflow_runs.with_raw_response.resume_when_complete(
264
+ async_result_id="asyncResultId",
265
265
  )
266
266
  print(response.headers.get('X-My-Header'))
267
267
 
268
- async_result = response.parse() # get the object that `v2.async_results.sleep()` would have returned
269
- print(async_result.async_result_id)
268
+ workflow_run = response.parse() # get the object that `v2.workflow_runs.resume_when_complete()` would have returned
269
+ print(workflow_run.message)
270
270
  ```
271
271
 
272
272
  These methods return an [`APIResponse`](https://github.com/samplehc/samplehc-python/tree/main/src/samplehc/_response.py) object.
@@ -280,8 +280,8 @@ The above interface eagerly reads the full response body when you make the reque
280
280
  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.
281
281
 
282
282
  ```python
283
- with client.v2.async_results.with_streaming_response.sleep(
284
- delay=1,
283
+ with client.v2.workflow_runs.with_streaming_response.resume_when_complete(
284
+ async_result_id="asyncResultId",
285
285
  ) as response:
286
286
  print(response.headers.get("X-My-Header"))
287
287
 
@@ -1,5 +1,17 @@
1
1
  # V2
2
2
 
3
+ ## WorkflowRuns
4
+
5
+ Types:
6
+
7
+ ```python
8
+ from samplehc.types.v2 import WorkflowRunResumeWhenCompleteResponse
9
+ ```
10
+
11
+ Methods:
12
+
13
+ - <code title="post /api/v2/workflow-runs/resume-when-complete">client.v2.workflow_runs.<a href="./src/samplehc/resources/v2/workflow_runs.py">resume_when_complete</a>(\*\*<a href="src/samplehc/types/v2/workflow_run_resume_when_complete_params.py">params</a>) -> <a href="./src/samplehc/types/v2/workflow_run_resume_when_complete_response.py">WorkflowRunResumeWhenCompleteResponse</a></code>
14
+
3
15
  ## AsyncResults
4
16
 
5
17
  Types:
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "samplehc"
3
- version = "0.18.0"
3
+ version = "0.20.0"
4
4
  description = "The official Python library for the Sample Healthcare API"
5
5
  dynamic = ["readme"]
6
6
  license = "Apache-2.0"
@@ -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)
@@ -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)
@@ -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)