Skip to content

Commit f25c076

Browse files
Generate logs
1 parent f4a8258 commit f25c076

20 files changed

Lines changed: 2463 additions & 307 deletions

services/logs/oas_commit

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
c09e232a83532c75ca1041153e3ebc7ce2d50eb6
1+
3495dec9dec80e7ef859725d8161fdb7940238a6

services/logs/src/stackit/logs/__init__.py

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
88
This API provides endpoints for managing STACKIT Logs.
99
10-
The version of the OpenAPI document: 1.0.0
10+
The version of the OpenAPI document: 1.1.0
1111
Generated by OpenAPI Generator (https://openapi-generator.tech)
1212
1313
Do not edit the class manually.
@@ -27,12 +27,16 @@
2727
"ApiKeyError",
2828
"ApiAttributeError",
2929
"ApiException",
30+
"AccessPolicy",
31+
"AccessPolicyList",
3032
"AccessToken",
3133
"AccessTokenList",
34+
"CreateAccessPolicyPayload",
3235
"CreateAccessTokenPayload",
3336
"CreateLogsInstancePayload",
3437
"LogsInstance",
3538
"LogsInstancesList",
39+
"UpdateAccessPolicyPayload",
3640
"UpdateAccessTokenPayload",
3741
"UpdateLogsInstancePayload",
3842
]
@@ -52,8 +56,13 @@
5256
from stackit.logs.exceptions import OpenApiException as OpenApiException
5357

5458
# import models into sdk package
59+
from stackit.logs.models.access_policy import AccessPolicy as AccessPolicy
60+
from stackit.logs.models.access_policy_list import AccessPolicyList as AccessPolicyList
5561
from stackit.logs.models.access_token import AccessToken as AccessToken
5662
from stackit.logs.models.access_token_list import AccessTokenList as AccessTokenList
63+
from stackit.logs.models.create_access_policy_payload import (
64+
CreateAccessPolicyPayload as CreateAccessPolicyPayload,
65+
)
5766
from stackit.logs.models.create_access_token_payload import (
5867
CreateAccessTokenPayload as CreateAccessTokenPayload,
5968
)
@@ -64,6 +73,9 @@
6473
from stackit.logs.models.logs_instances_list import (
6574
LogsInstancesList as LogsInstancesList,
6675
)
76+
from stackit.logs.models.update_access_policy_payload import (
77+
UpdateAccessPolicyPayload as UpdateAccessPolicyPayload,
78+
)
6779
from stackit.logs.models.update_access_token_payload import (
6880
UpdateAccessTokenPayload as UpdateAccessTokenPayload,
6981
)

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

Lines changed: 2011 additions & 290 deletions
Large diffs are not rendered by default.

