Skip to content

Commit cee38ac

Browse files
author
stlc-bot
committed
feat(governance): add the governance write endpoints and generate governance SDK methods
Stainless-Generated-From: 41f13ad6c9d6776832bb12c66945609f826bf66a
1 parent c22edc1 commit cee38ac

79 files changed

Lines changed: 12515 additions & 6 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.stats.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
configured_endpoints: 32
1+
configured_endpoints: 58

‎api.md‎

Lines changed: 148 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,12 +186,13 @@ Methods:
186186
Types:
187187

188188
```python
189-
from openlayer.types.storage import PresignedURLCreateResponse
189+
from openlayer.types.storage import PresignedURLCreateResponse, PresignedURLRetrieveResponse
190190
```
191191

192192
Methods:
193193

194194
- <code title="post /storage/presigned-url">client.storage.presigned_url.<a href="./src/openlayer/resources/storage/presigned_url.py">create</a>(\*\*<a href="src/openlayer/types/storage/presigned_url_create_params.py">params</a>) -> <a href="./src/openlayer/types/storage/presigned_url_create_response.py">PresignedURLCreateResponse</a></code>
195+
- <code title="get /storage/presigned-url">client.storage.presigned_url.<a href="./src/openlayer/resources/storage/presigned_url.py">retrieve</a>(\*\*<a href="src/openlayer/types/storage/presigned_url_retrieve_params.py">params</a>) -> <a href="./src/openlayer/types/storage/presigned_url_retrieve_response.py">PresignedURLRetrieveResponse</a></code>
195196

196197
# Tests
197198

@@ -205,3 +206,149 @@ Methods:
205206

