casedev 0.2.0__py3-none-any.whl → 0.4.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 (157) hide show
  1. casedev/_base_client.py +5 -2
  2. casedev/_client.py +275 -1
  3. casedev/_compat.py +3 -3
  4. casedev/_utils/_json.py +35 -0
  5. casedev/_version.py +1 -1
  6. casedev/resources/__init__.py +98 -0
  7. casedev/resources/applications/__init__.py +33 -0
  8. casedev/resources/applications/applications.py +102 -0
  9. casedev/resources/applications/v1/__init__.py +61 -0
  10. casedev/resources/applications/v1/deployments.py +867 -0
  11. casedev/resources/applications/v1/projects.py +1377 -0
  12. casedev/resources/applications/v1/v1.py +166 -0
  13. casedev/resources/applications/v1/workflows.py +182 -0
  14. casedev/resources/compute/v1/__init__.py +28 -0
  15. casedev/resources/compute/v1/instance_types.py +145 -0
  16. casedev/resources/compute/v1/instances.py +448 -0
  17. casedev/resources/compute/v1/v1.py +64 -0
  18. casedev/resources/database/__init__.py +33 -0
  19. casedev/resources/database/database.py +102 -0
  20. casedev/resources/database/v1/__init__.py +33 -0
  21. casedev/resources/database/v1/projects.py +771 -0
  22. casedev/resources/database/v1/v1.py +175 -0
  23. casedev/resources/legal/__init__.py +33 -0
  24. casedev/resources/legal/legal.py +102 -0
  25. casedev/resources/legal/v1.py +924 -0
  26. casedev/resources/memory/__init__.py +33 -0
  27. casedev/resources/memory/memory.py +102 -0
  28. casedev/resources/memory/v1.py +1100 -0
  29. casedev/resources/ocr/v1.py +2 -2
  30. casedev/resources/privilege/__init__.py +33 -0
  31. casedev/resources/privilege/privilege.py +102 -0
  32. casedev/resources/privilege/v1.py +260 -0
  33. casedev/resources/superdoc/__init__.py +33 -0
  34. casedev/resources/superdoc/superdoc.py +102 -0
  35. casedev/resources/superdoc/v1.py +349 -0
  36. casedev/resources/translate/__init__.py +33 -0
  37. casedev/resources/translate/translate.py +102 -0
  38. casedev/resources/translate/v1.py +418 -0
  39. casedev/resources/vault/__init__.py +14 -0
  40. casedev/resources/vault/graphrag.py +91 -0
  41. casedev/resources/vault/multipart.py +549 -0
  42. casedev/resources/vault/objects.py +481 -1
  43. casedev/resources/vault/vault.py +264 -5
  44. casedev/resources/voice/streaming.py +2 -2
  45. casedev/types/__init__.py +4 -0
  46. casedev/types/applications/v1/__init__.py +20 -0
  47. casedev/types/applications/v1/deployment_cancel_params.py +14 -0
  48. casedev/types/applications/v1/deployment_create_params.py +20 -0
  49. casedev/types/applications/v1/deployment_get_logs_params.py +14 -0
  50. casedev/types/applications/v1/deployment_list_params.py +23 -0
  51. casedev/types/applications/v1/deployment_retrieve_params.py +17 -0
  52. casedev/types/applications/v1/deployment_stream_params.py +17 -0
  53. casedev/types/applications/v1/project_create_deployment_params.py +29 -0
  54. casedev/types/applications/v1/project_create_domain_params.py +17 -0
  55. casedev/types/applications/v1/project_create_env_params.py +27 -0
  56. casedev/types/applications/v1/project_create_params.py +53 -0
  57. casedev/types/applications/v1/project_delete_params.py +14 -0
  58. casedev/types/applications/v1/project_get_runtime_logs_params.py +12 -0
  59. casedev/types/applications/v1/project_list_deployments_params.py +18 -0
  60. casedev/types/applications/v1/project_list_env_params.py +12 -0
  61. casedev/types/applications/v1/project_list_response.py +45 -0
  62. casedev/types/applications/v1/workflow_get_status_params.py +14 -0
  63. casedev/types/compute/v1/__init__.py +6 -0
  64. casedev/types/compute/v1/instance_create_params.py +28 -0
  65. casedev/types/compute/v1/instance_create_response.py +35 -0
  66. casedev/types/compute/v1/instance_delete_response.py +23 -0
  67. casedev/types/compute/v1/instance_list_response.py +45 -0
  68. casedev/types/compute/v1/instance_retrieve_response.py +55 -0
  69. casedev/types/compute/v1/instance_type_list_response.py +46 -0
  70. casedev/types/database/__init__.py +5 -0
  71. casedev/types/database/v1/__init__.py +14 -0
  72. casedev/types/database/v1/project_create_branch_params.py +17 -0
  73. casedev/types/database/v1/project_create_branch_response.py +30 -0
  74. casedev/types/database/v1/project_create_params.py +27 -0
  75. casedev/types/database/v1/project_create_response.py +47 -0
  76. casedev/types/database/v1/project_delete_response.py +13 -0
  77. casedev/types/database/v1/project_get_connection_params.py +15 -0
  78. casedev/types/database/v1/project_get_connection_response.py +18 -0
  79. casedev/types/database/v1/project_list_branches_response.py +37 -0
  80. casedev/types/database/v1/project_list_response.py +64 -0
  81. casedev/types/database/v1/project_retrieve_response.py +100 -0
  82. casedev/types/database/v1_get_usage_response.py +116 -0
  83. casedev/types/legal/__init__.py +20 -0
  84. casedev/types/legal/v1_find_params.py +23 -0
  85. casedev/types/legal/v1_find_response.py +37 -0
  86. casedev/types/legal/v1_get_citations_from_url_params.py +12 -0
  87. casedev/types/legal/v1_get_citations_from_url_response.py +69 -0
  88. casedev/types/legal/v1_get_citations_params.py +16 -0
  89. casedev/types/legal/v1_get_citations_response.py +60 -0
  90. casedev/types/legal/v1_get_full_text_params.py +23 -0
  91. casedev/types/legal/v1_get_full_text_response.py +35 -0
  92. casedev/types/legal/v1_list_jurisdictions_params.py +12 -0
  93. casedev/types/legal/v1_list_jurisdictions_response.py +35 -0
  94. casedev/types/legal/v1_research_params.py +27 -0
  95. casedev/types/legal/v1_research_response.py +51 -0
  96. casedev/types/legal/v1_similar_params.py +25 -0
  97. casedev/types/legal/v1_similar_response.py +42 -0
  98. casedev/types/legal/v1_verify_params.py +16 -0
  99. casedev/types/legal/v1_verify_response.py +92 -0
  100. casedev/types/memory/__init__.py +14 -0
  101. casedev/types/memory/v1_create_params.py +69 -0
  102. casedev/types/memory/v1_create_response.py +23 -0
  103. casedev/types/memory/v1_delete_all_params.py +45 -0
  104. casedev/types/memory/v1_delete_all_response.py +12 -0
  105. casedev/types/memory/v1_delete_response.py +13 -0
  106. casedev/types/memory/v1_list_params.py +54 -0
  107. casedev/types/memory/v1_list_response.py +29 -0
  108. casedev/types/memory/v1_retrieve_response.py +23 -0
  109. casedev/types/memory/v1_search_params.py +54 -0
  110. casedev/types/memory/v1_search_response.py +61 -0
  111. casedev/types/ocr/v1_process_params.py +21 -13
  112. casedev/types/ocr/v1_retrieve_response.py +7 -7
  113. casedev/types/privilege/__init__.py +6 -0
  114. casedev/types/privilege/v1_detect_params.py +34 -0
  115. casedev/types/privilege/v1_detect_response.py +41 -0
  116. casedev/types/superdoc/__init__.py +6 -0
  117. casedev/types/superdoc/v1_annotate_params.py +56 -0
  118. casedev/types/superdoc/v1_convert_params.py +23 -0
  119. casedev/types/translate/__init__.py +10 -0
  120. casedev/types/translate/v1_detect_params.py +18 -0
  121. casedev/types/translate/v1_detect_response.py +28 -0
  122. casedev/types/translate/v1_list_languages_params.py +18 -0
  123. casedev/types/translate/v1_list_languages_response.py +23 -0
  124. casedev/types/translate/v1_translate_params.py +30 -0
  125. casedev/types/translate/v1_translate_response.py +28 -0
  126. casedev/types/vault/__init__.py +14 -0
  127. casedev/types/vault/graphrag_process_object_response.py +45 -0
  128. casedev/types/vault/multipart_abort_params.py +15 -0
  129. casedev/types/vault/multipart_complete_params.py +26 -0
  130. casedev/types/vault/multipart_get_part_urls_params.py +24 -0
  131. casedev/types/vault/multipart_get_part_urls_response.py +19 -0
  132. casedev/types/vault/multipart_init_params.py +32 -0
  133. casedev/types/vault/multipart_init_response.py +23 -0
  134. casedev/types/vault/object_create_presigned_url_params.py +6 -0
  135. casedev/types/vault/object_delete_params.py +17 -0
  136. casedev/types/vault/object_delete_response.py +29 -0
  137. casedev/types/vault/object_get_ocr_words_params.py +28 -0
  138. casedev/types/vault/object_get_ocr_words_response.py +48 -0
  139. casedev/types/vault/object_get_summarize_job_response.py +40 -0
  140. casedev/types/vault/object_get_text_response.py +10 -10
  141. casedev/types/vault/object_list_response.py +13 -13
  142. casedev/types/vault/object_retrieve_response.py +13 -13
  143. casedev/types/vault/object_update_params.py +24 -0
  144. casedev/types/vault/object_update_response.py +39 -0
  145. casedev/types/vault_delete_params.py +17 -0
  146. casedev/types/vault_delete_response.py +30 -0
  147. casedev/types/vault_retrieve_response.py +13 -13
  148. casedev/types/vault_search_response.py +14 -0
  149. casedev/types/vault_update_params.py +21 -0
  150. casedev/types/vault_update_response.py +60 -0
  151. casedev/types/vault_upload_params.py +5 -2
  152. {casedev-0.2.0.dist-info → casedev-0.4.0.dist-info}/METADATA +1 -1
  153. casedev-0.4.0.dist-info/RECORD +275 -0
  154. casedev-0.2.0.dist-info/RECORD +0 -149
  155. /casedev/types/{webhooks → applications}/__init__.py +0 -0
  156. {casedev-0.2.0.dist-info → casedev-0.4.0.dist-info}/WHEEL +0 -0
  157. {casedev-0.2.0.dist-info → casedev-0.4.0.dist-info}/licenses/LICENSE +0 -0
