mirascope 2.0.0a4__py3-none-any.whl → 2.0.0a5__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.
- mirascope/api/_generated/__init__.py +17 -1
- mirascope/api/_generated/api_keys/__init__.py +7 -0
- mirascope/api/_generated/api_keys/client.py +453 -0
- mirascope/api/_generated/api_keys/raw_client.py +853 -0
- mirascope/api/_generated/api_keys/types/__init__.py +9 -0
- mirascope/api/_generated/api_keys/types/api_keys_create_response.py +36 -0
- mirascope/api/_generated/api_keys/types/api_keys_get_response.py +35 -0
- mirascope/api/_generated/api_keys/types/api_keys_list_response_item.py +35 -0
- mirascope/api/_generated/client.py +6 -0
- mirascope/api/_generated/environments/__init__.py +17 -0
- mirascope/api/_generated/environments/client.py +532 -0
- mirascope/api/_generated/environments/raw_client.py +1088 -0
- mirascope/api/_generated/environments/types/__init__.py +15 -0
- mirascope/api/_generated/environments/types/environments_create_response.py +26 -0
- mirascope/api/_generated/environments/types/environments_get_response.py +26 -0
- mirascope/api/_generated/environments/types/environments_list_response_item.py +26 -0
- mirascope/api/_generated/environments/types/environments_update_response.py +26 -0
- mirascope/api/_generated/organizations/client.py +36 -12
- mirascope/api/_generated/organizations/raw_client.py +32 -6
- mirascope/api/_generated/organizations/types/organizations_create_response.py +1 -0
- mirascope/api/_generated/organizations/types/organizations_get_response.py +1 -0
- mirascope/api/_generated/organizations/types/organizations_list_response_item.py +1 -0
- mirascope/api/_generated/organizations/types/organizations_update_response.py +1 -0
- mirascope/api/_generated/projects/client.py +34 -10
- mirascope/api/_generated/projects/raw_client.py +46 -4
- mirascope/api/_generated/projects/types/projects_create_response.py +1 -0
- mirascope/api/_generated/projects/types/projects_get_response.py +1 -0
- mirascope/api/_generated/projects/types/projects_list_response_item.py +1 -0
- mirascope/api/_generated/projects/types/projects_update_response.py +1 -0
- mirascope/api/_generated/reference.md +729 -4
- mirascope/llm/__init__.py +2 -2
- mirascope/llm/exceptions.py +28 -0
- mirascope/llm/providers/__init__.py +6 -4
- mirascope/llm/providers/anthropic/_utils/__init__.py +2 -0
- mirascope/llm/providers/anthropic/_utils/errors.py +46 -0
- mirascope/llm/providers/anthropic/beta_provider.py +6 -0
- mirascope/llm/providers/anthropic/provider.py +5 -0
- mirascope/llm/providers/base/__init__.py +2 -1
- mirascope/llm/providers/base/base_provider.py +173 -58
- mirascope/llm/providers/google/_utils/__init__.py +2 -0
- mirascope/llm/providers/google/_utils/errors.py +49 -0
- mirascope/llm/providers/google/provider.py +5 -4
- mirascope/llm/providers/mlx/_utils.py +8 -1
- mirascope/llm/providers/mlx/provider.py +8 -0
- mirascope/llm/providers/openai/__init__.py +10 -1
- mirascope/llm/providers/openai/_utils/__init__.py +5 -0
- mirascope/llm/providers/openai/_utils/errors.py +46 -0
- mirascope/llm/providers/openai/completions/base_provider.py +6 -6
- mirascope/llm/providers/openai/provider.py +14 -1
- mirascope/llm/providers/openai/responses/provider.py +13 -7
- mirascope/llm/providers/provider_registry.py +56 -3
- mirascope/ops/_internal/closure.py +62 -11
- {mirascope-2.0.0a4.dist-info → mirascope-2.0.0a5.dist-info}/METADATA +1 -1
- {mirascope-2.0.0a4.dist-info → mirascope-2.0.0a5.dist-info}/RECORD +56 -38
- mirascope/llm/providers/load_provider.py +0 -54
- {mirascope-2.0.0a4.dist-info → mirascope-2.0.0a5.dist-info}/WHEEL +0 -0
- {mirascope-2.0.0a4.dist-info → mirascope-2.0.0a5.dist-info}/licenses/LICENSE +0 -0
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
# isort: skip_file
|
|
4
|
+
|
|
5
|
+
from .api_keys_create_response import ApiKeysCreateResponse
|
|
6
|
+
from .api_keys_get_response import ApiKeysGetResponse
|
|
7
|
+
from .api_keys_list_response_item import ApiKeysListResponseItem
|
|
8
|
+
|
|
9
|
+
__all__ = ["ApiKeysCreateResponse", "ApiKeysGetResponse", "ApiKeysListResponseItem"]
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
import typing
|
|
4
|
+
|
|
5
|
+
import pydantic
|
|
6
|
+
import typing_extensions
|
|
7
|
+
from ...core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
|
|
8
|
+
from ...core.serialization import FieldMetadata
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
class ApiKeysCreateResponse(UniversalBaseModel):
|
|
12
|
+
id: str
|
|
13
|
+
name: str
|
|
14
|
+
key_prefix: typing_extensions.Annotated[str, FieldMetadata(alias="keyPrefix")]
|
|
15
|
+
environment_id: typing_extensions.Annotated[
|
|
16
|
+
str, FieldMetadata(alias="environmentId")
|
|
17
|
+
]
|
|
18
|
+
owner_id: typing_extensions.Annotated[str, FieldMetadata(alias="ownerId")]
|
|
19
|
+
created_at: typing_extensions.Annotated[
|
|
20
|
+
typing.Optional[str], FieldMetadata(alias="createdAt")
|
|
21
|
+
] = None
|
|
22
|
+
last_used_at: typing_extensions.Annotated[
|
|
23
|
+
typing.Optional[str], FieldMetadata(alias="lastUsedAt")
|
|
24
|
+
] = None
|
|
25
|
+
key: str
|
|
26
|
+
|
|
27
|
+
if IS_PYDANTIC_V2:
|
|
28
|
+
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(
|
|
29
|
+
extra="allow", frozen=True
|
|
30
|
+
) # type: ignore # Pydantic v2
|
|
31
|
+
else:
|
|
32
|
+
|
|
33
|
+
class Config:
|
|
34
|
+
frozen = True
|
|
35
|
+
smart_union = True
|
|
36
|
+
extra = pydantic.Extra.allow
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
import typing
|
|
4
|
+
|
|
5
|
+
import pydantic
|
|
6
|
+
import typing_extensions
|
|
7
|
+
from ...core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
|
|
8
|
+
from ...core.serialization import FieldMetadata
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
class ApiKeysGetResponse(UniversalBaseModel):
|
|
12
|
+
id: str
|
|
13
|
+
name: str
|
|
14
|
+
key_prefix: typing_extensions.Annotated[str, FieldMetadata(alias="keyPrefix")]
|
|
15
|
+
environment_id: typing_extensions.Annotated[
|
|
16
|
+
str, FieldMetadata(alias="environmentId")
|
|
17
|
+
]
|
|
18
|
+
owner_id: typing_extensions.Annotated[str, FieldMetadata(alias="ownerId")]
|
|
19
|
+
created_at: typing_extensions.Annotated[
|
|
20
|
+
typing.Optional[str], FieldMetadata(alias="createdAt")
|
|
21
|
+
] = None
|
|
22
|
+
last_used_at: typing_extensions.Annotated[
|
|
23
|
+
typing.Optional[str], FieldMetadata(alias="lastUsedAt")
|
|
24
|
+
] = None
|
|
25
|
+
|
|
26
|
+
if IS_PYDANTIC_V2:
|
|
27
|
+
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(
|
|
28
|
+
extra="allow", frozen=True
|
|
29
|
+
) # type: ignore # Pydantic v2
|
|
30
|
+
else:
|
|
31
|
+
|
|
32
|
+
class Config:
|
|
33
|
+
frozen = True
|
|
34
|
+
smart_union = True
|
|
35
|
+
extra = pydantic.Extra.allow
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
import typing
|
|
4
|
+
|
|
5
|
+
import pydantic
|
|
6
|
+
import typing_extensions
|
|
7
|
+
from ...core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
|
|
8
|
+
from ...core.serialization import FieldMetadata
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
class ApiKeysListResponseItem(UniversalBaseModel):
|
|
12
|
+
id: str
|
|
13
|
+
name: str
|
|
14
|
+
key_prefix: typing_extensions.Annotated[str, FieldMetadata(alias="keyPrefix")]
|
|
15
|
+
environment_id: typing_extensions.Annotated[
|
|
16
|
+
str, FieldMetadata(alias="environmentId")
|
|
17
|
+
]
|
|
18
|
+
owner_id: typing_extensions.Annotated[str, FieldMetadata(alias="ownerId")]
|
|
19
|
+
created_at: typing_extensions.Annotated[
|
|
20
|
+
typing.Optional[str], FieldMetadata(alias="createdAt")
|
|
21
|
+
] = None
|
|
22
|
+
last_used_at: typing_extensions.Annotated[
|
|
23
|
+
typing.Optional[str], FieldMetadata(alias="lastUsedAt")
|
|
24
|
+
] = None
|
|
25
|
+
|
|
26
|
+
if IS_PYDANTIC_V2:
|
|
27
|
+
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(
|
|
28
|
+
extra="allow", frozen=True
|
|
29
|
+
) # type: ignore # Pydantic v2
|
|
30
|
+
else:
|
|
31
|
+
|
|
32
|
+
class Config:
|
|
33
|
+
frozen = True
|
|
34
|
+
smart_union = True
|
|
35
|
+
extra = pydantic.Extra.allow
|
|
@@ -3,9 +3,11 @@
|
|
|
3
3
|
import typing
|
|
4
4
|
|
|
5
5
|
import httpx
|
|
6
|
+
from .api_keys.client import ApiKeysClient, AsyncApiKeysClient
|
|
6
7
|
from .core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
|
|
7
8
|
from .docs.client import AsyncDocsClient, DocsClient
|
|
8
9
|
from .environment import MirascopeEnvironment
|
|
10
|
+
from .environments.client import AsyncEnvironmentsClient, EnvironmentsClient
|
|
9
11
|
from .health.client import AsyncHealthClient, HealthClient
|
|
10
12
|
from .organizations.client import AsyncOrganizationsClient, OrganizationsClient
|
|
11
13
|
from .projects.client import AsyncProjectsClient, ProjectsClient
|
|
@@ -78,6 +80,8 @@ class Mirascope:
|
|
|
78
80
|
self.docs = DocsClient(client_wrapper=self._client_wrapper)
|
|
79
81
|
self.organizations = OrganizationsClient(client_wrapper=self._client_wrapper)
|
|
80
82
|
self.projects = ProjectsClient(client_wrapper=self._client_wrapper)
|
|
83
|
+
self.environments = EnvironmentsClient(client_wrapper=self._client_wrapper)
|
|
84
|
+
self.api_keys = ApiKeysClient(client_wrapper=self._client_wrapper)
|
|
81
85
|
|
|
82
86
|
|
|
83
87
|
class AsyncMirascope:
|
|
@@ -148,6 +152,8 @@ class AsyncMirascope:
|
|
|
148
152
|
client_wrapper=self._client_wrapper
|
|
149
153
|
)
|
|
150
154
|
self.projects = AsyncProjectsClient(client_wrapper=self._client_wrapper)
|
|
155
|
+
self.environments = AsyncEnvironmentsClient(client_wrapper=self._client_wrapper)
|
|
156
|
+
self.api_keys = AsyncApiKeysClient(client_wrapper=self._client_wrapper)
|
|
151
157
|
|
|
152
158
|
|
|
153
159
|
def _get_base_url(
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
# isort: skip_file
|
|
4
|
+
|
|
5
|
+
from .types import (
|
|
6
|
+
EnvironmentsCreateResponse,
|
|
7
|
+
EnvironmentsGetResponse,
|
|
8
|
+
EnvironmentsListResponseItem,
|
|
9
|
+
EnvironmentsUpdateResponse,
|
|
10
|
+
)
|
|
11
|
+
|
|
12
|
+
__all__ = [
|
|
13
|
+
"EnvironmentsCreateResponse",
|
|
14
|
+
"EnvironmentsGetResponse",
|
|
15
|
+
"EnvironmentsListResponseItem",
|
|
16
|
+
"EnvironmentsUpdateResponse",
|
|
17
|
+
]
|
|
@@ -0,0 +1,532 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
import typing
|
|
4
|
+
|
|
5
|
+
from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
|
|
6
|
+
from ..core.request_options import RequestOptions
|
|
7
|
+
from .raw_client import AsyncRawEnvironmentsClient, RawEnvironmentsClient
|
|
8
|
+
from .types.environments_create_response import EnvironmentsCreateResponse
|
|
9
|
+
from .types.environments_get_response import EnvironmentsGetResponse
|
|
10
|
+
from .types.environments_list_response_item import EnvironmentsListResponseItem
|
|
11
|
+
from .types.environments_update_response import EnvironmentsUpdateResponse
|
|
12
|
+
|
|
13
|
+
# this is used as the default value for optional parameters
|
|
14
|
+
OMIT = typing.cast(typing.Any, ...)
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
class EnvironmentsClient:
|
|
18
|
+
def __init__(self, *, client_wrapper: SyncClientWrapper):
|
|
19
|
+
self._raw_client = RawEnvironmentsClient(client_wrapper=client_wrapper)
|
|
20
|
+
|
|
21
|
+
@property
|
|
22
|
+
def with_raw_response(self) -> RawEnvironmentsClient:
|
|
23
|
+
"""
|
|
24
|
+
Retrieves a raw implementation of this client that returns raw responses.
|
|
25
|
+
|
|
26
|
+
Returns
|
|
27
|
+
-------
|
|
28
|
+
RawEnvironmentsClient
|
|
29
|
+
"""
|
|
30
|
+
return self._raw_client
|
|
31
|
+
|
|
32
|
+
def list(
|
|
33
|
+
self,
|
|
34
|
+
organization_id: str,
|
|
35
|
+
project_id: str,
|
|
36
|
+
*,
|
|
37
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
38
|
+
) -> typing.List[EnvironmentsListResponseItem]:
|
|
39
|
+
"""
|
|
40
|
+
Parameters
|
|
41
|
+
----------
|
|
42
|
+
organization_id : str
|
|
43
|
+
|
|
44
|
+
project_id : str
|
|
45
|
+
|
|
46
|
+
request_options : typing.Optional[RequestOptions]
|
|
47
|
+
Request-specific configuration.
|
|
48
|
+
|
|
49
|
+
Returns
|
|
50
|
+
-------
|
|
51
|
+
typing.List[EnvironmentsListResponseItem]
|
|
52
|
+
Success
|
|
53
|
+
|
|
54
|
+
Examples
|
|
55
|
+
--------
|
|
56
|
+
from mirascope.api._generated import Mirascope
|
|
57
|
+
|
|
58
|
+
client = Mirascope()
|
|
59
|
+
client.environments.list(
|
|
60
|
+
organization_id="organizationId",
|
|
61
|
+
project_id="projectId",
|
|
62
|
+
)
|
|
63
|
+
"""
|
|
64
|
+
_response = self._raw_client.list(
|
|
65
|
+
organization_id, project_id, request_options=request_options
|
|
66
|
+
)
|
|
67
|
+
return _response.data
|
|
68
|
+
|
|
69
|
+
def create(
|
|
70
|
+
self,
|
|
71
|
+
organization_id: str,
|
|
72
|
+
project_id: str,
|
|
73
|
+
*,
|
|
74
|
+
name: str,
|
|
75
|
+
slug: str,
|
|
76
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
77
|
+
) -> EnvironmentsCreateResponse:
|
|
78
|
+
"""
|
|
79
|
+
Parameters
|
|
80
|
+
----------
|
|
81
|
+
organization_id : str
|
|
82
|
+
|
|
83
|
+
project_id : str
|
|
84
|
+
|
|
85
|
+
name : str
|
|
86
|
+
a string at most 100 character(s) long
|
|
87
|
+
|
|
88
|
+
slug : str
|
|
89
|
+
a string matching the pattern ^[a-z0-9][a-z0-9_-]*[a-z0-9]$
|
|
90
|
+
|
|
91
|
+
request_options : typing.Optional[RequestOptions]
|
|
92
|
+
Request-specific configuration.
|
|
93
|
+
|
|
94
|
+
Returns
|
|
95
|
+
-------
|
|
96
|
+
EnvironmentsCreateResponse
|
|
97
|
+
Success
|
|
98
|
+
|
|
99
|
+
Examples
|
|
100
|
+
--------
|
|
101
|
+
from mirascope.api._generated import Mirascope
|
|
102
|
+
|
|
103
|
+
client = Mirascope()
|
|
104
|
+
client.environments.create(
|
|
105
|
+
organization_id="organizationId",
|
|
106
|
+
project_id="projectId",
|
|
107
|
+
name="name",
|
|
108
|
+
slug="slug",
|
|
109
|
+
)
|
|
110
|
+
"""
|
|
111
|
+
_response = self._raw_client.create(
|
|
112
|
+
organization_id,
|
|
113
|
+
project_id,
|
|
114
|
+
name=name,
|
|
115
|
+
slug=slug,
|
|
116
|
+
request_options=request_options,
|
|
117
|
+
)
|
|
118
|
+
return _response.data
|
|
119
|
+
|
|
120
|
+
def get(
|
|
121
|
+
self,
|
|
122
|
+
organization_id: str,
|
|
123
|
+
project_id: str,
|
|
124
|
+
environment_id: str,
|
|
125
|
+
*,
|
|
126
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
127
|
+
) -> EnvironmentsGetResponse:
|
|
128
|
+
"""
|
|
129
|
+
Parameters
|
|
130
|
+
----------
|
|
131
|
+
organization_id : str
|
|
132
|
+
|
|
133
|
+
project_id : str
|
|
134
|
+
|
|
135
|
+
environment_id : str
|
|
136
|
+
|
|
137
|
+
request_options : typing.Optional[RequestOptions]
|
|
138
|
+
Request-specific configuration.
|
|
139
|
+
|
|
140
|
+
Returns
|
|
141
|
+
-------
|
|
142
|
+
EnvironmentsGetResponse
|
|
143
|
+
Success
|
|
144
|
+
|
|
145
|
+
Examples
|
|
146
|
+
--------
|
|
147
|
+
from mirascope.api._generated import Mirascope
|
|
148
|
+
|
|
149
|
+
client = Mirascope()
|
|
150
|
+
client.environments.get(
|
|
151
|
+
organization_id="organizationId",
|
|
152
|
+
project_id="projectId",
|
|
153
|
+
environment_id="environmentId",
|
|
154
|
+
)
|
|
155
|
+
"""
|
|
156
|
+
_response = self._raw_client.get(
|
|
157
|
+
organization_id, project_id, environment_id, request_options=request_options
|
|
158
|
+
)
|
|
159
|
+
return _response.data
|
|
160
|
+
|
|
161
|
+
def update(
|
|
162
|
+
self,
|
|
163
|
+
organization_id: str,
|
|
164
|
+
project_id: str,
|
|
165
|
+
environment_id: str,
|
|
166
|
+
*,
|
|
167
|
+
name: typing.Optional[str] = OMIT,
|
|
168
|
+
slug: typing.Optional[str] = OMIT,
|
|
169
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
170
|
+
) -> EnvironmentsUpdateResponse:
|
|
171
|
+
"""
|
|
172
|
+
Parameters
|
|
173
|
+
----------
|
|
174
|
+
organization_id : str
|
|
175
|
+
|
|
176
|
+
project_id : str
|
|
177
|
+
|
|
178
|
+
environment_id : str
|
|
179
|
+
|
|
180
|
+
name : typing.Optional[str]
|
|
181
|
+
a string at most 100 character(s) long
|
|
182
|
+
|
|
183
|
+
slug : typing.Optional[str]
|
|
184
|
+
a string matching the pattern ^[a-z0-9][a-z0-9_-]*[a-z0-9]$
|
|
185
|
+
|
|
186
|
+
request_options : typing.Optional[RequestOptions]
|
|
187
|
+
Request-specific configuration.
|
|
188
|
+
|
|
189
|
+
Returns
|
|
190
|
+
-------
|
|
191
|
+
EnvironmentsUpdateResponse
|
|
192
|
+
Success
|
|
193
|
+
|
|
194
|
+
Examples
|
|
195
|
+
--------
|
|
196
|
+
from mirascope.api._generated import Mirascope
|
|
197
|
+
|
|
198
|
+
client = Mirascope()
|
|
199
|
+
client.environments.update(
|
|
200
|
+
organization_id="organizationId",
|
|
201
|
+
project_id="projectId",
|
|
202
|
+
environment_id="environmentId",
|
|
203
|
+
)
|
|
204
|
+
"""
|
|
205
|
+
_response = self._raw_client.update(
|
|
206
|
+
organization_id,
|
|
207
|
+
project_id,
|
|
208
|
+
environment_id,
|
|
209
|
+
name=name,
|
|
210
|
+
slug=slug,
|
|
211
|
+
request_options=request_options,
|
|
212
|
+
)
|
|
213
|
+
return _response.data
|
|
214
|
+
|
|
215
|
+
def delete(
|
|
216
|
+
self,
|
|
217
|
+
organization_id: str,
|
|
218
|
+
project_id: str,
|
|
219
|
+
environment_id: str,
|
|
220
|
+
*,
|
|
221
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
222
|
+
) -> None:
|
|
223
|
+
"""
|
|
224
|
+
Parameters
|
|
225
|
+
----------
|
|
226
|
+
organization_id : str
|
|
227
|
+
|
|
228
|
+
project_id : str
|
|
229
|
+
|
|
230
|
+
environment_id : str
|
|
231
|
+
|
|
232
|
+
request_options : typing.Optional[RequestOptions]
|
|
233
|
+
Request-specific configuration.
|
|
234
|
+
|
|
235
|
+
Returns
|
|
236
|
+
-------
|
|
237
|
+
None
|
|
238
|
+
|
|
239
|
+
Examples
|
|
240
|
+
--------
|
|
241
|
+
from mirascope.api._generated import Mirascope
|
|
242
|
+
|
|
243
|
+
client = Mirascope()
|
|
244
|
+
client.environments.delete(
|
|
245
|
+
organization_id="organizationId",
|
|
246
|
+
project_id="projectId",
|
|
247
|
+
environment_id="environmentId",
|
|
248
|
+
)
|
|
249
|
+
"""
|
|
250
|
+
_response = self._raw_client.delete(
|
|
251
|
+
organization_id, project_id, environment_id, request_options=request_options
|
|
252
|
+
)
|
|
253
|
+
return _response.data
|
|
254
|
+
|
|
255
|
+
|
|
256
|
+
class AsyncEnvironmentsClient:
|
|
257
|
+
def __init__(self, *, client_wrapper: AsyncClientWrapper):
|
|
258
|
+
self._raw_client = AsyncRawEnvironmentsClient(client_wrapper=client_wrapper)
|
|
259
|
+
|
|
260
|
+
@property
|
|
261
|
+
def with_raw_response(self) -> AsyncRawEnvironmentsClient:
|
|
262
|
+
"""
|
|
263
|
+
Retrieves a raw implementation of this client that returns raw responses.
|
|
264
|
+
|
|
265
|
+
Returns
|
|
266
|
+
-------
|
|
267
|
+
AsyncRawEnvironmentsClient
|
|
268
|
+
"""
|
|
269
|
+
return self._raw_client
|
|
270
|
+
|
|
271
|
+
async def list(
|
|
272
|
+
self,
|
|
273
|
+
organization_id: str,
|
|
274
|
+
project_id: str,
|
|
275
|
+
*,
|
|
276
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
277
|
+
) -> typing.List[EnvironmentsListResponseItem]:
|
|
278
|
+
"""
|
|
279
|
+
Parameters
|
|
280
|
+
----------
|
|
281
|
+
organization_id : str
|
|
282
|
+
|
|
283
|
+
project_id : str
|
|
284
|
+
|
|
285
|
+
request_options : typing.Optional[RequestOptions]
|
|
286
|
+
Request-specific configuration.
|
|
287
|
+
|
|
288
|
+
Returns
|
|
289
|
+
-------
|
|
290
|
+
typing.List[EnvironmentsListResponseItem]
|
|
291
|
+
Success
|
|
292
|
+
|
|
293
|
+
Examples
|
|
294
|
+
--------
|
|
295
|
+
import asyncio
|
|
296
|
+
|
|
297
|
+
from mirascope.api._generated import AsyncMirascope
|
|
298
|
+
|
|
299
|
+
client = AsyncMirascope()
|
|
300
|
+
|
|
301
|
+
|
|
302
|
+
async def main() -> None:
|
|
303
|
+
await client.environments.list(
|
|
304
|
+
organization_id="organizationId",
|
|
305
|
+
project_id="projectId",
|
|
306
|
+
)
|
|
307
|
+
|
|
308
|
+
|
|
309
|
+
asyncio.run(main())
|
|
310
|
+
"""
|
|
311
|
+
_response = await self._raw_client.list(
|
|
312
|
+
organization_id, project_id, request_options=request_options
|
|
313
|
+
)
|
|
314
|
+
return _response.data
|
|
315
|
+
|
|
316
|
+
async def create(
|
|
317
|
+
self,
|
|
318
|
+
organization_id: str,
|
|
319
|
+
project_id: str,
|
|
320
|
+
*,
|
|
321
|
+
name: str,
|
|
322
|
+
slug: str,
|
|
323
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
324
|
+
) -> EnvironmentsCreateResponse:
|
|
325
|
+
"""
|
|
326
|
+
Parameters
|
|
327
|
+
----------
|
|
328
|
+
organization_id : str
|
|
329
|
+
|
|
330
|
+
project_id : str
|
|
331
|
+
|
|
332
|
+
name : str
|
|
333
|
+
a string at most 100 character(s) long
|
|
334
|
+
|
|
335
|
+
slug : str
|
|
336
|
+
a string matching the pattern ^[a-z0-9][a-z0-9_-]*[a-z0-9]$
|
|
337
|
+
|
|
338
|
+
request_options : typing.Optional[RequestOptions]
|
|
339
|
+
Request-specific configuration.
|
|
340
|
+
|
|
341
|
+
Returns
|
|
342
|
+
-------
|
|
343
|
+
EnvironmentsCreateResponse
|
|
344
|
+
Success
|
|
345
|
+
|
|
346
|
+
Examples
|
|
347
|
+
--------
|
|
348
|
+
import asyncio
|
|
349
|
+
|
|
350
|
+
from mirascope.api._generated import AsyncMirascope
|
|
351
|
+
|
|
352
|
+
client = AsyncMirascope()
|
|
353
|
+
|
|
354
|
+
|
|
355
|
+
async def main() -> None:
|
|
356
|
+
await client.environments.create(
|
|
357
|
+
organization_id="organizationId",
|
|
358
|
+
project_id="projectId",
|
|
359
|
+
name="name",
|
|
360
|
+
slug="slug",
|
|
361
|
+
)
|
|
362
|
+
|
|
363
|
+
|
|
364
|
+
asyncio.run(main())
|
|
365
|
+
"""
|
|
366
|
+
_response = await self._raw_client.create(
|
|
367
|
+
organization_id,
|
|
368
|
+
project_id,
|
|
369
|
+
name=name,
|
|
370
|
+
slug=slug,
|
|
371
|
+
request_options=request_options,
|
|
372
|
+
)
|
|
373
|
+
return _response.data
|
|
374
|
+
|
|
375
|
+
async def get(
|
|
376
|
+
self,
|
|
377
|
+
organization_id: str,
|
|
378
|
+
project_id: str,
|
|
379
|
+
environment_id: str,
|
|
380
|
+
*,
|
|
381
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
382
|
+
) -> EnvironmentsGetResponse:
|
|
383
|
+
"""
|
|
384
|
+
Parameters
|
|
385
|
+
----------
|
|
386
|
+
organization_id : str
|
|
387
|
+
|
|
388
|
+
project_id : str
|
|
389
|
+
|
|
390
|
+
environment_id : str
|
|
391
|
+
|
|
392
|
+
request_options : typing.Optional[RequestOptions]
|
|
393
|
+
Request-specific configuration.
|
|
394
|
+
|
|
395
|
+
Returns
|
|
396
|
+
-------
|
|
397
|
+
EnvironmentsGetResponse
|
|
398
|
+
Success
|
|
399
|
+
|
|
400
|
+
Examples
|
|
401
|
+
--------
|
|
402
|
+
import asyncio
|
|
403
|
+
|
|
404
|
+
from mirascope.api._generated import AsyncMirascope
|
|
405
|
+
|
|
406
|
+
client = AsyncMirascope()
|
|
407
|
+
|
|
408
|
+
|
|
409
|
+
async def main() -> None:
|
|
410
|
+
await client.environments.get(
|
|
411
|
+
organization_id="organizationId",
|
|
412
|
+
project_id="projectId",
|
|
413
|
+
environment_id="environmentId",
|
|
414
|
+
)
|
|
415
|
+
|
|
416
|
+
|
|
417
|
+
asyncio.run(main())
|
|
418
|
+
"""
|
|
419
|
+
_response = await self._raw_client.get(
|
|
420
|
+
organization_id, project_id, environment_id, request_options=request_options
|
|
421
|
+
)
|
|
422
|
+
return _response.data
|
|
423
|
+
|
|
424
|
+
async def update(
|
|
425
|
+
self,
|
|
426
|
+
organization_id: str,
|
|
427
|
+
project_id: str,
|
|
428
|
+
environment_id: str,
|
|
429
|
+
*,
|
|
430
|
+
name: typing.Optional[str] = OMIT,
|
|
431
|
+
slug: typing.Optional[str] = OMIT,
|
|
432
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
433
|
+
) -> EnvironmentsUpdateResponse:
|
|
434
|
+
"""
|
|
435
|
+
Parameters
|
|
436
|
+
----------
|
|
437
|
+
organization_id : str
|
|
438
|
+
|
|
439
|
+
project_id : str
|
|
440
|
+
|
|
441
|
+
environment_id : str
|
|
442
|
+
|
|
443
|
+
name : typing.Optional[str]
|
|
444
|
+
a string at most 100 character(s) long
|
|
445
|
+
|
|
446
|
+
slug : typing.Optional[str]
|
|
447
|
+
a string matching the pattern ^[a-z0-9][a-z0-9_-]*[a-z0-9]$
|
|
448
|
+
|
|
449
|
+
request_options : typing.Optional[RequestOptions]
|
|
450
|
+
Request-specific configuration.
|
|
451
|
+
|
|
452
|
+
Returns
|
|
453
|
+
-------
|
|
454
|
+
EnvironmentsUpdateResponse
|
|
455
|
+
Success
|
|
456
|
+
|
|
457
|
+
Examples
|
|
458
|
+
--------
|
|
459
|
+
import asyncio
|
|
460
|
+
|
|
461
|
+
from mirascope.api._generated import AsyncMirascope
|
|
462
|
+
|
|
463
|
+
client = AsyncMirascope()
|
|
464
|
+
|
|
465
|
+
|
|
466
|
+
async def main() -> None:
|
|
467
|
+
await client.environments.update(
|
|
468
|
+
organization_id="organizationId",
|
|
469
|
+
project_id="projectId",
|
|
470
|
+
environment_id="environmentId",
|
|
471
|
+
)
|
|
472
|
+
|
|
473
|
+
|
|
474
|
+
asyncio.run(main())
|
|
475
|
+
"""
|
|
476
|
+
_response = await self._raw_client.update(
|
|
477
|
+
organization_id,
|
|
478
|
+
project_id,
|
|
479
|
+
environment_id,
|
|
480
|
+
name=name,
|
|
481
|
+
slug=slug,
|
|
482
|
+
request_options=request_options,
|
|
483
|
+
)
|
|
484
|
+
return _response.data
|
|
485
|
+
|
|
486
|
+
async def delete(
|
|
487
|
+
self,
|
|
488
|
+
organization_id: str,
|
|
489
|
+
project_id: str,
|
|
490
|
+
environment_id: str,
|
|
491
|
+
*,
|
|
492
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
493
|
+
) -> None:
|
|
494
|
+
"""
|
|
495
|
+
Parameters
|
|
496
|
+
----------
|
|
497
|
+
organization_id : str
|
|
498
|
+
|
|
499
|
+
project_id : str
|
|
500
|
+
|
|
501
|
+
environment_id : str
|
|
502
|
+
|
|
503
|
+
request_options : typing.Optional[RequestOptions]
|
|
504
|
+
Request-specific configuration.
|
|
505
|
+
|
|
506
|
+
Returns
|
|
507
|
+
-------
|
|
508
|
+
None
|
|
509
|
+
|
|
510
|
+
Examples
|
|
511
|
+
--------
|
|
512
|
+
import asyncio
|
|
513
|
+
|
|
514
|
+
from mirascope.api._generated import AsyncMirascope
|
|
515
|
+
|
|
516
|
+
client = AsyncMirascope()
|
|
517
|
+
|
|
518
|
+
|
|
519
|
+
async def main() -> None:
|
|
520
|
+
await client.environments.delete(
|
|
521
|
+
organization_id="organizationId",
|
|
522
|
+
project_id="projectId",
|
|
523
|
+
environment_id="environmentId",
|
|
524
|
+
)
|
|
525
|
+
|
|
526
|
+
|
|
527
|
+
asyncio.run(main())
|
|
528
|
+
"""
|
|
529
|
+
_response = await self._raw_client.delete(
|
|
530
|
+
organization_id, project_id, environment_id, request_options=request_options
|
|
531
|
+
)
|
|
532
|
+
return _response.data
|