casedev 0.1.0__py3-none-any.whl → 0.2.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 (135) hide show
  1. casedev/_base_client.py +140 -11
  2. casedev/_client.py +290 -119
  3. casedev/_models.py +16 -1
  4. casedev/_types.py +12 -2
  5. casedev/_version.py +1 -1
  6. casedev/resources/__init__.py +0 -70
  7. casedev/resources/compute/v1/__init__.py +0 -42
  8. casedev/resources/compute/v1/environments.py +16 -19
  9. casedev/resources/compute/v1/secrets.py +35 -41
  10. casedev/resources/compute/v1/v1.py +14 -276
  11. casedev/resources/format/v1/templates.py +11 -13
  12. casedev/resources/llm/llm.py +6 -7
  13. casedev/resources/llm/v1/v1.py +11 -13
  14. casedev/resources/ocr/v1.py +10 -13
  15. casedev/resources/search/v1.py +6 -7
  16. casedev/resources/vault/graphrag.py +11 -13
  17. casedev/resources/vault/objects.py +20 -25
  18. casedev/resources/vault/vault.py +64 -28
  19. casedev/resources/voice/streaming.py +6 -7
  20. casedev/resources/voice/transcription.py +82 -23
  21. casedev/resources/voice/v1/speak.py +1 -195
  22. casedev/resources/voice/v1/v1.py +6 -7
  23. casedev/types/__init__.py +2 -0
  24. casedev/types/compute/__init__.py +1 -2
  25. casedev/types/compute/v1/__init__.py +7 -5
  26. casedev/types/compute/v1/environment_list_response.py +40 -0
  27. casedev/types/compute/v1/environment_retrieve_response.py +36 -0
  28. casedev/types/compute/v1/environment_set_default_response.py +36 -0
  29. casedev/types/{convert/v1_webhook_response.py → compute/v1/secret_delete_group_response.py} +3 -3
  30. casedev/types/compute/v1/secret_list_response.py +31 -0
  31. casedev/types/compute/v1/secret_retrieve_group_response.py +38 -0
  32. casedev/types/compute/v1/secret_update_group_response.py +22 -0
  33. casedev/types/compute/v1_get_usage_response.py +51 -0
  34. casedev/types/format/v1/__init__.py +2 -0
  35. casedev/types/format/v1/template_list_response.py +40 -0
  36. casedev/types/format/v1/template_retrieve_response.py +33 -0
  37. casedev/types/llm/__init__.py +2 -0
  38. casedev/types/llm/v1_create_embedding_response.py +31 -0
  39. casedev/types/llm/v1_list_models_response.py +41 -0
  40. casedev/types/llm_get_config_response.py +33 -0
  41. casedev/types/ocr/__init__.py +2 -0
  42. casedev/types/ocr/v1_download_response.py +7 -0
  43. casedev/types/ocr/v1_process_params.py +2 -0
  44. casedev/types/ocr/v1_retrieve_response.py +32 -0
  45. casedev/types/search/__init__.py +1 -0
  46. casedev/types/search/v1_retrieve_research_response.py +74 -0
  47. casedev/types/vault/__init__.py +6 -0
  48. casedev/types/vault/graphrag_get_stats_response.py +31 -0
  49. casedev/types/{workflows/v1_delete_response.py → vault/graphrag_init_response.py} +6 -2
  50. casedev/types/vault/object_download_response.py +7 -0
  51. casedev/types/vault/object_get_text_response.py +35 -0
  52. casedev/types/vault/object_list_response.py +64 -0
  53. casedev/types/vault/object_retrieve_response.py +57 -0
  54. casedev/types/vault_create_params.py +16 -1
  55. casedev/types/vault_create_response.py +5 -2
  56. casedev/types/vault_ingest_response.py +15 -5
  57. casedev/types/vault_retrieve_response.py +76 -0
  58. casedev/types/vault_search_params.py +19 -5
  59. casedev/types/vault_search_response.py +25 -1
  60. casedev/types/vault_upload_params.py +7 -0
  61. casedev/types/vault_upload_response.py +6 -0
  62. casedev/types/voice/__init__.py +3 -0
  63. casedev/types/voice/streaming_get_url_response.py +44 -0
  64. casedev/types/voice/transcription_create_params.py +23 -3
  65. casedev/types/voice/transcription_create_response.py +22 -0
  66. casedev/types/voice/transcription_retrieve_response.py +19 -17
  67. casedev/types/voice/v1/__init__.py +0 -1
  68. casedev/types/voice/v1/speak_create_params.py +2 -0
  69. casedev/types/voice/v1_list_voices_response.py +40 -0
  70. casedev/types/webhooks/__init__.py +0 -3
  71. {casedev-0.1.0.dist-info → casedev-0.2.0.dist-info}/METADATA +10 -13
  72. casedev-0.2.0.dist-info/RECORD +149 -0
  73. {casedev-0.1.0.dist-info → casedev-0.2.0.dist-info}/licenses/LICENSE +1 -1
  74. casedev/resources/actions/__init__.py +0 -33
  75. casedev/resources/actions/actions.py +0 -102
  76. casedev/resources/actions/v1.py +0 -640
  77. casedev/resources/compute/v1/functions.py +0 -278
  78. casedev/resources/compute/v1/invoke.py +0 -216
  79. casedev/resources/compute/v1/runs.py +0 -290
  80. casedev/resources/convert/__init__.py +0 -33
  81. casedev/resources/convert/convert.py +0 -102
  82. casedev/resources/convert/v1/__init__.py +0 -33
  83. casedev/resources/convert/v1/jobs.py +0 -254
  84. casedev/resources/convert/v1/v1.py +0 -450
  85. casedev/resources/templates/__init__.py +0 -33
  86. casedev/resources/templates/templates.py +0 -102
  87. casedev/resources/templates/v1.py +0 -633
  88. casedev/resources/webhooks/__init__.py +0 -33
  89. casedev/resources/webhooks/v1.py +0 -447
  90. casedev/resources/webhooks/webhooks.py +0 -102
  91. casedev/resources/workflows/__init__.py +0 -33
  92. casedev/resources/workflows/v1.py +0 -1053
  93. casedev/resources/workflows/workflows.py +0 -102
  94. casedev/types/actions/__init__.py +0 -8
  95. casedev/types/actions/v1_create_params.py +0 -22
  96. casedev/types/actions/v1_create_response.py +0 -33
  97. casedev/types/actions/v1_execute_params.py +0 -16
  98. casedev/types/actions/v1_execute_response.py +0 -31
  99. casedev/types/compute/v1/function_get_logs_params.py +0 -12
  100. casedev/types/compute/v1/function_list_params.py +0 -12
  101. casedev/types/compute/v1/invoke_run_params.py +0 -21
  102. casedev/types/compute/v1/invoke_run_response.py +0 -39
  103. casedev/types/compute/v1/run_list_params.py +0 -18
  104. casedev/types/compute/v1_deploy_params.py +0 -114
  105. casedev/types/compute/v1_deploy_response.py +0 -30
  106. casedev/types/convert/__init__.py +0 -8
  107. casedev/types/convert/v1/__init__.py +0 -3
  108. casedev/types/convert/v1_process_params.py +0 -15
  109. casedev/types/convert/v1_process_response.py +0 -19
  110. casedev/types/convert/v1_webhook_params.py +0 -32
  111. casedev/types/templates/__init__.py +0 -8
  112. casedev/types/templates/v1_execute_params.py +0 -22
  113. casedev/types/templates/v1_execute_response.py +0 -31
  114. casedev/types/templates/v1_list_params.py +0 -32
  115. casedev/types/templates/v1_search_params.py +0 -18
  116. casedev/types/voice/v1/speak_stream_params.py +0 -58
  117. casedev/types/webhooks/v1_create_params.py +0 -20
  118. casedev/types/webhooks/v1_create_response.py +0 -33
  119. casedev/types/workflows/__init__.py +0 -19
  120. casedev/types/workflows/v1_create_params.py +0 -32
  121. casedev/types/workflows/v1_create_response.py +0 -29
  122. casedev/types/workflows/v1_deploy_response.py +0 -20
  123. casedev/types/workflows/v1_execute_params.py +0 -12
  124. casedev/types/workflows/v1_execute_response.py +0 -22
  125. casedev/types/workflows/v1_list_executions_params.py +0 -13
  126. casedev/types/workflows/v1_list_executions_response.py +0 -27
  127. casedev/types/workflows/v1_list_params.py +0 -18
  128. casedev/types/workflows/v1_list_response.py +0 -37
  129. casedev/types/workflows/v1_retrieve_execution_response.py +0 -31
  130. casedev/types/workflows/v1_retrieve_response.py +0 -35
  131. casedev/types/workflows/v1_undeploy_response.py +0 -13
  132. casedev/types/workflows/v1_update_params.py +0 -26
  133. casedev/types/workflows/v1_update_response.py +0 -17
  134. casedev-0.1.0.dist-info/RECORD +0 -185
  135. {casedev-0.1.0.dist-info → casedev-0.2.0.dist-info}/WHEEL +0 -0
