levelfour 0.1.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.
- levelfour/__init__.py +495 -0
- levelfour/api_keys/__init__.py +34 -0
- levelfour/api_keys/client.py +337 -0
- levelfour/api_keys/raw_client.py +621 -0
- levelfour/api_keys/types/__init__.py +34 -0
- levelfour/api_keys/types/create_api_key_request_scope.py +5 -0
- levelfour/async_levelfour_client.py +39 -0
- levelfour/base_client.py +346 -0
- levelfour/client.py +54 -0
- levelfour/core/__init__.py +127 -0
- levelfour/core/api_error.py +23 -0
- levelfour/core/client_wrapper.py +105 -0
- levelfour/core/datetime_utils.py +70 -0
- levelfour/core/file.py +67 -0
- levelfour/core/force_multipart.py +18 -0
- levelfour/core/http_client.py +776 -0
- levelfour/core/http_response.py +59 -0
- levelfour/core/http_sse/__init__.py +42 -0
- levelfour/core/http_sse/_api.py +112 -0
- levelfour/core/http_sse/_decoders.py +61 -0
- levelfour/core/http_sse/_exceptions.py +7 -0
- levelfour/core/http_sse/_models.py +17 -0
- levelfour/core/jsonable_encoder.py +108 -0
- levelfour/core/logging.py +107 -0
- levelfour/core/pagination.py +82 -0
- levelfour/core/pydantic_utilities.py +577 -0
- levelfour/core/query_encoder.py +58 -0
- levelfour/core/remove_none_from_dict.py +11 -0
- levelfour/core/request_options.py +35 -0
- levelfour/core/serialization.py +276 -0
- levelfour/errors/__init__.py +40 -0
- levelfour/errors/forbidden_error.py +11 -0
- levelfour/errors/unauthorized_error.py +11 -0
- levelfour/errors/unprocessable_entity_error.py +11 -0
- levelfour/evaluation/__init__.py +4 -0
- levelfour/evaluation/client.py +102 -0
- levelfour/evaluation/raw_client.py +141 -0
- levelfour/exceptions.py +63 -0
- levelfour/health/__init__.py +4 -0
- levelfour/health/client.py +163 -0
- levelfour/health/raw_client.py +164 -0
- levelfour/integrations/__init__.py +0 -0
- levelfour/integrations/django.py +26 -0
- levelfour/integrations/fastapi.py +39 -0
- levelfour/integrations/telemetry.py +66 -0
- levelfour/levelfour_client.py +47 -0
- levelfour/pagination.py +84 -0
- levelfour/pr_analysis/__init__.py +4 -0
- levelfour/pr_analysis/client.py +408 -0
- levelfour/pr_analysis/raw_client.py +620 -0
- levelfour/pr_analysis_actions/__init__.py +4 -0
- levelfour/pr_analysis_actions/client.py +588 -0
- levelfour/pr_analysis_actions/raw_client.py +939 -0
- levelfour/pr_analysis_installations/__init__.py +4 -0
- levelfour/pr_analysis_installations/client.py +470 -0
- levelfour/pr_analysis_installations/raw_client.py +868 -0
- levelfour/providers/__init__.py +34 -0
- levelfour/providers/client.py +1504 -0
- levelfour/providers/raw_client.py +2398 -0
- levelfour/providers/types/__init__.py +36 -0
- levelfour/providers/types/list_spending_breakdown_providers_response.py +11 -0
- levelfour/py.typed +0 -0
- levelfour/recommendations/__init__.py +4 -0
- levelfour/recommendations/client.py +1018 -0
- levelfour/recommendations/raw_client.py +1810 -0
- levelfour/savings/__init__.py +4 -0
- levelfour/savings/client.py +401 -0
- levelfour/savings/raw_client.py +624 -0
- levelfour/spending/__init__.py +34 -0
- levelfour/spending/client.py +437 -0
- levelfour/spending/raw_client.py +684 -0
- levelfour/spending/types/__init__.py +34 -0
- levelfour/spending/types/list_breakdown_spending_response.py +12 -0
- levelfour/types/__init__.py +413 -0
- levelfour/types/accept_terms_data.py +25 -0
- levelfour/types/accept_terms_response.py +27 -0
- levelfour/types/action_request.py +42 -0
- levelfour/types/api_key_created_data.py +28 -0
- levelfour/types/api_key_data.py +27 -0
- levelfour/types/authentication_error.py +5 -0
- levelfour/types/authorization_error.py +5 -0
- levelfour/types/bad_request_error.py +5 -0
- levelfour/types/comparison_item.py +32 -0
- levelfour/types/complete_wizard_data.py +27 -0
- levelfour/types/complete_wizard_response.py +27 -0
- levelfour/types/conflict_error.py +5 -0
- levelfour/types/cost_breakdown_data.py +35 -0
- levelfour/types/cost_breakdown_item.py +71 -0
- levelfour/types/cost_breakdown_raw_data.py +37 -0
- levelfour/types/cost_breakdown_raw_response.py +27 -0
- levelfour/types/cost_breakdown_response.py +27 -0
- levelfour/types/costs_breakdown_chart_data.py +48 -0
- levelfour/types/costs_breakdown_chart_response.py +27 -0
- levelfour/types/costs_breakdown_data_point.py +46 -0
- levelfour/types/costs_breakdown_grouped_chart_data.py +52 -0
- levelfour/types/costs_breakdown_grouped_chart_response.py +27 -0
- levelfour/types/costs_breakdown_grouped_data_point.py +36 -0
- levelfour/types/costs_breakdown_totals.py +41 -0
- levelfour/types/create_api_key_response.py +23 -0
- levelfour/types/daily_spending_breakdown_data.py +42 -0
- levelfour/types/daily_spending_breakdown_response.py +27 -0
- levelfour/types/daily_spending_data_point.py +31 -0
- levelfour/types/dashboard_summary_data.py +72 -0
- levelfour/types/dashboard_summary_response.py +27 -0
- levelfour/types/delete_endpoint_data.py +20 -0
- levelfour/types/delete_endpoint_response.py +23 -0
- levelfour/types/endpoint_data.py +23 -0
- levelfour/types/error_response.py +23 -0
- levelfour/types/error_response_error.py +21 -0
- levelfour/types/evaluation_status_data.py +71 -0
- levelfour/types/evaluation_status_response.py +27 -0
- levelfour/types/execution_log_command.py +21 -0
- levelfour/types/execution_log_entry.py +23 -0
- levelfour/types/execution_step_schema.py +23 -0
- levelfour/types/http_validation_error.py +20 -0
- levelfour/types/implementation_method_data.py +25 -0
- levelfour/types/implementation_method_response.py +27 -0
- levelfour/types/implementation_step.py +27 -0
- levelfour/types/internal_server_error.py +5 -0
- levelfour/types/list_api_keys_data.py +21 -0
- levelfour/types/list_api_keys_response.py +23 -0
- levelfour/types/list_endpoints_response.py +23 -0
- levelfour/types/metric_data_point.py +27 -0
- levelfour/types/metric_series.py +40 -0
- levelfour/types/metric_series_entry.py +25 -0
- levelfour/types/monthly_spending_data.py +27 -0
- levelfour/types/monthly_spending_data_point.py +31 -0
- levelfour/types/monthly_spending_response.py +27 -0
- levelfour/types/not_found_error.py +5 -0
- levelfour/types/pagination_meta.py +51 -0
- levelfour/types/processing_recommendation_item.py +61 -0
- levelfour/types/processing_recommendations_data.py +28 -0
- levelfour/types/processing_recommendations_response.py +27 -0
- levelfour/types/provider.py +46 -0
- levelfour/types/provider_breakdown_data.py +31 -0
- levelfour/types/provider_breakdown_item.py +77 -0
- levelfour/types/provider_breakdown_response.py +27 -0
- levelfour/types/provider_filter_options_data.py +51 -0
- levelfour/types/provider_filter_options_response.py +27 -0
- levelfour/types/provider_potential_savings_summary_data.py +46 -0
- levelfour/types/provider_potential_savings_summary_response.py +27 -0
- levelfour/types/provider_recommendations_summary_data.py +37 -0
- levelfour/types/provider_recommendations_summary_response.py +27 -0
- levelfour/types/provider_saved_summary_data.py +56 -0
- levelfour/types/provider_saved_summary_response.py +27 -0
- levelfour/types/provider_service_breakdown_data.py +65 -0
- levelfour/types/provider_service_breakdown_item.py +72 -0
- levelfour/types/provider_service_breakdown_raw_data.py +62 -0
- levelfour/types/provider_service_breakdown_raw_response.py +27 -0
- levelfour/types/provider_service_breakdown_response.py +27 -0
- levelfour/types/provider_service_costs_breakdown_data.py +62 -0
- levelfour/types/provider_service_costs_breakdown_response.py +27 -0
- levelfour/types/provider_service_costs_data_point.py +36 -0
- levelfour/types/provider_spending.py +61 -0
- levelfour/types/provider_spending_summary_data.py +67 -0
- levelfour/types/provider_spending_summary_response.py +27 -0
- levelfour/types/provider_timeline_data.py +57 -0
- levelfour/types/provider_timeline_response.py +27 -0
- levelfour/types/provider_top_service.py +36 -0
- levelfour/types/providers_summary_data.py +24 -0
- levelfour/types/providers_summary_response.py +27 -0
- levelfour/types/rate_limit_error.py +5 -0
- levelfour/types/recommendation_actions.py +60 -0
- levelfour/types/recommendation_detail.py +42 -0
- levelfour/types/recommendation_detail_response.py +27 -0
- levelfour/types/recommendation_filter_options_data.py +41 -0
- levelfour/types/recommendation_filter_options_response.py +27 -0
- levelfour/types/recommendation_item.py +36 -0
- levelfour/types/recommendation_wizard_data.py +173 -0
- levelfour/types/recommendation_wizard_data_metrics.py +7 -0
- levelfour/types/recommendation_wizard_response.py +27 -0
- levelfour/types/recommendations_breakdown_data.py +26 -0
- levelfour/types/recommendations_breakdown_response.py +27 -0
- levelfour/types/recommendations_overview_data.py +51 -0
- levelfour/types/recommendations_overview_response.py +27 -0
- levelfour/types/register_endpoint_response.py +23 -0
- levelfour/types/resource_change.py +42 -0
- levelfour/types/resource_snapshot.py +21 -0
- levelfour/types/revoke_api_key_data.py +20 -0
- levelfour/types/revoke_api_key_response.py +23 -0
- levelfour/types/risk_assessment.py +29 -0
- levelfour/types/risk_factor.py +27 -0
- levelfour/types/saved_breakdown_data.py +31 -0
- levelfour/types/saved_breakdown_response.py +27 -0
- levelfour/types/saved_by_provider_breakdown_data.py +31 -0
- levelfour/types/saved_by_provider_breakdown_response.py +27 -0
- levelfour/types/saved_by_provider_item.py +76 -0
- levelfour/types/saved_item.py +35 -0
- levelfour/types/saved_provider_summary.py +36 -0
- levelfour/types/saved_summary_data.py +57 -0
- levelfour/types/saved_summary_response.py +27 -0
- levelfour/types/savings_decision_data.py +28 -0
- levelfour/types/savings_decision_response.py +27 -0
- levelfour/types/spending_by_date_item.py +36 -0
- levelfour/types/top_recommendation.py +56 -0
- levelfour/types/trigger_info.py +22 -0
- levelfour/types/update_tag_data.py +20 -0
- levelfour/types/update_tag_response.py +23 -0
- levelfour/types/validation_error.py +24 -0
- levelfour/types/validation_error_loc_item.py +5 -0
- levelfour/webhooks/__init__.py +4 -0
- levelfour/webhooks/client.py +273 -0
- levelfour/webhooks/raw_client.py +483 -0
- levelfour/webhooks/verifier.py +61 -0
- levelfour-0.1.0.dist-info/METADATA +12 -0
- levelfour-0.1.0.dist-info/RECORD +208 -0
- levelfour-0.1.0.dist-info/WHEEL +5 -0
- levelfour-0.1.0.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,337 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
import datetime as dt
|
|
4
|
+
import typing
|
|
5
|
+
|
|
6
|
+
from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
|
|
7
|
+
from ..core.request_options import RequestOptions
|
|
8
|
+
from ..types.create_api_key_response import CreateApiKeyResponse
|
|
9
|
+
from ..types.list_api_keys_response import ListApiKeysResponse
|
|
10
|
+
from ..types.revoke_api_key_response import RevokeApiKeyResponse
|
|
11
|
+
from .raw_client import AsyncRawApiKeysClient, RawApiKeysClient
|
|
12
|
+
from .types.create_api_key_request_scope import CreateApiKeyRequestScope
|
|
13
|
+
|
|
14
|
+
# this is used as the default value for optional parameters
|
|
15
|
+
OMIT = typing.cast(typing.Any, ...)
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
class ApiKeysClient:
|
|
19
|
+
def __init__(self, *, client_wrapper: SyncClientWrapper):
|
|
20
|
+
self._raw_client = RawApiKeysClient(client_wrapper=client_wrapper)
|
|
21
|
+
|
|
22
|
+
@property
|
|
23
|
+
def with_raw_response(self) -> RawApiKeysClient:
|
|
24
|
+
"""
|
|
25
|
+
Retrieves a raw implementation of this client that returns raw responses.
|
|
26
|
+
|
|
27
|
+
Returns
|
|
28
|
+
-------
|
|
29
|
+
RawApiKeysClient
|
|
30
|
+
"""
|
|
31
|
+
return self._raw_client
|
|
32
|
+
|
|
33
|
+
def list(self, *, request_options: typing.Optional[RequestOptions] = None) -> ListApiKeysResponse:
|
|
34
|
+
"""
|
|
35
|
+
Parameters
|
|
36
|
+
----------
|
|
37
|
+
request_options : typing.Optional[RequestOptions]
|
|
38
|
+
Request-specific configuration.
|
|
39
|
+
|
|
40
|
+
Returns
|
|
41
|
+
-------
|
|
42
|
+
ListApiKeysResponse
|
|
43
|
+
Successful Response
|
|
44
|
+
|
|
45
|
+
Examples
|
|
46
|
+
--------
|
|
47
|
+
from levelfour import BaseLevelFour
|
|
48
|
+
|
|
49
|
+
client = BaseLevelFour(
|
|
50
|
+
token="YOUR_TOKEN",
|
|
51
|
+
base_url="https://yourhost.com/path/to/api",
|
|
52
|
+
)
|
|
53
|
+
client.api_keys.list()
|
|
54
|
+
"""
|
|
55
|
+
_response = self._raw_client.list(request_options=request_options)
|
|
56
|
+
return _response.data
|
|
57
|
+
|
|
58
|
+
def create(
|
|
59
|
+
self,
|
|
60
|
+
*,
|
|
61
|
+
name: str,
|
|
62
|
+
scope: typing.Optional[CreateApiKeyRequestScope] = OMIT,
|
|
63
|
+
expires_at: typing.Optional[dt.datetime] = OMIT,
|
|
64
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
65
|
+
) -> CreateApiKeyResponse:
|
|
66
|
+
"""
|
|
67
|
+
Parameters
|
|
68
|
+
----------
|
|
69
|
+
name : str
|
|
70
|
+
|
|
71
|
+
scope : typing.Optional[CreateApiKeyRequestScope]
|
|
72
|
+
|
|
73
|
+
expires_at : typing.Optional[dt.datetime]
|
|
74
|
+
|
|
75
|
+
request_options : typing.Optional[RequestOptions]
|
|
76
|
+
Request-specific configuration.
|
|
77
|
+
|
|
78
|
+
Returns
|
|
79
|
+
-------
|
|
80
|
+
CreateApiKeyResponse
|
|
81
|
+
Successful Response
|
|
82
|
+
|
|
83
|
+
Examples
|
|
84
|
+
--------
|
|
85
|
+
from levelfour import BaseLevelFour
|
|
86
|
+
|
|
87
|
+
client = BaseLevelFour(
|
|
88
|
+
token="YOUR_TOKEN",
|
|
89
|
+
base_url="https://yourhost.com/path/to/api",
|
|
90
|
+
)
|
|
91
|
+
client.api_keys.create(
|
|
92
|
+
name="name",
|
|
93
|
+
)
|
|
94
|
+
"""
|
|
95
|
+
_response = self._raw_client.create(
|
|
96
|
+
name=name, scope=scope, expires_at=expires_at, request_options=request_options
|
|
97
|
+
)
|
|
98
|
+
return _response.data
|
|
99
|
+
|
|
100
|
+
def revoke(self, key_id: str, *, request_options: typing.Optional[RequestOptions] = None) -> RevokeApiKeyResponse:
|
|
101
|
+
"""
|
|
102
|
+
Parameters
|
|
103
|
+
----------
|
|
104
|
+
key_id : str
|
|
105
|
+
API key UUID
|
|
106
|
+
|
|
107
|
+
request_options : typing.Optional[RequestOptions]
|
|
108
|
+
Request-specific configuration.
|
|
109
|
+
|
|
110
|
+
Returns
|
|
111
|
+
-------
|
|
112
|
+
RevokeApiKeyResponse
|
|
113
|
+
Successful Response
|
|
114
|
+
|
|
115
|
+
Examples
|
|
116
|
+
--------
|
|
117
|
+
from levelfour import BaseLevelFour
|
|
118
|
+
|
|
119
|
+
client = BaseLevelFour(
|
|
120
|
+
token="YOUR_TOKEN",
|
|
121
|
+
base_url="https://yourhost.com/path/to/api",
|
|
122
|
+
)
|
|
123
|
+
client.api_keys.revoke(
|
|
124
|
+
key_id="key_id",
|
|
125
|
+
)
|
|
126
|
+
"""
|
|
127
|
+
_response = self._raw_client.revoke(key_id, request_options=request_options)
|
|
128
|
+
return _response.data
|
|
129
|
+
|
|
130
|
+
def rotate(self, key_id: str, *, request_options: typing.Optional[RequestOptions] = None) -> CreateApiKeyResponse:
|
|
131
|
+
"""
|
|
132
|
+
Parameters
|
|
133
|
+
----------
|
|
134
|
+
key_id : str
|
|
135
|
+
API key UUID to rotate
|
|
136
|
+
|
|
137
|
+
request_options : typing.Optional[RequestOptions]
|
|
138
|
+
Request-specific configuration.
|
|
139
|
+
|
|
140
|
+
Returns
|
|
141
|
+
-------
|
|
142
|
+
CreateApiKeyResponse
|
|
143
|
+
Successful Response
|
|
144
|
+
|
|
145
|
+
Examples
|
|
146
|
+
--------
|
|
147
|
+
from levelfour import BaseLevelFour
|
|
148
|
+
|
|
149
|
+
client = BaseLevelFour(
|
|
150
|
+
token="YOUR_TOKEN",
|
|
151
|
+
base_url="https://yourhost.com/path/to/api",
|
|
152
|
+
)
|
|
153
|
+
client.api_keys.rotate(
|
|
154
|
+
key_id="key_id",
|
|
155
|
+
)
|
|
156
|
+
"""
|
|
157
|
+
_response = self._raw_client.rotate(key_id, request_options=request_options)
|
|
158
|
+
return _response.data
|
|
159
|
+
|
|
160
|
+
|
|
161
|
+
class AsyncApiKeysClient:
|
|
162
|
+
def __init__(self, *, client_wrapper: AsyncClientWrapper):
|
|
163
|
+
self._raw_client = AsyncRawApiKeysClient(client_wrapper=client_wrapper)
|
|
164
|
+
|
|
165
|
+
@property
|
|
166
|
+
def with_raw_response(self) -> AsyncRawApiKeysClient:
|
|
167
|
+
"""
|
|
168
|
+
Retrieves a raw implementation of this client that returns raw responses.
|
|
169
|
+
|
|
170
|
+
Returns
|
|
171
|
+
-------
|
|
172
|
+
AsyncRawApiKeysClient
|
|
173
|
+
"""
|
|
174
|
+
return self._raw_client
|
|
175
|
+
|
|
176
|
+
async def list(self, *, request_options: typing.Optional[RequestOptions] = None) -> ListApiKeysResponse:
|
|
177
|
+
"""
|
|
178
|
+
Parameters
|
|
179
|
+
----------
|
|
180
|
+
request_options : typing.Optional[RequestOptions]
|
|
181
|
+
Request-specific configuration.
|
|
182
|
+
|
|
183
|
+
Returns
|
|
184
|
+
-------
|
|
185
|
+
ListApiKeysResponse
|
|
186
|
+
Successful Response
|
|
187
|
+
|
|
188
|
+
Examples
|
|
189
|
+
--------
|
|
190
|
+
import asyncio
|
|
191
|
+
|
|
192
|
+
from levelfour import AsyncBaseLevelFour
|
|
193
|
+
|
|
194
|
+
client = AsyncBaseLevelFour(
|
|
195
|
+
token="YOUR_TOKEN",
|
|
196
|
+
base_url="https://yourhost.com/path/to/api",
|
|
197
|
+
)
|
|
198
|
+
|
|
199
|
+
|
|
200
|
+
async def main() -> None:
|
|
201
|
+
await client.api_keys.list()
|
|
202
|
+
|
|
203
|
+
|
|
204
|
+
asyncio.run(main())
|
|
205
|
+
"""
|
|
206
|
+
_response = await self._raw_client.list(request_options=request_options)
|
|
207
|
+
return _response.data
|
|
208
|
+
|
|
209
|
+
async def create(
|
|
210
|
+
self,
|
|
211
|
+
*,
|
|
212
|
+
name: str,
|
|
213
|
+
scope: typing.Optional[CreateApiKeyRequestScope] = OMIT,
|
|
214
|
+
expires_at: typing.Optional[dt.datetime] = OMIT,
|
|
215
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
216
|
+
) -> CreateApiKeyResponse:
|
|
217
|
+
"""
|
|
218
|
+
Parameters
|
|
219
|
+
----------
|
|
220
|
+
name : str
|
|
221
|
+
|
|
222
|
+
scope : typing.Optional[CreateApiKeyRequestScope]
|
|
223
|
+
|
|
224
|
+
expires_at : typing.Optional[dt.datetime]
|
|
225
|
+
|
|
226
|
+
request_options : typing.Optional[RequestOptions]
|
|
227
|
+
Request-specific configuration.
|
|
228
|
+
|
|
229
|
+
Returns
|
|
230
|
+
-------
|
|
231
|
+
CreateApiKeyResponse
|
|
232
|
+
Successful Response
|
|
233
|
+
|
|
234
|
+
Examples
|
|
235
|
+
--------
|
|
236
|
+
import asyncio
|
|
237
|
+
|
|
238
|
+
from levelfour import AsyncBaseLevelFour
|
|
239
|
+
|
|
240
|
+
client = AsyncBaseLevelFour(
|
|
241
|
+
token="YOUR_TOKEN",
|
|
242
|
+
base_url="https://yourhost.com/path/to/api",
|
|
243
|
+
)
|
|
244
|
+
|
|
245
|
+
|
|
246
|
+
async def main() -> None:
|
|
247
|
+
await client.api_keys.create(
|
|
248
|
+
name="name",
|
|
249
|
+
)
|
|
250
|
+
|
|
251
|
+
|
|
252
|
+
asyncio.run(main())
|
|
253
|
+
"""
|
|
254
|
+
_response = await self._raw_client.create(
|
|
255
|
+
name=name, scope=scope, expires_at=expires_at, request_options=request_options
|
|
256
|
+
)
|
|
257
|
+
return _response.data
|
|
258
|
+
|
|
259
|
+
async def revoke(
|
|
260
|
+
self, key_id: str, *, request_options: typing.Optional[RequestOptions] = None
|
|
261
|
+
) -> RevokeApiKeyResponse:
|
|
262
|
+
"""
|
|
263
|
+
Parameters
|
|
264
|
+
----------
|
|
265
|
+
key_id : str
|
|
266
|
+
API key UUID
|
|
267
|
+
|
|
268
|
+
request_options : typing.Optional[RequestOptions]
|
|
269
|
+
Request-specific configuration.
|
|
270
|
+
|
|
271
|
+
Returns
|
|
272
|
+
-------
|
|
273
|
+
RevokeApiKeyResponse
|
|
274
|
+
Successful Response
|
|
275
|
+
|
|
276
|
+
Examples
|
|
277
|
+
--------
|
|
278
|
+
import asyncio
|
|
279
|
+
|
|
280
|
+
from levelfour import AsyncBaseLevelFour
|
|
281
|
+
|
|
282
|
+
client = AsyncBaseLevelFour(
|
|
283
|
+
token="YOUR_TOKEN",
|
|
284
|
+
base_url="https://yourhost.com/path/to/api",
|
|
285
|
+
)
|
|
286
|
+
|
|
287
|
+
|
|
288
|
+
async def main() -> None:
|
|
289
|
+
await client.api_keys.revoke(
|
|
290
|
+
key_id="key_id",
|
|
291
|
+
)
|
|
292
|
+
|
|
293
|
+
|
|
294
|
+
asyncio.run(main())
|
|
295
|
+
"""
|
|
296
|
+
_response = await self._raw_client.revoke(key_id, request_options=request_options)
|
|
297
|
+
return _response.data
|
|
298
|
+
|
|
299
|
+
async def rotate(
|
|
300
|
+
self, key_id: str, *, request_options: typing.Optional[RequestOptions] = None
|
|
301
|
+
) -> CreateApiKeyResponse:
|
|
302
|
+
"""
|
|
303
|
+
Parameters
|
|
304
|
+
----------
|
|
305
|
+
key_id : str
|
|
306
|
+
API key UUID to rotate
|
|
307
|
+
|
|
308
|
+
request_options : typing.Optional[RequestOptions]
|
|
309
|
+
Request-specific configuration.
|
|
310
|
+
|
|
311
|
+
Returns
|
|
312
|
+
-------
|
|
313
|
+
CreateApiKeyResponse
|
|
314
|
+
Successful Response
|
|
315
|
+
|
|
316
|
+
Examples
|
|
317
|
+
--------
|
|
318
|
+
import asyncio
|
|
319
|
+
|
|
320
|
+
from levelfour import AsyncBaseLevelFour
|
|
321
|
+
|
|
322
|
+
client = AsyncBaseLevelFour(
|
|
323
|
+
token="YOUR_TOKEN",
|
|
324
|
+
base_url="https://yourhost.com/path/to/api",
|
|
325
|
+
)
|
|
326
|
+
|
|
327
|
+
|
|
328
|
+
async def main() -> None:
|
|
329
|
+
await client.api_keys.rotate(
|
|
330
|
+
key_id="key_id",
|
|
331
|
+
)
|
|
332
|
+
|
|
333
|
+
|
|
334
|
+
asyncio.run(main())
|
|
335
|
+
"""
|
|
336
|
+
_response = await self._raw_client.rotate(key_id, request_options=request_options)
|
|
337
|
+
return _response.data
|