casedev/_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)
casedev/_client.py CHANGED
@@ -31,14 +31,36 @@ from ._base_client import (
31
31
  )
32
32
 
33
33
  if TYPE_CHECKING:
34
- from .resources import llm, ocr, vault, voice, format, search, compute
34
+ from .resources import (
35
+ llm,
36
+ ocr,
37
+ legal,
38
+ vault,
39
+ voice,
40
+ format,
41
+ memory,
42
+ search,
43
+ compute,
44
+ database,
45
+ superdoc,
46
+ privilege,
47
+ translate,
48
+ applications,
49
+ )
35
50
  from .resources.llm.llm import LlmResource, AsyncLlmResource
36
51
  from .resources.ocr.ocr import OcrResource, AsyncOcrResource
52
+ from .resources.legal.legal import LegalResource, AsyncLegalResource
37
53
  from .resources.vault.vault import VaultResource, AsyncVaultResource
38
54
  from .resources.voice.voice import VoiceResource, AsyncVoiceResource
39
55
  from .resources.format.format import FormatResource, AsyncFormatResource
56
+ from .resources.memory.memory import MemoryResource, AsyncMemoryResource
40
57
  from .resources.search.search import SearchResource, AsyncSearchResource
41
58
  from .resources.compute.compute import ComputeResource, AsyncComputeResource
