Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion services/logs/oas_commit
Original file line number Diff line number Diff line change
@@ -1 +1 @@
c09e232a83532c75ca1041153e3ebc7ce2d50eb6
3495dec9dec80e7ef859725d8161fdb7940238a6
14 changes: 13 additions & 1 deletion services/logs/src/stackit/logs/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

This API provides endpoints for managing STACKIT Logs.

The version of the OpenAPI document: 1.0.0
The version of the OpenAPI document: 1.1.0
Generated by OpenAPI Generator (https://openapi-generator.tech)

Do not edit the class manually.
Expand All @@ -27,12 +27,16 @@
"ApiKeyError",
"ApiAttributeError",
"ApiException",
"AccessPolicy",
"AccessPolicyList",
"AccessToken",
"AccessTokenList",
"CreateAccessPolicyPayload",
"CreateAccessTokenPayload",
"CreateLogsInstancePayload",
"LogsInstance",
"LogsInstancesList",
"UpdateAccessPolicyPayload",
"UpdateAccessTokenPayload",
"UpdateLogsInstancePayload",
]
Expand All @@ -52,8 +56,13 @@
from stackit.logs.exceptions import OpenApiException as OpenApiException

# import models into sdk package
from stackit.logs.models.access_policy import AccessPolicy as AccessPolicy
from stackit.logs.models.access_policy_list import AccessPolicyList as AccessPolicyList
from stackit.logs.models.access_token import AccessToken as AccessToken
from stackit.logs.models.access_token_list import AccessTokenList as AccessTokenList
from stackit.logs.models.create_access_policy_payload import (
CreateAccessPolicyPayload as CreateAccessPolicyPayload,
)
from stackit.logs.models.create_access_token_payload import (
CreateAccessTokenPayload as CreateAccessTokenPayload,
)
Expand All @@ -64,6 +73,9 @@
from stackit.logs.models.logs_instances_list import (
LogsInstancesList as LogsInstancesList,
)
from stackit.logs.models.update_access_policy_payload import (
UpdateAccessPolicyPayload as UpdateAccessPolicyPayload,
)
from stackit.logs.models.update_access_token_payload import (
UpdateAccessTokenPayload as UpdateAccessTokenPayload,
)
Expand Down
2,301 changes: 2,011 additions & 290 deletions services/logs/src/stackit/logs/api/default_api.py

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion services/logs/src/stackit/logs/api_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

This API provides endpoints for managing STACKIT Logs.