@@ -1,254 +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, NoneType, 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
-
18
- __all__ = ["JobsResource", "AsyncJobsResource"]
19
-
20
-
21
- class JobsResource(SyncAPIResource):
22
- @cached_property
23
- def with_raw_response(self) -> JobsResourceWithRawResponse:
24
- """
25
- This property can be used as a prefix for any HTTP method call to return
26
- the raw response object instead of the parsed content.
27
-
28
- For more information, see https://www.github.com/CaseMark/casedev-python#accessing-raw-response-data-eg-headers
29
- """
30
- return JobsResourceWithRawResponse(self)
31
-
32
- @cached_property
33
- def with_streaming_response(self) -> JobsResourceWithStreamingResponse:
34
- """
35
- An alternative to `.with_raw_response` that doesn't eagerly read the response body.
36
-
37
- For more information, see https://www.github.com/CaseMark/casedev-python#with_streaming_response
38
- """
39
- return JobsResourceWithStreamingResponse(self)
40
-
41
- def retrieve(
42
- self,
43
- id: str,
44
- *,
45
- # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
46
- # The extra values given here take precedence over values defined on the client or passed to this method.
47
- extra_headers: Headers | None = None,
48
- extra_query: Query | None = None,
49
- extra_body: Body | None = None,
50
- timeout: float | httpx.Timeout | None | NotGiven = not_given,
51
- ) -> None:
52
- """Retrieve the status of a file conversion job.
53
-
54
- Returns detailed information about
55
- the conversion progress, completion status, and any errors that occurred during
56
- processing.
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 id:
68
- raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
69
- extra_headers = {"Accept": "*/*", **(extra_headers or {})}
70
- return self._get(
71
- f"/convert/v1/jobs/{id}",
72
- options=make_request_options(
73
- extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
74
- ),
75
- cast_to=NoneType,
76
- )
77
-
78
- def delete(
79
- self,
80
- id: str,
81
- *,
82
- # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
83
- # The extra values given here take precedence over values defined on the client or passed to this method.
84
- extra_headers: Headers | None = None,
85
- extra_query: Query | None = None,
86
- extra_body: Body | None = None,
87
- timeout: float | httpx.Timeout | None | NotGiven = not_given,
88
- ) -> None:
89
- """Delete a converted file from Modal storage by its job ID.
90
-
91
- This permanently
92
- removes the file and its associated metadata from the system.
93
-
94
- Args:
95
- extra_headers: Send extra headers
96
-
97
- extra_query: Add additional query parameters to the request
98
-
99
- extra_body: Add additional JSON properties to the request
100
-
101
- timeout: Override the client-level default timeout for this request, in seconds
102
- """
103
- if not id:
104
- raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
105
- extra_headers = {"Accept": "*/*", **(extra_headers or {})}
106
- return self._delete(
107
- f"/convert/v1/jobs/{id}",
108
- options=make_request_options(
109
- extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
110
- ),
111
- cast_to=NoneType,
112
- )
113
-
114
-
115
- class AsyncJobsResource(AsyncAPIResource):
116
- @cached_property
117
- def with_raw_response(self) -> AsyncJobsResourceWithRawResponse:
118
- """
119
- This property can be used as a prefix for any HTTP method call to return
120
- the raw response object instead of the parsed content.
121
-
122
- For more information, see https://www.github.com/CaseMark/casedev-python#accessing-raw-response-data-eg-headers
123
- """
124
- return AsyncJobsResourceWithRawResponse(self)
125
-
126
- @cached_property
127
- def with_streaming_response(self) -> AsyncJobsResourceWithStreamingResponse:
128
- """
129
- An alternative to `.with_raw_response` that doesn't eagerly read the response body.
130
-
131
- For more information, see https://www.github.com/CaseMark/casedev-python#with_streaming_response
132
- """
133
- return AsyncJobsResourceWithStreamingResponse(self)
134
-
135
- async def retrieve(
136
- self,
137
- id: str,
138
- *,
139
- # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
140
- # The extra values given here take precedence over values defined on the client or passed to this method.
141
- extra_headers: Headers | None = None,
142
- extra_query: Query | None = None,
143
- extra_body: Body | None = None,
144
- timeout: float | httpx.Timeout | None | NotGiven = not_given,
145
- ) -> None:
146
- """Retrieve the status of a file conversion job.
147
-
148
- Returns detailed information about
149
- the conversion progress, completion status, and any errors that occurred during
150
- processing.
151
-
152
- Args:
153
- extra_headers: Send extra headers
154
-
155
- extra_query: Add additional query parameters to the request
156
-
157
- extra_body: Add additional JSON properties to the request
158
-
159
- timeout: Override the client-level default timeout for this request, in seconds
160
- """
161
- if not id:
162
- raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
163
- extra_headers = {"Accept": "*/*", **(extra_headers or {})}
164
- return await self._get(
165
- f"/convert/v1/jobs/{id}",
166
- options=make_request_options(
167
- extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
168
- ),
169
- cast_to=NoneType,
170
- )
171
-
172
- async def delete(
173
- self,
174
- id: str,
175
- *,
176
- # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
177
- # The extra values given here take precedence over values defined on the client or passed to this method.
178
- extra_headers: Headers | None = None,
179
- extra_query: Query | None = None,
180
- extra_body: Body | None = None,
181
- timeout: float | httpx.Timeout | None | NotGiven = not_given,
182
- ) -> None:
183
- """Delete a converted file from Modal storage by its job ID.
184
-
185
- This permanently
186
- removes the file and its associated metadata from the system.
187
-
188
- Args:
189
- extra_headers: Send extra headers
190
-
191
- extra_query: Add additional query parameters to the request
192
-
193
- extra_body: Add additional JSON properties to the request
194
-
195
- timeout: Override the client-level default timeout for this request, in seconds
196
- """
197
- if not id:
198
- raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
199
- extra_headers = {"Accept": "*/*", **(extra_headers or {})}
200
- return await self._delete(
201
- f"/convert/v1/jobs/{id}",
202
- options=make_request_options(
203
- extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
204
- ),
205
- cast_to=NoneType,
206
- )
207
-
208
-
209
- class JobsResourceWithRawResponse:
210
- def __init__(self, jobs: JobsResource) -> None:
211
- self._jobs = jobs
212
-
213
- self.retrieve = to_raw_response_wrapper(
214
- jobs.retrieve,
215
- )
216
- self.delete = to_raw_response_wrapper(
217
- jobs.delete,
218
- )
219
-
220
-
221
- class AsyncJobsResourceWithRawResponse:
222
- def __init__(self, jobs: AsyncJobsResource) -> None:
223
- self._jobs = jobs
224
-
225
- self.retrieve = async_to_raw_response_wrapper(
226
- jobs.retrieve,
227
- )
228
- self.delete = async_to_raw_response_wrapper(
229
- jobs.delete,
230
- )
231
-
232
-
233
- class JobsResourceWithStreamingResponse:
234
- def __init__(self, jobs: JobsResource) -> None:
235
- self._jobs = jobs
236
-
237
- self.retrieve = to_streamed_response_wrapper(
238
- jobs.retrieve,
239
- )
240
- self.delete = to_streamed_response_wrapper(
241
- jobs.delete,
242
- )
243
-
244
-
245
- class AsyncJobsResourceWithStreamingResponse:
246
- def __init__(self, jobs: AsyncJobsResource) -> None:
247
- self._jobs = jobs
248
-
249
- self.retrieve = async_to_streamed_response_wrapper(
250
- jobs.retrieve,
251
- )
252
- self.delete = async_to_streamed_response_wrapper(
253
- jobs.delete,
254
- )
@@ -1,450 +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_extensions import Literal
6
-
7
- import httpx
8
-
9
- from .jobs import (
10
- JobsResource,
11
- AsyncJobsResource,
12
- JobsResourceWithRawResponse,
13
- AsyncJobsResourceWithRawResponse,
14
- JobsResourceWithStreamingResponse,
15
- AsyncJobsResourceWithStreamingResponse,
16
- )
17
- from ...._types import Body, Omit, Query, Headers, NotGiven, omit, not_given
18
- from ...._utils import maybe_transform, async_maybe_transform
19
- from ...._compat import cached_property
20
- from ...._resource import SyncAPIResource, AsyncAPIResource
21
- from ...._response import (
22
- BinaryAPIResponse,
23
- AsyncBinaryAPIResponse,
24
- StreamedBinaryAPIResponse,
25
- AsyncStreamedBinaryAPIResponse,
26
- to_raw_response_wrapper,
27
- to_streamed_response_wrapper,
28
- async_to_raw_response_wrapper,
29
- to_custom_raw_response_wrapper,
30
- async_to_streamed_response_wrapper,
31
- to_custom_streamed_response_wrapper,
32
- async_to_custom_raw_response_wrapper,
33
- async_to_custom_streamed_response_wrapper,
34
- )
35
- from ...._base_client import make_request_options
36
- from ....types.convert import v1_process_params, v1_webhook_params
37
- from ....types.convert.v1_process_response import V1ProcessResponse
38
- from ....types.convert.v1_webhook_response import V1WebhookResponse
39
-
40
- __all__ = ["V1Resource", "AsyncV1Resource"]
41
-
42
-
43
- class V1Resource(SyncAPIResource):
44
- @cached_property
45
- def jobs(self) -> JobsResource:
46
- return JobsResource(self._client)
47
-
48
- @cached_property
49
- def with_raw_response(self) -> V1ResourceWithRawResponse:
50
- """
51
- This property can be used as a prefix for any HTTP method call to return
52
- the raw response object instead of the parsed content.
53
-
54
- For more information, see https://www.github.com/CaseMark/casedev-python#accessing-raw-response-data-eg-headers
55
- """
56
- return V1ResourceWithRawResponse(self)
57
-
58
- @cached_property
59
- def with_streaming_response(self) -> V1ResourceWithStreamingResponse:
60
- """
61
- An alternative to `.with_raw_response` that doesn't eagerly read the response body.
62
-
63
- For more information, see https://www.github.com/CaseMark/casedev-python#with_streaming_response
64
- """
65
- return V1ResourceWithStreamingResponse(self)
66
-
67
- def download(
68
- self,
69
- id: str,
70
- *,
71
- # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
72
- # The extra values given here take precedence over values defined on the client or passed to this method.
73
- extra_headers: Headers | None = None,
74
- extra_query: Query | None = None,
75
- extra_body: Body | None = None,
76
- timeout: float | httpx.Timeout | None | NotGiven = not_given,
77
- ) -> BinaryAPIResponse:
78
- """Download the converted M4A audio file from a completed FTR conversion job.
79
-
80
- The
81
- file is streamed directly to the client with appropriate headers for audio
82
- playback or download.
83
-
84
- Args:
85
- extra_headers: Send extra headers
86
-
87
- extra_query: Add additional query parameters to the request
88
-
89
- extra_body: Add additional JSON properties to the request
90
-
91
- timeout: Override the client-level default timeout for this request, in seconds
92
- """
93
- if not id:
94
- raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
95
- extra_headers = {"Accept": "audio/mp4", **(extra_headers or {})}
96
- return self._get(
97
- f"/convert/v1/download/{id}",
98
- options=make_request_options(
99
- extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
100
- ),
101
- cast_to=BinaryAPIResponse,
102
- )
103
-
104
- def process(
105
- self,
106
- *,
107
- input_url: str,
108
- callback_url: str | Omit = omit,
109
- # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
110
- # The extra values given here take precedence over values defined on the client or passed to this method.
111
- extra_headers: Headers | None = None,
112
- extra_query: Query | None = None,
113
- extra_body: Body | None = None,
114
- timeout: float | httpx.Timeout | None | NotGiven = not_given,
115
- ) -> V1ProcessResponse:
116
- """
117
- Submit an FTR (ForensicTech Recording) file for conversion to M4A audio format.
118
- This endpoint is commonly used to convert court recording files into standard
119
- audio formats for transcription or playback. The conversion is processed
120
- asynchronously - you'll receive a job ID to track the conversion status.
121
-
122
- **Supported Input**: FTR files via S3 presigned URLs **Output Format**: M4A
123
- audio **Processing**: Asynchronous with webhook callbacks
124
-
125
- Args:
126
- input_url: HTTPS URL to the FTR file (must be a valid S3 presigned URL)
127
-
128
- callback_url: Optional webhook URL to receive conversion completion notification
129
-
130
- extra_headers: Send extra headers
131
-
132
- extra_query: Add additional query parameters to the request
133
-
134
- extra_body: Add additional JSON properties to the request
135
-
136
- timeout: Override the client-level default timeout for this request, in seconds
137
- """
138
- return self._post(
139
- "/convert/v1/process",
140
- body=maybe_transform(
141
- {
142
- "input_url": input_url,
143
- "callback_url": callback_url,
144
- },
145
- v1_process_params.V1ProcessParams,
146
- ),
147
- options=make_request_options(
148
- extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
149
- ),
150
- cast_to=V1ProcessResponse,
151
- )
152
-
153
- def webhook(
154
- self,
155
- *,
156
- job_id: str,
157
- status: Literal["completed", "failed"],
158
- error: str | Omit = omit,
159
- result: v1_webhook_params.Result | Omit = omit,
160
- # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
161
- # The extra values given here take precedence over values defined on the client or passed to this method.
162
- extra_headers: Headers | None = None,
163
- extra_query: Query | None = None,
164
- extra_body: Body | None = None,
165
- timeout: float | httpx.Timeout | None | NotGiven = not_given,
166
- ) -> V1WebhookResponse:
167
- """
168
- Internal webhook endpoint that receives completion notifications from the Modal
169
- FTR converter service. This endpoint handles status updates for file conversion
170
- jobs, including success and failure notifications. Requires valid Bearer token
171
- authentication.
172
-
173
- Args:
174
- job_id: Unique identifier for the conversion job
175
-
176
- status: Status of the conversion job
177
-
178
- error: Error message for failed jobs
179
-
180
- result: Result data for completed jobs
181
-
182
- extra_headers: Send extra headers
183
-
184
- extra_query: Add additional query parameters to the request
185
-
186
- extra_body: Add additional JSON properties to the request
187
-
188
- timeout: Override the client-level default timeout for this request, in seconds
189
- """
190
- return self._post(
191
- "/convert/v1/webhook",
192
- body=maybe_transform(
193
- {
194
- "job_id": job_id,
195
- "status": status,
196
- "error": error,
197
- "result": result,
198
- },
199
- v1_webhook_params.V1WebhookParams,
200
- ),
201
- options=make_request_options(
202
- extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
203
- ),
204
- cast_to=V1WebhookResponse,
205
- )
206
-
207
-
208
- class AsyncV1Resource(AsyncAPIResource):
209
- @cached_property
210
- def jobs(self) -> AsyncJobsResource:
211
- return AsyncJobsResource(self._client)
212
-
213
- @cached_property
214
- def with_raw_response(self) -> AsyncV1ResourceWithRawResponse:
215
- """
216
- This property can be used as a prefix for any HTTP method call to return
217
- the raw response object instead of the parsed content.
218
-
219
- For more information, see https://www.github.com/CaseMark/casedev-python#accessing-raw-response-data-eg-headers
220
- """
221
- return AsyncV1ResourceWithRawResponse(self)
222
-
223
- @cached_property
224
- def with_streaming_response(self) -> AsyncV1ResourceWithStreamingResponse:
225
- """
226
- An alternative to `.with_raw_response` that doesn't eagerly read the response body.
227
-
228
- For more information, see https://www.github.com/CaseMark/casedev-python#with_streaming_response
229
- """
230
- return AsyncV1ResourceWithStreamingResponse(self)
231
-
232
- async def download(
233
- self,
234
- id: str,
235
- *,
236
- # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
237
- # The extra values given here take precedence over values defined on the client or passed to this method.
238
- extra_headers: Headers | None = None,
239
- extra_query: Query | None = None,
240
- extra_body: Body | None = None,
241
- timeout: float | httpx.Timeout | None | NotGiven = not_given,
242
- ) -> AsyncBinaryAPIResponse:
243
- """Download the converted M4A audio file from a completed FTR conversion job.
244
-
245
- The
246
- file is streamed directly to the client with appropriate headers for audio
247
- playback or download.
248
-
249
- Args:
250
- extra_headers: Send extra headers
251
-
252
- extra_query: Add additional query parameters to the request
253
-
254
- extra_body: Add additional JSON properties to the request
255
-
256
- timeout: Override the client-level default timeout for this request, in seconds
257
- """
258
- if not id:
259
- raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
260
- extra_headers = {"Accept": "audio/mp4", **(extra_headers or {})}
261
- return await self._get(
262
- f"/convert/v1/download/{id}",
263
- options=make_request_options(
264
- extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
265
- ),
266
- cast_to=AsyncBinaryAPIResponse,
267
- )
268
-
269
- async def process(
270
- self,
271
- *,
272
- input_url: str,
273
- callback_url: str | Omit = omit,
274
- # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
275
- # The extra values given here take precedence over values defined on the client or passed to this method.
276
- extra_headers: Headers | None = None,
277
- extra_query: Query | None = None,
278
- extra_body: Body | None = None,
279
- timeout: float | httpx.Timeout | None | NotGiven = not_given,
280
- ) -> V1ProcessResponse:
281
- """
282
- Submit an FTR (ForensicTech Recording) file for conversion to M4A audio format.
283
- This endpoint is commonly used to convert court recording files into standard
284
- audio formats for transcription or playback. The conversion is processed
285
- asynchronously - you'll receive a job ID to track the conversion status.
286
-
287
- **Supported Input**: FTR files via S3 presigned URLs **Output Format**: M4A
288
- audio **Processing**: Asynchronous with webhook callbacks
289
-
290
- Args:
291
- input_url: HTTPS URL to the FTR file (must be a valid S3 presigned URL)
292
-
293
- callback_url: Optional webhook URL to receive conversion completion notification
294
-
295
- extra_headers: Send extra headers
296
-
297
- extra_query: Add additional query parameters to the request
298
-
299
- extra_body: Add additional JSON properties to the request
300
-
301
- timeout: Override the client-level default timeout for this request, in seconds
302
- """
303
- return await self._post(
304
- "/convert/v1/process",
305
- body=await async_maybe_transform(
306
- {
307
- "input_url": input_url,
308
- "callback_url": callback_url,
309
- },
310
- v1_process_params.V1ProcessParams,
311
- ),
312
- options=make_request_options(
313
- extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
314
- ),
315
- cast_to=V1ProcessResponse,
316
- )
317
-
318
- async def webhook(
319
- self,
320
- *,
321
- job_id: str,
322
- status: Literal["completed", "failed"],
323
- error: str | Omit = omit,
324
- result: v1_webhook_params.Result | Omit = omit,
325
- # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
326
- # The extra values given here take precedence over values defined on the client or passed to this method.
327
- extra_headers: Headers | None = None,
328
- extra_query: Query | None = None,
329
- extra_body: Body | None = None,
330
- timeout: float | httpx.Timeout | None | NotGiven = not_given,
331
- ) -> V1WebhookResponse:
332
- """
333
- Internal webhook endpoint that receives completion notifications from the Modal
334
- FTR converter service. This endpoint handles status updates for file conversion
335
- jobs, including success and failure notifications. Requires valid Bearer token
336
- authentication.
337
-
338
- Args:
339
- job_id: Unique identifier for the conversion job
340
-
341
- status: Status of the conversion job
342
-
343
- error: Error message for failed jobs
344
-
345
- result: Result data for completed jobs
346
-
347
- extra_headers: Send extra headers
348
-
349
- extra_query: Add additional query parameters to the request
350
-
351
- extra_body: Add additional JSON properties to the request
352
-
353
- timeout: Override the client-level default timeout for this request, in seconds
354
- """
355
- return await self._post(
356
- "/convert/v1/webhook",
357
- body=await async_maybe_transform(
358
- {
359
- "job_id": job_id,
360
- "status": status,
361
- "error": error,
362
- "result": result,
363
- },
364
- v1_webhook_params.V1WebhookParams,
365
- ),
366
- options=make_request_options(
367
- extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
368
- ),
369
- cast_to=V1WebhookResponse,
370
- )
371
-
372
-
373
- class V1ResourceWithRawResponse:
374
- def __init__(self, v1: V1Resource) -> None:
375
- self._v1 = v1
376
-
377
- self.download = to_custom_raw_response_wrapper(
378
- v1.download,
379
- BinaryAPIResponse,
380
- )
381
- self.process = to_raw_response_wrapper(
382
- v1.process,
383
- )
384
- self.webhook = to_raw_response_wrapper(
385
- v1.webhook,
386
- )
387
-
388
- @cached_property
389
- def jobs(self) -> JobsResourceWithRawResponse:
390
- return JobsResourceWithRawResponse(self._v1.jobs)
391
-
392
-
393
- class AsyncV1ResourceWithRawResponse:
394
- def __init__(self, v1: AsyncV1Resource) -> None:
395
- self._v1 = v1
396
-
397
- self.download = async_to_custom_raw_response_wrapper(
398
- v1.download,
399
- AsyncBinaryAPIResponse,
400
- )
401
- self.process = async_to_raw_response_wrapper(
402
- v1.process,
403
- )
404
- self.webhook = async_to_raw_response_wrapper(
405
- v1.webhook,
406
- )
407
-
408
- @cached_property
409
- def jobs(self) -> AsyncJobsResourceWithRawResponse:
410
- return AsyncJobsResourceWithRawResponse(self._v1.jobs)
411
-
412
-
413
- class V1ResourceWithStreamingResponse:
414
- def __init__(self, v1: V1Resource) -> None:
415
- self._v1 = v1
416
-
417
- self.download = to_custom_streamed_response_wrapper(
418
- v1.download,
419
- StreamedBinaryAPIResponse,
420
- )
421
- self.process = to_streamed_response_wrapper(
422
- v1.process,
423
- )
424
- self.webhook = to_streamed_response_wrapper(
425
- v1.webhook,
426
- )
427
-
428
- @cached_property
429
- def jobs(self) -> JobsResourceWithStreamingResponse:
430
- return JobsResourceWithStreamingResponse(self._v1.jobs)
431
-
432
-
433
- class AsyncV1ResourceWithStreamingResponse:
434
- def __init__(self, v1: AsyncV1Resource) -> None:
435
- self._v1 = v1
436
-
437
- self.download = async_to_custom_streamed_response_wrapper(
438
- v1.download,
439
- AsyncStreamedBinaryAPIResponse,
440
- )
441
- self.process = async_to_streamed_response_wrapper(
442
- v1.process,
443
- )
444
- self.webhook = async_to_streamed_response_wrapper(
445
- v1.webhook,
446
- )
447
-
448
- @cached_property
449
- def jobs(self) -> AsyncJobsResourceWithStreamingResponse:
450
- return AsyncJobsResourceWithStreamingResponse(self._v1.jobs)