59
+ from .resources.database.database import DatabaseResource, AsyncDatabaseResource
60
+ from .resources.superdoc.superdoc import SuperdocResource, AsyncSuperdocResource
61
+ from .resources.privilege.privilege import PrivilegeResource, AsyncPrivilegeResource
62
+ from .resources.translate.translate import TranslateResource, AsyncTranslateResource
63
+ from .resources.applications.applications import ApplicationsResource, AsyncApplicationsResource
42
64
 
43
65
  __all__ = [
44
66
  "ENVIRONMENTS",
@@ -137,36 +159,78 @@ class Casedev(SyncAPIClient):
137
159
  _strict_response_validation=_strict_response_validation,
138
160
  )
139
161
 
162
+ @cached_property
163
+ def applications(self) -> ApplicationsResource:
164
+ from .resources.applications import ApplicationsResource
165
+
166
+ return ApplicationsResource(self)
167
+
140
168
  @cached_property
141
169
  def compute(self) -> ComputeResource:
142
170
  from .resources.compute import ComputeResource
143
171
 
144
172
  return ComputeResource(self)
145
173
 
174
+ @cached_property
175
+ def database(self) -> DatabaseResource:
176
+ from .resources.database import DatabaseResource
177
+
178
+ return DatabaseResource(self)
179
+
146
180
  @cached_property
