Skip to content
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
from .types import AuthenticationEventMethod
from .types import AuthenticationEventOrigin
from .types import AuthenticationEventResult
from .types import ExportJobStatusCode
from .types import ListAuthenticationEventsRequestOrderBy
from .types import ListCombinedEventsRequestOrderBy
from .types import ListEventsRequestOrderBy
Expand Down Expand Up @@ -39,6 +40,7 @@
from .types import Event
from .types import SystemEvent
from .types import ExportJobS3
from .types import ExportJobStatus
from .types import ProductService
from .types import ListCombinedEventsResponseCombinedEvent
from .types import ExportJob
Expand All @@ -63,6 +65,7 @@
"AuthenticationEventMethod",
"AuthenticationEventOrigin",
"AuthenticationEventResult",
"ExportJobStatusCode",
"ListAuthenticationEventsRequestOrderBy",
"ListCombinedEventsRequestOrderBy",
"ListEventsRequestOrderBy",
Expand Down Expand Up @@ -97,6 +100,7 @@
"Event",
"SystemEvent",
"ExportJobS3",
"ExportJobStatus",
"ProductService",
"ListCombinedEventsResponseCombinedEvent",
"ExportJob",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
AuthenticationEventOrigin,
AuthenticationEventResult,
ExportJobS3,
ExportJobStatus,
ExportJob,
AccountOrganizationInfo,
AccountProjectInfo,
Expand Down Expand Up @@ -94,6 +95,29 @@ def unmarshal_ExportJobS3(data: Any) -> ExportJobS3:
return ExportJobS3(**args)


def unmarshal_ExportJobStatus(data: Any) -> ExportJobStatus:
if not isinstance(data, dict):
raise TypeError(
"Unmarshalling the type 'ExportJobStatus' failed as data isn't a dictionary."
)

args: dict[str, Any] = {}

field = data.get("code", None)
if field is not None:
args["code"] = field
else:
args["code"] = None

field = data.get("message", None)
if field is not None:
args["message"] = field
else:
args["message"] = None

return ExportJobStatus(**args)


