Skip to content

Commit 28eed61

Browse files
Generate logs
1 parent 2b94af1 commit 28eed61

20 files changed

Lines changed: 2523 additions & 313 deletions

‎services/logs/oas_commit‎

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

‎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.3.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.3.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.3.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.3.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.3.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: 109 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
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.3.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+
labels: Optional[Dict[str, StrictStr]] = Field(default=None, description="Labels as key-value pairs.")
39+
permissions: List[StrictStr] = Field(
40+
description="The access permissions granted to the access token or access policy."
41+
)
42+
__properties: ClassVar[List[str]] = ["description", "email", "id", "labels", "permissions"]
43+
44+
@field_validator("permissions")
45+
def permissions_validate_enum(cls, value):
46+
"""Validates the enum"""
47+
for i in value:
48+
if i not in set(["read", "write"]):
49+
raise ValueError("each list item must be one of ('read', 'write')")
50+
return value
51+
52+
model_config = ConfigDict(
53+
validate_by_name=True,
54+
validate_by_alias=True,
55+
validate_assignment=True,
56+
protected_namespaces=(),
57+
)
58+
59+
def to_str(self) -> str:
60+
"""Returns the string representation of the model using alias"""
61+
return pprint.pformat(self.model_dump(by_alias=True))
62+
63+
def to_json(self) -> str:
64+
"""Returns the JSON representation of the model using alias"""
65+
return json.dumps(to_jsonable_python(self.to_dict()))
66+
67+
@classmethod
68+
def from_json(cls, json_str: str) -> Optional[Self]:
69+
"""Create an instance of AccessPolicy from a JSON string"""
70+
return cls.from_dict(json.loads(json_str))
71+
72+
def to_dict(self) -> Dict[str, Any]:
73+
"""Return the dictionary representation of the model using alias.
74+
75+
This has the following differences from calling pydantic's
76+
`self.model_dump(by_alias=True)`:
77+
78+
* `None` is only added to the output dict for nullable fields that
79+
were set at model initialization. Other fields with value `None`
80+
are ignored.
81+
"""
82+
excluded_fields: Set[str] = set([])
83+
84+
_dict = self.model_dump(
85+
by_alias=True,
86+
exclude=excluded_fields,
87+
exclude_none=True,
88+
)
89+
return _dict
90+
91+
@classmethod
92+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
93+
"""Create an instance of AccessPolicy from a dict"""
94+
if obj is None:
95+
return None
96+
97+
if not isinstance(obj, dict):
98+
return cls.model_validate(obj)
99+
100+
_obj = cls.model_validate(
101+
{
102+
"description": obj.get("description"),
103+
"email": obj.get("email"),
104+
"id": obj.get("id"),
105+
"labels": obj.get("labels"),
106+
"permissions": obj.get("permissions"),
107+
}
108+
)
109+
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.3.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: 7 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.3.0
99
Generated by OpenAPI Generator (https://openapi-generator.tech)
1010
1111
Do not edit the class manually.
@@ -49,7 +49,10 @@ 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+
labels: Optional[Dict[str, StrictStr]] = Field(default=None, description="Labels as key-value pairs.")
53+
permissions: List[StrictStr] = Field(
54+
description="The access permissions granted to the access token or access policy."
55+
)
5356
status: StrictStr
5457
valid_until: Optional[datetime] = Field(
5558
default=None,
@@ -63,6 +66,7 @@ class AccessToken(BaseModel):
6366
"displayName",
6467
"expires",
6568
"id",
69+
"labels",
6670
"permissions",
6771
"status",
6872
"validUntil",
@@ -162,6 +166,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
162166
"displayName": obj.get("displayName"),
163167
"expires": obj.get("expires"),
164168
"id": obj.get("id"),
169+
"labels": obj.get("labels"),
165170
"permissions": obj.get("permissions"),
166171
"status": obj.get("status"),
167172
"validUntil": obj.get("validUntil"),

0 commit comments

Comments
 (0)