147
181
  def format(self) -> FormatResource:
148
182
  from .resources.format import FormatResource
149
183
 
150
184
  return FormatResource(self)
151
185
 
186
+ @cached_property
187
+ def legal(self) -> LegalResource:
188
+ from .resources.legal import LegalResource
189
+
190
+ return LegalResource(self)
191
+
152
192
  @cached_property
153
193
  def llm(self) -> LlmResource:
154
194
  from .resources.llm import LlmResource
155
195
 
156
196
  return LlmResource(self)
157
197
 
198
+ @cached_property
199
+ def memory(self) -> MemoryResource:
200
+ from .resources.memory import MemoryResource
201
+
202
+ return MemoryResource(self)
203
+
158
204
  @cached_property
159
205
  def ocr(self) -> OcrResource:
160
206
  from .resources.ocr import OcrResource
161
207
 
162
208
  return OcrResource(self)
163
209
 
210
+ @cached_property
211
+ def privilege(self) -> PrivilegeResource:
212
+ from .resources.privilege import PrivilegeResource
213
+
214
+ return PrivilegeResource(self)
215
+
164
216
  @cached_property
165
217
  def search(self) -> SearchResource:
166
218
  from .resources.search import SearchResource
167
219
 
168
220
  return SearchResource(self)
169
221
 
222
+ @cached_property
223
+ def superdoc(self) -> SuperdocResource:
224
+ from .resources.superdoc import SuperdocResource
225
+
226
+ return SuperdocResource(self)
227
+
228
+ @cached_property
229
+ def translate(self) -> TranslateResource:
230
+ from .resources.translate import TranslateResource
231
+
232
+ return TranslateResource(self)
233
+
170
234
  @cached_property
171
235
  def vault(self) -> VaultResource:
172
236
  from .resources.vault import VaultResource
@@ -373,36 +437,78 @@ class AsyncCasedev(AsyncAPIClient):
373
437
  _strict_response_validation=_strict_response_validation,
374
438
  )
375
439
 
440
+ @cached_property
441
+ def applications(self) -> AsyncApplicationsResource:
442
+ from .resources.applications import AsyncApplicationsResource
443
+
444
+ return AsyncApplicationsResource(self)
445
+
376
446
  @cached_property
377
447
  def compute(self) -> AsyncComputeResource:
378
448
  from .resources.compute import AsyncComputeResource
379
449
 
380
450
  return AsyncComputeResource(self)
381
451
 
452
+ @cached_property
453
+ def database(self) -> AsyncDatabaseResource:
454
+ from .resources.database import AsyncDatabaseResource
455
+
456
+ return AsyncDatabaseResource(self)
457
+
382
458
  @cached_property
383
459
  def format(self) -> AsyncFormatResource:
384
460
  from .resources.format import AsyncFormatResource
385
461
 
386
462
  return AsyncFormatResource(self)
387
463
 
464
+ @cached_property
465
+ def legal(self) -> AsyncLegalResource:
466
+ from .resources.legal import AsyncLegalResource
467
+
468
+ return AsyncLegalResource(self)
469
+
388
470
  @cached_property
389
471
  def llm(self) -> AsyncLlmResource:
390
472
  from .resources.llm import AsyncLlmResource
391
473
 
392
474
  return AsyncLlmResource(self)
393
475
 
476
+ @cached_property
477
+ def memory(self) -> AsyncMemoryResource:
478
+ from .resources.memory import AsyncMemoryResource
479
+
480
+ return AsyncMemoryResource(self)
481
+
394
482
  @cached_property