206207
- <code title="post /tests/{testId}/evaluate">client.tests.<a href="./src/openlayer/resources/tests.py">evaluate</a>(test_id, \*\*<a href="src/openlayer/types/test_evaluate_params.py">params</a>) -> <a href="./src/openlayer/types/test_evaluate_response.py">TestEvaluateResponse</a></code>
207208
- <code title="get /tests/{testId}/results">client.tests.<a href="./src/openlayer/resources/tests.py">list_results</a>(test_id, \*\*<a href="src/openlayer/types/test_list_results_params.py">params</a>) -> <a href="./src/openlayer/types/test_list_results_response.py">TestListResultsResponse</a></code>
209+
210+
# BackgroundTasks
211+
212+
Types:
213+
214+
```python
215+
from openlayer.types import BackgroundTaskRetrieveResponse
216+
```
217+
218+
Methods:
219+
220+
- <code title="get /background-tasks/{taskId}">client.background_tasks.<a href="./src/openlayer/resources/background_tasks.py">retrieve</a>(task_id) -> <a href="./src/openlayer/types/background_task_retrieve_response.py">BackgroundTaskRetrieveResponse</a></code>
221+
222+
# Governance
223+
224+
## Frameworks
225+
226+
Types:
227+
228+
```python
229+
from openlayer.types.governance import (
230+
FrameworkCreateResponse,
231+
FrameworkRetrieveResponse,
232+
FrameworkUpdateResponse,
233+
FrameworkListResponse,
234+
FrameworkExportResponse,
235+
FrameworkListProjectRuleStatsResponse,
236+
FrameworkListProjectsResponse,
237+
FrameworkListRulesResponse,
238+
)
239+
```
240+
241+
Methods:
242+
243+
- <code title="post /workspaces/{workspaceId}/frameworks">client.governance.frameworks.<a href="./src/openlayer/resources/governance/frameworks/frameworks.py">create</a>(workspace_id, \*\*<a href="src/openlayer/types/governance/framework_create_params.py">params</a>) -> <a href="./src/openlayer/types/governance/framework_create_response.py">FrameworkCreateResponse</a></code>
244+
- <code title="get /frameworks/{frameworkId}">client.governance.frameworks.<a href="./src/openlayer/resources/governance/frameworks/frameworks.py">retrieve</a>(framework_id) -> <a href="./src/openlayer/types/governance/framework_retrieve_response.py">FrameworkRetrieveResponse</a></code>
245+
- <code title="put /frameworks/{frameworkId}">client.governance.frameworks.<a href="./src/openlayer/resources/governance/frameworks/frameworks.py">update</a>(framework_id, \*\*<a href="src/openlayer/types/governance/framework_update_params.py">params</a>) -> <a href="./src/openlayer/types/governance/framework_update_response.py">FrameworkUpdateResponse</a></code>
246+
- <code title="get /workspaces/{workspaceId}/frameworks">client.governance.frameworks.<a href="./src/openlayer/resources/governance/frameworks/frameworks.py">list</a>(workspace_id, \*\*<a href="src/openlayer/types/governance/framework_list_params.py">params</a>) -> <a href="./src/openlayer/types/governance/framework_list_response.py">FrameworkListResponse</a></code>
247+
- <code title="post /frameworks/{frameworkId}/export">client.governance.frameworks.<a href="./src/openlayer/resources/governance/frameworks/frameworks.py">export</a>(framework_id, \*\*<a href="src/openlayer/types/governance/framework_export_params.py">params</a>) -> <a href="./src/openlayer/types/governance/framework_export_response.py">FrameworkExportResponse</a></code>
248+
- <code title="get /frameworks/{frameworkId}/project-rule-stats">client.governance.frameworks.<a href="./src/openlayer/resources/governance/frameworks/frameworks.py">list_project_rule_stats</a>(framework_id, \*\*<a href="src/openlayer/types/governance/framework_list_project_rule_stats_params.py">params</a>) -> <a href="./src/openlayer/types/governance/framework_list_project_rule_stats_response.py">FrameworkListProjectRuleStatsResponse</a></code>
249+
- <code title="get /frameworks/{frameworkId}/projects">client.governance.frameworks.<a href="./src/openlayer/resources/governance/frameworks/frameworks.py">list_projects</a>(framework_id, \*\*<a href="src/openlayer/types/governance/framework_list_projects_params.py">params</a>) -> <a href="./src/openlayer/types/governance/framework_list_projects_response.py">FrameworkListProjectsResponse</a></code>
250+
- <code title="get /frameworks/{frameworkId}/rules">client.governance.frameworks.<a href="./src/openlayer/resources/governance/frameworks/frameworks.py">list_rules</a>(framework_id, \*\*<a href="src/openlayer/types/governance/framework_list_rules_params.py">params</a>) -> <a href="./src/openlayer/types/governance/framework_list_rules_response.py">FrameworkListRulesResponse</a></code>
251+
252+
### Documents
253+
254+
Types:
255+
256+
```python
257+
from openlayer.types.governance.frameworks import DocumentRetrieveResponse, DocumentListResponse
258+
```
259+
260+
Methods:
261+
262+
- <code title="get /frameworks/{frameworkId}/documents/{documentId}">client.governance.frameworks.documents.<a href="./src/openlayer/resources/governance/frameworks/documents.py">retrieve</a>(document_id, \*, framework_id) -> <a href="./src/openlayer/types/governance/frameworks/document_retrieve_response.py">DocumentRetrieveResponse</a></code>
263+
- <code title="get /frameworks/{frameworkId}/documents">client.governance.frameworks.documents.<a href="./src/openlayer/resources/governance/frameworks/documents.py">list</a>(framework_id, \*\*<a href="src/openlayer/types/governance/frameworks/document_list_params.py">params</a>) -> <a href="./src/openlayer/types/governance/frameworks/document_list_response.py">DocumentListResponse</a></code>
264+
265+
### Sections
266+
267+
Types:
268+
269+
```python
270+
from openlayer.types.governance.frameworks import SectionListRulesResponse
271+
```
272+
273+
Methods:
274+
275+
- <code title="get /frameworks/{frameworkId}/sections/{sectionId}/rules">client.governance.frameworks.sections.<a href="./src/openlayer/resources/governance/frameworks/sections.py">list_rules</a>(section_id, \*, framework_id, \*\*<a href="src/openlayer/types/governance/frameworks/section_list_rules_params.py">params</a>) -> <a href="./src/openlayer/types/governance/frameworks/section_list_rules_response.py">SectionListRulesResponse</a></code>
276+
277+
### Subsections
278+
279+
Types:
280+
281+
```python
282+
from openlayer.types.governance.frameworks import SubsectionListRulesResponse
283+
```
284+
285+
Methods:
286+
287+
- <code title="get /frameworks/{frameworkId}/subsections/{subsectionId}/rules">client.governance.frameworks.subsections.<a href="./src/openlayer/resources/governance/frameworks/subsections.py">list_rules</a>(subsection_id, \*, framework_id, \*\*<a href="src/openlayer/types/governance/frameworks/subsection_list_rules_params.py">params</a>) -> <a href="./src/openlayer/types/governance/frameworks/subsection_list_rules_response.py">SubsectionListRulesResponse</a></code>
288+
289+
## Rules
290+
291+
Types:
292+
293+
```python
294+
from openlayer.types.governance import (
295+
RuleCreateResponse,
296+
RuleRetrieveResponse,
297+
RuleUpdateResponse,
298+
RuleListResponse,
299+
)
300+
```
301+
302+
Methods:
303+
304+
- <code title="post /workspaces/{workspaceId}/rules">client.governance.rules.<a href="./src/openlayer/resources/governance/rules.py">create</a>(workspace_id, \*\*<a href="src/openlayer/types/governance/rule_create_params.py">params</a>) -> <a href="./src/openlayer/types/governance/rule_create_response.py">RuleCreateResponse</a></code>
305+
- <code title="get /rules/{ruleId}">client.governance.rules.<a href="./src/openlayer/resources/governance/rules.py">retrieve</a>(rule_id) -> <a href="./src/openlayer/types/governance/rule_retrieve_response.py">RuleRetrieveResponse</a></code>
306+
- <code title="put /rules/{ruleId}">client.governance.rules.<a href="./src/openlayer/resources/governance/rules.py">update</a>(rule_id, \*\*<a href="src/openlayer/types/governance/rule_update_params.py">params</a>) -> <a href="./src/openlayer/types/governance/rule_update_response.py">RuleUpdateResponse</a></code>
307+
- <code title="get /workspaces/{workspaceId}/rules">client.governance.rules.<a href="./src/openlayer/resources/governance/rules.py">list</a>(workspace_id, \*\*<a href="src/openlayer/types/governance/rule_list_params.py">params</a>) -> <a href="./src/openlayer/types/governance/rule_list_response.py">RuleListResponse</a></code>
308+
- <code title="delete /rules/{ruleId}">client.governance.rules.<a href="./src/openlayer/resources/governance/rules.py">delete</a>(rule_id) -> None</code>
309+
310+
## RuleResults
311+
312+
Types:
313+
314+
```python
315+
from openlayer.types.governance import (
316+
RuleResultRetrieveResponse,
317+
RuleResultUpdateResponse,
318+
RuleResultListResponse,
319+
RuleResultCreateEvidenceResponse,
320+
RuleResultListEvidenceResponse,
321+
)
322+
```
323+
324+
Methods:
325+
326+
- <code title="get /rule-results/{ruleResultId}">client.governance.rule_results.<a href="./src/openlayer/resources/governance/rule_results.py">retrieve</a>(rule_result_id) -> <a href="./src/openlayer/types/governance/rule_result_retrieve_response.py">RuleResultRetrieveResponse</a></code>
327+
- <code title="patch /rule-results/{ruleResultId}">client.governance.rule_results.<a href="./src/openlayer/resources/governance/rule_results.py">update</a>(rule_result_id, \*\*<a href="src/openlayer/types/governance/rule_result_update_params.py">params</a>) -> <a href="./src/openlayer/types/governance/rule_result_update_response.py">RuleResultUpdateResponse</a></code>
328+
- <code title="get /workspaces/{workspaceId}/rule-results">client.governance.rule_results.<a href="./src/openlayer/resources/governance/rule_results.py">list</a>(workspace_id, \*\*<a href="src/openlayer/types/governance/rule_result_list_params.py">params</a>) -> <a href="./src/openlayer/types/governance/rule_result_list_response.py">RuleResultListResponse</a></code>
329+
- <code title="post /rule-results/{ruleResultId}/evidence">client.governance.rule_results.<a href="./src/openlayer/resources/governance/rule_results.py">create_evidence</a>(rule_result_id, \*\*<a href="src/openlayer/types/governance/rule_result_create_evidence_params.py">params</a>) -> <a href="./src/openlayer/types/governance/rule_result_create_evidence_response.py">RuleResultCreateEvidenceResponse</a></code>
330+
- <code title="get /rule-results/{ruleResultId}/evidence">client.governance.rule_results.<a href="./src/openlayer/resources/governance/rule_results.py">list_evidence</a>(rule_result_id, \*\*<a href="src/openlayer/types/governance/rule_result_list_evidence_params.py">params</a>) -> <a href="./src/openlayer/types/governance/rule_result_list_evidence_response.py">RuleResultListEvidenceResponse</a></code>
331+
332+
## RuleStats
333+
334+
Types:
335+
336+
```python
337+
from openlayer.types.governance import RuleStatRetrieveResponse
338+
```
339+
340+
Methods:
341+
342+
- <code title="get /workspaces/{workspaceId}/rule-stats">client.governance.rule_stats.<a href="./src/openlayer/resources/governance/rule_stats.py">retrieve</a>(workspace_id, \*\*<a href="src/openlayer/types/governance/rule_stat_retrieve_params.py">params</a>) -> <a href="./src/openlayer/types/governance/rule_stat_retrieve_response.py">RuleStatRetrieveResponse</a></code>
343+
344+
## RuleTags
345+
346+
Types:
347+
348+
```python
349+
from openlayer.types.governance import RuleTagListResponse
350+
```
351+
352+
Methods:
353+
354+
- <code title="get /workspaces/{workspaceId}/rule-tags">client.governance.rule_tags.<a href="./src/openlayer/resources/governance/rule_tags.py">list</a>(workspace_id, \*\*<a href="src/openlayer/types/governance/rule_tag_list_params.py">params</a>) -> <a href="./src/openlayer/types/governance/rule_tag_list_response.py">RuleTagListResponse</a></code>

