stackit-certificates 1.2.1__tar.gz → 1.3.0__tar.gz

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.
Files changed (24) hide show
  1. {stackit_certificates-1.2.1 → stackit_certificates-1.3.0}/PKG-INFO +1 -1
  2. {stackit_certificates-1.2.1 → stackit_certificates-1.3.0}/pyproject.toml +1 -1
  3. {stackit_certificates-1.2.1 → stackit_certificates-1.3.0}/src/stackit/certificates/__init__.py +10 -0
  4. {stackit_certificates-1.2.1 → stackit_certificates-1.3.0}/src/stackit/certificates/api/default_api.py +254 -0
  5. {stackit_certificates-1.2.1 → stackit_certificates-1.3.0}/src/stackit/certificates/models/__init__.py +3 -0
  6. stackit_certificates-1.3.0/src/stackit/certificates/models/certificates_quota.py +86 -0
  7. stackit_certificates-1.3.0/src/stackit/certificates/models/get_quota_response.py +125 -0
  8. stackit_certificates-1.3.0/src/stackit/certificates/models/quotas.py +92 -0
  9. {stackit_certificates-1.2.1 → stackit_certificates-1.3.0}/.gitignore +0 -0
  10. {stackit_certificates-1.2.1 → stackit_certificates-1.3.0}/LICENSE.md +0 -0
  11. {stackit_certificates-1.2.1 → stackit_certificates-1.3.0}/NOTICE.txt +0 -0
  12. {stackit_certificates-1.2.1 → stackit_certificates-1.3.0}/README.md +0 -0
  13. {stackit_certificates-1.2.1 → stackit_certificates-1.3.0}/src/stackit/certificates/api/__init__.py +0 -0
  14. {stackit_certificates-1.2.1 → stackit_certificates-1.3.0}/src/stackit/certificates/api_client.py +0 -0
  15. {stackit_certificates-1.2.1 → stackit_certificates-1.3.0}/src/stackit/certificates/api_response.py +0 -0
  16. {stackit_certificates-1.2.1 → stackit_certificates-1.3.0}/src/stackit/certificates/configuration.py +0 -0
  17. {stackit_certificates-1.2.1 → stackit_certificates-1.3.0}/src/stackit/certificates/exceptions.py +0 -0
  18. {stackit_certificates-1.2.1 → stackit_certificates-1.3.0}/src/stackit/certificates/models/create_certificate_payload.py +0 -0
  19. {stackit_certificates-1.2.1 → stackit_certificates-1.3.0}/src/stackit/certificates/models/get_certificate_response.py +0 -0
  20. {stackit_certificates-1.2.1 → stackit_certificates-1.3.0}/src/stackit/certificates/models/google_protobuf_any.py +0 -0
  21. {stackit_certificates-1.2.1 → stackit_certificates-1.3.0}/src/stackit/certificates/models/list_certificates_response.py +0 -0
  22. {stackit_certificates-1.2.1 → stackit_certificates-1.3.0}/src/stackit/certificates/models/status.py +0 -0
  23. {stackit_certificates-1.2.1 → stackit_certificates-1.3.0}/src/stackit/certificates/py.typed +0 -0
  24. {stackit_certificates-1.2.1 → stackit_certificates-1.3.0}/src/stackit/certificates/rest.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: stackit-certificates
3
- Version: 1.2.1
3
+ Version: 1.3.0
4
4
  Summary: Load Balancer Certificates API
5
5
  Project-URL: Homepage, https://github.com/stackitcloud/stackit-sdk-python
6
6
  Project-URL: Issues, https://github.com/stackitcloud/stackit-sdk-python/issues
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "stackit-certificates"
3
- version = "v1.2.1"
3
+ version = "v1.3.0"
4
4
  description = "Load Balancer Certificates API"
5
5
  authors = [{ name = "STACKIT Developer Tools", email = "developer-tools@stackit.cloud" }]
6
6
  requires-python = ">=3.9,<4.0"
@@ -28,10 +28,13 @@ __all__ = [
28
28
  "ApiKeyError",
29
29
  "ApiAttributeError",
30
30
  "ApiException",
31
+ "CertificatesQuota",
31
32
  "CreateCertificatePayload",
32
33
  "GetCertificateResponse",
34
+ "GetQuotaResponse",
33
35
  "GoogleProtobufAny",
34
36
  "ListCertificatesResponse",
37
+ "Quotas",
35
38
  "Status",
36
39
  ]
37
40
 
