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 @@ -42,6 +42,7 @@
from .types import ListCombinedEventsResponseCombinedEvent
from .types import Product
from .types import CreateExportJobRequest
from .types import DeleteExportJobRequest
from .types import ExportJob
from .types import ListAuthenticationEventsRequest
from .types import ListAuthenticationEventsResponse
Expand Down Expand Up @@ -96,6 +97,7 @@
"ListCombinedEventsResponseCombinedEvent",
"Product",
"CreateExportJobRequest",
"DeleteExportJobRequest",
"ExportJob",
"ListAuthenticationEventsRequest",
"ListAuthenticationEventsResponse",
Expand Down
32 changes: 32 additions & 0 deletions scaleway-async/scaleway_async/audit_trail/v1alpha1/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -303,3 +303,35 @@ async def create_export_job(

self._throw_on_error(res)
return unmarshal_ExportJob(res.json())

async def delete_export_job(
self,
*,
export_job_id: str,
region: Optional[ScwRegion] = None,
) -> None:
"""
Delete an export job.
Deletes an export job for a specified id.
:param export_job_id: ID of the export job.
:param region: Region to target. If none is passed will use default region from the config.

Usage:
::

result = await api.delete_export_job(
export_job_id="example",
)
"""

param_region = validate_path_param(
"region", region or self.client.default_region
)
param_export_job_id = validate_path_param("export_job_id", export_job_id)

res = self._request(
"DELETE",
f"/audit-trail/v1alpha1/regions/{param_region}/export-jobs/{param_export_job_id}",
)

self._throw_on_error(res)
13 changes: 13 additions & 0 deletions scaleway-async/scaleway_async/audit_trail/v1alpha1/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -559,6 +559,19 @@ class CreateExportJobRequest:
s3: Optional[ExportJobS3] = None


@dataclass
class DeleteExportJobRequest:
export_job_id: str
"""
ID of the export job.
"""

region: Optional[ScwRegion] = None
"""
Region to target. If none is passed will use default region from the config.
"""


@dataclass
class ExportJob:
id: str
Expand Down
2 changes: 2 additions & 0 deletions scaleway/scaleway/audit_trail/v1alpha1/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
from .types import ListCombinedEventsResponseCombinedEvent
from .types import Product
from .types import CreateExportJobRequest
from .types import DeleteExportJobRequest
from .types import ExportJob
from .types import ListAuthenticationEventsRequest
from .types import ListAuthenticationEventsResponse
Expand Down Expand Up @@ -96,6 +97,7 @@
"ListCombinedEventsResponseCombinedEvent",
"Product",
"CreateExportJobRequest",
"DeleteExportJobRequest",
"ExportJob",
"ListAuthenticationEventsRequest",
"ListAuthenticationEventsResponse",
Expand Down
32 changes: 32 additions & 0 deletions scaleway/scaleway/audit_trail/v1alpha1/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -303,3 +303,35 @@ def create_export_job(

self._throw_on_error(res)
return unmarshal_ExportJob(res.json())

def delete_export_job(
self,
*,
export_job_id: str,
region: Optional[ScwRegion] = None,
) -> None:
"""
Delete an export job.
Deletes an export job for a specified id.
:param export_job_id: ID of the export job.
:param region: Region to target. If none is passed will use default region from the config.

Usage:
::

result = api.delete_export_job(
export_job_id="example",
)
"""

param_region = validate_path_param(
"region", region or self.client.default_region
)
param_export_job_id = validate_path_param("export_job_id", export_job_id)

res = self._request(
"DELETE",
f"/audit-trail/v1alpha1/regions/{param_region}/export-jobs/{param_export_job_id}",
)

self._throw_on_error(res)
13 changes: 13 additions & 0 deletions scaleway/scaleway/audit_trail/v1alpha1/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -559,6 +559,19 @@ class CreateExportJobRequest:
s3: Optional[ExportJobS3] = None


@dataclass
class DeleteExportJobRequest:
export_job_id: str
"""
ID of the export job.
"""

region: Optional[ScwRegion] = None
"""
Region to target. If none is passed will use default region from the config.
"""


@dataclass
class ExportJob:
id: str
Expand Down