The version of the OpenAPI document: 1.0.0
The version of the OpenAPI document: 1.1.0
Generated by OpenAPI Generator (https://openapi-generator.tech)

Do not edit the class manually.
Expand Down
2 changes: 1 addition & 1 deletion services/logs/src/stackit/logs/configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

This API provides endpoints for managing STACKIT Logs.

The version of the OpenAPI document: 1.0.0
The version of the OpenAPI document: 1.1.0
Generated by OpenAPI Generator (https://openapi-generator.tech)

Do not edit the class manually.
Expand Down
2 changes: 1 addition & 1 deletion services/logs/src/stackit/logs/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

This API provides endpoints for managing STACKIT Logs.

The version of the OpenAPI document: 1.0.0
The version of the OpenAPI document: 1.1.0
Generated by OpenAPI Generator (https://openapi-generator.tech)

Do not edit the class manually.
Expand Down
6 changes: 5 additions & 1 deletion services/logs/src/stackit/logs/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,22 @@

This API provides endpoints for managing STACKIT Logs.

The version of the OpenAPI document: 1.0.0
The version of the OpenAPI document: 1.1.0
Generated by OpenAPI Generator (https://openapi-generator.tech)

Do not edit the class manually.
""" # noqa: E501

# import models into model package
from stackit.logs.models.access_policy import AccessPolicy
from stackit.logs.models.access_policy_list import AccessPolicyList
from stackit.logs.models.access_token import AccessToken
from stackit.logs.models.access_token_list import AccessTokenList
from stackit.logs.models.create_access_policy_payload import CreateAccessPolicyPayload
from stackit.logs.models.create_access_token_payload import CreateAccessTokenPayload
from stackit.logs.models.create_logs_instance_payload import CreateLogsInstancePayload
from stackit.logs.models.logs_instance import LogsInstance
from stackit.logs.models.logs_instances_list import LogsInstancesList
from stackit.logs.models.update_access_policy_payload import UpdateAccessPolicyPayload
from stackit.logs.models.update_access_token_payload import UpdateAccessTokenPayload
from stackit.logs.models.update_logs_instance_payload import UpdateLogsInstancePayload
107 changes: 107 additions & 0 deletions services/logs/src/stackit/logs/models/access_policy.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
# coding: utf-8

"""
STACKIT Logs API

This API provides endpoints for managing STACKIT Logs.

The version of the OpenAPI document: 1.1.0
Generated by OpenAPI Generator (https://openapi-generator.tech)

Do not edit the class manually.
""" # noqa: E501

from __future__ import annotations

import json
import pprint
from typing import Any, ClassVar, Dict, List, Optional, Set
from uuid import UUID

from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator
from pydantic_core import to_jsonable_python
from typing_extensions import Annotated, Self


class AccessPolicy(BaseModel):
"""
AccessPolicy
""" # noqa: E501

description: Optional[Annotated[str, Field(strict=True, max_length=100)]] = Field(
default=None, description="The description of the access policy."
)
email: Annotated[str, Field(min_length=3, strict=True, max_length=254)] = Field(
description="The email address of the STACKIT IAM subject (user, group, or service account)."
)
id: UUID = Field(description="An auto generated unique id which identifies the access policy.")
permissions: List[StrictStr] = Field(
description="The access permissions granted to the access token or access policy."
)
__properties: ClassVar[List[str]] = ["description", "email", "id", "permissions"]

@field_validator("permissions")
def permissions_validate_enum(cls, value):
"""Validates the enum"""
for i in value:
if i not in set(["read", "write"]):
raise ValueError("each list item must be one of ('read', 'write')")
return value

model_config = ConfigDict(
validate_by_name=True,
validate_by_alias=True,
validate_assignment=True,
protected_namespaces=(),
)

def to_str(self) -> str:
"""Returns the string representation of the model using alias"""
return pprint.pformat(self.model_dump(by_alias=True))

def to_json(self) -> str:
"""Returns the JSON representation of the model using alias"""
return json.dumps(to_jsonable_python(self.to_dict()))

@classmethod
def from_json(cls, json_str: str) -> Optional[Self]:
"""Create an instance of AccessPolicy from a JSON string"""
return cls.from_dict(json.loads(json_str))

def to_dict(self) -> Dict[str, Any]:
"""Return the dictionary representation of the model using alias.

This has the following differences from calling pydantic's
`self.model_dump(by_alias=True)`:

* `None` is only added to the output dict for nullable fields that
were set at model initialization. Other fields with value `None`
are ignored.
"""
excluded_fields: Set[str] = set([])

_dict = self.model_dump(
by_alias=True,
exclude=excluded_fields,
exclude_none=True,
)
return _dict

@classmethod
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
"""Create an instance of AccessPolicy from a dict"""
if obj is None:
return None

if not isinstance(obj, dict):
return cls.model_validate(obj)

_obj = cls.model_validate(
{
"description": obj.get("description"),
"email": obj.get("email"),
"id": obj.get("id"),
"permissions": obj.get("permissions"),
}
)
return _obj
99 changes: 99 additions & 0 deletions services/logs/src/stackit/logs/models/access_policy_list.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
# coding: utf-8

"""
STACKIT Logs API

This API provides endpoints for managing STACKIT Logs.

The version of the OpenAPI document: 1.1.0
Generated by OpenAPI Generator (https://openapi-generator.tech)

Do not edit the class manually.
""" # noqa: E501

from __future__ import annotations

import json
import pprint
from typing import Any, ClassVar, Dict, List, Optional, Set

from pydantic import BaseModel, ConfigDict
from pydantic_core import to_jsonable_python
from typing_extensions import Self

from stackit.logs.models.access_policy import AccessPolicy


class AccessPolicyList(BaseModel):
"""
AccessPolicyList
""" # noqa: E501

policies: List[AccessPolicy]
__properties: ClassVar[List[str]] = ["policies"]

model_config = ConfigDict(
validate_by_name=True,
validate_by_alias=True,
validate_assignment=True,
protected_namespaces=(),
)

def to_str(self) -> str:
"""Returns the string representation of the model using alias"""
return pprint.pformat(self.model_dump(by_alias=True))

def to_json(self) -> str:
"""Returns the JSON representation of the model using alias"""
return json.dumps(to_jsonable_python(self.to_dict()))

@classmethod
def from_json(cls, json_str: str) -> Optional[Self]:
"""Create an instance of AccessPolicyList from a JSON string"""
return cls.from_dict(json.loads(json_str))

def to_dict(self) -> Dict[str, Any]:
"""Return the dictionary representation of the model using alias.

This has the following differences from calling pydantic's
`self.model_dump(by_alias=True)`:

* `None` is only added to the output dict for nullable fields that
were set at model initialization. Other fields with value `None`
are ignored.
"""
excluded_fields: Set[str] = set([])

_dict = self.model_dump(
by_alias=True,
exclude=excluded_fields,
exclude_none=True,
)
# override the default output from pydantic by calling `to_dict()` of each item in policies (list)
_items = []
if self.policies:
for _item_policies in self.policies:
if _item_policies:
_items.append(_item_policies.to_dict())
_dict["policies"] = _items
return _dict

@classmethod
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
"""Create an instance of AccessPolicyList from a dict"""
if obj is None:
return None

if not isinstance(obj, dict):
return cls.model_validate(obj)

_obj = cls.model_validate(
{
"policies": (
[AccessPolicy.from_dict(_item) for _item in obj["policies"]]
if obj.get("policies") is not None
else None
)
}
)
return _obj
6 changes: 4 additions & 2 deletions services/logs/src/stackit/logs/models/access_token.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

This API provides endpoints for managing STACKIT Logs.

The version of the OpenAPI document: 1.0.0
The version of the OpenAPI document: 1.1.0
Generated by OpenAPI Generator (https://openapi-generator.tech)

Do not edit the class manually.
Expand Down Expand Up @@ -49,7 +49,9 @@ class AccessToken(BaseModel):
)
expires: StrictBool = Field(description="Indicates if the access token can expire.")
id: UUID = Field(description="An auto generated unique id which identifies the access token.")
permissions: List[StrictStr] = Field(description="The access permissions granted to the access token.")
permissions: List[StrictStr] = Field(
description="The access permissions granted to the access token or access policy."
)
status: StrictStr
valid_until: Optional[datetime] = Field(
default=None,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

This API provides endpoints for managing STACKIT Logs.

The version of the OpenAPI document: 1.0.0
The version of the OpenAPI document: 1.1.0
Generated by OpenAPI Generator (https://openapi-generator.tech)

Do not edit the class manually.
Expand Down
Loading
Loading