agentmail-clone-v1 0.1.0
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.
- package/.env.example +20 -0
- package/.github/workflows/docs-deploy.yml +37 -0
- package/.github/workflows/landing-preview.yml +43 -0
- package/.github/workflows/openapi-lint.yml +31 -0
- package/.github/workflows/sdk-generate-check.yml +66 -0
- package/.github/workflows/sdk-release.yml +62 -0
- package/CHANGELOG.md +10 -0
- package/README.md +208 -0
- package/RELEASING.md +43 -0
- package/docs/api-reference/api-keys.mdx +11 -0
- package/docs/api-reference/domains.mdx +13 -0
- package/docs/api-reference/emails.mdx +26 -0
- package/docs/api-reference/inboxes.mdx +13 -0
- package/docs/api-reference/metrics.mdx +10 -0
- package/docs/authentication.mdx +25 -0
- package/docs/docs.json +35 -0
- package/docs/errors.mdx +34 -0
- package/docs/favicon.svg +5 -0
- package/docs/idempotency.mdx +18 -0
- package/docs/index.mdx +24 -0
- package/docs/quickstart.mdx +134 -0
- package/landing/DEPLOYING.md +33 -0
- package/landing/favicon.svg +5 -0
- package/landing/index.html +129 -0
- package/landing/main.js +45 -0
- package/landing/privacy.html +29 -0
- package/landing/styles.css +356 -0
- package/landing/terms.html +29 -0
- package/netlify.toml +15 -0
- package/openapi/openapi.yaml +1016 -0
- package/package.json +34 -0
- package/render.yaml +48 -0
- package/scripts/generate-sdk-py.sh +16 -0
- package/scripts/generate-sdk-ts.sh +16 -0
- package/scripts/migrate.js +66 -0
- package/scripts/validate-docs.js +56 -0
- package/scripts/validate-landing.js +39 -0
- package/sdks/python/README.md +40 -0
- package/sdks/python/emailagent_sdk/__init__.py +157 -0
- package/sdks/python/generated/.openapi-generator/FILES +101 -0
- package/sdks/python/generated/.openapi-generator/VERSION +1 -0
- package/sdks/python/generated/.openapi-generator-ignore +23 -0
- package/sdks/python/generated/emailagent_sdk_generated/__init__.py +105 -0
- package/sdks/python/generated/emailagent_sdk_generated/api/__init__.py +9 -0
- package/sdks/python/generated/emailagent_sdk_generated/api/api_keys_api.py +1162 -0
- package/sdks/python/generated/emailagent_sdk_generated/api/domains_api.py +1168 -0
- package/sdks/python/generated/emailagent_sdk_generated/api/emails_api.py +1232 -0
- package/sdks/python/generated/emailagent_sdk_generated/api/inboxes_api.py +1191 -0
- package/sdks/python/generated/emailagent_sdk_generated/api/metrics_api.py +285 -0
- package/sdks/python/generated/emailagent_sdk_generated/api_client.py +801 -0
- package/sdks/python/generated/emailagent_sdk_generated/api_response.py +21 -0
- package/sdks/python/generated/emailagent_sdk_generated/configuration.py +586 -0
- package/sdks/python/generated/emailagent_sdk_generated/docs/APIKeysApi.md +334 -0
- package/sdks/python/generated/emailagent_sdk_generated/docs/ApiKeyCreated.md +35 -0
- package/sdks/python/generated/emailagent_sdk_generated/docs/ApiKeyCreatedResponse.md +29 -0
- package/sdks/python/generated/emailagent_sdk_generated/docs/ApiKeyListItem.md +35 -0
- package/sdks/python/generated/emailagent_sdk_generated/docs/ApiKeyListResponse.md +29 -0
- package/sdks/python/generated/emailagent_sdk_generated/docs/CreateApiKeyRequest.md +30 -0
- package/sdks/python/generated/emailagent_sdk_generated/docs/CreateApiKeyRequestScopes.md +29 -0
- package/sdks/python/generated/emailagent_sdk_generated/docs/CreateDomainRequest.md +29 -0
- package/sdks/python/generated/emailagent_sdk_generated/docs/CreateInboxRequest.md +31 -0
- package/sdks/python/generated/emailagent_sdk_generated/docs/Domain.md +37 -0
- package/sdks/python/generated/emailagent_sdk_generated/docs/DomainListResponse.md +29 -0
- package/sdks/python/generated/emailagent_sdk_generated/docs/DomainResponse.md +29 -0
- package/sdks/python/generated/emailagent_sdk_generated/docs/DomainsApi.md +336 -0
- package/sdks/python/generated/emailagent_sdk_generated/docs/Email.md +43 -0
- package/sdks/python/generated/emailagent_sdk_generated/docs/EmailListResponse.md +29 -0
- package/sdks/python/generated/emailagent_sdk_generated/docs/EmailResponse.md +29 -0
- package/sdks/python/generated/emailagent_sdk_generated/docs/EmailsApi.md +353 -0
- package/sdks/python/generated/emailagent_sdk_generated/docs/ErrorResponse.md +29 -0
- package/sdks/python/generated/emailagent_sdk_generated/docs/Inbox.md +38 -0
- package/sdks/python/generated/emailagent_sdk_generated/docs/InboxListResponse.md +29 -0
- package/sdks/python/generated/emailagent_sdk_generated/docs/InboxResponse.md +29 -0
- package/sdks/python/generated/emailagent_sdk_generated/docs/InboxesApi.md +337 -0
- package/sdks/python/generated/emailagent_sdk_generated/docs/MetricsApi.md +83 -0
- package/sdks/python/generated/emailagent_sdk_generated/docs/MetricsData.md +35 -0
- package/sdks/python/generated/emailagent_sdk_generated/docs/MetricsResponse.md +29 -0
- package/sdks/python/generated/emailagent_sdk_generated/docs/OkResponse.md +29 -0
- package/sdks/python/generated/emailagent_sdk_generated/docs/PlanLimits.md +32 -0
- package/sdks/python/generated/emailagent_sdk_generated/docs/SendEmailRequest.md +32 -0
- package/sdks/python/generated/emailagent_sdk_generated/docs/UpdateEmailReadRequest.md +29 -0
- package/sdks/python/generated/emailagent_sdk_generated/docs/UpdateInboxRequest.md +29 -0
- package/sdks/python/generated/emailagent_sdk_generated/exceptions.py +216 -0
- package/sdks/python/generated/emailagent_sdk_generated/models/__init__.py +41 -0
- package/sdks/python/generated/emailagent_sdk_generated/models/api_key_created.py +113 -0
- package/sdks/python/generated/emailagent_sdk_generated/models/api_key_created_response.py +91 -0
- package/sdks/python/generated/emailagent_sdk_generated/models/api_key_list_item.py +123 -0
- package/sdks/python/generated/emailagent_sdk_generated/models/api_key_list_response.py +95 -0
- package/sdks/python/generated/emailagent_sdk_generated/models/create_api_key_request.py +93 -0
- package/sdks/python/generated/emailagent_sdk_generated/models/create_api_key_request_scopes.py +143 -0
- package/sdks/python/generated/emailagent_sdk_generated/models/create_domain_request.py +87 -0
- package/sdks/python/generated/emailagent_sdk_generated/models/create_inbox_request.py +91 -0
- package/sdks/python/generated/emailagent_sdk_generated/models/domain.py +134 -0
- package/sdks/python/generated/emailagent_sdk_generated/models/domain_list_response.py +95 -0
- package/sdks/python/generated/emailagent_sdk_generated/models/domain_response.py +91 -0
- package/sdks/python/generated/emailagent_sdk_generated/models/email.py +175 -0
- package/sdks/python/generated/emailagent_sdk_generated/models/email_list_response.py +95 -0
- package/sdks/python/generated/emailagent_sdk_generated/models/email_response.py +91 -0
- package/sdks/python/generated/emailagent_sdk_generated/models/error_response.py +87 -0
- package/sdks/python/generated/emailagent_sdk_generated/models/inbox.py +136 -0
- package/sdks/python/generated/emailagent_sdk_generated/models/inbox_list_response.py +95 -0
- package/sdks/python/generated/emailagent_sdk_generated/models/inbox_response.py +91 -0
- package/sdks/python/generated/emailagent_sdk_generated/models/metrics_data.py +110 -0
- package/sdks/python/generated/emailagent_sdk_generated/models/metrics_response.py +91 -0
- package/sdks/python/generated/emailagent_sdk_generated/models/ok_response.py +87 -0
- package/sdks/python/generated/emailagent_sdk_generated/models/plan_limits.py +93 -0
- package/sdks/python/generated/emailagent_sdk_generated/models/send_email_request.py +93 -0
- package/sdks/python/generated/emailagent_sdk_generated/models/update_email_read_request.py +87 -0
- package/sdks/python/generated/emailagent_sdk_generated/models/update_inbox_request.py +92 -0
- package/sdks/python/generated/emailagent_sdk_generated/rest.py +258 -0
- package/sdks/python/generated/emailagent_sdk_generated/test/__init__.py +0 -0
- package/sdks/python/generated/emailagent_sdk_generated/test/test_api_key_created.py +68 -0
- package/sdks/python/generated/emailagent_sdk_generated/test/test_api_key_created_response.py +52 -0
- package/sdks/python/generated/emailagent_sdk_generated/test/test_api_key_list_item.py +66 -0
- package/sdks/python/generated/emailagent_sdk_generated/test/test_api_key_list_response.py +56 -0
- package/sdks/python/generated/emailagent_sdk_generated/test/test_api_keys_api.py +59 -0
- package/sdks/python/generated/emailagent_sdk_generated/test/test_create_api_key_request.py +53 -0
- package/sdks/python/generated/emailagent_sdk_generated/test/test_create_api_key_request_scopes.py +50 -0
- package/sdks/python/generated/emailagent_sdk_generated/test/test_create_domain_request.py +52 -0
- package/sdks/python/generated/emailagent_sdk_generated/test/test_create_inbox_request.py +54 -0
- package/sdks/python/generated/emailagent_sdk_generated/test/test_domain.py +70 -0
- package/sdks/python/generated/emailagent_sdk_generated/test/test_domain_list_response.py +56 -0
- package/sdks/python/generated/emailagent_sdk_generated/test/test_domain_response.py +52 -0
- package/sdks/python/generated/emailagent_sdk_generated/test/test_domains_api.py +59 -0
- package/sdks/python/generated/emailagent_sdk_generated/test/test_email.py +79 -0
- package/sdks/python/generated/emailagent_sdk_generated/test/test_email_list_response.py +56 -0
- package/sdks/python/generated/emailagent_sdk_generated/test/test_email_response.py +52 -0
- package/sdks/python/generated/emailagent_sdk_generated/test/test_emails_api.py +59 -0
- package/sdks/python/generated/emailagent_sdk_generated/test/test_error_response.py +52 -0
- package/sdks/python/generated/emailagent_sdk_generated/test/test_inbox.py +68 -0
- package/sdks/python/generated/emailagent_sdk_generated/test/test_inbox_list_response.py +56 -0
- package/sdks/python/generated/emailagent_sdk_generated/test/test_inbox_response.py +52 -0
- package/sdks/python/generated/emailagent_sdk_generated/test/test_inboxes_api.py +59 -0
- package/sdks/python/generated/emailagent_sdk_generated/test/test_metrics_api.py +38 -0
- package/sdks/python/generated/emailagent_sdk_generated/test/test_metrics_data.py +72 -0
- package/sdks/python/generated/emailagent_sdk_generated/test/test_metrics_response.py +74 -0
- package/sdks/python/generated/emailagent_sdk_generated/test/test_ok_response.py +52 -0
- package/sdks/python/generated/emailagent_sdk_generated/test/test_plan_limits.py +58 -0
- package/sdks/python/generated/emailagent_sdk_generated/test/test_send_email_request.py +56 -0
- package/sdks/python/generated/emailagent_sdk_generated/test/test_update_email_read_request.py +52 -0
- package/sdks/python/generated/emailagent_sdk_generated/test/test_update_inbox_request.py +52 -0
- package/sdks/python/generated/emailagent_sdk_generated_README.md +140 -0
- package/sdks/python/openapitools.json +7 -0
- package/sdks/python/pyproject.toml +19 -0
- package/sdks/typescript/README.md +41 -0
- package/sdks/typescript/generated/.openapi-generator/FILES +41 -0
- package/sdks/typescript/generated/.openapi-generator/VERSION +1 -0
- package/sdks/typescript/generated/.openapi-generator-ignore +23 -0
- package/sdks/typescript/generated/package.json +21 -0
- package/sdks/typescript/generated/src/apis/APIKeysApi.ts +314 -0
- package/sdks/typescript/generated/src/apis/DomainsApi.ts +314 -0
- package/sdks/typescript/generated/src/apis/EmailsApi.ts +350 -0
- package/sdks/typescript/generated/src/apis/InboxesApi.ts +329 -0
- package/sdks/typescript/generated/src/apis/MetricsApi.ts +93 -0
- package/sdks/typescript/generated/src/apis/index.ts +7 -0
- package/sdks/typescript/generated/src/index.ts +5 -0
- package/sdks/typescript/generated/src/models/ApiKeyCreated.ts +123 -0
- package/sdks/typescript/generated/src/models/ApiKeyCreatedResponse.ts +74 -0
- package/sdks/typescript/generated/src/models/ApiKeyListItem.ts +121 -0
- package/sdks/typescript/generated/src/models/ApiKeyListResponse.ts +74 -0
- package/sdks/typescript/generated/src/models/CreateApiKeyRequest.ts +82 -0
- package/sdks/typescript/generated/src/models/CreateApiKeyRequestScopes.ts +45 -0
- package/sdks/typescript/generated/src/models/CreateDomainRequest.ts +66 -0
- package/sdks/typescript/generated/src/models/CreateInboxRequest.ts +82 -0
- package/sdks/typescript/generated/src/models/Domain.ts +152 -0
- package/sdks/typescript/generated/src/models/DomainListResponse.ts +74 -0
- package/sdks/typescript/generated/src/models/DomainResponse.ts +74 -0
- package/sdks/typescript/generated/src/models/Email.ts +222 -0
- package/sdks/typescript/generated/src/models/EmailListResponse.ts +74 -0
- package/sdks/typescript/generated/src/models/EmailResponse.ts +74 -0
- package/sdks/typescript/generated/src/models/ErrorResponse.ts +66 -0
- package/sdks/typescript/generated/src/models/Inbox.ts +159 -0
- package/sdks/typescript/generated/src/models/InboxListResponse.ts +74 -0
- package/sdks/typescript/generated/src/models/InboxResponse.ts +74 -0
- package/sdks/typescript/generated/src/models/MetricsData.ts +139 -0
- package/sdks/typescript/generated/src/models/MetricsResponse.ts +74 -0
- package/sdks/typescript/generated/src/models/OkResponse.ts +66 -0
- package/sdks/typescript/generated/src/models/PlanLimits.ts +93 -0
- package/sdks/typescript/generated/src/models/SendEmailRequest.ts +91 -0
- package/sdks/typescript/generated/src/models/UpdateEmailReadRequest.ts +66 -0
- package/sdks/typescript/generated/src/models/UpdateInboxRequest.ts +66 -0
- package/sdks/typescript/generated/src/models/index.ts +27 -0
- package/sdks/typescript/generated/src/runtime.ts +432 -0
- package/sdks/typescript/generated/tsconfig.esm.json +7 -0
- package/sdks/typescript/generated/tsconfig.json +16 -0
- package/sdks/typescript/openapitools.json +8 -0
- package/sdks/typescript/package.json +27 -0
- package/sdks/typescript/src/index.ts +138 -0
- package/sdks/typescript/tsconfig.json +14 -0
- package/sql/001_init.sql +143 -0
- package/sql/002_local_auth.sql +38 -0
- package/sql/003_domain_routes.sql +2 -0
- package/sql/004_reliability_primitives.sql +75 -0
- package/sql/005_auth_email_flows.sql +22 -0
- package/src/config.js +30 -0
- package/src/db.js +25 -0
- package/src/lib/api-auth.js +55 -0
- package/src/lib/auth.js +71 -0
- package/src/lib/csrf.js +46 -0
- package/src/lib/dodo.js +67 -0
- package/src/lib/email-templates.js +67 -0
- package/src/lib/idempotency.js +85 -0
- package/src/lib/mailgun.js +188 -0
- package/src/lib/plan.js +24 -0
- package/src/lib/rate-limit.js +43 -0
- package/src/lib/security.js +62 -0
- package/src/lib/session.js +21 -0
- package/src/lib/store.js +638 -0
- package/src/lib/transactional-mailer.js +54 -0
- package/src/lib/validation.js +30 -0
- package/src/routes/api.js +485 -0
- package/src/routes/app.js +699 -0
- package/src/routes/auth.js +404 -0
- package/src/routes/webhooks.js +257 -0
- package/src/server.js +79 -0
- package/src/views/pages/admin.ejs +58 -0
- package/src/views/pages/api-keys.ejs +56 -0
- package/src/views/pages/billing.ejs +71 -0
- package/src/views/pages/domains.ejs +106 -0
- package/src/views/pages/inboxes.ejs +127 -0
- package/src/views/pages/login.ejs +57 -0
- package/src/views/pages/metrics.ejs +34 -0
- package/src/views/pages/reset-password.ejs +19 -0
- package/src/views/partials/bottom.ejs +3 -0
- package/src/views/partials/csrf-field.ejs +3 -0
- package/src/views/partials/flash.ejs +3 -0
- package/src/views/partials/top.ejs +130 -0
|
@@ -0,0 +1,1162 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
EmailAgent API
|
|
5
|
+
|
|
6
|
+
API for creating agent inboxes, sending emails, managing custom domains, managing API keys, and reading usage metrics. Authentication uses API keys via `Authorization: Bearer <api_key>`. For mutating endpoints, send an optional `Idempotency-Key` header. - Replaying the same key with the same payload returns the original response. - Reusing a key with a different payload returns `409`.
|
|
7
|
+
|
|
8
|
+
The version of the OpenAPI document: 1.0.0
|
|
9
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
10
|
+
|
|
11
|
+
Do not edit the class manually.
|
|
12
|
+
""" # noqa: E501
|
|
13
|
+
|
|
14
|
+
import warnings
|
|
15
|
+
from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt
|
|
16
|
+
from typing import Any, Dict, List, Optional, Tuple, Union
|
|
17
|
+
from typing_extensions import Annotated
|
|
18
|
+
|
|
19
|
+
from pydantic import Field, StrictStr
|
|
20
|
+
from typing import Optional
|
|
21
|
+
from typing_extensions import Annotated
|
|
22
|
+
from emailagent_sdk_generated.models.api_key_created_response import ApiKeyCreatedResponse
|
|
23
|
+
from emailagent_sdk_generated.models.api_key_list_response import ApiKeyListResponse
|
|
24
|
+
from emailagent_sdk_generated.models.create_api_key_request import CreateApiKeyRequest
|
|
25
|
+
from emailagent_sdk_generated.models.ok_response import OkResponse
|
|
26
|
+
|
|
27
|
+
from emailagent_sdk_generated.api_client import ApiClient, RequestSerialized
|
|
28
|
+
from emailagent_sdk_generated.api_response import ApiResponse
|
|
29
|
+
from emailagent_sdk_generated.rest import RESTResponseType
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
class APIKeysApi:
|
|
33
|
+
"""NOTE: This class is auto generated by OpenAPI Generator
|
|
34
|
+
Ref: https://openapi-generator.tech
|
|
35
|
+
|
|
36
|
+
Do not edit the class manually.
|
|
37
|
+
"""
|
|
38
|
+
|
|
39
|
+
def __init__(self, api_client=None) -> None:
|
|
40
|
+
if api_client is None:
|
|
41
|
+
api_client = ApiClient.get_default()
|
|
42
|
+
self.api_client = api_client
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
@validate_call
|
|
46
|
+
def create_api_key(
|
|
47
|
+
self,
|
|
48
|
+
create_api_key_request: CreateApiKeyRequest,
|
|
49
|
+
idempotency_key: Annotated[Optional[Annotated[str, Field(min_length=1, strict=True, max_length=255)]], Field(description="Optional key for safe retries of mutating operations.")] = None,
|
|
50
|
+
_request_timeout: Union[
|
|
51
|
+
None,
|
|
52
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
53
|
+
Tuple[
|
|
54
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
55
|
+
Annotated[StrictFloat, Field(gt=0)]
|
|
56
|
+
]
|
|
57
|
+
] = None,
|
|
58
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
59
|
+
_content_type: Optional[StrictStr] = None,
|
|
60
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
61
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
62
|
+
) -> ApiKeyCreatedResponse:
|
|
63
|
+
"""Create API key
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
:param create_api_key_request: (required)
|
|
67
|
+
:type create_api_key_request: CreateApiKeyRequest
|
|
68
|
+
:param idempotency_key: Optional key for safe retries of mutating operations.
|
|
69
|
+
:type idempotency_key: str
|
|
70
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
71
|
+
number provided, it will be total request
|
|
72
|
+
timeout. It can also be a pair (tuple) of
|
|
73
|
+
(connection, read) timeouts.
|
|
74
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
75
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
76
|
+
request; this effectively ignores the
|
|
77
|
+
authentication in the spec for a single request.
|
|
78
|
+
:type _request_auth: dict, optional
|
|
79
|
+
:param _content_type: force content-type for the request.
|
|
80
|
+
:type _content_type: str, Optional
|
|
81
|
+
:param _headers: set to override the headers for a single
|
|
82
|
+
request; this effectively ignores the headers
|
|
83
|
+
in the spec for a single request.
|
|
84
|
+
:type _headers: dict, optional
|
|
85
|
+
:param _host_index: set to override the host_index for a single
|
|
86
|
+
request; this effectively ignores the host_index
|
|
87
|
+
in the spec for a single request.
|
|
88
|
+
:type _host_index: int, optional
|
|
89
|
+
:return: Returns the result object.
|
|
90
|
+
""" # noqa: E501
|
|
91
|
+
|
|
92
|
+
_param = self._create_api_key_serialize(
|
|
93
|
+
create_api_key_request=create_api_key_request,
|
|
94
|
+
idempotency_key=idempotency_key,
|
|
95
|
+
_request_auth=_request_auth,
|
|
96
|
+
_content_type=_content_type,
|
|
97
|
+
_headers=_headers,
|
|
98
|
+
_host_index=_host_index
|
|
99
|
+
)
|
|
100
|
+
|
|
101
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
102
|
+
'201': "ApiKeyCreatedResponse",
|
|
103
|
+
'400': "ErrorResponse",
|
|
104
|
+
'401': "ErrorResponse",
|
|
105
|
+
'403': "ErrorResponse",
|
|
106
|
+
'409': "ErrorResponse",
|
|
107
|
+
'422': "ErrorResponse",
|
|
108
|
+
}
|
|
109
|
+
response_data = self.api_client.call_api(
|
|
110
|
+
*_param,
|
|
111
|
+
_request_timeout=_request_timeout
|
|
112
|
+
)
|
|
113
|
+
response_data.read()
|
|
114
|
+
return self.api_client.response_deserialize(
|
|
115
|
+
response_data=response_data,
|
|
116
|
+
response_types_map=_response_types_map,
|
|
117
|
+
).data
|
|
118
|
+
|
|
119
|
+
|
|
120
|
+
@validate_call
|
|
121
|
+
def create_api_key_with_http_info(
|
|
122
|
+
self,
|
|
123
|
+
create_api_key_request: CreateApiKeyRequest,
|
|
124
|
+
idempotency_key: Annotated[Optional[Annotated[str, Field(min_length=1, strict=True, max_length=255)]], Field(description="Optional key for safe retries of mutating operations.")] = None,
|
|
125
|
+
_request_timeout: Union[
|
|
126
|
+
None,
|
|
127
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
128
|
+
Tuple[
|
|
129
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
130
|
+
Annotated[StrictFloat, Field(gt=0)]
|
|
131
|
+
]
|
|
132
|
+
] = None,
|
|
133
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
134
|
+
_content_type: Optional[StrictStr] = None,
|
|
135
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
136
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
137
|
+
) -> ApiResponse[ApiKeyCreatedResponse]:
|
|
138
|
+
"""Create API key
|
|
139
|
+
|
|
140
|
+
|
|
141
|
+
:param create_api_key_request: (required)
|
|
142
|
+
:type create_api_key_request: CreateApiKeyRequest
|
|
143
|
+
:param idempotency_key: Optional key for safe retries of mutating operations.
|
|
144
|
+
:type idempotency_key: str
|
|
145
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
146
|
+
number provided, it will be total request
|
|
147
|
+
timeout. It can also be a pair (tuple) of
|
|
148
|
+
(connection, read) timeouts.
|
|
149
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
150
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
151
|
+
request; this effectively ignores the
|
|
152
|
+
authentication in the spec for a single request.
|
|
153
|
+
:type _request_auth: dict, optional
|
|
154
|
+
:param _content_type: force content-type for the request.
|
|
155
|
+
:type _content_type: str, Optional
|
|
156
|
+
:param _headers: set to override the headers for a single
|
|
157
|
+
request; this effectively ignores the headers
|
|
158
|
+
in the spec for a single request.
|
|
159
|
+
:type _headers: dict, optional
|
|
160
|
+
:param _host_index: set to override the host_index for a single
|
|
161
|
+
request; this effectively ignores the host_index
|
|
162
|
+
in the spec for a single request.
|
|
163
|
+
:type _host_index: int, optional
|
|
164
|
+
:return: Returns the result object.
|
|
165
|
+
""" # noqa: E501
|
|
166
|
+
|
|
167
|
+
_param = self._create_api_key_serialize(
|
|
168
|
+
create_api_key_request=create_api_key_request,
|
|
169
|
+
idempotency_key=idempotency_key,
|
|
170
|
+
_request_auth=_request_auth,
|
|
171
|
+
_content_type=_content_type,
|
|
172
|
+
_headers=_headers,
|
|
173
|
+
_host_index=_host_index
|
|
174
|
+
)
|
|
175
|
+
|
|
176
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
177
|
+
'201': "ApiKeyCreatedResponse",
|
|
178
|
+
'400': "ErrorResponse",
|
|
179
|
+
'401': "ErrorResponse",
|
|
180
|
+
'403': "ErrorResponse",
|
|
181
|
+
'409': "ErrorResponse",
|
|
182
|
+
'422': "ErrorResponse",
|
|
183
|
+
}
|
|
184
|
+
response_data = self.api_client.call_api(
|
|
185
|
+
*_param,
|
|
186
|
+
_request_timeout=_request_timeout
|
|
187
|
+
)
|
|
188
|
+
response_data.read()
|
|
189
|
+
return self.api_client.response_deserialize(
|
|
190
|
+
response_data=response_data,
|
|
191
|
+
response_types_map=_response_types_map,
|
|
192
|
+
)
|
|
193
|
+
|
|
194
|
+
|
|
195
|
+
@validate_call
|
|
196
|
+
def create_api_key_without_preload_content(
|
|
197
|
+
self,
|
|
198
|
+
create_api_key_request: CreateApiKeyRequest,
|
|
199
|
+
idempotency_key: Annotated[Optional[Annotated[str, Field(min_length=1, strict=True, max_length=255)]], Field(description="Optional key for safe retries of mutating operations.")] = None,
|
|
200
|
+
_request_timeout: Union[
|
|
201
|
+
None,
|
|
202
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
203
|
+
Tuple[
|
|
204
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
205
|
+
Annotated[StrictFloat, Field(gt=0)]
|
|
206
|
+
]
|
|
207
|
+
] = None,
|
|
208
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
209
|
+
_content_type: Optional[StrictStr] = None,
|
|
210
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
211
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
212
|
+
) -> RESTResponseType:
|
|
213
|
+
"""Create API key
|
|
214
|
+
|
|
215
|
+
|
|
216
|
+
:param create_api_key_request: (required)
|
|
217
|
+
:type create_api_key_request: CreateApiKeyRequest
|
|
218
|
+
:param idempotency_key: Optional key for safe retries of mutating operations.
|
|
219
|
+
:type idempotency_key: str
|
|
220
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
221
|
+
number provided, it will be total request
|
|
222
|
+
timeout. It can also be a pair (tuple) of
|
|
223
|
+
(connection, read) timeouts.
|
|
224
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
225
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
226
|
+
request; this effectively ignores the
|
|
227
|
+
authentication in the spec for a single request.
|
|
228
|
+
:type _request_auth: dict, optional
|
|
229
|
+
:param _content_type: force content-type for the request.
|
|
230
|
+
:type _content_type: str, Optional
|
|
231
|
+
:param _headers: set to override the headers for a single
|
|
232
|
+
request; this effectively ignores the headers
|
|
233
|
+
in the spec for a single request.
|
|
234
|
+
:type _headers: dict, optional
|
|
235
|
+
:param _host_index: set to override the host_index for a single
|
|
236
|
+
request; this effectively ignores the host_index
|
|
237
|
+
in the spec for a single request.
|
|
238
|
+
:type _host_index: int, optional
|
|
239
|
+
:return: Returns the result object.
|
|
240
|
+
""" # noqa: E501
|
|
241
|
+
|
|
242
|
+
_param = self._create_api_key_serialize(
|
|
243
|
+
create_api_key_request=create_api_key_request,
|
|
244
|
+
idempotency_key=idempotency_key,
|
|
245
|
+
_request_auth=_request_auth,
|
|
246
|
+
_content_type=_content_type,
|
|
247
|
+
_headers=_headers,
|
|
248
|
+
_host_index=_host_index
|
|
249
|
+
)
|
|
250
|
+
|
|
251
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
252
|
+
'201': "ApiKeyCreatedResponse",
|
|
253
|
+
'400': "ErrorResponse",
|
|
254
|
+
'401': "ErrorResponse",
|
|
255
|
+
'403': "ErrorResponse",
|
|
256
|
+
'409': "ErrorResponse",
|
|
257
|
+
'422': "ErrorResponse",
|
|
258
|
+
}
|
|
259
|
+
response_data = self.api_client.call_api(
|
|
260
|
+
*_param,
|
|
261
|
+
_request_timeout=_request_timeout
|
|
262
|
+
)
|
|
263
|
+
return response_data.response
|
|
264
|
+
|
|
265
|
+
|
|
266
|
+
def _create_api_key_serialize(
|
|
267
|
+
self,
|
|
268
|
+
create_api_key_request,
|
|
269
|
+
idempotency_key,
|
|
270
|
+
_request_auth,
|
|
271
|
+
_content_type,
|
|
272
|
+
_headers,
|
|
273
|
+
_host_index,
|
|
274
|
+
) -> RequestSerialized:
|
|
275
|
+
|
|
276
|
+
_host = None
|
|
277
|
+
|
|
278
|
+
_collection_formats: Dict[str, str] = {
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
_path_params: Dict[str, str] = {}
|
|
282
|
+
_query_params: List[Tuple[str, str]] = []
|
|
283
|
+
_header_params: Dict[str, Optional[str]] = _headers or {}
|
|
284
|
+
_form_params: List[Tuple[str, str]] = []
|
|
285
|
+
_files: Dict[
|
|
286
|
+
str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
|
|
287
|
+
] = {}
|
|
288
|
+
_body_params: Optional[bytes] = None
|
|
289
|
+
|
|
290
|
+
# process the path parameters
|
|
291
|
+
# process the query parameters
|
|
292
|
+
# process the header parameters
|
|
293
|
+
if idempotency_key is not None:
|
|
294
|
+
_header_params['Idempotency-Key'] = idempotency_key
|
|
295
|
+
# process the form parameters
|
|
296
|
+
# process the body parameter
|
|
297
|
+
if create_api_key_request is not None:
|
|
298
|
+
_body_params = create_api_key_request
|
|
299
|
+
|
|
300
|
+
|
|
301
|
+
# set the HTTP header `Accept`
|
|
302
|
+
if 'Accept' not in _header_params:
|
|
303
|
+
_header_params['Accept'] = self.api_client.select_header_accept(
|
|
304
|
+
[
|
|
305
|
+
'application/json'
|
|
306
|
+
]
|
|
307
|
+
)
|
|
308
|
+
|
|
309
|
+
# set the HTTP header `Content-Type`
|
|
310
|
+
if _content_type:
|
|
311
|
+
_header_params['Content-Type'] = _content_type
|
|
312
|
+
else:
|
|
313
|
+
_default_content_type = (
|
|
314
|
+
self.api_client.select_header_content_type(
|
|
315
|
+
[
|
|
316
|
+
'application/json'
|
|
317
|
+
]
|
|
318
|
+
)
|
|
319
|
+
)
|
|
320
|
+
if _default_content_type is not None:
|
|
321
|
+
_header_params['Content-Type'] = _default_content_type
|
|
322
|
+
|
|
323
|
+
# authentication setting
|
|
324
|
+
_auth_settings: List[str] = [
|
|
325
|
+
'bearerAuth'
|
|
326
|
+
]
|
|
327
|
+
|
|
328
|
+
return self.api_client.param_serialize(
|
|
329
|
+
method='POST',
|
|
330
|
+
resource_path='/api/v1/api-keys',
|
|
331
|
+
path_params=_path_params,
|
|
332
|
+
query_params=_query_params,
|
|
333
|
+
header_params=_header_params,
|
|
334
|
+
body=_body_params,
|
|
335
|
+
post_params=_form_params,
|
|
336
|
+
files=_files,
|
|
337
|
+
auth_settings=_auth_settings,
|
|
338
|
+
collection_formats=_collection_formats,
|
|
339
|
+
_host=_host,
|
|
340
|
+
_request_auth=_request_auth
|
|
341
|
+
)
|
|
342
|
+
|
|
343
|
+
|
|
344
|
+
|
|
345
|
+
|
|
346
|
+
@validate_call
|
|
347
|
+
def list_api_keys(
|
|
348
|
+
self,
|
|
349
|
+
_request_timeout: Union[
|
|
350
|
+
None,
|
|
351
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
352
|
+
Tuple[
|
|
353
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
354
|
+
Annotated[StrictFloat, Field(gt=0)]
|
|
355
|
+
]
|
|
356
|
+
] = None,
|
|
357
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
358
|
+
_content_type: Optional[StrictStr] = None,
|
|
359
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
360
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
361
|
+
) -> ApiKeyListResponse:
|
|
362
|
+
"""List API keys
|
|
363
|
+
|
|
364
|
+
|
|
365
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
366
|
+
number provided, it will be total request
|
|
367
|
+
timeout. It can also be a pair (tuple) of
|
|
368
|
+
(connection, read) timeouts.
|
|
369
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
370
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
371
|
+
request; this effectively ignores the
|
|
372
|
+
authentication in the spec for a single request.
|
|
373
|
+
:type _request_auth: dict, optional
|
|
374
|
+
:param _content_type: force content-type for the request.
|
|
375
|
+
:type _content_type: str, Optional
|
|
376
|
+
:param _headers: set to override the headers for a single
|
|
377
|
+
request; this effectively ignores the headers
|
|
378
|
+
in the spec for a single request.
|
|
379
|
+
:type _headers: dict, optional
|
|
380
|
+
:param _host_index: set to override the host_index for a single
|
|
381
|
+
request; this effectively ignores the host_index
|
|
382
|
+
in the spec for a single request.
|
|
383
|
+
:type _host_index: int, optional
|
|
384
|
+
:return: Returns the result object.
|
|
385
|
+
""" # noqa: E501
|
|
386
|
+
|
|
387
|
+
_param = self._list_api_keys_serialize(
|
|
388
|
+
_request_auth=_request_auth,
|
|
389
|
+
_content_type=_content_type,
|
|
390
|
+
_headers=_headers,
|
|
391
|
+
_host_index=_host_index
|
|
392
|
+
)
|
|
393
|
+
|
|
394
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
395
|
+
'200': "ApiKeyListResponse",
|
|
396
|
+
'401': "ErrorResponse",
|
|
397
|
+
'403': "ErrorResponse",
|
|
398
|
+
}
|
|
399
|
+
response_data = self.api_client.call_api(
|
|
400
|
+
*_param,
|
|
401
|
+
_request_timeout=_request_timeout
|
|
402
|
+
)
|
|
403
|
+
response_data.read()
|
|
404
|
+
return self.api_client.response_deserialize(
|
|
405
|
+
response_data=response_data,
|
|
406
|
+
response_types_map=_response_types_map,
|
|
407
|
+
).data
|
|
408
|
+
|
|
409
|
+
|
|
410
|
+
@validate_call
|
|
411
|
+
def list_api_keys_with_http_info(
|
|
412
|
+
self,
|
|
413
|
+
_request_timeout: Union[
|
|
414
|
+
None,
|
|
415
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
416
|
+
Tuple[
|
|
417
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
418
|
+
Annotated[StrictFloat, Field(gt=0)]
|
|
419
|
+
]
|
|
420
|
+
] = None,
|
|
421
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
422
|
+
_content_type: Optional[StrictStr] = None,
|
|
423
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
424
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
425
|
+
) -> ApiResponse[ApiKeyListResponse]:
|
|
426
|
+
"""List API keys
|
|
427
|
+
|
|
428
|
+
|
|
429
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
430
|
+
number provided, it will be total request
|
|
431
|
+
timeout. It can also be a pair (tuple) of
|
|
432
|
+
(connection, read) timeouts.
|
|
433
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
434
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
435
|
+
request; this effectively ignores the
|
|
436
|
+
authentication in the spec for a single request.
|
|
437
|
+
:type _request_auth: dict, optional
|
|
438
|
+
:param _content_type: force content-type for the request.
|
|
439
|
+
:type _content_type: str, Optional
|
|
440
|
+
:param _headers: set to override the headers for a single
|
|
441
|
+
request; this effectively ignores the headers
|
|
442
|
+
in the spec for a single request.
|
|
443
|
+
:type _headers: dict, optional
|
|
444
|
+
:param _host_index: set to override the host_index for a single
|
|
445
|
+
request; this effectively ignores the host_index
|
|
446
|
+
in the spec for a single request.
|
|
447
|
+
:type _host_index: int, optional
|
|
448
|
+
:return: Returns the result object.
|
|
449
|
+
""" # noqa: E501
|
|
450
|
+
|
|
451
|
+
_param = self._list_api_keys_serialize(
|
|
452
|
+
_request_auth=_request_auth,
|
|
453
|
+
_content_type=_content_type,
|
|
454
|
+
_headers=_headers,
|
|
455
|
+
_host_index=_host_index
|
|
456
|
+
)
|
|
457
|
+
|
|
458
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
459
|
+
'200': "ApiKeyListResponse",
|
|
460
|
+
'401': "ErrorResponse",
|
|
461
|
+
'403': "ErrorResponse",
|
|
462
|
+
}
|
|
463
|
+
response_data = self.api_client.call_api(
|
|
464
|
+
*_param,
|
|
465
|
+
_request_timeout=_request_timeout
|
|
466
|
+
)
|
|
467
|
+
response_data.read()
|
|
468
|
+
return self.api_client.response_deserialize(
|
|
469
|
+
response_data=response_data,
|
|
470
|
+
response_types_map=_response_types_map,
|
|
471
|
+
)
|
|
472
|
+
|
|
473
|
+
|
|
474
|
+
@validate_call
|
|
475
|
+
def list_api_keys_without_preload_content(
|
|
476
|
+
self,
|
|
477
|
+
_request_timeout: Union[
|
|
478
|
+
None,
|
|
479
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
480
|
+
Tuple[
|
|
481
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
482
|
+
Annotated[StrictFloat, Field(gt=0)]
|
|
483
|
+
]
|
|
484
|
+
] = None,
|
|
485
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
486
|
+
_content_type: Optional[StrictStr] = None,
|
|
487
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
488
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
489
|
+
) -> RESTResponseType:
|
|
490
|
+
"""List API keys
|
|
491
|
+
|
|
492
|
+
|
|
493
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
494
|
+
number provided, it will be total request
|
|
495
|
+
timeout. It can also be a pair (tuple) of
|
|
496
|
+
(connection, read) timeouts.
|
|
497
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
498
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
499
|
+
request; this effectively ignores the
|
|
500
|
+
authentication in the spec for a single request.
|
|
501
|
+
:type _request_auth: dict, optional
|
|
502
|
+
:param _content_type: force content-type for the request.
|
|
503
|
+
:type _content_type: str, Optional
|
|
504
|
+
:param _headers: set to override the headers for a single
|
|
505
|
+
request; this effectively ignores the headers
|
|
506
|
+
in the spec for a single request.
|
|
507
|
+
:type _headers: dict, optional
|
|
508
|
+
:param _host_index: set to override the host_index for a single
|
|
509
|
+
request; this effectively ignores the host_index
|
|
510
|
+
in the spec for a single request.
|
|
511
|
+
:type _host_index: int, optional
|
|
512
|
+
:return: Returns the result object.
|
|
513
|
+
""" # noqa: E501
|
|
514
|
+
|
|
515
|
+
_param = self._list_api_keys_serialize(
|
|
516
|
+
_request_auth=_request_auth,
|
|
517
|
+
_content_type=_content_type,
|
|
518
|
+
_headers=_headers,
|
|
519
|
+
_host_index=_host_index
|
|
520
|
+
)
|
|
521
|
+
|
|
522
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
523
|
+
'200': "ApiKeyListResponse",
|
|
524
|
+
'401': "ErrorResponse",
|
|
525
|
+
'403': "ErrorResponse",
|
|
526
|
+
}
|
|
527
|
+
response_data = self.api_client.call_api(
|
|
528
|
+
*_param,
|
|
529
|
+
_request_timeout=_request_timeout
|
|
530
|
+
)
|
|
531
|
+
return response_data.response
|
|
532
|
+
|
|
533
|
+
|
|
534
|
+
def _list_api_keys_serialize(
|
|
535
|
+
self,
|
|
536
|
+
_request_auth,
|
|
537
|
+
_content_type,
|
|
538
|
+
_headers,
|
|
539
|
+
_host_index,
|
|
540
|
+
) -> RequestSerialized:
|
|
541
|
+
|
|
542
|
+
_host = None
|
|
543
|
+
|
|
544
|
+
_collection_formats: Dict[str, str] = {
|
|
545
|
+
}
|
|
546
|
+
|
|
547
|
+
_path_params: Dict[str, str] = {}
|
|
548
|
+
_query_params: List[Tuple[str, str]] = []
|
|
549
|
+
_header_params: Dict[str, Optional[str]] = _headers or {}
|
|
550
|
+
_form_params: List[Tuple[str, str]] = []
|
|
551
|
+
_files: Dict[
|
|
552
|
+
str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
|
|
553
|
+
] = {}
|
|
554
|
+
_body_params: Optional[bytes] = None
|
|
555
|
+
|
|
556
|
+
# process the path parameters
|
|
557
|
+
# process the query parameters
|
|
558
|
+
# process the header parameters
|
|
559
|
+
# process the form parameters
|
|
560
|
+
# process the body parameter
|
|
561
|
+
|
|
562
|
+
|
|
563
|
+
# set the HTTP header `Accept`
|
|
564
|
+
if 'Accept' not in _header_params:
|
|
565
|
+
_header_params['Accept'] = self.api_client.select_header_accept(
|
|
566
|
+
[
|
|
567
|
+
'application/json'
|
|
568
|
+
]
|
|
569
|
+
)
|
|
570
|
+
|
|
571
|
+
|
|
572
|
+
# authentication setting
|
|
573
|
+
_auth_settings: List[str] = [
|
|
574
|
+
'bearerAuth'
|
|
575
|
+
]
|
|
576
|
+
|
|
577
|
+
return self.api_client.param_serialize(
|
|
578
|
+
method='GET',
|
|
579
|
+
resource_path='/api/v1/api-keys',
|
|
580
|
+
path_params=_path_params,
|
|
581
|
+
query_params=_query_params,
|
|
582
|
+
header_params=_header_params,
|
|
583
|
+
body=_body_params,
|
|
584
|
+
post_params=_form_params,
|
|
585
|
+
files=_files,
|
|
586
|
+
auth_settings=_auth_settings,
|
|
587
|
+
collection_formats=_collection_formats,
|
|
588
|
+
_host=_host,
|
|
589
|
+
_request_auth=_request_auth
|
|
590
|
+
)
|
|
591
|
+
|
|
592
|
+
|
|
593
|
+
|
|
594
|
+
|
|
595
|
+
@validate_call
|
|
596
|
+
def revoke_api_key(
|
|
597
|
+
self,
|
|
598
|
+
id: StrictStr,
|
|
599
|
+
idempotency_key: Annotated[Optional[Annotated[str, Field(min_length=1, strict=True, max_length=255)]], Field(description="Optional key for safe retries of mutating operations.")] = None,
|
|
600
|
+
_request_timeout: Union[
|
|
601
|
+
None,
|
|
602
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
603
|
+
Tuple[
|
|
604
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
605
|
+
Annotated[StrictFloat, Field(gt=0)]
|
|
606
|
+
]
|
|
607
|
+
] = None,
|
|
608
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
609
|
+
_content_type: Optional[StrictStr] = None,
|
|
610
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
611
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
612
|
+
) -> OkResponse:
|
|
613
|
+
"""Revoke API key
|
|
614
|
+
|
|
615
|
+
|
|
616
|
+
:param id: (required)
|
|
617
|
+
:type id: str
|
|
618
|
+
:param idempotency_key: Optional key for safe retries of mutating operations.
|
|
619
|
+
:type idempotency_key: str
|
|
620
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
621
|
+
number provided, it will be total request
|
|
622
|
+
timeout. It can also be a pair (tuple) of
|
|
623
|
+
(connection, read) timeouts.
|
|
624
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
625
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
626
|
+
request; this effectively ignores the
|
|
627
|
+
authentication in the spec for a single request.
|
|
628
|
+
:type _request_auth: dict, optional
|
|
629
|
+
:param _content_type: force content-type for the request.
|
|
630
|
+
:type _content_type: str, Optional
|
|
631
|
+
:param _headers: set to override the headers for a single
|
|
632
|
+
request; this effectively ignores the headers
|
|
633
|
+
in the spec for a single request.
|
|
634
|
+
:type _headers: dict, optional
|
|
635
|
+
:param _host_index: set to override the host_index for a single
|
|
636
|
+
request; this effectively ignores the host_index
|
|
637
|
+
in the spec for a single request.
|
|
638
|
+
:type _host_index: int, optional
|
|
639
|
+
:return: Returns the result object.
|
|
640
|
+
""" # noqa: E501
|
|
641
|
+
|
|
642
|
+
_param = self._revoke_api_key_serialize(
|
|
643
|
+
id=id,
|
|
644
|
+
idempotency_key=idempotency_key,
|
|
645
|
+
_request_auth=_request_auth,
|
|
646
|
+
_content_type=_content_type,
|
|
647
|
+
_headers=_headers,
|
|
648
|
+
_host_index=_host_index
|
|
649
|
+
)
|
|
650
|
+
|
|
651
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
652
|
+
'200': "OkResponse",
|
|
653
|
+
'401': "ErrorResponse",
|
|
654
|
+
'403': "ErrorResponse",
|
|
655
|
+
'404': "ErrorResponse",
|
|
656
|
+
'409': "ErrorResponse",
|
|
657
|
+
}
|
|
658
|
+
response_data = self.api_client.call_api(
|
|
659
|
+
*_param,
|
|
660
|
+
_request_timeout=_request_timeout
|
|
661
|
+
)
|
|
662
|
+
response_data.read()
|
|
663
|
+
return self.api_client.response_deserialize(
|
|
664
|
+
response_data=response_data,
|
|
665
|
+
response_types_map=_response_types_map,
|
|
666
|
+
).data
|
|
667
|
+
|
|
668
|
+
|
|
669
|
+
@validate_call
|
|
670
|
+
def revoke_api_key_with_http_info(
|
|
671
|
+
self,
|
|
672
|
+
id: StrictStr,
|
|
673
|
+
idempotency_key: Annotated[Optional[Annotated[str, Field(min_length=1, strict=True, max_length=255)]], Field(description="Optional key for safe retries of mutating operations.")] = None,
|
|
674
|
+
_request_timeout: Union[
|
|
675
|
+
None,
|
|
676
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
677
|
+
Tuple[
|
|
678
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
679
|
+
Annotated[StrictFloat, Field(gt=0)]
|
|
680
|
+
]
|
|
681
|
+
] = None,
|
|
682
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
683
|
+
_content_type: Optional[StrictStr] = None,
|
|
684
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
685
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
686
|
+
) -> ApiResponse[OkResponse]:
|
|
687
|
+
"""Revoke API key
|
|
688
|
+
|
|
689
|
+
|
|
690
|
+
:param id: (required)
|
|
691
|
+
:type id: str
|
|
692
|
+
:param idempotency_key: Optional key for safe retries of mutating operations.
|
|
693
|
+
:type idempotency_key: str
|
|
694
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
695
|
+
number provided, it will be total request
|
|
696
|
+
timeout. It can also be a pair (tuple) of
|
|
697
|
+
(connection, read) timeouts.
|
|
698
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
699
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
700
|
+
request; this effectively ignores the
|
|
701
|
+
authentication in the spec for a single request.
|
|
702
|
+
:type _request_auth: dict, optional
|
|
703
|
+
:param _content_type: force content-type for the request.
|
|
704
|
+
:type _content_type: str, Optional
|
|
705
|
+
:param _headers: set to override the headers for a single
|
|
706
|
+
request; this effectively ignores the headers
|
|
707
|
+
in the spec for a single request.
|
|
708
|
+
:type _headers: dict, optional
|
|
709
|
+
:param _host_index: set to override the host_index for a single
|
|
710
|
+
request; this effectively ignores the host_index
|
|
711
|
+
in the spec for a single request.
|
|
712
|
+
:type _host_index: int, optional
|
|
713
|
+
:return: Returns the result object.
|
|
714
|
+
""" # noqa: E501
|
|
715
|
+
|
|
716
|
+
_param = self._revoke_api_key_serialize(
|
|
717
|
+
id=id,
|
|
718
|
+
idempotency_key=idempotency_key,
|
|
719
|
+
_request_auth=_request_auth,
|
|
720
|
+
_content_type=_content_type,
|
|
721
|
+
_headers=_headers,
|
|
722
|
+
_host_index=_host_index
|
|
723
|
+
)
|
|
724
|
+
|
|
725
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
726
|
+
'200': "OkResponse",
|
|
727
|
+
'401': "ErrorResponse",
|
|
728
|
+
'403': "ErrorResponse",
|
|
729
|
+
'404': "ErrorResponse",
|
|
730
|
+
'409': "ErrorResponse",
|
|
731
|
+
}
|
|
732
|
+
response_data = self.api_client.call_api(
|
|
733
|
+
*_param,
|
|
734
|
+
_request_timeout=_request_timeout
|
|
735
|
+
)
|
|
736
|
+
response_data.read()
|
|
737
|
+
return self.api_client.response_deserialize(
|
|
738
|
+
response_data=response_data,
|
|
739
|
+
response_types_map=_response_types_map,
|
|
740
|
+
)
|
|
741
|
+
|
|
742
|
+
|
|
743
|
+
@validate_call
|
|
744
|
+
def revoke_api_key_without_preload_content(
|
|
745
|
+
self,
|
|
746
|
+
id: StrictStr,
|
|
747
|
+
idempotency_key: Annotated[Optional[Annotated[str, Field(min_length=1, strict=True, max_length=255)]], Field(description="Optional key for safe retries of mutating operations.")] = None,
|
|
748
|
+
_request_timeout: Union[
|
|
749
|
+
None,
|
|
750
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
751
|
+
Tuple[
|
|
752
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
753
|
+
Annotated[StrictFloat, Field(gt=0)]
|
|
754
|
+
]
|
|
755
|
+
] = None,
|
|
756
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
757
|
+
_content_type: Optional[StrictStr] = None,
|
|
758
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
759
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
760
|
+
) -> RESTResponseType:
|
|
761
|
+
"""Revoke API key
|
|
762
|
+
|
|
763
|
+
|
|
764
|
+
:param id: (required)
|
|
765
|
+
:type id: str
|
|
766
|
+
:param idempotency_key: Optional key for safe retries of mutating operations.
|
|
767
|
+
:type idempotency_key: str
|
|
768
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
769
|
+
number provided, it will be total request
|
|
770
|
+
timeout. It can also be a pair (tuple) of
|
|
771
|
+
(connection, read) timeouts.
|
|
772
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
773
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
774
|
+
request; this effectively ignores the
|
|
775
|
+
authentication in the spec for a single request.
|
|
776
|
+
:type _request_auth: dict, optional
|
|
777
|
+
:param _content_type: force content-type for the request.
|
|
778
|
+
:type _content_type: str, Optional
|
|
779
|
+
:param _headers: set to override the headers for a single
|
|
780
|
+
request; this effectively ignores the headers
|
|
781
|
+
in the spec for a single request.
|
|
782
|
+
:type _headers: dict, optional
|
|
783
|
+
:param _host_index: set to override the host_index for a single
|
|
784
|
+
request; this effectively ignores the host_index
|
|
785
|
+
in the spec for a single request.
|
|
786
|
+
:type _host_index: int, optional
|
|
787
|
+
:return: Returns the result object.
|
|
788
|
+
""" # noqa: E501
|
|
789
|
+
|
|
790
|
+
_param = self._revoke_api_key_serialize(
|
|
791
|
+
id=id,
|
|
792
|
+
idempotency_key=idempotency_key,
|
|
793
|
+
_request_auth=_request_auth,
|
|
794
|
+
_content_type=_content_type,
|
|
795
|
+
_headers=_headers,
|
|
796
|
+
_host_index=_host_index
|
|
797
|
+
)
|
|
798
|
+
|
|
799
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
800
|
+
'200': "OkResponse",
|
|
801
|
+
'401': "ErrorResponse",
|
|
802
|
+
'403': "ErrorResponse",
|
|
803
|
+
'404': "ErrorResponse",
|
|
804
|
+
'409': "ErrorResponse",
|
|
805
|
+
}
|
|
806
|
+
response_data = self.api_client.call_api(
|
|
807
|
+
*_param,
|
|
808
|
+
_request_timeout=_request_timeout
|
|
809
|
+
)
|
|
810
|
+
return response_data.response
|
|
811
|
+
|
|
812
|
+
|
|
813
|
+
def _revoke_api_key_serialize(
|
|
814
|
+
self,
|
|
815
|
+
id,
|
|
816
|
+
idempotency_key,
|
|
817
|
+
_request_auth,
|
|
818
|
+
_content_type,
|
|
819
|
+
_headers,
|
|
820
|
+
_host_index,
|
|
821
|
+
) -> RequestSerialized:
|
|
822
|
+
|
|
823
|
+
_host = None
|
|
824
|
+
|
|
825
|
+
_collection_formats: Dict[str, str] = {
|
|
826
|
+
}
|
|
827
|
+
|
|
828
|
+
_path_params: Dict[str, str] = {}
|
|
829
|
+
_query_params: List[Tuple[str, str]] = []
|
|
830
|
+
_header_params: Dict[str, Optional[str]] = _headers or {}
|
|
831
|
+
_form_params: List[Tuple[str, str]] = []
|
|
832
|
+
_files: Dict[
|
|
833
|
+
str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
|
|
834
|
+
] = {}
|
|
835
|
+
_body_params: Optional[bytes] = None
|
|
836
|
+
|
|
837
|
+
# process the path parameters
|
|
838
|
+
if id is not None:
|
|
839
|
+
_path_params['id'] = id
|
|
840
|
+
# process the query parameters
|
|
841
|
+
# process the header parameters
|
|
842
|
+
if idempotency_key is not None:
|
|
843
|
+
_header_params['Idempotency-Key'] = idempotency_key
|
|
844
|
+
# process the form parameters
|
|
845
|
+
# process the body parameter
|
|
846
|
+
|
|
847
|
+
|
|
848
|
+
# set the HTTP header `Accept`
|
|
849
|
+
if 'Accept' not in _header_params:
|
|
850
|
+
_header_params['Accept'] = self.api_client.select_header_accept(
|
|
851
|
+
[
|
|
852
|
+
'application/json'
|
|
853
|
+
]
|
|
854
|
+
)
|
|
855
|
+
|
|
856
|
+
|
|
857
|
+
# authentication setting
|
|
858
|
+
_auth_settings: List[str] = [
|
|
859
|
+
'bearerAuth'
|
|
860
|
+
]
|
|
861
|
+
|
|
862
|
+
return self.api_client.param_serialize(
|
|
863
|
+
method='POST',
|
|
864
|
+
resource_path='/api/v1/api-keys/{id}/revoke',
|
|
865
|
+
path_params=_path_params,
|
|
866
|
+
query_params=_query_params,
|
|
867
|
+
header_params=_header_params,
|
|
868
|
+
body=_body_params,
|
|
869
|
+
post_params=_form_params,
|
|
870
|
+
files=_files,
|
|
871
|
+
auth_settings=_auth_settings,
|
|
872
|
+
collection_formats=_collection_formats,
|
|
873
|
+
_host=_host,
|
|
874
|
+
_request_auth=_request_auth
|
|
875
|
+
)
|
|
876
|
+
|
|
877
|
+
|
|
878
|
+
|
|
879
|
+
|
|
880
|
+
@validate_call
|
|
881
|
+
def rotate_api_key(
|
|
882
|
+
self,
|
|
883
|
+
id: StrictStr,
|
|
884
|
+
idempotency_key: Annotated[Optional[Annotated[str, Field(min_length=1, strict=True, max_length=255)]], Field(description="Optional key for safe retries of mutating operations.")] = None,
|
|
885
|
+
_request_timeout: Union[
|
|
886
|
+
None,
|
|
887
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
888
|
+
Tuple[
|
|
889
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
890
|
+
Annotated[StrictFloat, Field(gt=0)]
|
|
891
|
+
]
|
|
892
|
+
] = None,
|
|
893
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
894
|
+
_content_type: Optional[StrictStr] = None,
|
|
895
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
896
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
897
|
+
) -> ApiKeyCreatedResponse:
|
|
898
|
+
"""Rotate API key (creates new key and revokes old key)
|
|
899
|
+
|
|
900
|
+
|
|
901
|
+
:param id: (required)
|
|
902
|
+
:type id: str
|
|
903
|
+
:param idempotency_key: Optional key for safe retries of mutating operations.
|
|
904
|
+
:type idempotency_key: str
|
|
905
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
906
|
+
number provided, it will be total request
|
|
907
|
+
timeout. It can also be a pair (tuple) of
|
|
908
|
+
(connection, read) timeouts.
|
|
909
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
910
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
911
|
+
request; this effectively ignores the
|
|
912
|
+
authentication in the spec for a single request.
|
|
913
|
+
:type _request_auth: dict, optional
|
|
914
|
+
:param _content_type: force content-type for the request.
|
|
915
|
+
:type _content_type: str, Optional
|
|
916
|
+
:param _headers: set to override the headers for a single
|
|
917
|
+
request; this effectively ignores the headers
|
|
918
|
+
in the spec for a single request.
|
|
919
|
+
:type _headers: dict, optional
|
|
920
|
+
:param _host_index: set to override the host_index for a single
|
|
921
|
+
request; this effectively ignores the host_index
|
|
922
|
+
in the spec for a single request.
|
|
923
|
+
:type _host_index: int, optional
|
|
924
|
+
:return: Returns the result object.
|
|
925
|
+
""" # noqa: E501
|
|
926
|
+
|
|
927
|
+
_param = self._rotate_api_key_serialize(
|
|
928
|
+
id=id,
|
|
929
|
+
idempotency_key=idempotency_key,
|
|
930
|
+
_request_auth=_request_auth,
|
|
931
|
+
_content_type=_content_type,
|
|
932
|
+
_headers=_headers,
|
|
933
|
+
_host_index=_host_index
|
|
934
|
+
)
|
|
935
|
+
|
|
936
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
937
|
+
'201': "ApiKeyCreatedResponse",
|
|
938
|
+
'401': "ErrorResponse",
|
|
939
|
+
'403': "ErrorResponse",
|
|
940
|
+
'404': "ErrorResponse",
|
|
941
|
+
'409': "ErrorResponse",
|
|
942
|
+
}
|
|
943
|
+
response_data = self.api_client.call_api(
|
|
944
|
+
*_param,
|
|
945
|
+
_request_timeout=_request_timeout
|
|
946
|
+
)
|
|
947
|
+
response_data.read()
|
|
948
|
+
return self.api_client.response_deserialize(
|
|
949
|
+
response_data=response_data,
|
|
950
|
+
response_types_map=_response_types_map,
|
|
951
|
+
).data
|
|
952
|
+
|
|
953
|
+
|
|
954
|
+
@validate_call
|
|
955
|
+
def rotate_api_key_with_http_info(
|
|
956
|
+
self,
|
|
957
|
+
id: StrictStr,
|
|
958
|
+
idempotency_key: Annotated[Optional[Annotated[str, Field(min_length=1, strict=True, max_length=255)]], Field(description="Optional key for safe retries of mutating operations.")] = None,
|
|
959
|
+
_request_timeout: Union[
|
|
960
|
+
None,
|
|
961
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
962
|
+
Tuple[
|
|
963
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
964
|
+
Annotated[StrictFloat, Field(gt=0)]
|
|
965
|
+
]
|
|
966
|
+
] = None,
|
|
967
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
968
|
+
_content_type: Optional[StrictStr] = None,
|
|
969
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
970
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
971
|
+
) -> ApiResponse[ApiKeyCreatedResponse]:
|
|
972
|
+
"""Rotate API key (creates new key and revokes old key)
|
|
973
|
+
|
|
974
|
+
|
|
975
|
+
:param id: (required)
|
|
976
|
+
:type id: str
|
|
977
|
+
:param idempotency_key: Optional key for safe retries of mutating operations.
|
|
978
|
+
:type idempotency_key: str
|
|
979
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
980
|
+
number provided, it will be total request
|
|
981
|
+
timeout. It can also be a pair (tuple) of
|
|
982
|
+
(connection, read) timeouts.
|
|
983
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
984
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
985
|
+
request; this effectively ignores the
|
|
986
|
+
authentication in the spec for a single request.
|
|
987
|
+
:type _request_auth: dict, optional
|
|
988
|
+
:param _content_type: force content-type for the request.
|
|
989
|
+
:type _content_type: str, Optional
|
|
990
|
+
:param _headers: set to override the headers for a single
|
|
991
|
+
request; this effectively ignores the headers
|
|
992
|
+
in the spec for a single request.
|
|
993
|
+
:type _headers: dict, optional
|
|
994
|
+
:param _host_index: set to override the host_index for a single
|
|
995
|
+
request; this effectively ignores the host_index
|
|
996
|
+
in the spec for a single request.
|
|
997
|
+
:type _host_index: int, optional
|
|
998
|
+
:return: Returns the result object.
|
|
999
|
+
""" # noqa: E501
|
|
1000
|
+
|
|
1001
|
+
_param = self._rotate_api_key_serialize(
|
|
1002
|
+
id=id,
|
|
1003
|
+
idempotency_key=idempotency_key,
|
|
1004
|
+
_request_auth=_request_auth,
|
|
1005
|
+
_content_type=_content_type,
|
|
1006
|
+
_headers=_headers,
|
|
1007
|
+
_host_index=_host_index
|
|
1008
|
+
)
|
|
1009
|
+
|
|
1010
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
1011
|
+
'201': "ApiKeyCreatedResponse",
|
|
1012
|
+
'401': "ErrorResponse",
|
|
1013
|
+
'403': "ErrorResponse",
|
|
1014
|
+
'404': "ErrorResponse",
|
|
1015
|
+
'409': "ErrorResponse",
|
|
1016
|
+
}
|
|
1017
|
+
response_data = self.api_client.call_api(
|
|
1018
|
+
*_param,
|
|
1019
|
+
_request_timeout=_request_timeout
|
|
1020
|
+
)
|
|
1021
|
+
response_data.read()
|
|
1022
|
+
return self.api_client.response_deserialize(
|
|
1023
|
+
response_data=response_data,
|
|
1024
|
+
response_types_map=_response_types_map,
|
|
1025
|
+
)
|
|
1026
|
+
|
|
1027
|
+
|
|
1028
|
+
@validate_call
|
|
1029
|
+
def rotate_api_key_without_preload_content(
|
|
1030
|
+
self,
|
|
1031
|
+
id: StrictStr,
|
|
1032
|
+
idempotency_key: Annotated[Optional[Annotated[str, Field(min_length=1, strict=True, max_length=255)]], Field(description="Optional key for safe retries of mutating operations.")] = None,
|
|
1033
|
+
_request_timeout: Union[
|
|
1034
|
+
None,
|
|
1035
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
1036
|
+
Tuple[
|
|
1037
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
1038
|
+
Annotated[StrictFloat, Field(gt=0)]
|
|
1039
|
+
]
|
|
1040
|
+
] = None,
|
|
1041
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
1042
|
+
_content_type: Optional[StrictStr] = None,
|
|
1043
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
1044
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
1045
|
+
) -> RESTResponseType:
|
|
1046
|
+
"""Rotate API key (creates new key and revokes old key)
|
|
1047
|
+
|
|
1048
|
+
|
|
1049
|
+
:param id: (required)
|
|
1050
|
+
:type id: str
|
|
1051
|
+
:param idempotency_key: Optional key for safe retries of mutating operations.
|
|
1052
|
+
:type idempotency_key: str
|
|
1053
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
1054
|
+
number provided, it will be total request
|
|
1055
|
+
timeout. It can also be a pair (tuple) of
|
|
1056
|
+
(connection, read) timeouts.
|
|
1057
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
1058
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
1059
|
+
request; this effectively ignores the
|
|
1060
|
+
authentication in the spec for a single request.
|
|
1061
|
+
:type _request_auth: dict, optional
|
|
1062
|
+
:param _content_type: force content-type for the request.
|
|
1063
|
+
:type _content_type: str, Optional
|
|
1064
|
+
:param _headers: set to override the headers for a single
|
|
1065
|
+
request; this effectively ignores the headers
|
|
1066
|
+
in the spec for a single request.
|
|
1067
|
+
:type _headers: dict, optional
|
|
1068
|
+
:param _host_index: set to override the host_index for a single
|
|
1069
|
+
request; this effectively ignores the host_index
|
|
1070
|
+
in the spec for a single request.
|
|
1071
|
+
:type _host_index: int, optional
|
|
1072
|
+
:return: Returns the result object.
|
|
1073
|
+
""" # noqa: E501
|
|
1074
|
+
|
|
1075
|
+
_param = self._rotate_api_key_serialize(
|
|
1076
|
+
id=id,
|
|
1077
|
+
idempotency_key=idempotency_key,
|
|
1078
|
+
_request_auth=_request_auth,
|
|
1079
|
+
_content_type=_content_type,
|
|
1080
|
+
_headers=_headers,
|
|
1081
|
+
_host_index=_host_index
|
|
1082
|
+
)
|
|
1083
|
+
|
|
1084
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
1085
|
+
'201': "ApiKeyCreatedResponse",
|
|
1086
|
+
'401': "ErrorResponse",
|
|
1087
|
+
'403': "ErrorResponse",
|
|
1088
|
+
'404': "ErrorResponse",
|
|
1089
|
+
'409': "ErrorResponse",
|
|
1090
|
+
}
|
|
1091
|
+
response_data = self.api_client.call_api(
|
|
1092
|
+
*_param,
|
|
1093
|
+
_request_timeout=_request_timeout
|
|
1094
|
+
)
|
|
1095
|
+
return response_data.response
|
|
1096
|
+
|
|
1097
|
+
|
|
1098
|
+
def _rotate_api_key_serialize(
|
|
1099
|
+
self,
|
|
1100
|
+
id,
|
|
1101
|
+
idempotency_key,
|
|
1102
|
+
_request_auth,
|
|
1103
|
+
_content_type,
|
|
1104
|
+
_headers,
|
|
1105
|
+
_host_index,
|
|
1106
|
+
) -> RequestSerialized:
|
|
1107
|
+
|
|
1108
|
+
_host = None
|
|
1109
|
+
|
|
1110
|
+
_collection_formats: Dict[str, str] = {
|
|
1111
|
+
}
|
|
1112
|
+
|
|
1113
|
+
_path_params: Dict[str, str] = {}
|
|
1114
|
+
_query_params: List[Tuple[str, str]] = []
|
|
1115
|
+
_header_params: Dict[str, Optional[str]] = _headers or {}
|
|
1116
|
+
_form_params: List[Tuple[str, str]] = []
|
|
1117
|
+
_files: Dict[
|
|
1118
|
+
str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
|
|
1119
|
+
] = {}
|
|
1120
|
+
_body_params: Optional[bytes] = None
|
|
1121
|
+
|
|
1122
|
+
# process the path parameters
|
|
1123
|
+
if id is not None:
|
|
1124
|
+
_path_params['id'] = id
|
|
1125
|
+
# process the query parameters
|
|
1126
|
+
# process the header parameters
|
|
1127
|
+
if idempotency_key is not None:
|
|
1128
|
+
_header_params['Idempotency-Key'] = idempotency_key
|
|
1129
|
+
# process the form parameters
|
|
1130
|
+
# process the body parameter
|
|
1131
|
+
|
|
1132
|
+
|
|
1133
|
+
# set the HTTP header `Accept`
|
|
1134
|
+
if 'Accept' not in _header_params:
|
|
1135
|
+
_header_params['Accept'] = self.api_client.select_header_accept(
|
|
1136
|
+
[
|
|
1137
|
+
'application/json'
|
|
1138
|
+
]
|
|
1139
|
+
)
|
|
1140
|
+
|
|
1141
|
+
|
|
1142
|
+
# authentication setting
|
|
1143
|
+
_auth_settings: List[str] = [
|
|
1144
|
+
'bearerAuth'
|
|
1145
|
+
]
|
|
1146
|
+
|
|
1147
|
+
return self.api_client.param_serialize(
|
|
1148
|
+
method='POST',
|
|
1149
|
+
resource_path='/api/v1/api-keys/{id}/rotate',
|
|
1150
|
+
path_params=_path_params,
|
|
1151
|
+
query_params=_query_params,
|
|
1152
|
+
header_params=_header_params,
|
|
1153
|
+
body=_body_params,
|
|
1154
|
+
post_params=_form_params,
|
|
1155
|
+
files=_files,
|
|
1156
|
+
auth_settings=_auth_settings,
|
|
1157
|
+
collection_formats=_collection_formats,
|
|
1158
|
+
_host=_host,
|
|
1159
|
+
_request_auth=_request_auth
|
|
1160
|
+
)
|
|
1161
|
+
|
|
1162
|
+
|