395
483
  def ocr(self) -> AsyncOcrResource:
396
484
  from .resources.ocr import AsyncOcrResource
397
485
 
398
486
  return AsyncOcrResource(self)
399
487
 
488
+ @cached_property
489
+ def privilege(self) -> AsyncPrivilegeResource:
490
+ from .resources.privilege import AsyncPrivilegeResource
491
+
492
+ return AsyncPrivilegeResource(self)
493
+
400
494
  @cached_property
401
495
  def search(self) -> AsyncSearchResource:
402
496
  from .resources.search import AsyncSearchResource
403
497
 
404
498
  return AsyncSearchResource(self)
405
499
 
500
+ @cached_property
501
+ def superdoc(self) -> AsyncSuperdocResource:
502
+ from .resources.superdoc import AsyncSuperdocResource
503
+
504
+ return AsyncSuperdocResource(self)
505
+
506
+ @cached_property
507
+ def translate(self) -> AsyncTranslateResource:
508
+ from .resources.translate import AsyncTranslateResource
509
+
510
+ return AsyncTranslateResource(self)
511
+
406
512
  @cached_property
407
513
  def vault(self) -> AsyncVaultResource:
408
514
  from .resources.vault import AsyncVaultResource
@@ -536,36 +642,78 @@ class CasedevWithRawResponse:
536
642
  def __init__(self, client: Casedev) -> None:
537
643
  self._client = client
538
644
 
645
+ @cached_property
646
+ def applications(self) -> applications.ApplicationsResourceWithRawResponse:
647
+ from .resources.applications import ApplicationsResourceWithRawResponse
648
+
649
+ return ApplicationsResourceWithRawResponse(self._client.applications)
650
+
539
651
  @cached_property
540
652
  def compute(self) -> compute.ComputeResourceWithRawResponse:
541
653
  from .resources.compute import ComputeResourceWithRawResponse
542
654
 
543
655
  return ComputeResourceWithRawResponse(self._client.compute)
544
656
 
657
+ @cached_property
658
+ def database(self) -> database.DatabaseResourceWithRawResponse:
659
+ from .resources.database import DatabaseResourceWithRawResponse
660
+
661
+ return DatabaseResourceWithRawResponse(self._client.database)
662
+
545
663
  @cached_property
546
664
  def format(self) -> format.FormatResourceWithRawResponse:
547
665
  from .resources.format import FormatResourceWithRawResponse
548
666
 
549
667
  return FormatResourceWithRawResponse(self._client.format)
550
668
 
669
+ @cached_property
670
+ def legal(self) -> legal.LegalResourceWithRawResponse:
671
+ from .resources.legal import LegalResourceWithRawResponse
672
+
673
+ return LegalResourceWithRawResponse(self._client.legal)
674
+
551
675
  @cached_property
552
676
  def llm(self) -> llm.LlmResourceWithRawResponse:
553
677
  from .resources.llm import LlmResourceWithRawResponse
554
678
 
555
679
  return LlmResourceWithRawResponse(self._client.llm)
556
680
 
681
+ @cached_property
682
+ def memory(self) -> memory.MemoryResourceWithRawResponse:
683
+ from .resources.memory import MemoryResourceWithRawResponse
684
+
685
+ return MemoryResourceWithRawResponse(self._client.memory)
686
+
557
687
  @cached_property
558
688
  def ocr(self) -> ocr.OcrResourceWithRawResponse:
559
689
  from .resources.ocr import OcrResourceWithRawResponse
560
690
 
561
691
  return OcrResourceWithRawResponse(self._client.ocr)
562
692
 
693
+ @cached_property
694
+ def privilege(self) -> privilege.PrivilegeResourceWithRawResponse:
695
+ from .resources.privilege import PrivilegeResourceWithRawResponse
696
+
697
+ return PrivilegeResourceWithRawResponse(self._client.privilege)
698
+
563
699
  @cached_property
564
700
  def search(self) -> search.SearchResourceWithRawResponse:
565
701
  from .resources.search import SearchResourceWithRawResponse
566
702
 
567
703
  return SearchResourceWithRawResponse(self._client.search)
568
704
 
