diff --git a/scaleway-async/scaleway_async/audit_trail/v1alpha1/__init__.py b/scaleway-async/scaleway_async/audit_trail/v1alpha1/__init__.py index fbfc50c1d..c234d260c 100644 --- a/scaleway-async/scaleway_async/audit_trail/v1alpha1/__init__.py +++ b/scaleway-async/scaleway_async/audit_trail/v1alpha1/__init__.py @@ -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 @@ -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 @@ -63,6 +65,7 @@ "AuthenticationEventMethod", "AuthenticationEventOrigin", "AuthenticationEventResult", + "ExportJobStatusCode", "ListAuthenticationEventsRequestOrderBy", "ListCombinedEventsRequestOrderBy", "ListEventsRequestOrderBy", @@ -97,6 +100,7 @@ "Event", "SystemEvent", "ExportJobS3", + "ExportJobStatus", "ProductService", "ListCombinedEventsResponseCombinedEvent", "ExportJob", diff --git a/scaleway-async/scaleway_async/audit_trail/v1alpha1/marshalling.py b/scaleway-async/scaleway_async/audit_trail/v1alpha1/marshalling.py index 29ad09d9f..b65b8db0b 100644 --- a/scaleway-async/scaleway_async/audit_trail/v1alpha1/marshalling.py +++ b/scaleway-async/scaleway_async/audit_trail/v1alpha1/marshalling.py @@ -16,6 +16,7 @@ AuthenticationEventOrigin, AuthenticationEventResult, ExportJobS3, + ExportJobStatus, ExportJob, AccountOrganizationInfo, AccountProjectInfo, @@ -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( @@ -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) diff --git a/scaleway-async/scaleway_async/audit_trail/v1alpha1/types.py b/scaleway-async/scaleway_async/audit_trail/v1alpha1/types.py index 5c9e32993..39c509d43 100644 --- a/scaleway-async/scaleway_async/audit_trail/v1alpha1/types.py +++ b/scaleway-async/scaleway_async/audit_trail/v1alpha1/types.py @@ -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" @@ -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 @@ -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 @@ -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 diff --git a/scaleway/scaleway/audit_trail/v1alpha1/__init__.py b/scaleway/scaleway/audit_trail/v1alpha1/__init__.py index fbfc50c1d..c234d260c 100644 --- a/scaleway/scaleway/audit_trail/v1alpha1/__init__.py +++ b/scaleway/scaleway/audit_trail/v1alpha1/__init__.py @@ -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 @@ -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 @@ -63,6 +65,7 @@ "AuthenticationEventMethod", "AuthenticationEventOrigin", "AuthenticationEventResult", + "ExportJobStatusCode", "ListAuthenticationEventsRequestOrderBy", "ListCombinedEventsRequestOrderBy", "ListEventsRequestOrderBy", @@ -97,6 +100,7 @@ "Event", "SystemEvent", "ExportJobS3", + "ExportJobStatus", "ProductService", "ListCombinedEventsResponseCombinedEvent", "ExportJob", diff --git a/scaleway/scaleway/audit_trail/v1alpha1/marshalling.py b/scaleway/scaleway/audit_trail/v1alpha1/marshalling.py index 29ad09d9f..b65b8db0b 100644 --- a/scaleway/scaleway/audit_trail/v1alpha1/marshalling.py +++ b/scaleway/scaleway/audit_trail/v1alpha1/marshalling.py @@ -16,6 +16,7 @@ AuthenticationEventOrigin, AuthenticationEventResult, ExportJobS3, + ExportJobStatus, ExportJob, AccountOrganizationInfo, AccountProjectInfo, @@ -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( @@ -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) diff --git a/scaleway/scaleway/audit_trail/v1alpha1/types.py b/scaleway/scaleway/audit_trail/v1alpha1/types.py index 5c9e32993..39c509d43 100644 --- a/scaleway/scaleway/audit_trail/v1alpha1/types.py +++ b/scaleway/scaleway/audit_trail/v1alpha1/types.py @@ -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" @@ -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 @@ -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 @@ -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