typizer 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.
- typizer/__init__.py +8 -0
- typizer/api/__init__.py +1 -0
- typizer/api/account/__init__.py +1 -0
- typizer/api/account/delete_me.py +243 -0
- typizer/api/account/get_me.py +192 -0
- typizer/api/account/list_sign_ins.py +194 -0
- typizer/api/agent/__init__.py +1 -0
- typizer/api/agent/create_agent_message.py +290 -0
- typizer/api/agent/create_agent_sample_run.py +304 -0
- typizer/api/agent/create_agent_thread.py +251 -0
- typizer/api/agent/get_agent_thread.py +223 -0
- typizer/api/agent/list_agent_threads.py +243 -0
- typizer/api/agent/save_agent_thread.py +283 -0
- typizer/api/agent/update_agent_thread.py +245 -0
- typizer/api/api_keys/__init__.py +1 -0
- typizer/api/api_keys/create_api_key.py +235 -0
- typizer/api/api_keys/delete_api_key.py +217 -0
- typizer/api/api_keys/list_api_keys.py +196 -0
- typizer/api/auth/__init__.py +1 -0
- typizer/api/auth/start_login.py +209 -0
- typizer/api/batches/__init__.py +1 -0
- typizer/api/batches/create_batch.py +333 -0
- typizer/api/batches/export_batch.py +281 -0
- typizer/api/batches/get_batch.py +213 -0
- typizer/api/batches/list_batches.py +243 -0
- typizer/api/billing/__init__.py +1 -0
- typizer/api/billing/create_checkout.py +243 -0
- typizer/api/billing/create_contract_request.py +233 -0
- typizer/api/billing/create_invoice.py +243 -0
- typizer/api/billing/get_act_pdf.py +225 -0
- typizer/api/billing/get_balance.py +187 -0
- typizer/api/billing/get_billing_profile.py +196 -0
- typizer/api/billing/get_company.py +233 -0
- typizer/api/billing/get_contract_request_pdf.py +225 -0
- typizer/api/billing/get_payment.py +213 -0
- typizer/api/billing/get_usage.py +278 -0
- typizer/api/billing/list_contract_requests.py +196 -0
- typizer/api/billing/list_payments.py +233 -0
- typizer/api/billing/suggest_companies.py +214 -0
- typizer/api/billing/update_autotopup.py +231 -0
- typizer/api/billing/update_billing_profile.py +230 -0
- typizer/api/consents/__init__.py +1 -0
- typizer/api/consents/create_consent.py +228 -0
- typizer/api/consents/get_my_consents.py +210 -0
- typizer/api/demo/__init__.py +1 -0
- typizer/api/demo/create_demo_run.py +314 -0
- typizer/api/demo/get_demo_run.py +249 -0
- typizer/api/demo/list_demo_samples.py +159 -0
- typizer/api/files/__init__.py +1 -0
- typizer/api/files/create_file.py +266 -0
- typizer/api/files/delete_file.py +231 -0
- typizer/api/files/get_file.py +213 -0
- typizer/api/files/get_file_content.py +233 -0
- typizer/api/meta/__init__.py +1 -0
- typizer/api/meta/get_open_api_document.py +185 -0
- typizer/api/organization/__init__.py +1 -0
- typizer/api/organization/delete_organization.py +231 -0
- typizer/api/organization/get_organization.py +194 -0
- typizer/api/organization/update_organization.py +212 -0
- typizer/api/runs/__init__.py +1 -0
- typizer/api/runs/create_run.py +358 -0
- typizer/api/runs/extract.py +350 -0
- typizer/api/runs/get_run.py +225 -0
- typizer/api/runs/get_run_output.py +286 -0
- typizer/api/runs/list_runs.py +362 -0
- typizer/api/runs/retry_run.py +275 -0
- typizer/api/status/__init__.py +1 -0
- typizer/api/status/get_status.py +172 -0
- typizer/api/typizers/__init__.py +1 -0
- typizer/api/typizers/create_typizer.py +239 -0
- typizer/api/typizers/delete_typizer.py +229 -0
- typizer/api/typizers/generate_typizer.py +282 -0
- typizer/api/typizers/get_typizer.py +213 -0
- typizer/api/typizers/get_typizer_version.py +231 -0
- typizer/api/typizers/get_typizer_xsd.py +215 -0
- typizer/api/typizers/list_typizer_versions.py +256 -0
- typizer/api/typizers/list_typizers.py +235 -0
- typizer/api/typizers/update_typizer.py +247 -0
- typizer/api/webhooks/__init__.py +1 -0
- typizer/api/webhooks/create_webhook_endpoint.py +259 -0
- typizer/api/webhooks/delete_webhook_endpoint.py +217 -0
- typizer/api/webhooks/get_webhook_endpoint.py +217 -0
- typizer/api/webhooks/list_webhook_deliveries.py +264 -0
- typizer/api/webhooks/list_webhook_endpoints.py +235 -0
- typizer/api/webhooks/retry_webhook_delivery.py +254 -0
- typizer/api/webhooks/test_webhook_endpoint.py +254 -0
- typizer/api/webhooks/update_webhook_endpoint.py +252 -0
- typizer/client.py +268 -0
- typizer/errors.py +16 -0
- typizer/models/__init__.py +449 -0
- typizer/models/agent_message.py +103 -0
- typizer/models/agent_message_content.py +72 -0
- typizer/models/agent_message_object.py +8 -0
- typizer/models/agent_message_role.py +10 -0
- typizer/models/agent_thread.py +166 -0
- typizer/models/agent_thread_draft_schema_type_0.py +47 -0
- typizer/models/agent_thread_object.py +8 -0
- typizer/models/api_key.py +152 -0
- typizer/models/api_key_created_by.py +87 -0
- typizer/models/api_key_object.py +8 -0
- typizer/models/balance.py +103 -0
- typizer/models/balance_lot.py +97 -0
- typizer/models/balance_lot_source.py +11 -0
- typizer/models/balance_object.py +8 -0
- typizer/models/batch.py +146 -0
- typizer/models/batch_object.py +8 -0
- typizer/models/batch_status.py +9 -0
- typizer/models/billing_profile.py +184 -0
- typizer/models/billing_profile_autotopup.py +148 -0
- typizer/models/billing_profile_object.py +8 -0
- typizer/models/checkout.py +69 -0
- typizer/models/checkout_request.py +87 -0
- typizer/models/checkout_request_autotopup.py +81 -0
- typizer/models/checkout_request_package_code.py +12 -0
- typizer/models/company.py +139 -0
- typizer/models/company_list.py +107 -0
- typizer/models/company_list_object.py +8 -0
- typizer/models/company_object.py +8 -0
- typizer/models/company_status.py +12 -0
- typizer/models/company_type.py +9 -0
- typizer/models/consent_request.py +61 -0
- typizer/models/consent_request_kind.py +9 -0
- typizer/models/contract_request.py +211 -0
- typizer/models/contract_request_delivery_type_1.py +9 -0
- typizer/models/contract_request_delivery_type_2_type_1.py +9 -0
- typizer/models/contract_request_delivery_type_3_type_1.py +9 -0
- typizer/models/contract_request_edo_type_0.py +112 -0
- typizer/models/contract_request_list.py +107 -0
- typizer/models/contract_request_list_object.py +8 -0
- typizer/models/contract_request_object.py +8 -0
- typizer/models/contract_request_status.py +12 -0
- typizer/models/create_agent_message_request.py +54 -0
- typizer/models/create_agent_thread_request.py +51 -0
- typizer/models/create_api_key_request.py +85 -0
- typizer/models/create_batch_files_body.py +149 -0
- typizer/models/create_batch_files_body_format.py +11 -0
- typizer/models/create_batch_files_body_mode.py +9 -0
- typizer/models/create_batch_request.py +108 -0
- typizer/models/create_batch_request_format.py +11 -0
- typizer/models/create_batch_request_metadata.py +52 -0
- typizer/models/create_batch_request_mode.py +9 -0
- typizer/models/create_demo_run_files_body.py +107 -0
- typizer/models/create_demo_run_files_body_consent_pd.py +8 -0
- typizer/models/create_file_body.py +75 -0
- typizer/models/create_invoice_request.py +63 -0
- typizer/models/create_invoice_request_package_code.py +12 -0
- typizer/models/create_run_files_body.py +169 -0
- typizer/models/create_run_files_body_format.py +11 -0
- typizer/models/create_run_files_body_mode.py +9 -0
- typizer/models/create_run_request.py +120 -0
- typizer/models/create_run_request_format.py +11 -0
- typizer/models/create_run_request_metadata.py +53 -0
- typizer/models/create_run_request_mode.py +9 -0
- typizer/models/create_typizer_request.py +125 -0
- typizer/models/create_typizer_request_default_format.py +11 -0
- typizer/models/create_typizer_request_mode.py +9 -0
- typizer/models/create_typizer_request_schema.py +53 -0
- typizer/models/create_webhook_endpoint_request.py +62 -0
- typizer/models/created_api_key.py +163 -0
- typizer/models/deleted_api_key.py +79 -0
- typizer/models/deleted_api_key_object.py +8 -0
- typizer/models/deleted_file.py +79 -0
- typizer/models/deleted_file_object.py +8 -0
- typizer/models/deleted_typizer.py +79 -0
- typizer/models/deleted_typizer_object.py +8 -0
- typizer/models/deleted_webhook_endpoint.py +79 -0
- typizer/models/deleted_webhook_endpoint_object.py +8 -0
- typizer/models/demo_run.py +180 -0
- typizer/models/demo_run_error_type_0.py +69 -0
- typizer/models/demo_run_object.py +8 -0
- typizer/models/demo_run_pages.py +76 -0
- typizer/models/demo_run_request.py +52 -0
- typizer/models/demo_run_request_sample.py +10 -0
- typizer/models/demo_run_status.py +11 -0
- typizer/models/demo_sample.py +95 -0
- typizer/models/demo_sample_id.py +10 -0
- typizer/models/demo_sample_list.py +85 -0
- typizer/models/demo_sample_list_object.py +8 -0
- typizer/models/export_batch_format.py +10 -0
- typizer/models/extract_files_body.py +194 -0
- typizer/models/extract_files_body_format.py +11 -0
- typizer/models/extract_files_body_mode.py +9 -0
- typizer/models/extract_request.py +146 -0
- typizer/models/extract_request_format.py +11 -0
- typizer/models/extract_request_metadata.py +53 -0
- typizer/models/extract_request_mode.py +9 -0
- typizer/models/extract_request_schema.py +53 -0
- typizer/models/file.py +153 -0
- typizer/models/file_object.py +8 -0
- typizer/models/file_source.py +12 -0
- typizer/models/generate_typizer_request.py +51 -0
- typizer/models/get_open_api_document_response_200.py +45 -0
- typizer/models/get_run_output_format.py +11 -0
- typizer/models/get_usage_group_by.py +10 -0
- typizer/models/list_agent_threads_response_200.py +107 -0
- typizer/models/list_agent_threads_response_200_object.py +8 -0
- typizer/models/list_api_keys_response_200.py +107 -0
- typizer/models/list_api_keys_response_200_object.py +8 -0
- typizer/models/list_batches_response_200.py +107 -0
- typizer/models/list_batches_response_200_object.py +8 -0
- typizer/models/list_runs_response_200.py +107 -0
- typizer/models/list_runs_response_200_object.py +8 -0
- typizer/models/list_runs_source.py +12 -0
- typizer/models/list_runs_status.py +11 -0
- typizer/models/list_typizer_versions_response_200.py +107 -0
- typizer/models/list_typizer_versions_response_200_object.py +8 -0
- typizer/models/list_typizers_response_200.py +107 -0
- typizer/models/list_typizers_response_200_object.py +8 -0
- typizer/models/list_webhook_deliveries_response_200.py +107 -0
- typizer/models/list_webhook_deliveries_response_200_object.py +8 -0
- typizer/models/list_webhook_endpoints_response_200.py +107 -0
- typizer/models/list_webhook_endpoints_response_200_object.py +8 -0
- typizer/models/login_challenge.py +71 -0
- typizer/models/login_challenge_object.py +8 -0
- typizer/models/login_start_request.py +94 -0
- typizer/models/login_start_request_consents.py +74 -0
- typizer/models/login_start_request_consents_pd_processing.py +61 -0
- typizer/models/maintenance_event.py +139 -0
- typizer/models/maintenance_event_components_item.py +13 -0
- typizer/models/maintenance_event_kind.py +9 -0
- typizer/models/maintenance_event_object.py +8 -0
- typizer/models/maintenance_event_status.py +9 -0
- typizer/models/marketing_consent_state.py +102 -0
- typizer/models/me.py +226 -0
- typizer/models/me_api_key_type_0.py +88 -0
- typizer/models/me_auth.py +9 -0
- typizer/models/me_features.py +70 -0
- typizer/models/me_object.py +8 -0
- typizer/models/me_organization.py +69 -0
- typizer/models/me_organizations_item.py +79 -0
- typizer/models/me_organizations_item_role.py +10 -0
- typizer/models/me_role_type_1.py +10 -0
- typizer/models/me_role_type_2_type_1.py +10 -0
- typizer/models/me_role_type_3_type_1.py +10 -0
- typizer/models/me_user_type_0.py +86 -0
- typizer/models/my_consents.py +77 -0
- typizer/models/my_consents_object.py +8 -0
- typizer/models/organization.py +93 -0
- typizer/models/organization_object.py +8 -0
- typizer/models/organization_settings.py +74 -0
- typizer/models/organization_settings_file_retention.py +11 -0
- typizer/models/organization_settings_output_retention.py +10 -0
- typizer/models/payment.py +231 -0
- typizer/models/payment_act_type_0.py +136 -0
- typizer/models/payment_act_type_0_edo_type_0.py +112 -0
- typizer/models/payment_invoice_type_0.py +121 -0
- typizer/models/payment_invoice_type_0_status.py +11 -0
- typizer/models/payment_list.py +107 -0
- typizer/models/payment_list_object.py +8 -0
- typizer/models/payment_method.py +10 -0
- typizer/models/payment_object.py +8 -0
- typizer/models/payment_status.py +15 -0
- typizer/models/problem.py +158 -0
- typizer/models/problem_code.py +26 -0
- typizer/models/run.py +318 -0
- typizer/models/run_error_type_0.py +69 -0
- typizer/models/run_fields_type_0.py +45 -0
- typizer/models/run_file_type_0.py +69 -0
- typizer/models/run_format.py +11 -0
- typizer/models/run_metadata.py +45 -0
- typizer/models/run_mode.py +9 -0
- typizer/models/run_object.py +8 -0
- typizer/models/run_pages.py +82 -0
- typizer/models/run_source.py +12 -0
- typizer/models/run_status.py +11 -0
- typizer/models/save_agent_thread_request.py +63 -0
- typizer/models/save_agent_thread_response_200.py +47 -0
- typizer/models/save_agent_thread_response_201.py +47 -0
- typizer/models/scope.py +12 -0
- typizer/models/sign_in.py +94 -0
- typizer/models/sign_in_list.py +108 -0
- typizer/models/sign_in_list_object.py +8 -0
- typizer/models/sign_in_object.py +8 -0
- typizer/models/status.py +85 -0
- typizer/models/status_object.py +8 -0
- typizer/models/typizer.py +158 -0
- typizer/models/typizer_default_format.py +11 -0
- typizer/models/typizer_draft.py +97 -0
- typizer/models/typizer_draft_object.py +8 -0
- typizer/models/typizer_draft_schema.py +53 -0
- typizer/models/typizer_mode.py +9 -0
- typizer/models/typizer_object.py +8 -0
- typizer/models/typizer_schema.py +47 -0
- typizer/models/typizer_version.py +118 -0
- typizer/models/typizer_version_object.py +8 -0
- typizer/models/typizer_version_schema.py +45 -0
- typizer/models/update_agent_thread_request.py +80 -0
- typizer/models/update_agent_thread_request_draft_schema.py +53 -0
- typizer/models/update_autotopup_request.py +111 -0
- typizer/models/update_autotopup_request_consent.py +62 -0
- typizer/models/update_autotopup_request_package_code.py +12 -0
- typizer/models/update_billing_profile_request.py +127 -0
- typizer/models/update_organization_request.py +69 -0
- typizer/models/update_organization_request_file_retention.py +11 -0
- typizer/models/update_organization_request_output_retention.py +10 -0
- typizer/models/update_typizer_request.py +131 -0
- typizer/models/update_typizer_request_default_format.py +11 -0
- typizer/models/update_typizer_request_mode.py +9 -0
- typizer/models/update_typizer_request_schema.py +53 -0
- typizer/models/update_webhook_endpoint_request.py +83 -0
- typizer/models/update_webhook_endpoint_request_status.py +9 -0
- typizer/models/usage.py +119 -0
- typizer/models/usage_group_by.py +10 -0
- typizer/models/usage_object.py +8 -0
- typizer/models/usage_row.py +102 -0
- typizer/models/webhook_delivery.py +154 -0
- typizer/models/webhook_delivery_object.py +8 -0
- typizer/models/webhook_delivery_status.py +10 -0
- typizer/models/webhook_endpoint.py +156 -0
- typizer/models/webhook_endpoint_object.py +8 -0
- typizer/models/webhook_endpoint_status.py +9 -0
- typizer/models/webhook_event_type.py +11 -0
- typizer/py.typed +1 -0
- typizer/types.py +54 -0
- typizer-0.1.0.dist-info/METADATA +280 -0
- typizer-0.1.0.dist-info/RECORD +318 -0
- typizer-0.1.0.dist-info/WHEEL +4 -0
- typizer-0.1.0.dist-info/licenses/LICENSE +21 -0
|
@@ -0,0 +1,235 @@
|
|
|
1
|
+
from http import HTTPStatus
|
|
2
|
+
from typing import Any
|
|
3
|
+
|
|
4
|
+
import httpx
|
|
5
|
+
|
|
6
|
+
from ... import errors
|
|
7
|
+
from ...client import AuthenticatedClient, Client
|
|
8
|
+
from ...models.create_api_key_request import CreateApiKeyRequest
|
|
9
|
+
from ...models.created_api_key import CreatedApiKey
|
|
10
|
+
from ...models.problem import Problem
|
|
11
|
+
from ...types import UNSET, Response, Unset
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
def _get_kwargs(
|
|
15
|
+
*,
|
|
16
|
+
body: CreateApiKeyRequest,
|
|
17
|
+
typizer_organization: str | Unset = UNSET,
|
|
18
|
+
idempotency_key: str | Unset = UNSET,
|
|
19
|
+
) -> dict[str, Any]:
|
|
20
|
+
headers: dict[str, Any] = {}
|
|
21
|
+
if not isinstance(typizer_organization, Unset):
|
|
22
|
+
headers["Typizer-Organization"] = typizer_organization
|
|
23
|
+
|
|
24
|
+
if not isinstance(idempotency_key, Unset):
|
|
25
|
+
headers["Idempotency-Key"] = idempotency_key
|
|
26
|
+
|
|
27
|
+
_kwargs: dict[str, Any] = {
|
|
28
|
+
"method": "post",
|
|
29
|
+
"url": "/v1/api_keys",
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
_kwargs["json"] = body.to_dict()
|
|
33
|
+
|
|
34
|
+
headers["Content-Type"] = "application/json"
|
|
35
|
+
|
|
36
|
+
_kwargs["headers"] = headers
|
|
37
|
+
return _kwargs
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
def _parse_response(
|
|
41
|
+
*, client: AuthenticatedClient | Client, response: httpx.Response
|
|
42
|
+
) -> CreatedApiKey | Problem | None:
|
|
43
|
+
if response.status_code == 201:
|
|
44
|
+
response_201 = CreatedApiKey.from_dict(response.json())
|
|
45
|
+
|
|
46
|
+
return response_201
|
|
47
|
+
|
|
48
|
+
if response.status_code == 400:
|
|
49
|
+
response_400 = Problem.from_dict(response.json())
|
|
50
|
+
|
|
51
|
+
return response_400
|
|
52
|
+
|
|
53
|
+
if response.status_code == 401:
|
|
54
|
+
response_401 = Problem.from_dict(response.json())
|
|
55
|
+
|
|
56
|
+
return response_401
|
|
57
|
+
|
|
58
|
+
if response.status_code == 403:
|
|
59
|
+
response_403 = Problem.from_dict(response.json())
|
|
60
|
+
|
|
61
|
+
return response_403
|
|
62
|
+
|
|
63
|
+
if response.status_code == 409:
|
|
64
|
+
response_409 = Problem.from_dict(response.json())
|
|
65
|
+
|
|
66
|
+
return response_409
|
|
67
|
+
|
|
68
|
+
if response.status_code == 429:
|
|
69
|
+
response_429 = Problem.from_dict(response.json())
|
|
70
|
+
|
|
71
|
+
return response_429
|
|
72
|
+
|
|
73
|
+
if response.status_code == 500:
|
|
74
|
+
response_500 = Problem.from_dict(response.json())
|
|
75
|
+
|
|
76
|
+
return response_500
|
|
77
|
+
|
|
78
|
+
if response.status_code == 503:
|
|
79
|
+
response_503 = Problem.from_dict(response.json())
|
|
80
|
+
|
|
81
|
+
return response_503
|
|
82
|
+
|
|
83
|
+
if client.raise_on_unexpected_status:
|
|
84
|
+
raise errors.UnexpectedStatus(response.status_code, response.content)
|
|
85
|
+
else:
|
|
86
|
+
return None
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
def _build_response(
|
|
90
|
+
*, client: AuthenticatedClient | Client, response: httpx.Response
|
|
91
|
+
) -> Response[CreatedApiKey | Problem]:
|
|
92
|
+
return Response(
|
|
93
|
+
status_code=HTTPStatus(response.status_code),
|
|
94
|
+
content=response.content,
|
|
95
|
+
headers=response.headers,
|
|
96
|
+
parsed=_parse_response(client=client, response=response),
|
|
97
|
+
)
|
|
98
|
+
|
|
99
|
+
|
|
100
|
+
def sync_detailed(
|
|
101
|
+
*,
|
|
102
|
+
client: AuthenticatedClient,
|
|
103
|
+
body: CreateApiKeyRequest,
|
|
104
|
+
typizer_organization: str | Unset = UNSET,
|
|
105
|
+
idempotency_key: str | Unset = UNSET,
|
|
106
|
+
) -> Response[CreatedApiKey | Problem]:
|
|
107
|
+
"""Создать ключ API (ключ показывается один раз)
|
|
108
|
+
|
|
109
|
+
Доступ: только сессия с ролью owner или admin.
|
|
110
|
+
|
|
111
|
+
Args:
|
|
112
|
+
typizer_organization (str | Unset):
|
|
113
|
+
idempotency_key (str | Unset):
|
|
114
|
+
body (CreateApiKeyRequest):
|
|
115
|
+
|
|
116
|
+
Raises:
|
|
117
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
118
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
119
|
+
|
|
120
|
+
Returns:
|
|
121
|
+
Response[CreatedApiKey | Problem]
|
|
122
|
+
"""
|
|
123
|
+
|
|
124
|
+
kwargs = _get_kwargs(
|
|
125
|
+
body=body,
|
|
126
|
+
typizer_organization=typizer_organization,
|
|
127
|
+
idempotency_key=idempotency_key,
|
|
128
|
+
)
|
|
129
|
+
|
|
130
|
+
response = client.get_httpx_client().request(
|
|
131
|
+
**kwargs,
|
|
132
|
+
)
|
|
133
|
+
|
|
134
|
+
return _build_response(client=client, response=response)
|
|
135
|
+
|
|
136
|
+
|
|
137
|
+
def sync(
|
|
138
|
+
*,
|
|
139
|
+
client: AuthenticatedClient,
|
|
140
|
+
body: CreateApiKeyRequest,
|
|
141
|
+
typizer_organization: str | Unset = UNSET,
|
|
142
|
+
idempotency_key: str | Unset = UNSET,
|
|
143
|
+
) -> CreatedApiKey | Problem | None:
|
|
144
|
+
"""Создать ключ API (ключ показывается один раз)
|
|
145
|
+
|
|
146
|
+
Доступ: только сессия с ролью owner или admin.
|
|
147
|
+
|
|
148
|
+
Args:
|
|
149
|
+
typizer_organization (str | Unset):
|
|
150
|
+
idempotency_key (str | Unset):
|
|
151
|
+
body (CreateApiKeyRequest):
|
|
152
|
+
|
|
153
|
+
Raises:
|
|
154
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
155
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
156
|
+
|
|
157
|
+
Returns:
|
|
158
|
+
CreatedApiKey | Problem
|
|
159
|
+
"""
|
|
160
|
+
|
|
161
|
+
return sync_detailed(
|
|
162
|
+
client=client,
|
|
163
|
+
body=body,
|
|
164
|
+
typizer_organization=typizer_organization,
|
|
165
|
+
idempotency_key=idempotency_key,
|
|
166
|
+
).parsed
|
|
167
|
+
|
|
168
|
+
|
|
169
|
+
async def asyncio_detailed(
|
|
170
|
+
*,
|
|
171
|
+
client: AuthenticatedClient,
|
|
172
|
+
body: CreateApiKeyRequest,
|
|
173
|
+
typizer_organization: str | Unset = UNSET,
|
|
174
|
+
idempotency_key: str | Unset = UNSET,
|
|
175
|
+
) -> Response[CreatedApiKey | Problem]:
|
|
176
|
+
"""Создать ключ API (ключ показывается один раз)
|
|
177
|
+
|
|
178
|
+
Доступ: только сессия с ролью owner или admin.
|
|
179
|
+
|
|
180
|
+
Args:
|
|
181
|
+
typizer_organization (str | Unset):
|
|
182
|
+
idempotency_key (str | Unset):
|
|
183
|
+
body (CreateApiKeyRequest):
|
|
184
|
+
|
|
185
|
+
Raises:
|
|
186
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
187
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
188
|
+
|
|
189
|
+
Returns:
|
|
190
|
+
Response[CreatedApiKey | Problem]
|
|
191
|
+
"""
|
|
192
|
+
|
|
193
|
+
kwargs = _get_kwargs(
|
|
194
|
+
body=body,
|
|
195
|
+
typizer_organization=typizer_organization,
|
|
196
|
+
idempotency_key=idempotency_key,
|
|
197
|
+
)
|
|
198
|
+
|
|
199
|
+
response = await client.get_async_httpx_client().request(**kwargs)
|
|
200
|
+
|
|
201
|
+
return _build_response(client=client, response=response)
|
|
202
|
+
|
|
203
|
+
|
|
204
|
+
async def asyncio(
|
|
205
|
+
*,
|
|
206
|
+
client: AuthenticatedClient,
|
|
207
|
+
body: CreateApiKeyRequest,
|
|
208
|
+
typizer_organization: str | Unset = UNSET,
|
|
209
|
+
idempotency_key: str | Unset = UNSET,
|
|
210
|
+
) -> CreatedApiKey | Problem | None:
|
|
211
|
+
"""Создать ключ API (ключ показывается один раз)
|
|
212
|
+
|
|
213
|
+
Доступ: только сессия с ролью owner или admin.
|
|
214
|
+
|
|
215
|
+
Args:
|
|
216
|
+
typizer_organization (str | Unset):
|
|
217
|
+
idempotency_key (str | Unset):
|
|
218
|
+
body (CreateApiKeyRequest):
|
|
219
|
+
|
|
220
|
+
Raises:
|
|
221
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
222
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
223
|
+
|
|
224
|
+
Returns:
|
|
225
|
+
CreatedApiKey | Problem
|
|
226
|
+
"""
|
|
227
|
+
|
|
228
|
+
return (
|
|
229
|
+
await asyncio_detailed(
|
|
230
|
+
client=client,
|
|
231
|
+
body=body,
|
|
232
|
+
typizer_organization=typizer_organization,
|
|
233
|
+
idempotency_key=idempotency_key,
|
|
234
|
+
)
|
|
235
|
+
).parsed
|
|
@@ -0,0 +1,217 @@
|
|
|
1
|
+
from http import HTTPStatus
|
|
2
|
+
from typing import Any
|
|
3
|
+
from urllib.parse import quote
|
|
4
|
+
|
|
5
|
+
import httpx
|
|
6
|
+
|
|
7
|
+
from ... import errors
|
|
8
|
+
from ...client import AuthenticatedClient, Client
|
|
9
|
+
from ...models.deleted_api_key import DeletedApiKey
|
|
10
|
+
from ...models.problem import Problem
|
|
11
|
+
from ...types import UNSET, Response, Unset
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
def _get_kwargs(
|
|
15
|
+
id: str,
|
|
16
|
+
*,
|
|
17
|
+
typizer_organization: str | Unset = UNSET,
|
|
18
|
+
) -> dict[str, Any]:
|
|
19
|
+
headers: dict[str, Any] = {}
|
|
20
|
+
if not isinstance(typizer_organization, Unset):
|
|
21
|
+
headers["Typizer-Organization"] = typizer_organization
|
|
22
|
+
|
|
23
|
+
_kwargs: dict[str, Any] = {
|
|
24
|
+
"method": "delete",
|
|
25
|
+
"url": "/v1/api_keys/{id}".format(
|
|
26
|
+
id=quote(str(id), safe=""),
|
|
27
|
+
),
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
_kwargs["headers"] = headers
|
|
31
|
+
return _kwargs
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
def _parse_response(
|
|
35
|
+
*, client: AuthenticatedClient | Client, response: httpx.Response
|
|
36
|
+
) -> DeletedApiKey | Problem | None:
|
|
37
|
+
if response.status_code == 200:
|
|
38
|
+
response_200 = DeletedApiKey.from_dict(response.json())
|
|
39
|
+
|
|
40
|
+
return response_200
|
|
41
|
+
|
|
42
|
+
if response.status_code == 400:
|
|
43
|
+
response_400 = Problem.from_dict(response.json())
|
|
44
|
+
|
|
45
|
+
return response_400
|
|
46
|
+
|
|
47
|
+
if response.status_code == 401:
|
|
48
|
+
response_401 = Problem.from_dict(response.json())
|
|
49
|
+
|
|
50
|
+
return response_401
|
|
51
|
+
|
|
52
|
+
if response.status_code == 403:
|
|
53
|
+
response_403 = Problem.from_dict(response.json())
|
|
54
|
+
|
|
55
|
+
return response_403
|
|
56
|
+
|
|
57
|
+
if response.status_code == 404:
|
|
58
|
+
response_404 = Problem.from_dict(response.json())
|
|
59
|
+
|
|
60
|
+
return response_404
|
|
61
|
+
|
|
62
|
+
if response.status_code == 429:
|
|
63
|
+
response_429 = Problem.from_dict(response.json())
|
|
64
|
+
|
|
65
|
+
return response_429
|
|
66
|
+
|
|
67
|
+
if response.status_code == 500:
|
|
68
|
+
response_500 = Problem.from_dict(response.json())
|
|
69
|
+
|
|
70
|
+
return response_500
|
|
71
|
+
|
|
72
|
+
if response.status_code == 503:
|
|
73
|
+
response_503 = Problem.from_dict(response.json())
|
|
74
|
+
|
|
75
|
+
return response_503
|
|
76
|
+
|
|
77
|
+
if client.raise_on_unexpected_status:
|
|
78
|
+
raise errors.UnexpectedStatus(response.status_code, response.content)
|
|
79
|
+
else:
|
|
80
|
+
return None
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
def _build_response(
|
|
84
|
+
*, client: AuthenticatedClient | Client, response: httpx.Response
|
|
85
|
+
) -> Response[DeletedApiKey | Problem]:
|
|
86
|
+
return Response(
|
|
87
|
+
status_code=HTTPStatus(response.status_code),
|
|
88
|
+
content=response.content,
|
|
89
|
+
headers=response.headers,
|
|
90
|
+
parsed=_parse_response(client=client, response=response),
|
|
91
|
+
)
|
|
92
|
+
|
|
93
|
+
|
|
94
|
+
def sync_detailed(
|
|
95
|
+
id: str,
|
|
96
|
+
*,
|
|
97
|
+
client: AuthenticatedClient,
|
|
98
|
+
typizer_organization: str | Unset = UNSET,
|
|
99
|
+
) -> Response[DeletedApiKey | Problem]:
|
|
100
|
+
"""Отозвать ключ API навсегда
|
|
101
|
+
|
|
102
|
+
Доступ: только сессия с ролью owner или admin.
|
|
103
|
+
|
|
104
|
+
Args:
|
|
105
|
+
id (str): Example: key_….
|
|
106
|
+
typizer_organization (str | Unset):
|
|
107
|
+
|
|
108
|
+
Raises:
|
|
109
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
110
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
111
|
+
|
|
112
|
+
Returns:
|
|
113
|
+
Response[DeletedApiKey | Problem]
|
|
114
|
+
"""
|
|
115
|
+
|
|
116
|
+
kwargs = _get_kwargs(
|
|
117
|
+
id=id,
|
|
118
|
+
typizer_organization=typizer_organization,
|
|
119
|
+
)
|
|
120
|
+
|
|
121
|
+
response = client.get_httpx_client().request(
|
|
122
|
+
**kwargs,
|
|
123
|
+
)
|
|
124
|
+
|
|
125
|
+
return _build_response(client=client, response=response)
|
|
126
|
+
|
|
127
|
+
|
|
128
|
+
def sync(
|
|
129
|
+
id: str,
|
|
130
|
+
*,
|
|
131
|
+
client: AuthenticatedClient,
|
|
132
|
+
typizer_organization: str | Unset = UNSET,
|
|
133
|
+
) -> DeletedApiKey | Problem | None:
|
|
134
|
+
"""Отозвать ключ API навсегда
|
|
135
|
+
|
|
136
|
+
Доступ: только сессия с ролью owner или admin.
|
|
137
|
+
|
|
138
|
+
Args:
|
|
139
|
+
id (str): Example: key_….
|
|
140
|
+
typizer_organization (str | Unset):
|
|
141
|
+
|
|
142
|
+
Raises:
|
|
143
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
144
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
145
|
+
|
|
146
|
+
Returns:
|
|
147
|
+
DeletedApiKey | Problem
|
|
148
|
+
"""
|
|
149
|
+
|
|
150
|
+
return sync_detailed(
|
|
151
|
+
id=id,
|
|
152
|
+
client=client,
|
|
153
|
+
typizer_organization=typizer_organization,
|
|
154
|
+
).parsed
|
|
155
|
+
|
|
156
|
+
|
|
157
|
+
async def asyncio_detailed(
|
|
158
|
+
id: str,
|
|
159
|
+
*,
|
|
160
|
+
client: AuthenticatedClient,
|
|
161
|
+
typizer_organization: str | Unset = UNSET,
|
|
162
|
+
) -> Response[DeletedApiKey | Problem]:
|
|
163
|
+
"""Отозвать ключ API навсегда
|
|
164
|
+
|
|
165
|
+
Доступ: только сессия с ролью owner или admin.
|
|
166
|
+
|
|
167
|
+
Args:
|
|
168
|
+
id (str): Example: key_….
|
|
169
|
+
typizer_organization (str | Unset):
|
|
170
|
+
|
|
171
|
+
Raises:
|
|
172
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
173
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
174
|
+
|
|
175
|
+
Returns:
|
|
176
|
+
Response[DeletedApiKey | Problem]
|
|
177
|
+
"""
|
|
178
|
+
|
|
179
|
+
kwargs = _get_kwargs(
|
|
180
|
+
id=id,
|
|
181
|
+
typizer_organization=typizer_organization,
|
|
182
|
+
)
|
|
183
|
+
|
|
184
|
+
response = await client.get_async_httpx_client().request(**kwargs)
|
|
185
|
+
|
|
186
|
+
return _build_response(client=client, response=response)
|
|
187
|
+
|
|
188
|
+
|
|
189
|
+
async def asyncio(
|
|
190
|
+
id: str,
|
|
191
|
+
*,
|
|
192
|
+
client: AuthenticatedClient,
|
|
193
|
+
typizer_organization: str | Unset = UNSET,
|
|
194
|
+
) -> DeletedApiKey | Problem | None:
|
|
195
|
+
"""Отозвать ключ API навсегда
|
|
196
|
+
|
|
197
|
+
Доступ: только сессия с ролью owner или admin.
|
|
198
|
+
|
|
199
|
+
Args:
|
|
200
|
+
id (str): Example: key_….
|
|
201
|
+
typizer_organization (str | Unset):
|
|
202
|
+
|
|
203
|
+
Raises:
|
|
204
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
205
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
206
|
+
|
|
207
|
+
Returns:
|
|
208
|
+
DeletedApiKey | Problem
|
|
209
|
+
"""
|
|
210
|
+
|
|
211
|
+
return (
|
|
212
|
+
await asyncio_detailed(
|
|
213
|
+
id=id,
|
|
214
|
+
client=client,
|
|
215
|
+
typizer_organization=typizer_organization,
|
|
216
|
+
)
|
|
217
|
+
).parsed
|
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
from http import HTTPStatus
|
|
2
|
+
from typing import Any
|
|
3
|
+
|
|
4
|
+
import httpx
|
|
5
|
+
|
|
6
|
+
from ... import errors
|
|
7
|
+
from ...client import AuthenticatedClient, Client
|
|
8
|
+
from ...models.list_api_keys_response_200 import ListApiKeysResponse200
|
|
9
|
+
from ...models.problem import Problem
|
|
10
|
+
from ...types import UNSET, Response, Unset
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
def _get_kwargs(
|
|
14
|
+
*,
|
|
15
|
+
typizer_organization: str | Unset = UNSET,
|
|
16
|
+
) -> dict[str, Any]:
|
|
17
|
+
headers: dict[str, Any] = {}
|
|
18
|
+
if not isinstance(typizer_organization, Unset):
|
|
19
|
+
headers["Typizer-Organization"] = typizer_organization
|
|
20
|
+
|
|
21
|
+
_kwargs: dict[str, Any] = {
|
|
22
|
+
"method": "get",
|
|
23
|
+
"url": "/v1/api_keys",
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
_kwargs["headers"] = headers
|
|
27
|
+
return _kwargs
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
def _parse_response(
|
|
31
|
+
*, client: AuthenticatedClient | Client, response: httpx.Response
|
|
32
|
+
) -> ListApiKeysResponse200 | Problem | None:
|
|
33
|
+
if response.status_code == 200:
|
|
34
|
+
response_200 = ListApiKeysResponse200.from_dict(response.json())
|
|
35
|
+
|
|
36
|
+
return response_200
|
|
37
|
+
|
|
38
|
+
if response.status_code == 400:
|
|
39
|
+
response_400 = Problem.from_dict(response.json())
|
|
40
|
+
|
|
41
|
+
return response_400
|
|
42
|
+
|
|
43
|
+
if response.status_code == 401:
|
|
44
|
+
response_401 = Problem.from_dict(response.json())
|
|
45
|
+
|
|
46
|
+
return response_401
|
|
47
|
+
|
|
48
|
+
if response.status_code == 403:
|
|
49
|
+
response_403 = Problem.from_dict(response.json())
|
|
50
|
+
|
|
51
|
+
return response_403
|
|
52
|
+
|
|
53
|
+
if response.status_code == 429:
|
|
54
|
+
response_429 = Problem.from_dict(response.json())
|
|
55
|
+
|
|
56
|
+
return response_429
|
|
57
|
+
|
|
58
|
+
if response.status_code == 500:
|
|
59
|
+
response_500 = Problem.from_dict(response.json())
|
|
60
|
+
|
|
61
|
+
return response_500
|
|
62
|
+
|
|
63
|
+
if response.status_code == 503:
|
|
64
|
+
response_503 = Problem.from_dict(response.json())
|
|
65
|
+
|
|
66
|
+
return response_503
|
|
67
|
+
|
|
68
|
+
if client.raise_on_unexpected_status:
|
|
69
|
+
raise errors.UnexpectedStatus(response.status_code, response.content)
|
|
70
|
+
else:
|
|
71
|
+
return None
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
def _build_response(
|
|
75
|
+
*, client: AuthenticatedClient | Client, response: httpx.Response
|
|
76
|
+
) -> Response[ListApiKeysResponse200 | Problem]:
|
|
77
|
+
return Response(
|
|
78
|
+
status_code=HTTPStatus(response.status_code),
|
|
79
|
+
content=response.content,
|
|
80
|
+
headers=response.headers,
|
|
81
|
+
parsed=_parse_response(client=client, response=response),
|
|
82
|
+
)
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
def sync_detailed(
|
|
86
|
+
*,
|
|
87
|
+
client: AuthenticatedClient,
|
|
88
|
+
typizer_organization: str | Unset = UNSET,
|
|
89
|
+
) -> Response[ListApiKeysResponse200 | Problem]:
|
|
90
|
+
"""Активные ключи API организации
|
|
91
|
+
|
|
92
|
+
Доступ: только сессия с ролью owner или admin.
|
|
93
|
+
|
|
94
|
+
Args:
|
|
95
|
+
typizer_organization (str | Unset):
|
|
96
|
+
|
|
97
|
+
Raises:
|
|
98
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
99
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
100
|
+
|
|
101
|
+
Returns:
|
|
102
|
+
Response[ListApiKeysResponse200 | Problem]
|
|
103
|
+
"""
|
|
104
|
+
|
|
105
|
+
kwargs = _get_kwargs(
|
|
106
|
+
typizer_organization=typizer_organization,
|
|
107
|
+
)
|
|
108
|
+
|
|
109
|
+
response = client.get_httpx_client().request(
|
|
110
|
+
**kwargs,
|
|
111
|
+
)
|
|
112
|
+
|
|
113
|
+
return _build_response(client=client, response=response)
|
|
114
|
+
|
|
115
|
+
|
|
116
|
+
def sync(
|
|
117
|
+
*,
|
|
118
|
+
client: AuthenticatedClient,
|
|
119
|
+
typizer_organization: str | Unset = UNSET,
|
|
120
|
+
) -> ListApiKeysResponse200 | Problem | None:
|
|
121
|
+
"""Активные ключи API организации
|
|
122
|
+
|
|
123
|
+
Доступ: только сессия с ролью owner или admin.
|
|
124
|
+
|
|
125
|
+
Args:
|
|
126
|
+
typizer_organization (str | Unset):
|
|
127
|
+
|
|
128
|
+
Raises:
|
|
129
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
130
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
131
|
+
|
|
132
|
+
Returns:
|
|
133
|
+
ListApiKeysResponse200 | Problem
|
|
134
|
+
"""
|
|
135
|
+
|
|
136
|
+
return sync_detailed(
|
|
137
|
+
client=client,
|
|
138
|
+
typizer_organization=typizer_organization,
|
|
139
|
+
).parsed
|
|
140
|
+
|
|
141
|
+
|
|
142
|
+
async def asyncio_detailed(
|
|
143
|
+
*,
|
|
144
|
+
client: AuthenticatedClient,
|
|
145
|
+
typizer_organization: str | Unset = UNSET,
|
|
146
|
+
) -> Response[ListApiKeysResponse200 | Problem]:
|
|
147
|
+
"""Активные ключи API организации
|
|
148
|
+
|
|
149
|
+
Доступ: только сессия с ролью owner или admin.
|
|
150
|
+
|
|
151
|
+
Args:
|
|
152
|
+
typizer_organization (str | Unset):
|
|
153
|
+
|
|
154
|
+
Raises:
|
|
155
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
156
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
157
|
+
|
|
158
|
+
Returns:
|
|
159
|
+
Response[ListApiKeysResponse200 | Problem]
|
|
160
|
+
"""
|
|
161
|
+
|
|
162
|
+
kwargs = _get_kwargs(
|
|
163
|
+
typizer_organization=typizer_organization,
|
|
164
|
+
)
|
|
165
|
+
|
|
166
|
+
response = await client.get_async_httpx_client().request(**kwargs)
|
|
167
|
+
|
|
168
|
+
return _build_response(client=client, response=response)
|
|
169
|
+
|
|
170
|
+
|
|
171
|
+
async def asyncio(
|
|
172
|
+
*,
|
|
173
|
+
client: AuthenticatedClient,
|
|
174
|
+
typizer_organization: str | Unset = UNSET,
|
|
175
|
+
) -> ListApiKeysResponse200 | Problem | None:
|
|
176
|
+
"""Активные ключи API организации
|
|
177
|
+
|
|
178
|
+
Доступ: только сессия с ролью owner или admin.
|
|
179
|
+
|
|
180
|
+
Args:
|
|
181
|
+
typizer_organization (str | Unset):
|
|
182
|
+
|
|
183
|
+
Raises:
|
|
184
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
185
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
186
|
+
|
|
187
|
+
Returns:
|
|
188
|
+
ListApiKeysResponse200 | Problem
|
|
189
|
+
"""
|
|
190
|
+
|
|
191
|
+
return (
|
|
192
|
+
await asyncio_detailed(
|
|
193
|
+
client=client,
|
|
194
|
+
typizer_organization=typizer_organization,
|
|
195
|
+
)
|
|
196
|
+
).parsed
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"""Contains endpoint functions for accessing the API"""
|