Skip to content

Commit cf34e89

Browse files
Generate certificates
1 parent b7bc6f6 commit cf34e89

File tree

7 files changed

+571
-1
lines changed

7 files changed

+571
-1
lines changed

services/certificates/oas_commit

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0e64886dd0847341800d7191ed193b75413be998
1+
95de5cba3201a683657cb472d5fa30aa768f19cc

services/certificates/src/stackit/certificates/__init__.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,13 @@
2828
"ApiKeyError",
2929
"ApiAttributeError",
3030
"ApiException",
31+
"CertificatesQuota",
3132
"CreateCertificatePayload",
3233
"GetCertificateResponse",
34+
"GetQuotaResponse",
3335
"GoogleProtobufAny",
3436
"ListCertificatesResponse",
37+
"Quotas",
3538
"Status",
3639
]
3740

@@ -50,16 +53,23 @@
5053
from stackit.certificates.exceptions import OpenApiException as OpenApiException
5154

5255
# import models into sdk package
56+
from stackit.certificates.models.certificates_quota import (
57+
CertificatesQuota as CertificatesQuota,
58+
)
5359
from stackit.certificates.models.create_certificate_payload import (
5460
CreateCertificatePayload as CreateCertificatePayload,
5561
)
5662
from stackit.certificates.models.get_certificate_response import (
5763
GetCertificateResponse as GetCertificateResponse,
5864
)
65+
from stackit.certificates.models.get_quota_response import (
66+
GetQuotaResponse as GetQuotaResponse,
67+
)
5968
from stackit.certificates.models.google_protobuf_any import (
6069
GoogleProtobufAny as GoogleProtobufAny,
6170
)
6271
from stackit.certificates.models.list_certificates_response import (
6372
ListCertificatesResponse as ListCertificatesResponse,
6473
)
74+
from stackit.certificates.models.quotas import Quotas as Quotas
6575
from stackit.certificates.models.status import Status as Status

services/certificates/src/stackit/certificates/api/default_api.py

Lines changed: 254 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
CreateCertificatePayload,
2424
)
2525
from stackit.certificates.models.get_certificate_response import GetCertificateResponse
26+
from stackit.certificates.models.get_quota_response import GetQuotaResponse
2627
from stackit.certificates.models.list_certificates_response import (
2728
ListCertificatesResponse,
2829
)
@@ -857,6 +858,259 @@ def _get_certificate_serialize(
857858
_request_auth=_request_auth,
858859
)
859860

