stackit-git 0.2.0__py3-none-any.whl → 0.3.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
stackit/git/__init__.py CHANGED
@@ -12,35 +12,61 @@
12
12
  Generated by OpenAPI Generator (https://openapi-generator.tech)
13
13
 
14
14
  Do not edit the class manually.
15
- """ # noqa: E501 docstring might be too long
15
+ """ # noqa: E501
16
16
 
17
17
 
18
18
  __version__ = "1.0.0"
19
19
 
20
+ # Define package exports
21
+ __all__ = [
22
+ "DefaultApi",
23
+ "ApiResponse",
24
+ "ApiClient",
25
+ "HostConfiguration",
26
+ "OpenApiException",
27
+ "ApiTypeError",
28
+ "ApiValueError",
29
+ "ApiKeyError",
30
+ "ApiAttributeError",
31
+ "ApiException",
32
+ "CreateInstancePayload",
33
+ "Flavor",
34
+ "GenericErrorResponse",
35
+ "Instance",
36
+ "InternalServerErrorResponse",
37
+ "ListFlavors",
38
+ "ListInstances",
39
+ "UnauthorizedResponse",
40
+ ]
41
+
20
42
  # import apis into sdk package
21
- from stackit.git.api.default_api import DefaultApi
22
- from stackit.git.api_client import ApiClient
43
+ from stackit.git.api.default_api import DefaultApi as DefaultApi
44
+ from stackit.git.api_client import ApiClient as ApiClient
23
45
 
24
46
  # import ApiClient
25
- from stackit.git.api_response import ApiResponse
26
- from stackit.git.configuration import HostConfiguration
27
- from stackit.git.exceptions import (
28
- ApiAttributeError,
29
- ApiException,
30
- ApiKeyError,
31
- ApiTypeError,
32
- ApiValueError,
33
- OpenApiException,
34
- )
47
+ from stackit.git.api_response import ApiResponse as ApiResponse
48
+ from stackit.git.configuration import HostConfiguration as HostConfiguration
49
+ from stackit.git.exceptions import ApiAttributeError as ApiAttributeError
50
+ from stackit.git.exceptions import ApiException as ApiException
51
+ from stackit.git.exceptions import ApiKeyError as ApiKeyError
52
+ from stackit.git.exceptions import ApiTypeError as ApiTypeError
53
+ from stackit.git.exceptions import ApiValueError as ApiValueError
54
+ from stackit.git.exceptions import OpenApiException as OpenApiException
35
55
 
36
56
  # import models into sdk package
37
- from stackit.git.models.create_instance_payload import CreateInstancePayload
38
- from stackit.git.models.flavor import Flavor
39
- from stackit.git.models.generic_error_response import GenericErrorResponse
40
- from stackit.git.models.instance import Instance
57
+ from stackit.git.models.create_instance_payload import (
58
+ CreateInstancePayload as CreateInstancePayload,
59
+ )
60
+ from stackit.git.models.flavor import Flavor as Flavor
61
+ from stackit.git.models.generic_error_response import (
62
+ GenericErrorResponse as GenericErrorResponse,
63
+ )
64
+ from stackit.git.models.instance import Instance as Instance
41
65
  from stackit.git.models.internal_server_error_response import (
42
- InternalServerErrorResponse,
66
+ InternalServerErrorResponse as InternalServerErrorResponse,
67
+ )
68
+ from stackit.git.models.list_flavors import ListFlavors as ListFlavors
69
+ from stackit.git.models.list_instances import ListInstances as ListInstances
70
+ from stackit.git.models.unauthorized_response import (
71
+ UnauthorizedResponse as UnauthorizedResponse,
43
72
  )
44
- from stackit.git.models.list_flavors import ListFlavors
45
- from stackit.git.models.list_instances import ListInstances
46
- from stackit.git.models.unauthorized_response import UnauthorizedResponse
@@ -10,7 +10,7 @@
10
10
  Generated by OpenAPI Generator (https://openapi-generator.tech)
11
11
 
12
12
  Do not edit the class manually.
13
- """ # noqa: E501 docstring might be too long
13
+ """ # noqa: E501
14
14
 
15
15
  from typing import Any, Dict, List, Optional, Tuple, Union
16
16
 
@@ -89,7 +89,7 @@ class DefaultApi:
89
89
  in the spec for a single request.
90
90
  :type _host_index: int, optional
91
91
  :return: Returns the result object.
92
- """ # noqa: E501 docstring might be too long
92
+ """ # noqa: E501
93
93
 
94
94
  _param = self._create_instance_serialize(
95
95
  project_id=project_id,
@@ -157,7 +157,7 @@ class DefaultApi:
157
157
  in the spec for a single request.
158
158
  :type _host_index: int, optional
159
159
  :return: Returns the result object.
160
- """ # noqa: E501 docstring might be too long
160
+ """ # noqa: E501
161
161
 
162
162
  _param = self._create_instance_serialize(
163
163
  project_id=project_id,
@@ -225,7 +225,7 @@ class DefaultApi:
225
225
  in the spec for a single request.
226
226
  :type _host_index: int, optional
227
227
  :return: Returns the result object.
228
- """ # noqa: E501 docstring might be too long
228
+ """ # noqa: E501
229
229
 
230
230
  _param = self._create_instance_serialize(
231
231
  project_id=project_id,
@@ -264,7 +264,7 @@ class DefaultApi:
264
264
  _query_params: List[Tuple[str, str]] = []
265
265
  _header_params: Dict[str, Optional[str]] = _headers or {}
266
266
  _form_params: List[Tuple[str, str]] = []
267
- _files: Dict[str, Union[str, bytes]] = {}
267
+ _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {}
268
268
  _body_params: Optional[bytes] = None
269
269
 
270
270
  # process the path parameters
@@ -352,7 +352,7 @@ class DefaultApi:
352
352
  in the spec for a single request.
353
353
  :type _host_index: int, optional
354
354
  :return: Returns the result object.
355
- """ # noqa: E501 docstring might be too long
355
+ """ # noqa: E501
356
356
 
357
357
  _param = self._delete_instance_serialize(
358
358
  project_id=project_id,
@@ -423,7 +423,7 @@ class DefaultApi:
423
423
  in the spec for a single request.
424
424
  :type _host_index: int, optional
425
425
  :return: Returns the result object.
426
- """ # noqa: E501 docstring might be too long
426
+ """ # noqa: E501
427
427
 
428
428
  _param = self._delete_instance_serialize(
429
429
  project_id=project_id,
@@ -494,7 +494,7 @@ class DefaultApi:
494
494
  in the spec for a single request.
495
495
  :type _host_index: int, optional
496
496
  :return: Returns the result object.
497
- """ # noqa: E501 docstring might be too long
497
+ """ # noqa: E501
498
498
 
499
499
  _param = self._delete_instance_serialize(
500
500
  project_id=project_id,
@@ -534,7 +534,7 @@ class DefaultApi:
534
534
  _query_params: List[Tuple[str, str]] = []
535
535
  _header_params: Dict[str, Optional[str]] = _headers or {}
536
536
  _form_params: List[Tuple[str, str]] = []
537
- _files: Dict[str, Union[str, bytes]] = {}
537
+ _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {}
538
538
  _body_params: Optional[bytes] = None
539
539
 
540
540
  # process the path parameters
@@ -614,7 +614,7 @@ class DefaultApi:
614
614
  in the spec for a single request.
615
615
  :type _host_index: int, optional
616
616
  :return: Returns the result object.
617
- """ # noqa: E501 docstring might be too long
617
+ """ # noqa: E501
618
618
 
619
619
  _param = self._get_instance_serialize(
620
620
  project_id=project_id,
@@ -684,7 +684,7 @@ class DefaultApi:
684
684
  in the spec for a single request.
685
685
  :type _host_index: int, optional
686
686
  :return: Returns the result object.
687
- """ # noqa: E501 docstring might be too long
687
+ """ # noqa: E501
688
688
 
689
689
  _param = self._get_instance_serialize(
690
690
  project_id=project_id,
@@ -754,7 +754,7 @@ class DefaultApi:
754
754
  in the spec for a single request.
755
755
  :type _host_index: int, optional
756
756
  :return: Returns the result object.
757
- """ # noqa: E501 docstring might be too long
757
+ """ # noqa: E501
758
758
 
759
759
  _param = self._get_instance_serialize(
760
760
  project_id=project_id,
@@ -793,7 +793,7 @@ class DefaultApi:
793
793
  _query_params: List[Tuple[str, str]] = []
794
794
  _header_params: Dict[str, Optional[str]] = _headers or {}
795
795
  _form_params: List[Tuple[str, str]] = []
796
- _files: Dict[str, Union[str, bytes]] = {}
796
+ _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {}
797
797
  _body_params: Optional[bytes] = None
798
798
 
799
799
  # process the path parameters
@@ -831,14 +831,7 @@ class DefaultApi:
831
831
  @validate_call
832
832
  def list_flavors(
833
833
  self,
834
- project_id: Annotated[
835
- str,
836
- Field(
837
- strict=True,
838
- max_length=36,
839
- description="The STACKIT portal project UUID the STACKIT Git instance is part of.",
840
- ),
841
- ],
834
+ project_id: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="Project identifier.")],
842
835
  _request_timeout: Union[
843
836
  None,
844
837
  Annotated[StrictFloat, Field(gt=0)],
@@ -853,7 +846,7 @@ class DefaultApi:
853
846
 
854
847
  Provides detailed information about possible Git Flavors.
855
848
 
856
- :param project_id: The STACKIT portal project UUID the STACKIT Git instance is part of. (required)
849
+ :param project_id: Project identifier. (required)
857
850
  :type project_id: str
858
851
  :param _request_timeout: timeout setting for this request. If one
859
852
  number provided, it will be total request
@@ -875,7 +868,7 @@ class DefaultApi:
875
868
  in the spec for a single request.
876
869
  :type _host_index: int, optional
877
870
  :return: Returns the result object.
878
- """ # noqa: E501 docstring might be too long
871
+ """ # noqa: E501
879
872
 
880
873
  _param = self._list_flavors_serialize(
881
874
  project_id=project_id,
@@ -887,10 +880,10 @@ class DefaultApi:
887
880
 
888
881
  _response_types_map: Dict[str, Optional[str]] = {
889
882
  "200": "ListFlavors",
890
- "400": None,
883
+ "400": "GenericErrorResponse",
891
884
  "401": "UnauthorizedResponse",
892
885
  "404": None,
893
- "500": "InternalServerErrorResponse",
886
+ "500": "GenericErrorResponse",
894
887
  }
895
888
  response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
896
889
  response_data.read()
@@ -902,14 +895,7 @@ class DefaultApi:
902
895
  @validate_call
903
896
  def list_flavors_with_http_info(
904
897
  self,
905
- project_id: Annotated[
906
- str,
907
- Field(
908
- strict=True,
909
- max_length=36,
910
- description="The STACKIT portal project UUID the STACKIT Git instance is part of.",
911
- ),
912
- ],
898
+ project_id: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="Project identifier.")],
913
899
  _request_timeout: Union[
914
900
  None,
915
901
  Annotated[StrictFloat, Field(gt=0)],
@@ -924,7 +910,7 @@ class DefaultApi:
924
910
 
925
911
  Provides detailed information about possible Git Flavors.
926
912
 
927
- :param project_id: The STACKIT portal project UUID the STACKIT Git instance is part of. (required)
913
+ :param project_id: Project identifier. (required)
928
914
  :type project_id: str
929
915
  :param _request_timeout: timeout setting for this request. If one
930
916
  number provided, it will be total request
@@ -946,7 +932,7 @@ class DefaultApi:
946
932
  in the spec for a single request.
947
933
  :type _host_index: int, optional
948
934
  :return: Returns the result object.
949
- """ # noqa: E501 docstring might be too long
935
+ """ # noqa: E501
950
936
 
951
937
  _param = self._list_flavors_serialize(
952
938
  project_id=project_id,
@@ -958,10 +944,10 @@ class DefaultApi:
958
944
 
959
945
  _response_types_map: Dict[str, Optional[str]] = {
960
946
  "200": "ListFlavors",
961
- "400": None,
947
+ "400": "GenericErrorResponse",
962
948
  "401": "UnauthorizedResponse",
963
949
  "404": None,
964
- "500": "InternalServerErrorResponse",
950
+ "500": "GenericErrorResponse",
965
951
  }
966
952
  response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
967
953
  response_data.read()
@@ -973,14 +959,7 @@ class DefaultApi:
973
959
  @validate_call
974
960
  def list_flavors_without_preload_content(
975
961
  self,
976
- project_id: Annotated[
977
- str,
978
- Field(
979
- strict=True,
980
- max_length=36,
981
- description="The STACKIT portal project UUID the STACKIT Git instance is part of.",
982
- ),
983
- ],
962
+ project_id: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="Project identifier.")],
984
963
  _request_timeout: Union[
985
964
  None,
986
965
  Annotated[StrictFloat, Field(gt=0)],
@@ -995,7 +974,7 @@ class DefaultApi:
995
974
 
996
975
  Provides detailed information about possible Git Flavors.
997
976
 
998
- :param project_id: The STACKIT portal project UUID the STACKIT Git instance is part of. (required)
977
+ :param project_id: Project identifier. (required)
999
978
  :type project_id: str
1000
979
  :param _request_timeout: timeout setting for this request. If one
1001
980
  number provided, it will be total request
@@ -1017,7 +996,7 @@ class DefaultApi:
1017
996
  in the spec for a single request.
1018
997
  :type _host_index: int, optional
1019
998
  :return: Returns the result object.
1020
- """ # noqa: E501 docstring might be too long
999
+ """ # noqa: E501
1021
1000
 
1022
1001
  _param = self._list_flavors_serialize(
1023
1002
  project_id=project_id,
@@ -1029,10 +1008,10 @@ class DefaultApi:
1029
1008
 
1030
1009
  _response_types_map: Dict[str, Optional[str]] = {
1031
1010
  "200": "ListFlavors",
1032
- "400": None,
1011
+ "400": "GenericErrorResponse",
1033
1012
  "401": "UnauthorizedResponse",
1034
1013
  "404": None,
1035
- "500": "InternalServerErrorResponse",
1014
+ "500": "GenericErrorResponse",
1036
1015
  }
1037
1016
  response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
1038
1017
  return response_data.response
@@ -1054,7 +1033,7 @@ class DefaultApi:
1054
1033
  _query_params: List[Tuple[str, str]] = []
1055
1034
  _header_params: Dict[str, Optional[str]] = _headers or {}
1056
1035
  _form_params: List[Tuple[str, str]] = []
1057
- _files: Dict[str, Union[str, bytes]] = {}
1036
+ _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {}
1058
1037
  _body_params: Optional[bytes] = None
1059
1038
 
1060
1039
  # process the path parameters
@@ -1127,7 +1106,7 @@ class DefaultApi:
1127
1106
  in the spec for a single request.
1128
1107
  :type _host_index: int, optional
1129
1108
  :return: Returns the result object.
1130
- """ # noqa: E501 docstring might be too long
1109
+ """ # noqa: E501
1131
1110
 
1132
1111
  _param = self._list_instances_serialize(
1133
1112
  project_id=project_id,
@@ -1190,7 +1169,7 @@ class DefaultApi:
1190
1169
  in the spec for a single request.
1191
1170
  :type _host_index: int, optional
1192
1171
  :return: Returns the result object.
1193
- """ # noqa: E501 docstring might be too long
1172
+ """ # noqa: E501
1194
1173
 
1195
1174
  _param = self._list_instances_serialize(
1196
1175
  project_id=project_id,
@@ -1253,7 +1232,7 @@ class DefaultApi:
1253
1232
  in the spec for a single request.
1254
1233
  :type _host_index: int, optional
1255
1234
  :return: Returns the result object.
1256
- """ # noqa: E501 docstring might be too long
1235
+ """ # noqa: E501
1257
1236
 
1258
1237
  _param = self._list_instances_serialize(
1259
1238
  project_id=project_id,
@@ -1289,7 +1268,7 @@ class DefaultApi:
1289
1268
  _query_params: List[Tuple[str, str]] = []
1290
1269
  _header_params: Dict[str, Optional[str]] = _headers or {}
1291
1270
  _form_params: List[Tuple[str, str]] = []
1292
- _files: Dict[str, Union[str, bytes]] = {}
1271
+ _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {}
1293
1272
  _body_params: Optional[bytes] = None
1294
1273
 
1295
1274
  # process the path parameters
stackit/git/api_client.py CHANGED
@@ -10,7 +10,7 @@
10
10
  Generated by OpenAPI Generator (https://openapi-generator.tech)
11
11
 
12
12
  Do not edit the class manually.
13
- """ # noqa: E501 docstring might be too long
13
+ """ # noqa: E501
14
14
 
15
15
  import datetime
16
16
  import json
@@ -332,6 +332,10 @@ class ApiClient:
332
332
  else:
333
333
  obj_dict = obj.__dict__
334
334
 
335
+ if isinstance(obj_dict, list):
336
+ # here we handle instances that can either be a list or something else, and only became a real list by calling to_dict() # noqa: E501
337
+ return self.sanitize_for_serialization(obj_dict)
338
+
335
339
  return {key: self.sanitize_for_serialization(val) for key, val in obj_dict.items()}
336
340
 
337
341
  def deserialize(self, response_text: str, response_type: str, content_type: Optional[str]):
@@ -351,12 +355,12 @@ class ApiClient:
351
355
  data = json.loads(response_text)
352
356
  except ValueError:
353
357
  data = response_text
354
- elif content_type.startswith("application/json"):
358
+ elif re.match(r"^application/(json|[\w!#$&.+-^_]+\+json)\s*(;|$)", content_type, re.IGNORECASE):
355
359
  if response_text == "":
356
360
  data = ""
357
361
  else:
358
362
  data = json.loads(response_text)
359
- elif content_type.startswith("text/plain"):
363
+ elif re.match(r"^text\/[a-z.+-]+\s*(;|$)", content_type, re.IGNORECASE):
360
364
  data = response_text
361
365
  else:
362
366
  raise ApiException(status=0, reason="Unsupported content type: {0}".format(content_type))
@@ -458,7 +462,7 @@ class ApiClient:
458
462
  if k in collection_formats:
459
463
  collection_format = collection_formats[k]
460
464
  if collection_format == "multi":
461
- new_params.extend((k, str(value)) for value in v)
465
+ new_params.extend((k, quote(str(value))) for value in v)
462
466
  else:
463
467
  if collection_format == "ssv":
464
468
  delimiter = " "
@@ -474,7 +478,10 @@ class ApiClient:
474
478
 
475
479
  return "&".join(["=".join(map(str, item)) for item in new_params])
476
480
 
477
- def files_parameters(self, files: Dict[str, Union[str, bytes]]):
481
+ def files_parameters(
482
+ self,
483
+ files: Dict[str, Union[str, bytes, List[str], List[bytes], Tuple[str, bytes]]],
484
+ ):
478
485
  """Builds form parameters.
479
486
 
480
487
  :param files: File parameters.
@@ -489,6 +496,12 @@ class ApiClient:
489
496
  elif isinstance(v, bytes):
490
497
  filename = k
491
498
  filedata = v
499
+ elif isinstance(v, tuple):
500
+ filename, filedata = v
501
+ elif isinstance(v, list):
502
+ for file_param in v:
503
+ params.extend(self.files_parameters({k: file_param}))
504
+ continue
492
505
  else:
493
506
  raise ValueError("Unsupported file value")
494
507
  mimetype = mimetypes.guess_type(filename)[0] or "application/octet-stream"
@@ -1,10 +1,5 @@
1
1
  # coding: utf-8
2
2
 
3
- import sys
4
-
5
- import os
6
-
7
-
8
3
  """
9
4
  STACKIT Git API
10
5
 
@@ -15,7 +10,29 @@ import os
15
10
  Generated by OpenAPI Generator (https://openapi-generator.tech)
16
11
 
17
12
  Do not edit the class manually.
18
- """ # noqa: E501 docstring might be too long
13
+ """ # noqa: E501
14
+
15
+ import sys
16
+ from typing import Dict, List, Optional, TypedDict
17
+
18
+ from typing_extensions import NotRequired
19
+
20
+ import os
21
+
22
+
23
+ ServerVariablesT = Dict[str, str]
24
+
25
+
26
+ class HostSettingVariable(TypedDict):
27
+ description: str
28
+ default_value: str
29
+ enum_values: List[str]
30
+
31
+
32
+ class HostSetting(TypedDict):
33
+ url: str
34
+ description: str
35
+ variables: NotRequired[Dict[str, HostSettingVariable]]
19
36
 
20
37
 
21
38
  class HostConfiguration:
@@ -54,7 +71,7 @@ class HostConfiguration:
54
71
  """Ignore operation servers
55
72
  """
56
73
 
57
- def get_host_settings(self):
74
+ def get_host_settings(self) -> List[HostSetting]:
58
75
  """Gets an array of host settings
59
76
 
60
77
  :return: An array of host settings
@@ -72,7 +89,12 @@ class HostConfiguration:
72
89
  }
73
90
  ]
74
91
 
75
- def get_host_from_settings(self, index, variables=None, servers=None):
92
+ def get_host_from_settings(
93
+ self,
94
+ index: Optional[int],
95
+ variables: Optional[ServerVariablesT] = None,
96
+ servers: Optional[List[HostSetting]] = None,
97
+ ) -> str:
76
98
  """Gets host URL based on the index and variables
77
99
  :param index: array index of the host settings
78
100
  :param variables: hash of variable and the corresponding value
@@ -112,7 +134,7 @@ class HostConfiguration:
112
134
  and variables.get(variable_name) is not None
113
135
  ):
114
136
  raise ValueError(
115
- "this API does not support setting a region in the the client configuration, "
137
+ "this API does not support setting a region in the client configuration, "
116
138
  "please check if the region can be specified as a function parameter"
117
139
  )
118
140
  used_value = variables.get(variable_name, variable["default_value"])
@@ -131,12 +153,12 @@ class HostConfiguration:
131
153
  return url
132
154
 
133
155
  @property
134
- def host(self):
156
+ def host(self) -> str:
135
157
  """Return generated host."""
136
158
  return self.get_host_from_settings(self.server_index, variables=self.server_variables)
137
159
 
138
160
  @host.setter
139
- def host(self, value):
161
+ def host(self, value: str) -> None:
140
162
  """Fix base path."""
141
163
  self._base_path = value
142
164
  self.server_index = None
stackit/git/exceptions.py CHANGED
@@ -10,7 +10,7 @@
10
10
  Generated by OpenAPI Generator (https://openapi-generator.tech)
11
11
 
12
12
  Do not edit the class manually.
13
- """ # noqa: E501 docstring might be too long
13
+ """ # noqa: E501
14
14
 
15
15
  from typing import Any, Optional
16
16
 
@@ -152,6 +152,13 @@ class ApiException(OpenApiException):
152
152
  if http_resp.status == 404:
153
153
  raise NotFoundException(http_resp=http_resp, body=body, data=data)
154
154
 
155
+ # Added new conditions for 409 and 422
156
+ if http_resp.status == 409:
157
+ raise ConflictException(http_resp=http_resp, body=body, data=data)
158
+
159
+ if http_resp.status == 422:
160
+ raise UnprocessableEntityException(http_resp=http_resp, body=body, data=data)
161
+
155
162
  if 500 <= http_resp.status <= 599:
156
163
  raise ServiceException(http_resp=http_resp, body=body, data=data)
157
164
  raise ApiException(http_resp=http_resp, body=body, data=data)
@@ -188,6 +195,18 @@ class ServiceException(ApiException):
188
195
  pass
189
196
 
190
197
 
198
+ class ConflictException(ApiException):
199
+ """Exception for HTTP 409 Conflict."""
200
+
201
+ pass
202
+
203
+
204
+ class UnprocessableEntityException(ApiException):
205
+ """Exception for HTTP 422 Unprocessable Entity."""
206
+
207
+ pass
208
+
209
+
191
210
  def render_path(path_to_item):
192
211
  """Returns a string representation of a path"""
193
212
  result = ""
@@ -11,7 +11,7 @@
11
11
  Generated by OpenAPI Generator (https://openapi-generator.tech)
12
12
 
13
13
  Do not edit the class manually.
14
- """ # noqa: E501 docstring might be too long
14
+ """ # noqa: E501
15
15
 
16
16
 
17
17
  # import models into model package
@@ -10,13 +10,13 @@
10
10
  Generated by OpenAPI Generator (https://openapi-generator.tech)
11
11
 
12
12
  Do not edit the class manually.
13
- """ # noqa: E501 docstring might be too long
13
+ """ # noqa: E501
14
14
 
15
15
  from __future__ import annotations
16
16
 
17
17
  import json
18
18
  import pprint
19
- import re
19
+ import re # noqa: F401
20
20
  from typing import Any, ClassVar, Dict, List, Optional, Set
21
21
 
22
22
  from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator
@@ -25,20 +25,30 @@ from typing_extensions import Annotated, Self
25
25
 
26
26
  class CreateInstancePayload(BaseModel):
27
27
  """
28
- Instance creation configuration options.
29
- """
28
+ Request a STACKIT Git instance to be created with these properties.
29
+ """ # noqa: E501
30
30
 
31
31
  acl: Optional[Annotated[List[StrictStr], Field(max_length=5)]] = Field(
32
32
  default=None, description="Restricted ACL for instance access."
33
33
  )
34
- flavor: Optional[StrictStr] = Field(
35
- default="git-100", description="Instance flavor. Defaults to git-100 if not specified."
34
+ flavor: Optional[Annotated[str, Field(strict=True, max_length=255)]] = Field(
35
+ default=None, description="Desired instance flavor. Must be one of the defined enum values"
36
36
  )
37
37
  name: Annotated[str, Field(min_length=5, strict=True, max_length=32)] = Field(
38
38
  description="A user chosen name to distinguish multiple STACKIT Git instances."
39
39
  )
40
40
  __properties: ClassVar[List[str]] = ["acl", "flavor", "name"]
41
41
 
42
+ @field_validator("flavor")
43
+ def flavor_validate_enum(cls, value):
44
+ """Validates the enum"""
45
+ if value is None:
46
+ return value
47
+
48
+ if value not in set(["git-10", "git-100"]):
49
+ raise ValueError("must be one of enum values ('git-10', 'git-100')")
50
+ return value
51
+
42
52
  @field_validator("name")
43
53
  def name_validate_regular_expression(cls, value):
44
54
  """Validates the regular expression"""
@@ -94,11 +104,5 @@ class CreateInstancePayload(BaseModel):
94
104
  if not isinstance(obj, dict):
95
105
  return cls.model_validate(obj)
96
106
 
97
- _obj = cls.model_validate(
98
- {
99
- "acl": obj.get("acl"),
100
- "flavor": obj.get("flavor") if obj.get("flavor") is not None else "git-100",
101
- "name": obj.get("name"),
102
- }
103
- )
107
+ _obj = cls.model_validate({"acl": obj.get("acl"), "flavor": obj.get("flavor"), "name": obj.get("name")})
104
108
  return _obj
@@ -10,7 +10,7 @@
10
10
  Generated by OpenAPI Generator (https://openapi-generator.tech)
11
11
 
12
12
  Do not edit the class manually.
13
- """ # noqa: E501 docstring might be too long
13
+ """ # noqa: E501
14
14
 
15
15
  from __future__ import annotations
16
16
 
@@ -25,13 +25,14 @@ from typing_extensions import Annotated, Self
25
25
  class Flavor(BaseModel):
26
26
  """
27
27
  Describes a STACKIT Git Flavor.
28
- """
28
+ """ # noqa: E501
29
29
 
30
30
  availability: StrictStr = Field(description="Defines the flavor availability.")
31
31
  description: StrictStr = Field(description="Flavor description.")
32
32
  display_name: StrictStr = Field(description="The display name that will be shown in the Portal.")
33
33
  id: Annotated[str, Field(strict=True, max_length=36)] = Field(description="Flavor id.")
34
- __properties: ClassVar[List[str]] = ["availability", "description", "display_name", "id"]
34
+ sku: StrictStr = Field(description="SAP article number.")
35
+ __properties: ClassVar[List[str]] = ["availability", "description", "display_name", "id", "sku"]
35
36
 
36
37
  @field_validator("availability")
37
38
  def availability_validate_enum(cls, value):
@@ -94,6 +95,7 @@ class Flavor(BaseModel):
94
95
  "description": obj.get("description"),
95
96
  "display_name": obj.get("display_name"),
96
97
  "id": obj.get("id"),
98
+ "sku": obj.get("sku"),
97
99
  }
98
100
  )
99
101
  return _obj
@@ -10,7 +10,7 @@
10
10
  Generated by OpenAPI Generator (https://openapi-generator.tech)
11
11
 
12
12
  Do not edit the class manually.
13
- """ # noqa: E501 docstring might be too long
13
+ """ # noqa: E501
14
14
 
15
15
  from __future__ import annotations
16
16
 
@@ -25,7 +25,7 @@ from typing_extensions import Self
25
25
  class GenericErrorResponse(BaseModel):
26
26
  """
27
27
  Generic Error Response.
28
- """
28
+ """ # noqa: E501
29
29
 
30
30
  details: Optional[List[StrictStr]] = None
31
31
  message: StrictStr
@@ -10,13 +10,12 @@
10
10
  Generated by OpenAPI Generator (https://openapi-generator.tech)
11
11
 
12
12
  Do not edit the class manually.
13
- """ # noqa: E501 docstring might be too long
13
+ """ # noqa: E501
14
14
 
15
15
  from __future__ import annotations
16
16
 
17
17
  import json
18
18
  import pprint
19
- import re
20
19
  from datetime import datetime
21
20
  from typing import Any, ClassVar, Dict, List, Optional, Set
22
21
 
@@ -26,21 +25,29 @@ from typing_extensions import Annotated, Self
26
25
 
27
26
  class Instance(BaseModel):
28
27
  """
29
- Information about an Instance.
30
- """
28
+ Describes a STACKIT Git instance.
29
+ """ # noqa: E501
31
30
 
32
31
  acl: List[StrictStr] = Field(description="Restricted ACL for instance access.")
33
32
  consumed_disk: StrictStr = Field(description="How many bytes of disk space is consumed. Read Only.")
34
33
  consumed_object_storage: StrictStr = Field(description="How many bytes of Object Storage is consumed. Read Only.")
35
- created: datetime = Field(description="Instance creation timestamp in RFC3339 format.")
36
- flavor: StrictStr = Field(description="Instance flavor.")
37
- id: Annotated[str, Field(min_length=36, strict=True, max_length=36)] = Field(description="Instance identifier.")
38
- name: Annotated[str, Field(strict=True, max_length=32)] = Field(description="Instance name.")
34
+ created: datetime = Field(description="The date and time the creation of the STACKIT Git instance was triggered.")
35
+ flavor: StrictStr = Field(description="Desired instance flavor. Must be one of the defined enum values")
36
+ id: Annotated[str, Field(strict=True, max_length=36)] = Field(
37
+ description="A auto generated unique id which identifies the STACKIT Git instances."
38
+ )
39
+ name: Annotated[str, Field(strict=True, max_length=32)] = Field(
40
+ description="A user chosen name to distinguish multiple STACKIT Git instances."
41
+ )
39
42
  state: Annotated[str, Field(strict=True, max_length=32)] = Field(
40
- description="Indicate the readiness state of the instance."
43
+ description="The current state of the STACKIT Git instance."
44
+ )
45
+ url: Annotated[str, Field(strict=True, max_length=2048)] = Field(
46
+ description="The URL for reaching the STACKIT Git instance."
47
+ )
48
+ version: Annotated[str, Field(strict=True, max_length=20)] = Field(
49
+ description="The current version of STACKIT Git deployed to the instance."
41
50
  )
42
- url: Annotated[str, Field(strict=True, max_length=512)] = Field(description="Instance url.")
43
- version: Annotated[str, Field(strict=True, max_length=20)] = Field(description="STACKIT Git version indicator.")
44
51
  __properties: ClassVar[List[str]] = [
45
52
  "acl",
46
53
  "consumed_disk",
@@ -54,15 +61,6 @@ class Instance(BaseModel):
54
61
  "version",
55
62
  ]
56
63
 
57
- @field_validator("id")
58
- def id_validate_regular_expression(cls, value):
59
- """Validates the regular expression"""
60
- if not re.match(r"^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$", value):
61
- raise ValueError(
62
- r"must validate the regular expression /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/"
63
- )
64
- return value
65
-
66
64
  @field_validator("state")
67
65
  def state_validate_enum(cls, value):
68
66
  """Validates the enum"""
@@ -10,7 +10,7 @@
10
10
  Generated by OpenAPI Generator (https://openapi-generator.tech)
11
11
 
12
12
  Do not edit the class manually.
13
- """ # noqa: E501 docstring might be too long
13
+ """ # noqa: E501
14
14
 
15
15
  from __future__ import annotations
16
16
 
@@ -25,7 +25,7 @@ from typing_extensions import Self
25
25
  class InternalServerErrorResponse(BaseModel):
26
26
  """
27
27
  Internal server error.
28
- """
28
+ """ # noqa: E501
29
29
 
30
30
  error: Optional[StrictStr] = None
31
31
  __properties: ClassVar[List[str]] = ["error"]
@@ -10,7 +10,7 @@
10
10
  Generated by OpenAPI Generator (https://openapi-generator.tech)
11
11
 
12
12
  Do not edit the class manually.
13
- """ # noqa: E501 docstring might be too long
13
+ """ # noqa: E501
14
14
 
15
15
  from __future__ import annotations
16
16
 
@@ -27,7 +27,7 @@ from stackit.git.models.flavor import Flavor
27
27
  class ListFlavors(BaseModel):
28
28
  """
29
29
  A list of STACKIT Git flavors.
30
- """
30
+ """ # noqa: E501
31
31
 
32
32
  flavors: List[Flavor]
33
33
  __properties: ClassVar[List[str]] = ["flavors"]
@@ -10,7 +10,7 @@
10
10
  Generated by OpenAPI Generator (https://openapi-generator.tech)
11
11
 
12
12
  Do not edit the class manually.
13
- """ # noqa: E501 docstring might be too long
13
+ """ # noqa: E501
14
14
 
15
15
  from __future__ import annotations
16
16
 
@@ -26,10 +26,10 @@ from stackit.git.models.instance import Instance
26
26
 
27
27
  class ListInstances(BaseModel):
28
28
  """
29
- List of Instances.
30
- """
29
+ A list of STACKIT Git instances.
30
+ """ # noqa: E501
31
31
 
32
- instances: Annotated[List[Instance], Field(max_length=100)]
32
+ instances: Annotated[List[Instance], Field(max_length=50)]
33
33
  __properties: ClassVar[List[str]] = ["instances"]
34
34
 
35
35
  model_config = ConfigDict(
@@ -10,7 +10,7 @@
10
10
  Generated by OpenAPI Generator (https://openapi-generator.tech)
11
11
 
12
12
  Do not edit the class manually.
13
- """ # noqa: E501 docstring might be too long
13
+ """ # noqa: E501
14
14
 
15
15
  from __future__ import annotations
16
16
 
@@ -25,7 +25,7 @@ from typing_extensions import Self
25
25
  class UnauthorizedResponse(BaseModel):
26
26
  """
27
27
  The request could not be authorized.
28
- """
28
+ """ # noqa: E501
29
29
 
30
30
  error: Optional[StrictStr] = None
31
31
  __properties: ClassVar[List[str]] = ["error"]
stackit/git/rest.py CHANGED
@@ -10,7 +10,7 @@
10
10
  Generated by OpenAPI Generator (https://openapi-generator.tech)
11
11
 
12
12
  Do not edit the class manually.
13
- """ # noqa: E501 docstring might be too long
13
+ """ # noqa: E501
14
14
 
15
15
  import io
16
16
  import json
@@ -125,7 +125,7 @@ class RESTClientObject:
125
125
  data=body,
126
126
  headers=headers,
127
127
  )
128
- elif headers["Content-Type"] == "text/plain" and isinstance(body, bool):
128
+ elif headers["Content-Type"].startswith("text/") and isinstance(body, bool):
129
129
  request_body = "true" if body else "false"
130
130
  r = self.session.request(method, url, data=request_body, headers=headers)
131
131
  else:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: stackit-git
3
- Version: 0.2.0
3
+ Version: 0.3.0
4
4
  Summary: STACKIT Git API
5
5
  Author: STACKIT Developer Tools
6
6
  Author-email: developer-tools@stackit.cloud
@@ -0,0 +1,23 @@
1
+ stackit/git/__init__.py,sha256=njGspbhfsAXxPKHlsJshY2j9u8WYB7RtcCWgeCPy14o,2230
2
+ stackit/git/api/__init__.py,sha256=JKxWk68Icluu7NXknLJ_ZN69NPa6_2QrISs1MRsuJwc,98
3
+ stackit/git/api/default_api.py,sha256=nRwW58yecXD-nlmsTCbj0a_TCTdqJ0bEReZ-gRpFO2E,56206
4
+ stackit/git/api_client.py,sha256=TCY74-7UYXf-50piCN9_jhu0nRI1WioJIa1uZYHCdis,23253
5
+ stackit/git/api_response.py,sha256=HRYkVqMNIlfODacTQPTbiVj2YdcnutpQrKJdeAoCSpM,642
6
+ stackit/git/configuration.py,sha256=4kqIDTel1irFn5ig1p-lGLMD93Zr-R4_ePVi0AVxFew,5648
7
+ stackit/git/exceptions.py,sha256=ZnbIj5brGKeWBhpPiLx0uSMNsbBpJONXSOBU4HlVBmU,6386
8
+ stackit/git/models/__init__.py,sha256=X0J2BJLSqMxc4uVc9dLkuOfgolKYs-ICO0UAS4rjiAM,867
9
+ stackit/git/models/create_instance_payload.py,sha256=PGItm9_VthkURwXEeuBh6gm6ifqDT7BELS7GTBMHchQ,3707
10
+ stackit/git/models/flavor.py,sha256=f8VgSpDao4uJQJm4teUxcto6xUMJIhHDSpYgsGs_5gI,3429
11
+ stackit/git/models/generic_error_response.py,sha256=LzcoNfY57nJQbisJzWqZD2u_u4G8MnbuUF8nTaRokI4,2490
12
+ stackit/git/models/instance.py,sha256=lQD8TBJtgETVTVOvZypsScEguIWxmItivg349PtXKJs,4806
13
+ stackit/git/models/internal_server_error_response.py,sha256=q5cK0880KZS5sXg7C7pl5bVvXPm2CU90WqLt-6Y3BOk,2431
14
+ stackit/git/models/list_flavors.py,sha256=8hnXdo1UNtSZ-hPW00dl4iZTPF3c1M2uKgeTMYJ92oM,2896
15
+ stackit/git/models/list_instances.py,sha256=_iFmPfpSkJl9a9diEVcBFKdaElm4qrgOoOEuBPCtRpk,3021
16
+ stackit/git/models/unauthorized_response.py,sha256=QImZVEO7TGoyP8U8_tGAIwvXvgtnNShJBRlu2Yh4JE0,2424
17
+ stackit/git/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
18
+ stackit/git/rest.py,sha256=JLNXZAaV08K2D5ew13p7QKcgdZNweOFVpKab4uYbNgA,5765
19
+ stackit_git-0.3.0.dist-info/LICENSE.md,sha256=3dF8Tb7yZn2tS4zyNa-yNe-68pH8qyWdGz4ioMd3MgE,10933
20
+ stackit_git-0.3.0.dist-info/METADATA,sha256=KmaMlDncVudv_0lpbyo9ZNol3B3-6pMgDAM1xEma_oY,1589
21
+ stackit_git-0.3.0.dist-info/NOTICE.txt,sha256=q8jngWyVHYJId-5_CsuOCwFg7t0R-qlHpZ0zd4gyWI8,47
22
+ stackit_git-0.3.0.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
23
+ stackit_git-0.3.0.dist-info/RECORD,,
@@ -1,23 +0,0 @@
1
- stackit/git/__init__.py,sha256=O1oZddEwf6Lm8XciEECtWo4gDHFk7o0uMIIE1nbSFio,1326
2
- stackit/git/api/__init__.py,sha256=JKxWk68Icluu7NXknLJ_ZN69NPa6_2QrISs1MRsuJwc,98
3
- stackit/git/api/default_api.py,sha256=LDX-vmClgnlChvhfk6z3NDtCGO3mJyqrmaONikGy8cM,56919
4
- stackit/git/api_client.py,sha256=4eyq5FYf52n03GOnNPQMm86jWkyxG2Xd4FDQL4wJ3io,22633
5
- stackit/git/api_response.py,sha256=HRYkVqMNIlfODacTQPTbiVj2YdcnutpQrKJdeAoCSpM,642
6
- stackit/git/configuration.py,sha256=d67eVFatVjfalrJiEvFFxd43eGfXhWDRcICHJVxlPeY,5152
7
- stackit/git/exceptions.py,sha256=uFd6E06OTfuE8pAFcSl0rDc9mkjS_4qhiUtt3uT0EGM,5913
8
- stackit/git/models/__init__.py,sha256=SBZFXhfVnN4AdlG1Mka7UUWGSymSntO0lYlinXwJ5nk,895
9
- stackit/git/models/create_instance_payload.py,sha256=uIE-A0syyjkua6VTWMWJOApg5vlMejCpDtCxChkt9Hw,3455
10
- stackit/git/models/flavor.py,sha256=-d5zHxi20TyZu-oKBdIZpM46cSjN7_QKYltVBNg0lek,3335
11
- stackit/git/models/generic_error_response.py,sha256=65YqnPJHKoRGUy9aRFbu87MpnHrmG85UgxB0kdRJtUQ,2504
12
- stackit/git/models/instance.py,sha256=7oDGEtzyxbpljcRO09VjtYt4LoHffFMop1I1kxmnCY0,4958
13
- stackit/git/models/internal_server_error_response.py,sha256=QV34TumQJyMZmMZ3j8n2l8hyQHXNBL9ex8Q8bZFZecY,2445
14
- stackit/git/models/list_flavors.py,sha256=_uVWMh3JBMEoCePdxuStAXgc6MIFHbl3ZcArNrZI--k,2910
15
- stackit/git/models/list_instances.py,sha256=lw3caZOWswfa4PxGAKbiWC7jOz8PKed2vKI1zD5WGUY,3022
16
- stackit/git/models/unauthorized_response.py,sha256=Gyib18rAbkymMyN30MM2IQ4_O5X3webUnQVeH5RYorM,2438
17
- stackit/git/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
18
- stackit/git/rest.py,sha256=0jZHuEJ2tr5ICu1Qg65GfEjjY1yDQKFN1ff_g-gSTik,5789
19
- stackit_git-0.2.0.dist-info/LICENSE.md,sha256=3dF8Tb7yZn2tS4zyNa-yNe-68pH8qyWdGz4ioMd3MgE,10933
20
- stackit_git-0.2.0.dist-info/METADATA,sha256=lcztFKAC8fRfNmsUVMcRulnaTajOKYGjPm9e4ik4fo8,1589
21
- stackit_git-0.2.0.dist-info/NOTICE.txt,sha256=q8jngWyVHYJId-5_CsuOCwFg7t0R-qlHpZ0zd4gyWI8,47
22
- stackit_git-0.2.0.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
23
- stackit_git-0.2.0.dist-info/RECORD,,