@@ -50,16 +53,23 @@ from stackit.certificates.exceptions import ApiValueError as ApiValueError
50
53
  from stackit.certificates.exceptions import OpenApiException as OpenApiException
51
54
 
52
55
  # import models into sdk package
56
+ from stackit.certificates.models.certificates_quota import (
57
+ CertificatesQuota as CertificatesQuota,
58
+ )
53
59
  from stackit.certificates.models.create_certificate_payload import (
54
60
  CreateCertificatePayload as CreateCertificatePayload,
55
61
  )
56
62
  from stackit.certificates.models.get_certificate_response import (
57
63
  GetCertificateResponse as GetCertificateResponse,
58
64
  )
65
+ from stackit.certificates.models.get_quota_response import (
66
+ GetQuotaResponse as GetQuotaResponse,
67
+ )
59
68
  from stackit.certificates.models.google_protobuf_any import (
60
69
  GoogleProtobufAny as GoogleProtobufAny,
61
70
  )
62
71
  from stackit.certificates.models.list_certificates_response import (
63
72
  ListCertificatesResponse as ListCertificatesResponse,
64
73
  )
74
+ from stackit.certificates.models.quotas import Quotas as Quotas
65
75
  from stackit.certificates.models.status import Status as Status
@@ -23,6 +23,7 @@ from stackit.certificates.models.create_certificate_payload import (
23
23
  CreateCertificatePayload,
24
24
  )
25
25
  from stackit.certificates.models.get_certificate_response import GetCertificateResponse
26
+ from stackit.certificates.models.get_quota_response import GetQuotaResponse
26
27
  from stackit.certificates.models.list_certificates_response import (
27
28
  ListCertificatesResponse,
28
29
  )
@@ -857,6 +858,259 @@ class DefaultApi:
857
858
  _request_auth=_request_auth,
858
859
  )
859
860
 
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
+
860
1114
  @validate_call
