Skip to content

Commit f507c4d

Browse files
Generate git
1 parent 3b07ac5 commit f507c4d

15 files changed

+709
-203
lines changed

services/git/src/stackit/git/__init__.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55
"""
66
STACKIT Git API
77
8-
Manage STACKIT Git instances.
8+
STACKIT Git management API.
99
10-
The version of the OpenAPI document: 1beta.0.3
10+
The version of the OpenAPI document: 1beta.0.4
1111
1212
Generated by OpenAPI Generator (https://openapi-generator.tech)
1313
@@ -35,9 +35,12 @@
3535

3636
# import models into sdk package
3737
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
3840
from stackit.git.models.instance import Instance
3941
from stackit.git.models.internal_server_error_response import (
4042
InternalServerErrorResponse,
4143
)
44+
from stackit.git.models.list_flavors import ListFlavors
4245
from stackit.git.models.list_instances import ListInstances
4346
from stackit.git.models.unauthorized_response import UnauthorizedResponse

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

Lines changed: 346 additions & 158 deletions
Large diffs are not rendered by default.

services/git/src/stackit/git/api_client.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
"""
44
STACKIT Git API
55
6-
Manage STACKIT Git instances.
6+
STACKIT Git management API.
77
8-
The version of the OpenAPI document: 1beta.0.3
8+
The version of the OpenAPI document: 1beta.0.4
99
1010
Generated by OpenAPI Generator (https://openapi-generator.tech)
1111

services/git/src/stackit/git/configuration.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@
88
"""
99
STACKIT Git API
1010
11-
Manage STACKIT Git instances.
11+
STACKIT Git management API.
1212
13-
The version of the OpenAPI document: 1beta.0.3
13+
The version of the OpenAPI document: 1beta.0.4
1414
1515
Generated by OpenAPI Generator (https://openapi-generator.tech)
1616

services/git/src/stackit/git/exceptions.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
"""
44
STACKIT Git API
55
6-
Manage STACKIT Git instances.
6+
STACKIT Git management API.
77
8-
The version of the OpenAPI document: 1beta.0.3
8+
The version of the OpenAPI document: 1beta.0.4
99
1010
Generated by OpenAPI Generator (https://openapi-generator.tech)
1111

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

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
"""
55
STACKIT Git API
66
7-
Manage STACKIT Git instances.
7+
STACKIT Git management API.
88
9-
The version of the OpenAPI document: 1beta.0.3
9+
The version of the OpenAPI document: 1beta.0.4
1010
1111
Generated by OpenAPI Generator (https://openapi-generator.tech)
1212
@@ -16,9 +16,12 @@
1616

1717
# import models into model package
1818
from stackit.git.models.create_instance_payload import CreateInstancePayload
19+
from stackit.git.models.flavor import Flavor
20+
from stackit.git.models.generic_error_response import GenericErrorResponse
1921
from stackit.git.models.instance import Instance
2022
from stackit.git.models.internal_server_error_response import (
2123
InternalServerErrorResponse,
2224
)
25+
from stackit.git.models.list_flavors import ListFlavors
2326
from stackit.git.models.list_instances import ListInstances
2427
from stackit.git.models.unauthorized_response import UnauthorizedResponse

services/git/src/stackit/git/models/create_instance_payload.py

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
"""
44
STACKIT Git API
55
6-
Manage STACKIT Git instances.
6+
STACKIT Git management API.
77
8-
The version of the OpenAPI document: 1beta.0.3
8+
The version of the OpenAPI document: 1beta.0.4
99
1010
Generated by OpenAPI Generator (https://openapi-generator.tech)
1111
@@ -19,19 +19,25 @@
1919
import re
2020
from typing import Any, ClassVar, Dict, List, Optional, Set
2121

22-
from pydantic import BaseModel, ConfigDict, Field, field_validator
22+
from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator
2323
from typing_extensions import Annotated, Self
2424

2525

2626
class CreateInstancePayload(BaseModel):
2727
"""
28-
Request a STACKIT Git instance to be created with these properties.
28+
Instance creation configuration options.
2929
"""
3030

31+
acl: Optional[Annotated[List[StrictStr], Field(max_length=5)]] = Field(
32+
default=None, description="Restricted ACL for instance access."
33+
)
34+
flavor: Optional[StrictStr] = Field(
35+
default="git-100", description="Instance flavor. Defaults to git-100 if not specified."
36+
)
3137
name: Annotated[str, Field(min_length=5, strict=True, max_length=32)] = Field(
3238
description="A user chosen name to distinguish multiple STACKIT Git instances."
3339
)
34-
__properties: ClassVar[List[str]] = ["name"]
40+
__properties: ClassVar[List[str]] = ["acl", "flavor", "name"]
3541

3642
@field_validator("name")
3743
def name_validate_regular_expression(cls, value):
@@ -88,5 +94,11 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
8894
if not isinstance(obj, dict):
8995
return cls.model_validate(obj)
9096

91-
_obj = cls.model_validate({"name": obj.get("name")})
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+
)
92104
return _obj
Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
# coding: utf-8
2+
3+
"""
4+
STACKIT Git API
5+
6+
STACKIT Git management API.
7+
8+
The version of the OpenAPI document: 1beta.0.4
9+
10+
Generated by OpenAPI Generator (https://openapi-generator.tech)
11+
12+
Do not edit the class manually.
13+
""" # noqa: E501 docstring might be too long
14+
15+
from __future__ import annotations
16+
17+
import json
18+
import pprint
19+
from typing import Any, ClassVar, Dict, List, Optional, Set
20+
21+
from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator
22+
from typing_extensions import Annotated, Self
23+
24+
25+
class Flavor(BaseModel):
26+
"""
27+
Describes a STACKIT Git Flavor.
28+
"""
29+
30+
availability: StrictStr = Field(description="Defines the flavor availability.")
31+
description: StrictStr = Field(description="Flavor description.")
32+
display_name: StrictStr = Field(description="The display name that will be shown in the Portal.")
33+
id: Annotated[str, Field(strict=True, max_length=36)] = Field(description="Flavor id.")
34+
__properties: ClassVar[List[str]] = ["availability", "description", "display_name", "id"]
35+
36+
@field_validator("availability")
37+
def availability_validate_enum(cls, value):
38+
"""Validates the enum"""
39+
if value not in set(["available", "unavailable", "internal", "deprecated"]):
40+
raise ValueError("must be one of enum values ('available', 'unavailable', 'internal', 'deprecated')")
41+
return value
42+
43+
model_config = ConfigDict(
44+
populate_by_name=True,
45+
validate_assignment=True,
46+
protected_namespaces=(),
47+
)
48+
49+
def to_str(self) -> str:
50+
"""Returns the string representation of the model using alias"""
51+
return pprint.pformat(self.model_dump(by_alias=True))
52+
53+
def to_json(self) -> str:
54+
"""Returns the JSON representation of the model using alias"""
55+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
56+
return json.dumps(self.to_dict())
57+
58+
@classmethod
59+
def from_json(cls, json_str: str) -> Optional[Self]:
60+
"""Create an instance of Flavor from a JSON string"""
61+
return cls.from_dict(json.loads(json_str))
62+
63+
def to_dict(self) -> Dict[str, Any]:
64+
"""Return the dictionary representation of the model using alias.
65+
66+
This has the following differences from calling pydantic's
67+
`self.model_dump(by_alias=True)`:
68+
69+
* `None` is only added to the output dict for nullable fields that
70+
were set at model initialization. Other fields with value `None`
71+
are ignored.
72+
"""
73+
excluded_fields: Set[str] = set([])
74+
75+
_dict = self.model_dump(
76+
by_alias=True,
77+
exclude=excluded_fields,
78+
exclude_none=True,
79+
)
80+
return _dict
81+
82+
@classmethod
83+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
84+
"""Create an instance of Flavor from a dict"""
85+
if obj is None:
86+
return None
87+
88+
if not isinstance(obj, dict):
89+
return cls.model_validate(obj)
90+
91+
_obj = cls.model_validate(
92+
{
93+
"availability": obj.get("availability"),
94+
"description": obj.get("description"),
95+
"display_name": obj.get("display_name"),
96+
"id": obj.get("id"),
97+
}
98+
)
99+
return _obj
Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
# coding: utf-8
2+
3+
"""
4+
STACKIT Git API
5+
6+
STACKIT Git management API.
7+
8+
The version of the OpenAPI document: 1beta.0.4
9+
10+
Generated by OpenAPI Generator (https://openapi-generator.tech)
11+
12+
Do not edit the class manually.
13+
""" # noqa: E501 docstring might be too long
14+
15+
from __future__ import annotations
16+
17+
import json
18+
import pprint
19+
from typing import Any, ClassVar, Dict, List, Optional, Set
20+
21+
from pydantic import BaseModel, ConfigDict, StrictStr
22+
from typing_extensions import Self
23+
24+
25+
class GenericErrorResponse(BaseModel):
26+
"""
27+
Generic Error Response.
28+
"""
29+
30+
details: Optional[List[StrictStr]] = None
31+
message: StrictStr
32+
__properties: ClassVar[List[str]] = ["details", "message"]
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 GenericErrorResponse 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+
return _dict
72+
73+
@classmethod
74+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
75+
"""Create an instance of GenericErrorResponse from a dict"""
76+
if obj is None:
77+
return None
78+
79+
if not isinstance(obj, dict):
80+
return cls.model_validate(obj)
81+
82+
_obj = cls.model_validate({"details": obj.get("details"), "message": obj.get("message")})
83+
return _obj

0 commit comments

Comments
 (0)