def unmarshal_ExportJob(data: Any) -> ExportJob:
if not isinstance(data, dict):
raise TypeError(
Expand Down Expand Up @@ -146,6 +170,12 @@ def unmarshal_ExportJob(data: Any) -> ExportJob:
else:
args["last_run_at"] = None

field = data.get("last_status", None)
if field is not None:
args["last_status"] = unmarshal_ExportJobStatus(field)
else:
args["last_status"] = None

return ExportJob(**args)


Expand Down
26 changes: 23 additions & 3 deletions scaleway-async/scaleway_async/audit_trail/v1alpha1/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,15 @@ def __str__(self) -> str:
return str(self.value)


class ExportJobStatusCode(str, Enum, metaclass=StrEnumMeta):
UNKNOWN_CODE = "unknown_code"
SUCCESS = "success"
FAILURE = "failure"

def __str__(self) -> str:
return str(self.value)


class ListAuthenticationEventsRequestOrderBy(str, Enum, metaclass=StrEnumMeta):
RECORDED_AT_DESC = "recorded_at_desc"
RECORDED_AT_ASC = "recorded_at_asc"
Expand Down Expand Up @@ -511,6 +520,12 @@ class ExportJobS3:
project_id: Optional[str] = None


@dataclass
class ExportJobStatus:
code: ExportJobStatusCode
message: Optional[str] = None


@dataclass
class ProductService:
name: str
Expand Down Expand Up @@ -540,12 +555,12 @@ class ExportJob:

name: str
"""
Name of the export.
Name of the export job.
"""

tags: dict[str, str]
"""
Tags of the export.
Tags of the export job.
"""

created_at: Optional[datetime] = None
Expand All @@ -555,7 +570,12 @@ class ExportJob:

last_run_at: Optional[datetime] = None
"""
Last export date.
Last run of export job.
"""

last_status: Optional[ExportJobStatus] = None
"""
Status of last export job.
"""

s3: Optional[ExportJobS3] = None
Expand Down
4 changes: 4 additions & 0 deletions scaleway/scaleway/audit_trail/v1alpha1/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
from .types import AuthenticationEventMethod
from .types import AuthenticationEventOrigin
from .types import AuthenticationEventResult
from .types import ExportJobStatusCode
from .types import ListAuthenticationEventsRequestOrderBy
from .types import ListCombinedEventsRequestOrderBy
from .types import ListEventsRequestOrderBy
Expand Down Expand Up @@ -39,6 +40,7 @@
from .types import Event
from .types import SystemEvent
from .types import ExportJobS3
from .types import ExportJobStatus
from .types import ProductService
from .types import ListCombinedEventsResponseCombinedEvent
from .types import ExportJob
Expand All @@ -63,6 +65,7 @@
"AuthenticationEventMethod",
"AuthenticationEventOrigin",
"AuthenticationEventResult",
"ExportJobStatusCode",
"ListAuthenticationEventsRequestOrderBy",
"ListCombinedEventsRequestOrderBy",
"ListEventsRequestOrderBy",
Expand Down Expand Up @@ -97,6 +100,7 @@
"Event",
"SystemEvent",
"ExportJobS3",
"ExportJobStatus",
"ProductService",
"ListCombinedEventsResponseCombinedEvent",
"ExportJob",
Expand Down
30 changes: 30 additions & 0 deletions scaleway/scaleway/audit_trail/v1alpha1/marshalling.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
AuthenticationEventOrigin,
AuthenticationEventResult,
ExportJobS3,
ExportJobStatus,
ExportJob,
AccountOrganizationInfo,
AccountProjectInfo,
Expand Down Expand Up @@ -94,6 +95,29 @@ def unmarshal_ExportJobS3(data: Any) -> ExportJobS3:
return ExportJobS3(**args)


def unmarshal_ExportJobStatus(data: Any) -> ExportJobStatus:
if not isinstance(data, dict):
raise TypeError(
"Unmarshalling the type 'ExportJobStatus' failed as data isn't a dictionary."
)

args: dict[str, Any] = {}

field = data.get("code", None)
if field is not None:
args["code"] = field
else:
args["code"] = None

field = data.get("message", None)
if field is not None:
args["message"] = field
else:
args["message"] = None

return ExportJobStatus(**args)


def unmarshal_ExportJob(data: Any) -> ExportJob:
if not isinstance(data, dict):
raise TypeError(
Expand Down Expand Up @@ -146,6 +170,12 @@ def unmarshal_ExportJob(data: Any) -> ExportJob:
else:
args["last_run_at"] = None

field = data.get("last_status", None)
if field is not None:
args["last_status"] = unmarshal_ExportJobStatus(field)
else:
args["last_status"] = None

return ExportJob(**args)


Expand Down
26 changes: 23 additions & 3 deletions scaleway/scaleway/audit_trail/v1alpha1/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,15 @@ def __str__(self) -> str:
return str(self.value)


class ExportJobStatusCode(str, Enum, metaclass=StrEnumMeta):
UNKNOWN_CODE = "unknown_code"
SUCCESS = "success"
FAILURE = "failure"

def __str__(self) -> str:
return str(self.value)


class ListAuthenticationEventsRequestOrderBy(str, Enum, metaclass=StrEnumMeta):
RECORDED_AT_DESC = "recorded_at_desc"
RECORDED_AT_ASC = "recorded_at_asc"
Expand Down Expand Up @@ -511,6 +520,12 @@ class ExportJobS3:
project_id: Optional[str] = None


@dataclass
class ExportJobStatus:
code: ExportJobStatusCode
message: Optional[str] = None


@dataclass
class ProductService:
name: str
Expand Down Expand Up @@ -540,12 +555,12 @@ class ExportJob:

name: str
"""
Name of the export.
Name of the export job.
"""

tags: dict[str, str]
"""
Tags of the export.
Tags of the export job.
"""

created_at: Optional[datetime] = None
Expand All @@ -555,7 +570,12 @@ class ExportJob:

last_run_at: Optional[datetime] = None
"""
Last export date.
Last run of export job.
"""

last_status: Optional[ExportJobStatus] = None
"""
Status of last export job.
"""

s3: Optional[ExportJobS3] = None
Expand Down