861+
@validate_call
862+
def get_quota(
863+
self,
864+
project_id: StrictStr,
865+
region: StrictStr,
866+
_request_timeout: Union[
867+
None,
868+
Annotated[StrictFloat, Field(gt=0)],
869+
Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
870+
] = None,
871+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
872+
_content_type: Optional[StrictStr] = None,
873+
_headers: Optional[Dict[StrictStr, Any]] = None,
874+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
875+
) -> GetQuotaResponse:
876+
"""Get the quota for TLS certificates in a project.
877+
878+
Retrieves the configured TLS certificate quota for the project. Limit can be changed via service request.
879+
880+
:param project_id: (required)
881+
:type project_id: str
882+
:param region: (required)
883+
:type region: str
884+
:param _request_timeout: timeout setting for this request. If one
885+
number provided, it will be total request
886+
timeout. It can also be a pair (tuple) of
887+
(connection, read) timeouts.
888+
:type _request_timeout: int, tuple(int, int), optional
889+
:param _request_auth: set to override the auth_settings for an a single
890+
request; this effectively ignores the
891+
authentication in the spec for a single request.
892+
:type _request_auth: dict, optional
893+
:param _content_type: force content-type for the request.
894+
:type _content_type: str, Optional
895+
:param _headers: set to override the headers for a single
896+
request; this effectively ignores the headers
897+
in the spec for a single request.
898+
:type _headers: dict, optional
899+
:param _host_index: set to override the host_index for a single
900+
request; this effectively ignores the host_index
901+
in the spec for a single request.
902+
:type _host_index: int, optional
903+
:return: Returns the result object.
904+
""" # noqa: E501
905+
906+
_param = self._get_quota_serialize(
907+
project_id=project_id,
908+
region=region,
909+
_request_auth=_request_auth,
910+
_content_type=_content_type,
911+
_headers=_headers,
912+
_host_index=_host_index,
913+
)
914+
915+
_response_types_map: Dict[str, Optional[str]] = {
916+
"200": "GetQuotaResponse",
917+
"400": None,
918+
"401": "str",
919+
"403": None,
920+
"500": None,
921+
}
922+
response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
923+
response_data.read()
924+
return self.api_client.response_deserialize(
925+
response_data=response_data,
926+
response_types_map=_response_types_map,
927+
).data
928+
929+
@validate_call
930+
def get_quota_with_http_info(
931+
self,
932+
project_id: StrictStr,
933+
region: StrictStr,
934+
_request_timeout: Union[
935+
None,
936+
Annotated[StrictFloat, Field(gt=0)],
937+
Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
938+
] = None,
939+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
940+
_content_type: Optional[StrictStr] = None,
941+
_headers: Optional[Dict[StrictStr, Any]] = None,
942+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
943+
) -> ApiResponse[GetQuotaResponse]:
944+
"""Get the quota for TLS certificates in a project.
945+
946+
Retrieves the configured TLS certificate quota for the project. Limit can be changed via service request.
947+
948+
:param project_id: (required)
949+
:type project_id: str
950+
:param region: (required)
951+
:type region: str
952+
:param _request_timeout: timeout setting for this request. If one
953+
number provided, it will be total request
954+
timeout. It can also be a pair (tuple) of
955+
(connection, read) timeouts.
956+
:type _request_timeout: int, tuple(int, int), optional
957+
:param _request_auth: set to override the auth_settings for an a single
958+
request; this effectively ignores the
959+
authentication in the spec for a single request.
960+
:type _request_auth: dict, optional
961+
:param _content_type: force content-type for the request.
962+
:type _content_type: str, Optional
963+
:param _headers: set to override the headers for a single
964+
request; this effectively ignores the headers
965+
in the spec for a single request.
966+
:type _headers: dict, optional
967+
:param _host_index: set to override the host_index for a single
968+
request; this effectively ignores the host_index
969+
in the spec for a single request.
970+
:type _host_index: int, optional
971+
:return: Returns the result object.
972+
""" # noqa: E501
973+
974+
_param = self._get_quota_serialize(
975+
project_id=project_id,
976+
region=region,
977+
_request_auth=_request_auth,
978+
_content_type=_content_type,
979+
_headers=_headers,
980+
_host_index=_host_index,
981+
)
982+
983+
_response_types_map: Dict[str, Optional[str]] = {
984+
"200": "GetQuotaResponse",
985+
"400": None,
986+
"401": "str",
987+
"403": None,
988+
"500": None,
989+
}
990+
response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
991+
response_data.read()
992+
return self.api_client.response_deserialize(
993+
response_data=response_data,
994+
response_types_map=_response_types_map,
995+
)
996+
997+
@validate_call
998+
def get_quota_without_preload_content(
999+
self,
1000+
project_id: StrictStr,
1001+
region: StrictStr,
1002+
_request_timeout: Union[
1003+
None,
1004+
Annotated[StrictFloat, Field(gt=0)],
1005+
Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
1006+
] = None,
1007+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
1008+
_content_type: Optional[StrictStr] = None,
1009+
_headers: Optional[Dict[StrictStr, Any]] = None,
1010+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1011+
) -> RESTResponseType:
1012+
"""Get the quota for TLS certificates in a project.
1013+
1014+
Retrieves the configured TLS certificate quota for the project. Limit can be changed via service request.
1015+
1016+
:param project_id: (required)
1017+
:type project_id: str
1018+
:param region: (required)
1019+
:type region: str
1020+
:param _request_timeout: timeout setting for this request. If one
1021+
number provided, it will be total request
1022+
timeout. It can also be a pair (tuple) of
1023+
(connection, read) timeouts.
1024+
:type _request_timeout: int, tuple(int, int), optional
1025+
:param _request_auth: set to override the auth_settings for an a single
1026+
request; this effectively ignores the
1027+
authentication in the spec for a single request.
1028+
:type _request_auth: dict, optional
1029+
:param _content_type: force content-type for the request.
1030+
:type _content_type: str, Optional
1031+
:param _headers: set to override the headers for a single
1032+
request; this effectively ignores the headers
1033+
in the spec for a single request.
1034+
:type _headers: dict, optional
1035+
:param _host_index: set to override the host_index for a single
1036+
request; this effectively ignores the host_index
1037+
in the spec for a single request.
1038+
:type _host_index: int, optional
1039+
:return: Returns the result object.
1040+
""" # noqa: E501
1041+
1042+
_param = self._get_quota_serialize(
1043+
project_id=project_id,
1044+
region=region,
1045+
_request_auth=_request_auth,
1046+
_content_type=_content_type,
1047+
_headers=_headers,
1048+
_host_index=_host_index,
1049+
)
1050+
1051+
_response_types_map: Dict[str, Optional[str]] = {
1052+
"200": "GetQuotaResponse",
1053+
"400": None,
1054+
"401": "str",
1055+
"403": None,
1056+
"500": None,
1057+
}
1058+
response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
1059+
return response_data.response
1060+
1061+
def _get_quota_serialize(
1062+
self,
1063+
project_id,
1064+
region,
1065+
_request_auth,
1066+
_content_type,
1067+
_headers,
1068+
_host_index,
1069+
) -> RequestSerialized:
1070+
1071+
_host = None
1072+
1073+
_collection_formats: Dict[str, str] = {}
1074+
1075+
_path_params: Dict[str, str] = {}
1076+
_query_params: List[Tuple[str, str]] = []
1077+
_header_params: Dict[str, Optional[str]] = _headers or {}
1078+
_form_params: List[Tuple[str, str]] = []
1079+
_files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {}
1080+
_body_params: Optional[bytes] = None
1081+
1082+
# process the path parameters
1083+
if project_id is not None:
1084+
_path_params["projectId"] = project_id
1085+
if region is not None:
1086+
_path_params["region"] = region
1087+
# process the query parameters
1088+
# process the header parameters
1089+
# process the form parameters
1090+
# process the body parameter
1091+
1092+
# set the HTTP header `Accept`
1093+
if "Accept" not in _header_params:
1094+
_header_params["Accept"] = self.api_client.select_header_accept(["application/json", "text/plain"])
1095+
1096+
# authentication setting
1097+
_auth_settings: List[str] = []
1098+
1099+
return self.api_client.param_serialize(
1100+
method="GET",
1101+
resource_path="/v2/projects/{projectId}/regions/{region}/quotas",
1102+
path_params=_path_params,
1103+
query_params=_query_params,
1104+
header_params=_header_params,
1105+
body=_body_params,
1106+
post_params=_form_params,
1107+
files=_files,
1108+
auth_settings=_auth_settings,
1109+
collection_formats=_collection_formats,
1110+
_host=_host,
1111+
_request_auth=_request_auth,
1112+
)
1113+
8601114
@validate_call
8611115
def list_certificates(
8621116
self,

services/certificates/src/stackit/certificates/models/__init__.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,15 @@
1313
""" # noqa: E501
1414

1515
# import models into model package
16+
from stackit.certificates.models.certificates_quota import CertificatesQuota
1617
from stackit.certificates.models.create_certificate_payload import (
1718
CreateCertificatePayload,
1819
)
1920
from stackit.certificates.models.get_certificate_response import GetCertificateResponse
21+
from stackit.certificates.models.get_quota_response import GetQuotaResponse
2022
from stackit.certificates.models.google_protobuf_any import GoogleProtobufAny
2123
from stackit.certificates.models.list_certificates_response import (
2224
ListCertificatesResponse,
2325
)
26+
from stackit.certificates.models.quotas import Quotas
2427
from stackit.certificates.models.status import Status

0 commit comments

Comments
 (0)