705
+ @cached_property
706
+ def superdoc(self) -> superdoc.SuperdocResourceWithRawResponse:
707
+ from .resources.superdoc import SuperdocResourceWithRawResponse
708
+
709
+ return SuperdocResourceWithRawResponse(self._client.superdoc)
710
+
711
+ @cached_property
712
+ def translate(self) -> translate.TranslateResourceWithRawResponse:
713
+ from .resources.translate import TranslateResourceWithRawResponse
714
+
715
+ return TranslateResourceWithRawResponse(self._client.translate)
716
+
569
717
  @cached_property
570
718
  def vault(self) -> vault.VaultResourceWithRawResponse:
571
719
  from .resources.vault import VaultResourceWithRawResponse
@@ -585,36 +733,78 @@ class AsyncCasedevWithRawResponse:
585
733
  def __init__(self, client: AsyncCasedev) -> None:
586
734
  self._client = client
587
735
 
736
+ @cached_property
737
+ def applications(self) -> applications.AsyncApplicationsResourceWithRawResponse:
738
+ from .resources.applications import AsyncApplicationsResourceWithRawResponse
739
+
740
+ return AsyncApplicationsResourceWithRawResponse(self._client.applications)
741
+
588
742
  @cached_property
589
743
  def compute(self) -> compute.AsyncComputeResourceWithRawResponse:
590
744
  from .resources.compute import AsyncComputeResourceWithRawResponse
591
745
 
592
746
  return AsyncComputeResourceWithRawResponse(self._client.compute)
593
747
 
748
+ @cached_property
749
+ def database(self) -> database.AsyncDatabaseResourceWithRawResponse:
750
+ from .resources.database import AsyncDatabaseResourceWithRawResponse
751
+
752
+ return AsyncDatabaseResourceWithRawResponse(self._client.database)
753
+
594
754
  @cached_property
595
755
  def format(self) -> format.AsyncFormatResourceWithRawResponse:
596
756
  from .resources.format import AsyncFormatResourceWithRawResponse
597
757
 
598
758
  return AsyncFormatResourceWithRawResponse(self._client.format)
599
759
 
760
+ @cached_property
761
+ def legal(self) -> legal.AsyncLegalResourceWithRawResponse:
762
+ from .resources.legal import AsyncLegalResourceWithRawResponse
763
+
764
+ return AsyncLegalResourceWithRawResponse(self._client.legal)
765
+
600
766
  @cached_property
601
767
  def llm(self) -> llm.AsyncLlmResourceWithRawResponse:
602
768
  from .resources.llm import AsyncLlmResourceWithRawResponse
603
769
 
604
770
  return AsyncLlmResourceWithRawResponse(self._client.llm)
605
771
 
772
+ @cached_property
773
+ def memory(self) -> memory.AsyncMemoryResourceWithRawResponse:
774
+ from .resources.memory import AsyncMemoryResourceWithRawResponse
775
+
776
+ return AsyncMemoryResourceWithRawResponse(self._client.memory)
777
+
606
778
  @cached_property
607
779
  def ocr(self) -> ocr.AsyncOcrResourceWithRawResponse:
608
780
  from .resources.ocr import AsyncOcrResourceWithRawResponse
609
781
 
610
782
  return AsyncOcrResourceWithRawResponse(self._client.ocr)
611
783
 
784
+ @cached_property
785
+ def privilege(self) -> privilege.AsyncPrivilegeResourceWithRawResponse:
786
+ from .resources.privilege import AsyncPrivilegeResourceWithRawResponse
787
+
788
+ return AsyncPrivilegeResourceWithRawResponse(self._client.privilege)
789
+
612
790
  @cached_property
613
791
  def search(self) -> search.AsyncSearchResourceWithRawResponse:
614
792
  from .resources.search import AsyncSearchResourceWithRawResponse
615
793
 
616
794
  return AsyncSearchResourceWithRawResponse(self._client.search)
617
795
 
796
+ @cached_property
797
+ def superdoc(self) -> superdoc.AsyncSuperdocResourceWithRawResponse:
798
+ from .resources.superdoc import AsyncSuperdocResourceWithRawResponse
799
+
800
+ return AsyncSuperdocResourceWithRawResponse(self._client.superdoc)
801
+
802
+ @cached_property
803
+ def translate(self) -> translate.AsyncTranslateResourceWithRawResponse:
804
+ from .resources.translate import AsyncTranslateResourceWithRawResponse
805
+
806
+ return AsyncTranslateResourceWithRawResponse(self._client.translate)
807
+
618
808
  @cached_property