861
1115
  def list_certificates(
862
1116
  self,
@@ -13,12 +13,15 @@
13
13
  """ # noqa: E501
14
14
 
15
15
  # import models into model package
16
+ from stackit.certificates.models.certificates_quota import CertificatesQuota
16
17
  from stackit.certificates.models.create_certificate_payload import (
17
18
  CreateCertificatePayload,
18
19
  )
19
20
  from stackit.certificates.models.get_certificate_response import GetCertificateResponse
21
+ from stackit.certificates.models.get_quota_response import GetQuotaResponse
20
22
  from stackit.certificates.models.google_protobuf_any import GoogleProtobufAny
21
23
  from stackit.certificates.models.list_certificates_response import (
22
24
  ListCertificatesResponse,
23
25
  )
26
+ from stackit.certificates.models.quotas import Quotas
24
27
  from stackit.certificates.models.status import Status
@@ -0,0 +1,86 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ STACKIT Application Load Balancer Certificates API
5
+
6
+ This API offers the ability to store TLS certificates, which can be used by load balancing servers in STACKIT. They can be between consumer and load balancing server and/or between load balancing server and endpoint server.
7
+
8
+ The version of the OpenAPI document: 2.0.0
9
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
10
+
11
+ Do not edit the class manually.
12
+ """ # noqa: E501
13
+
14
+ from __future__ import annotations
15
+
16
+ import json
17
+ import pprint
18
+ from typing import Any, ClassVar, Dict, List, Optional, Set
19
+
20
+ from pydantic import BaseModel, ConfigDict, Field
21
+ from typing_extensions import Annotated, Self
22
+
23
+
24
+ class CertificatesQuota(BaseModel):
25
+ """
26
+ Certificates quotas holds the limits and usage for certificates resources
27
+ """ # noqa: E501
28
+
29
+ limit: Optional[Annotated[int, Field(le=1000000, strict=True, ge=-1)]] = Field(
30
+ default=None, description="The maximum number of TLS certificates in this project."
31
+ )
32
+ usage: Optional[Annotated[int, Field(le=1000000, strict=True, ge=-1)]] = Field(
33
+ default=None, description="The number of certificates that are currently existing in this project."
34
+ )
35
+ __properties: ClassVar[List[str]] = ["limit", "usage"]
36
+
37
+ model_config = ConfigDict(
38
+ populate_by_name=True,
39
+ validate_assignment=True,
40
+ protected_namespaces=(),
41
+ )
42
+
43
+ def to_str(self) -> str:
44
+ """Returns the string representation of the model using alias"""
45
+ return pprint.pformat(self.model_dump(by_alias=True))
46
+
47
+ def to_json(self) -> str:
48
+ """Returns the JSON representation of the model using alias"""
49
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
50
+ return json.dumps(self.to_dict())
51
+
52
+ @classmethod
53
+ def from_json(cls, json_str: str) -> Optional[Self]:
54
+ """Create an instance of CertificatesQuota from a JSON string"""
55
+ return cls.from_dict(json.loads(json_str))
56
+
57
+ def to_dict(self) -> Dict[str, Any]:
58
+ """Return the dictionary representation of the model using alias.
59
+
60
+ This has the following differences from calling pydantic's
61
+ `self.model_dump(by_alias=True)`:
62
+
63
+ * `None` is only added to the output dict for nullable fields that
64
+ were set at model initialization. Other fields with value `None`
65
+ are ignored.
66
+ """
67
+ excluded_fields: Set[str] = set([])
68
+
69
+ _dict = self.model_dump(
70
+ by_alias=True,
71
+ exclude=excluded_fields,
72
+ exclude_none=True,
73
+ )
74
+ return _dict
75
+
76
+ @classmethod
77
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
78
+ """Create an instance of CertificatesQuota from a dict"""
79
+ if obj is None:
80
+ return None
81
+
82
+ if not isinstance(obj, dict):
83
+ return cls.model_validate(obj)
84
+
85
+ _obj = cls.model_validate({"limit": obj.get("limit"), "usage": obj.get("usage")})
86
+ return _obj
@@ -0,0 +1,125 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ STACKIT Application Load Balancer Certificates API
5
+
6
+ This API offers the ability to store TLS certificates, which can be used by load balancing servers in STACKIT. They can be between consumer and load balancing server and/or between load balancing server and endpoint server.
7
+
8
+ The version of the OpenAPI document: 2.0.0
9
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
10
+
11
+ Do not edit the class manually.
12
+ """ # noqa: E501
13
+
14
+ from __future__ import annotations
15
+
16
+ import json
17
+ import pprint
18
+ import re # noqa: F401
19
+ from typing import Any, ClassVar, Dict, List, Optional, Set
20
+ from uuid import UUID
21
+
22
+ from pydantic import BaseModel, ConfigDict, Field, field_validator
23
+ from typing_extensions import Annotated, Self
24
+
25
+ from stackit.certificates.models.quotas import Quotas
26
+
27
+
28
+ class GetQuotaResponse(BaseModel):
29
+ """
30
+ GetQuotaResponse
31
+ """ # noqa: E501
32
+
33
+ project_id: Optional[UUID] = Field(default=None, description="Project identifier", alias="projectId")
34
+ quotas: Optional[Quotas] = None
35
+ region: Optional[Annotated[str, Field(strict=True)]] = Field(default=None, description="Region")
36
+ __properties: ClassVar[List[str]] = ["projectId", "quotas", "region"]
37
+
38
+ @field_validator("project_id")
39
+ def project_id_validate_regular_expression(cls, value):
40
+ """Validates the regular expression"""
41
+ if value is None:
42
+ return value
43
+
44
+ if not re.match(r"^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$", value):
45
+ raise ValueError(
46
+ r"must validate the regular expression /^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/"
47
+ )
48
+ return value
49
+
50
+ @field_validator("region")
51
+ def region_validate_regular_expression(cls, value):
52
+ """Validates the regular expression"""
53
+ if value is None:
54
+ return value
55
+
56
+ if not re.match(r"^[a-z]{2,4}[0-9]{2}$", value):
57
+ raise ValueError(r"must validate the regular expression /^[a-z]{2,4}[0-9]{2}$/")
58
+ return value
59
+
60
+ model_config = ConfigDict(
61
+ populate_by_name=True,
62
+ validate_assignment=True,
63
+ protected_namespaces=(),
64
+ )
65
+
66
+ def to_str(self) -> str:
67
+ """Returns the string representation of the model using alias"""
68
+ return pprint.pformat(self.model_dump(by_alias=True))
69
+
70
+ def to_json(self) -> str:
71
+ """Returns the JSON representation of the model using alias"""
72
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
73
+ return json.dumps(self.to_dict())
74
+
75
+ @classmethod
76
+ def from_json(cls, json_str: str) -> Optional[Self]:
77
+ """Create an instance of GetQuotaResponse from a JSON string"""
78
+ return cls.from_dict(json.loads(json_str))
79
+
80
+ def to_dict(self) -> Dict[str, Any]:
81
+ """Return the dictionary representation of the model using alias.
82
+
83
+ This has the following differences from calling pydantic's
84
+ `self.model_dump(by_alias=True)`:
85
+
86
+ * `None` is only added to the output dict for nullable fields that
87
+ were set at model initialization. Other fields with value `None`
88
+ are ignored.
89
+ * OpenAPI `readOnly` fields are excluded.
90
+ * OpenAPI `readOnly` fields are excluded.
91
+ """
92
+ excluded_fields: Set[str] = set(
93
+ [
94
+ "project_id",
95
+ "region",
96
+ ]
97
+ )
98
+
99
+ _dict = self.model_dump(
100
+ by_alias=True,
101
+ exclude=excluded_fields,
102
+ exclude_none=True,
103
+ )
104
+ # override the default output from pydantic by calling `to_dict()` of quotas
105
+ if self.quotas:
106
+ _dict["quotas"] = self.quotas.to_dict()
107
+ return _dict
108
+
109
+ @classmethod
110
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
111
+ """Create an instance of GetQuotaResponse from a dict"""
112
+ if obj is None:
113
+ return None
114
+
115
+ if not isinstance(obj, dict):
116
+ return cls.model_validate(obj)
117
+
118
+ _obj = cls.model_validate(
119
+ {
120
+ "projectId": obj.get("projectId"),
121
+ "quotas": Quotas.from_dict(obj["quotas"]) if obj.get("quotas") is not None else None,
122
+ "region": obj.get("region"),
123
+ }
124
+ )
125
+ return _obj
@@ -0,0 +1,92 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ STACKIT Application Load Balancer Certificates API
5
+
6
+ This API offers the ability to store TLS certificates, which can be used by load balancing servers in STACKIT. They can be between consumer and load balancing server and/or between load balancing server and endpoint server.
7
+
8
+ The version of the OpenAPI document: 2.0.0
9
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
10
+
11
+ Do not edit the class manually.
12
+ """ # noqa: E501
13
+
14
+ from __future__ import annotations
15
+
16
+ import json
17
+ import pprint
18
+ from typing import Any, ClassVar, Dict, List, Optional, Set
19
+
20
+ from pydantic import BaseModel, ConfigDict
21
+ from typing_extensions import Self
22
+
23
+ from stackit.certificates.models.certificates_quota import CertificatesQuota
24
+
25
+
26
+ class Quotas(BaseModel):
27
+ """
28
+ Quotas holds the specific quota elements for different resources
29
+ """ # noqa: E501
30
+
31
+ certificates: Optional[CertificatesQuota] = None
32
+ __properties: ClassVar[List[str]] = ["certificates"]
33
+
34
+ model_config = ConfigDict(
35
+ populate_by_name=True,
36
+ validate_assignment=True,
37
+ protected_namespaces=(),
38
+ )
39
+
40
+ def to_str(self) -> str:
41
+ """Returns the string representation of the model using alias"""
42
+ return pprint.pformat(self.model_dump(by_alias=True))
43
+
44
+ def to_json(self) -> str:
45
+ """Returns the JSON representation of the model using alias"""
46
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
47
+ return json.dumps(self.to_dict())
48
+
49
+ @classmethod
50
+ def from_json(cls, json_str: str) -> Optional[Self]:
51
+ """Create an instance of Quotas from a JSON string"""
52
+ return cls.from_dict(json.loads(json_str))
53
+
54
+ def to_dict(self) -> Dict[str, Any]:
55
+ """Return the dictionary representation of the model using alias.
56
+
57
+ This has the following differences from calling pydantic's
58
+ `self.model_dump(by_alias=True)`:
59
+
60
+ * `None` is only added to the output dict for nullable fields that
61
+ were set at model initialization. Other fields with value `None`
62
+ are ignored.
63
+ """
64
+ excluded_fields: Set[str] = set([])
65
+
66
+ _dict = self.model_dump(
67
+ by_alias=True,
68
+ exclude=excluded_fields,
69
+ exclude_none=True,
70
+ )
71
+ # override the default output from pydantic by calling `to_dict()` of certificates
72
+ if self.certificates:
73
+ _dict["certificates"] = self.certificates.to_dict()
74
+ return _dict
75
+
76
+ @classmethod
77
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
78
+ """Create an instance of Quotas from a dict"""
79
+ if obj is None:
80
+ return None
81
+
82
+ if not isinstance(obj, dict):
83
+ return cls.model_validate(obj)
84
+
85
+ _obj = cls.model_validate(
86
+ {
87
+ "certificates": (
88
+ CertificatesQuota.from_dict(obj["certificates"]) if obj.get("certificates") is not None else None
89
+ )
90
+ }
91
+ )
92
+ return _obj