‎scripts/mock‎

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

‎src/openlayer/_client.py‎

Lines changed: 84 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,22 @@
3636
)
3737

3838
if TYPE_CHECKING:
39-
from .resources import tests, commits, storage, projects, workspaces, inference_pipelines
39+
from .resources import (
40+
tests,
41+
commits,
42+
storage,
43+
projects,
44+
governance,
45+
workspaces,
46+
background_tasks,
47+
inference_pipelines,
48+
)
4049
from .resources.tests import TestsResource, AsyncTestsResource
4150
from .resources.commits.commits import CommitsResource, AsyncCommitsResource
4251
from .resources.storage.storage import StorageResource, AsyncStorageResource
52+
from .resources.background_tasks import BackgroundTasksResource, AsyncBackgroundTasksResource
4353
from .resources.projects.projects import ProjectsResource, AsyncProjectsResource
54+
from .resources.governance.governance import GovernanceResource, AsyncGovernanceResource
4455
from .resources.workspaces.workspaces import WorkspacesResource, AsyncWorkspacesResource
4556
from .resources.inference_pipelines.inference_pipelines import (
4657
InferencePipelinesResource,
@@ -155,6 +166,18 @@ def tests(self) -> TestsResource:
155166

156167
return TestsResource(self)
157168

169+
@cached_property
170+
def background_tasks(self) -> BackgroundTasksResource:
171+
from .resources.background_tasks import BackgroundTasksResource
172+
173+
return BackgroundTasksResource(self)
174+
175+
@cached_property
176+
def governance(self) -> GovernanceResource:
177+
from .resources.governance import GovernanceResource
178+
179+
return GovernanceResource(self)
180+
158181
@cached_property
159182
def with_raw_response(self) -> OpenlayerWithRawResponse:
160183
return OpenlayerWithRawResponse(self)
@@ -375,6 +398,18 @@ def tests(self) -> AsyncTestsResource:
375398

376399
return AsyncTestsResource(self)
377400

401+
@cached_property
402+
def background_tasks(self) -> AsyncBackgroundTasksResource:
403+
from .resources.background_tasks import AsyncBackgroundTasksResource
404+
405+
return AsyncBackgroundTasksResource(self)
406+
407+
@cached_property
408+
def governance(self) -> AsyncGovernanceResource:
409+
from .resources.governance import AsyncGovernanceResource
410+
411+
return AsyncGovernanceResource(self)
412+
378413
@cached_property
379414
def with_raw_response(self) -> AsyncOpenlayerWithRawResponse:
380415
return AsyncOpenlayerWithRawResponse(self)
@@ -541,6 +576,18 @@ def tests(self) -> tests.TestsResourceWithRawResponse:
541576

542577
return TestsResourceWithRawResponse(self._client.tests)
543578

579+
@cached_property
580+
def background_tasks(self) -> background_tasks.BackgroundTasksResourceWithRawResponse:
581+
from .resources.background_tasks import BackgroundTasksResourceWithRawResponse
582+
583+
return BackgroundTasksResourceWithRawResponse(self._client.background_tasks)
584+
585+
@cached_property
586+
def governance(self) -> governance.GovernanceResourceWithRawResponse:
587+
from .resources.governance import GovernanceResourceWithRawResponse
588+
589+
return GovernanceResourceWithRawResponse(self._client.governance)
590+
544591

545592
class AsyncOpenlayerWithRawResponse:
546593
_client: AsyncOpenlayer
@@ -584,6 +631,18 @@ def tests(self) -> tests.AsyncTestsResourceWithRawResponse:
584631

585632
return AsyncTestsResourceWithRawResponse(self._client.tests)
586633

634+
@cached_property
635+
def background_tasks(self) -> background_tasks.AsyncBackgroundTasksResourceWithRawResponse:
636+
from .resources.background_tasks import AsyncBackgroundTasksResourceWithRawResponse
637+
638+
return AsyncBackgroundTasksResourceWithRawResponse(self._client.background_tasks)
639+
640+
@cached_property
641+
def governance(self) -> governance.AsyncGovernanceResourceWithRawResponse:
642+
from .resources.governance import AsyncGovernanceResourceWithRawResponse
643+
644+
return AsyncGovernanceResourceWithRawResponse(self._client.governance)
645+
587646

588647
class OpenlayerWithStreamedResponse:
589648
_client: Openlayer
@@ -627,6 +686,18 @@ def tests(self) -> tests.TestsResourceWithStreamingResponse:
627686

628687
return TestsResourceWithStreamingResponse(self._client.tests)
629688

689+
@cached_property
690+
def background_tasks(self) -> background_tasks.BackgroundTasksResourceWithStreamingResponse:
691+
from .resources.background_tasks import BackgroundTasksResourceWithStreamingResponse
692+
693+
return BackgroundTasksResourceWithStreamingResponse(self._client.background_tasks)
694+
695+
@cached_property
696+
def governance(self) -> governance.GovernanceResourceWithStreamingResponse:
697+
from .resources.governance import GovernanceResourceWithStreamingResponse
698+
699+
return GovernanceResourceWithStreamingResponse(self._client.governance)
700+
630701

631702
class AsyncOpenlayerWithStreamedResponse:
632703
_client: AsyncOpenlayer
@@ -670,6 +741,18 @@ def tests(self) -> tests.AsyncTestsResourceWithStreamingResponse:
670741

671742
return AsyncTestsResourceWithStreamingResponse(self._client.tests)
672743

744+
@cached_property
745+
def background_tasks(self) -> background_tasks.AsyncBackgroundTasksResourceWithStreamingResponse:
746+
from .resources.background_tasks import AsyncBackgroundTasksResourceWithStreamingResponse
747+
748+
return AsyncBackgroundTasksResourceWithStreamingResponse(self._client.background_tasks)
749+
750+
@cached_property
751+
def governance(self) -> governance.AsyncGovernanceResourceWithStreamingResponse:
752+
from .resources.governance import AsyncGovernanceResourceWithStreamingResponse
753+
754+
return AsyncGovernanceResourceWithStreamingResponse(self._client.governance)
755+
673756

674757
Client = Openlayer
675758

‎src/openlayer/resources/__init__.py‎

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,14 @@
3232
ProjectsResourceWithStreamingResponse,
3333
AsyncProjectsResourceWithStreamingResponse,
3434
)
35+
from .governance import (
36+
GovernanceResource,
37+
AsyncGovernanceResource,
38+
GovernanceResourceWithRawResponse,
39+
AsyncGovernanceResourceWithRawResponse,
40+
GovernanceResourceWithStreamingResponse,
41+
AsyncGovernanceResourceWithStreamingResponse,
42+
)
3543
from .workspaces import (
3644
WorkspacesResource,
3745
AsyncWorkspacesResource,
@@ -40,6 +48,14 @@
4048
WorkspacesResourceWithStreamingResponse,
4149
AsyncWorkspacesResourceWithStreamingResponse,
4250
)
51+
from .background_tasks import (
52+
BackgroundTasksResource,
53+
AsyncBackgroundTasksResource,
54+
BackgroundTasksResourceWithRawResponse,
55+
AsyncBackgroundTasksResourceWithRawResponse,
56+
BackgroundTasksResourceWithStreamingResponse,
57+
AsyncBackgroundTasksResourceWithStreamingResponse,
58+
)
4359
from .inference_pipelines import (
4460
InferencePipelinesResource,
4561
AsyncInferencePipelinesResource,
@@ -86,4 +102,16 @@
86102
"AsyncTestsResourceWithRawResponse",
87103
"TestsResourceWithStreamingResponse",
88104
"AsyncTestsResourceWithStreamingResponse",
105+
"BackgroundTasksResource",
106+
"AsyncBackgroundTasksResource",
107+
"BackgroundTasksResourceWithRawResponse",
108+
"AsyncBackgroundTasksResourceWithRawResponse",
109+
"BackgroundTasksResourceWithStreamingResponse",
110+
"AsyncBackgroundTasksResourceWithStreamingResponse",
111+
"GovernanceResource",
112+
"AsyncGovernanceResource",
113+
"GovernanceResourceWithRawResponse",
114+
"AsyncGovernanceResourceWithRawResponse",
115+
"GovernanceResourceWithStreamingResponse",
116+
"AsyncGovernanceResourceWithStreamingResponse",
89117
]

0 commit comments

Comments
 (0)