619
809
  def vault(self) -> vault.AsyncVaultResourceWithRawResponse:
620
810
  from .resources.vault import AsyncVaultResourceWithRawResponse
@@ -634,36 +824,78 @@ class CasedevWithStreamedResponse:
634
824
  def __init__(self, client: Casedev) -> None:
635
825
  self._client = client
636
826
 
827
+ @cached_property
828
+ def applications(self) -> applications.ApplicationsResourceWithStreamingResponse:
829
+ from .resources.applications import ApplicationsResourceWithStreamingResponse
830
+
831
+ return ApplicationsResourceWithStreamingResponse(self._client.applications)
832
+
637
833
  @cached_property
638
834
  def compute(self) -> compute.ComputeResourceWithStreamingResponse:
639
835
  from .resources.compute import ComputeResourceWithStreamingResponse
640
836
 
641
837
  return ComputeResourceWithStreamingResponse(self._client.compute)
642
838
 
839
+ @cached_property
840
+ def database(self) -> database.DatabaseResourceWithStreamingResponse:
841
+ from .resources.database import DatabaseResourceWithStreamingResponse
842
+
843
+ return DatabaseResourceWithStreamingResponse(self._client.database)
844
+
643
845
  @cached_property
644
846
  def format(self) -> format.FormatResourceWithStreamingResponse:
645
847
  from .resources.format import FormatResourceWithStreamingResponse
646
848
 
647
849
  return FormatResourceWithStreamingResponse(self._client.format)
648
850
 
851
+ @cached_property
852
+ def legal(self) -> legal.LegalResourceWithStreamingResponse:
853
+ from .resources.legal import LegalResourceWithStreamingResponse
854
+
855
+ return LegalResourceWithStreamingResponse(self._client.legal)
856
+
649
857
  @cached_property
650
858
  def llm(self) -> llm.LlmResourceWithStreamingResponse:
651
859
  from .resources.llm import LlmResourceWithStreamingResponse
652
860
 
653
861
  return LlmResourceWithStreamingResponse(self._client.llm)
654
862
 
863
+ @cached_property
864
+ def memory(self) -> memory.MemoryResourceWithStreamingResponse:
865
+ from .resources.memory import MemoryResourceWithStreamingResponse
866
+
867
+ return MemoryResourceWithStreamingResponse(self._client.memory)
868
+
655
869
  @cached_property
656
870
  def ocr(self) -> ocr.OcrResourceWithStreamingResponse:
657
871
  from .resources.ocr import OcrResourceWithStreamingResponse
658
872
 
659
873
  return OcrResourceWithStreamingResponse(self._client.ocr)
660
874
 
875
+ @cached_property
876
+ def privilege(self) -> privilege.PrivilegeResourceWithStreamingResponse:
877
+ from .resources.privilege import PrivilegeResourceWithStreamingResponse
878
+
879
+ return PrivilegeResourceWithStreamingResponse(self._client.privilege)
880
+
661
881
  @cached_property
662
882
  def search(self) -> search.SearchResourceWithStreamingResponse:
663
883
  from .resources.search import SearchResourceWithStreamingResponse
664
884
 
665
885
  return SearchResourceWithStreamingResponse(self._client.search)
666
886
 
887
+ @cached_property
888
+ def superdoc(self) -> superdoc.SuperdocResourceWithStreamingResponse:
889
+ from .resources.superdoc import SuperdocResourceWithStreamingResponse
890
+
891
+ return SuperdocResourceWithStreamingResponse(self._client.superdoc)
892
+
893
+ @cached_property
894
+ def translate(self) -> translate.TranslateResourceWithStreamingResponse:
895
+ from .resources.translate import TranslateResourceWithStreamingResponse
896
+
897
+ return TranslateResourceWithStreamingResponse(self._client.translate)
898
+
667
899
  @cached_property
668
900
  def vault(self) -> vault.VaultResourceWithStreamingResponse:
669
901
  from .resources.vault import VaultResourceWithStreamingResponse
@@ -683,36 +915,78 @@ class AsyncCasedevWithStreamedResponse:
683
915
  def __init__(self, client: AsyncCasedev) -> None:
684
916
  self._client = client
685
917
 
918
+ @cached_property
919
+ def applications(self) -> applications.AsyncApplicationsResourceWithStreamingResponse:
920
+ from .resources.applications import AsyncApplicationsResourceWithStreamingResponse
921
+
922
+ return AsyncApplicationsResourceWithStreamingResponse(self._client.applications)
923
+
686
924
  @cached_property
687
925
  def compute(self) -> compute.AsyncComputeResourceWithStreamingResponse:
688
926
  from .resources.compute import AsyncComputeResourceWithStreamingResponse
689
927
 
690
928
  return AsyncComputeResourceWithStreamingResponse(self._client.compute)
691
929
 
930
+ @cached_property
931
+ def database(self) -> database.AsyncDatabaseResourceWithStreamingResponse:
932
+ from .resources.database import AsyncDatabaseResourceWithStreamingResponse
933
+
934
+ return AsyncDatabaseResourceWithStreamingResponse(self._client.database)
935
+
692
936
  @cached_property
693
937
  def format(self) -> format.AsyncFormatResourceWithStreamingResponse:
694
938
  from .resources.format import AsyncFormatResourceWithStreamingResponse
695
939
 
696
940
  return AsyncFormatResourceWithStreamingResponse(self._client.format)
697
941
 
942
+ @cached_property
943
+ def legal(self) -> legal.AsyncLegalResourceWithStreamingResponse:
944
+ from .resources.legal import AsyncLegalResourceWithStreamingResponse
945
+
946
+ return AsyncLegalResourceWithStreamingResponse(self._client.legal)
947
+
698
948
  @cached_property
699
949
  def llm(self) -> llm.AsyncLlmResourceWithStreamingResponse:
700
950
  from .resources.llm import AsyncLlmResourceWithStreamingResponse
701
951
 
702
952
  return AsyncLlmResourceWithStreamingResponse(self._client.llm)
703
953
 
954
+ @cached_property
955
+ def memory(self) -> memory.AsyncMemoryResourceWithStreamingResponse:
956
+ from .resources.memory import AsyncMemoryResourceWithStreamingResponse
957
+
958
+ return AsyncMemoryResourceWithStreamingResponse(self._client.memory)
959
+
704
960
  @cached_property
705
961
  def ocr(self) -> ocr.AsyncOcrResourceWithStreamingResponse:
706
962
  from .resources.ocr import AsyncOcrResourceWithStreamingResponse
707
963
 
708
964
  return AsyncOcrResourceWithStreamingResponse(self._client.ocr)
709
965
 
966
+ @cached_property
967
+ def privilege(self) -> privilege.AsyncPrivilegeResourceWithStreamingResponse:
968
+ from .resources.privilege import AsyncPrivilegeResourceWithStreamingResponse
969
+
970
+ return AsyncPrivilegeResourceWithStreamingResponse(self._client.privilege)
971
+
710
972
  @cached_property
711
973
  def search(self) -> search.AsyncSearchResourceWithStreamingResponse:
712
974
  from .resources.search import AsyncSearchResourceWithStreamingResponse
713
975
 
714
976
  return AsyncSearchResourceWithStreamingResponse(self._client.search)
715
977
 
978
+ @cached_property
979
+ def superdoc(self) -> superdoc.AsyncSuperdocResourceWithStreamingResponse:
980
+ from .resources.superdoc import AsyncSuperdocResourceWithStreamingResponse
981
+
982
+ return AsyncSuperdocResourceWithStreamingResponse(self._client.superdoc)
983
+
984
+ @cached_property
985
+ def translate(self) -> translate.AsyncTranslateResourceWithStreamingResponse:
986
+ from .resources.translate import AsyncTranslateResourceWithStreamingResponse
987
+
988
+ return AsyncTranslateResourceWithStreamingResponse(self._client.translate)
989
+
716
990
  @cached_property
717
991
  def vault(self) -> vault.AsyncVaultResourceWithStreamingResponse:
718
992
  from .resources.vault import AsyncVaultResourceWithStreamingResponse
casedev/_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)
casedev/_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__ = "casedev"
4
- __version__ = "0.2.0" # x-release-please-version
4
+ __version__ = "0.4.0" # x-release-please-version