services/logs/src/stackit/logs/api_client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
66
This API provides endpoints for managing STACKIT Logs.
77
8-
The version of the OpenAPI document: 1.0.0
8+
The version of the OpenAPI document: 1.1.0
99
Generated by OpenAPI Generator (https://openapi-generator.tech)
1010
1111
Do not edit the class manually.

services/logs/src/stackit/logs/configuration.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
66
This API provides endpoints for managing STACKIT Logs.
77
8-
The version of the OpenAPI document: 1.0.0
8+
The version of the OpenAPI document: 1.1.0
99
Generated by OpenAPI Generator (https://openapi-generator.tech)
1010
1111
Do not edit the class manually.

services/logs/src/stackit/logs/exceptions.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
66
This API provides endpoints for managing STACKIT Logs.
77
8-
The version of the OpenAPI document: 1.0.0
8+
The version of the OpenAPI document: 1.1.0
99
Generated by OpenAPI Generator (https://openapi-generator.tech)
1010
1111
Do not edit the class manually.

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,22 @@
66
77
This API provides endpoints for managing STACKIT Logs.
88
9-
The version of the OpenAPI document: 1.0.0
9+
The version of the OpenAPI document: 1.1.0
1010
Generated by OpenAPI Generator (https://openapi-generator.tech)
1111
1212
Do not edit the class manually.
1313
""" # noqa: E501
1414

1515
# import models into model package
16+
from stackit.logs.models.access_policy import AccessPolicy
17+
from stackit.logs.models.access_policy_list import AccessPolicyList
1618
from stackit.logs.models.access_token import AccessToken
1719
from stackit.logs.models.access_token_list import AccessTokenList
20+
from stackit.logs.models.create_access_policy_payload import CreateAccessPolicyPayload
1821
from stackit.logs.models.create_access_token_payload import CreateAccessTokenPayload
1922
from stackit.logs.models.create_logs_instance_payload import CreateLogsInstancePayload
2023
from stackit.logs.models.logs_instance import LogsInstance
2124
from stackit.logs.models.logs_instances_list import LogsInstancesList
25+
from stackit.logs.models.update_access_policy_payload import UpdateAccessPolicyPayload
2226
from stackit.logs.models.update_access_token_payload import UpdateAccessTokenPayload
2327
from stackit.logs.models.update_logs_instance_payload import UpdateLogsInstancePayload
Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
# coding: utf-8
2+
3+
"""
4+
STACKIT Logs API
5+
6+
This API provides endpoints for managing STACKIT Logs.
7+
8+
The version of the OpenAPI document: 1.1.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+
from uuid import UUID
20+
21+
from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator
22+
from pydantic_core import to_jsonable_python
23+
from typing_extensions import Annotated, Self
24+
25+
26+
class AccessPolicy(BaseModel):
27+
"""
28+
AccessPolicy
29+
""" # noqa: E501
30+
31+
description: Optional[Annotated[str, Field(strict=True, max_length=100)]] = Field(
32+
default=None, description="The description of the access policy."
33+
)
34+
email: Annotated[str, Field(min_length=3, strict=True, max_length=254)] = Field(
35+
description="The email address of the STACKIT IAM subject (user, group, or service account)."
36+
)
37+
id: UUID = Field(description="An auto generated unique id which identifies the access policy.")
38+
permissions: List[StrictStr] = Field(
39+
description="The access permissions granted to the access token or access policy."
40+
)
41+
__properties: ClassVar[List[str]] = ["description", "email", "id", "permissions"]
42+
43+
@field_validator("permissions")
44+
def permissions_validate_enum(cls, value):
45+
"""Validates the enum"""
46+
for i in value:
47+
if i not in set(["read", "write"]):
48+
raise ValueError("each list item must be one of ('read', 'write')")
49+
return value
50+
51+
model_config = ConfigDict(
52+
validate_by_name=True,
53+
validate_by_alias=True,
54+
validate_assignment=True,
55+
protected_namespaces=(),
56+
)
57+
58+
def to_str(self) -> str:
59+
"""Returns the string representation of the model using alias"""
60+
return pprint.pformat(self.model_dump(by_alias=True))
61+
62+
def to_json(self) -> str:
63+
"""Returns the JSON representation of the model using alias"""
64+
return json.dumps(to_jsonable_python(self.to_dict()))
65+
66+
@classmethod
67+
def from_json(cls, json_str: str) -> Optional[Self]:
68+
"""Create an instance of AccessPolicy from a JSON string"""
69+
return cls.from_dict(json.loads(json_str))
70+
71+
def to_dict(self) -> Dict[str, Any]:
72+
"""Return the dictionary representation of the model using alias.
73+
74+
This has the following differences from calling pydantic's
75+
`self.model_dump(by_alias=True)`:
76+
77+
* `None` is only added to the output dict for nullable fields that
78+
were set at model initialization. Other fields with value `None`
79+
are ignored.
80+
"""
81+
excluded_fields: Set[str] = set([])
82+
83+
_dict = self.model_dump(
84+
by_alias=True,
85+
exclude=excluded_fields,
86+
exclude_none=True,
87+
)
88+
return _dict
89+
90+
@classmethod
91+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
92+
"""Create an instance of AccessPolicy from a dict"""
93+
if obj is None:
94+
return None
95+
96+
if not isinstance(obj, dict):
97+
return cls.model_validate(obj)
98+
99+
_obj = cls.model_validate(
100+
{
101+
"description": obj.get("description"),
102+
"email": obj.get("email"),
103+
"id": obj.get("id"),
104+
"permissions": obj.get("permissions"),
105+
}
106+
)
107+
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 Logs API
5+
6+
This API provides endpoints for managing STACKIT Logs.
7+
8+
The version of the OpenAPI document: 1.1.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 pydantic_core import to_jsonable_python
22+
from typing_extensions import Self
23+
24+
from stackit.logs.models.access_policy import AccessPolicy
25+
26+
27+
class AccessPolicyList(BaseModel):
28+
"""
29+
AccessPolicyList
30+
""" # noqa: E501
31+
32+
policies: List[AccessPolicy]
33+
__properties: ClassVar[List[str]] = ["policies"]
34+
35+
model_config = ConfigDict(
36+
validate_by_name=True,
37+
validate_by_alias=True,
38+
validate_assignment=True,
39+
protected_namespaces=(),
40+
)
41+
42+
def to_str(self) -> str:
43+
"""Returns the string representation of the model using alias"""
44+
return pprint.pformat(self.model_dump(by_alias=True))
45+
46+
def to_json(self) -> str:
47+
"""Returns the JSON representation of the model using alias"""
48+
return json.dumps(to_jsonable_python(self.to_dict()))
49+
50+
@classmethod
51+
def from_json(cls, json_str: str) -> Optional[Self]:
52+
"""Create an instance of AccessPolicyList from a JSON string"""
53+
return cls.from_dict(json.loads(json_str))
54+
55+
def to_dict(self) -> Dict[str, Any]:
56+
"""Return the dictionary representation of the model using alias.
57+
58+
This has the following differences from calling pydantic's
59+
`self.model_dump(by_alias=True)`:
60+
61+
* `None` is only added to the output dict for nullable fields that
62+
were set at model initialization. Other fields with value `None`
63+
are ignored.
64+
"""
65+
excluded_fields: Set[str] = set([])
66+
67+
_dict = self.model_dump(
68+
by_alias=True,
69+
exclude=excluded_fields,
70+
exclude_none=True,
71+
)
72+
# override the default output from pydantic by calling `to_dict()` of each item in policies (list)
73+
_items = []
74+
if self.policies:
75+
for _item_policies in self.policies:
76+
if _item_policies:
77+
_items.append(_item_policies.to_dict())
78+
_dict["policies"] = _items
79+
return _dict
80+
81+
@classmethod
82+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
83+
"""Create an instance of AccessPolicyList from a dict"""
84+
if obj is None:
85+
return None
86+
87+
if not isinstance(obj, dict):
88+
return cls.model_validate(obj)
89+
90+
_obj = cls.model_validate(
91+
{
92+
"policies": (
93+
[AccessPolicy.from_dict(_item) for _item in obj["policies"]]
94+
if obj.get("policies") is not None
95+
else None
96+
)
97+
}
98+
)
99+
return _obj

services/logs/src/stackit/logs/models/access_token.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
66
This API provides endpoints for managing STACKIT Logs.
77
8-
The version of the OpenAPI document: 1.0.0
8+
The version of the OpenAPI document: 1.1.0
99
Generated by OpenAPI Generator (https://openapi-generator.tech)
1010
1111
Do not edit the class manually.
@@ -49,7 +49,9 @@ class AccessToken(BaseModel):
4949
)
5050
expires: StrictBool = Field(description="Indicates if the access token can expire.")
5151
id: UUID = Field(description="An auto generated unique id which identifies the access token.")
52-
permissions: List[StrictStr] = Field(description="The access permissions granted to the access token.")
52+
permissions: List[StrictStr] = Field(
53+
description="The access permissions granted to the access token or access policy."
54+
)
5355
status: StrictStr
5456
valid_until: Optional[datetime] = Field(
5557
default=None,

0 commit comments

Comments
 (0)