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
96 changes: 39 additions & 57 deletions packages_generated/audit_trail/src/v1alpha1/api.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
import {
API as ParentAPI,
enrichForPagination,
toApiLocality,
urlParams,
validatePathParam,
toApiLocality,
} from '@scaleway/sdk-client'
import type { ApiLocality } from '@scaleway/sdk-client'
import type { ApiLocality,} from '@scaleway/sdk-client'
import {
marshalCreateExportJobRequest,
unmarshalExportJob,
Expand Down Expand Up @@ -47,10 +47,14 @@ export class API extends ParentAPI {
* Locality of this API.
* type ∈ {'zone','region','global','unspecified'}
*/
public static readonly LOCALITY: ApiLocality = toApiLocality({
regions: ['fr-par', 'nl-ams'],
})

public static readonly LOCALITY: ApiLocality =
toApiLocality({
regions: [
'fr-par',
'nl-ams',
],
})

/**
* List events. Retrieve the list of Audit Trail events for a Scaleway Organization and/or Project. You must specify the `organization_id` and optionally, the `project_id`.
*
Expand All @@ -65,15 +69,8 @@ export class API extends ParentAPI {
urlParams: urlParams(
['method_name', request.methodName],
['order_by', request.orderBy],
[
'organization_id',
request.organizationId ??
this.client.settings.defaultOrganizationId,
],
[
'page_size',
request.pageSize ?? this.client.settings.defaultPageSize,
],
['organization_id', request.organizationId ?? this.client.settings.defaultOrganizationId],
['page_size', request.pageSize ?? this.client.settings.defaultPageSize],
['page_token', request.pageToken],
['principal_id', request.principalId],
['product_name', request.productName],
Expand All @@ -90,30 +87,22 @@ export class API extends ParentAPI {
unmarshalListEventsResponse,
)


/**
* List authentication events. Retrieve the list of Audit Trail authentication events for a Scaleway Organization. You must specify the `organization_id`.
*
* @param request - The request {@link ListAuthenticationEventsRequest}
* @returns A Promise of ListAuthenticationEventsResponse
*/
listAuthenticationEvents = (
request: Readonly<ListAuthenticationEventsRequest> = {},
) =>
listAuthenticationEvents = (request: Readonly<ListAuthenticationEventsRequest> = {}) =>
this.client.fetch<ListAuthenticationEventsResponse>(
{
method: 'GET',
path: `/audit-trail/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/authentication-events`,
urlParams: urlParams(
['order_by', request.orderBy],
[
'organization_id',
request.organizationId ??
this.client.settings.defaultOrganizationId,
],
[
'page_size',
request.pageSize ?? this.client.settings.defaultPageSize,
],
['organization_id', request.organizationId ?? this.client.settings.defaultOrganizationId],
['page_size', request.pageSize ?? this.client.settings.defaultPageSize],
['page_token', request.pageToken],
['recorded_after', request.recordedAfter],
['recorded_before', request.recordedBefore],
Expand All @@ -122,22 +111,16 @@ export class API extends ParentAPI {
unmarshalListAuthenticationEventsResponse,
)


listCombinedEvents = (request: Readonly<ListCombinedEventsRequest> = {}) =>
this.client.fetch<ListCombinedEventsResponse>(
{
method: 'GET',
path: `/audit-trail/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/combined-events`,
urlParams: urlParams(
['order_by', request.orderBy],
[
'organization_id',
request.organizationId ??
this.client.settings.defaultOrganizationId,
],
[
'page_size',
request.pageSize ?? this.client.settings.defaultPageSize,
],
['organization_id', request.organizationId ?? this.client.settings.defaultOrganizationId],
['page_size', request.pageSize ?? this.client.settings.defaultPageSize],
['page_token', request.pageToken],
['project_id', request.projectId],
['recorded_after', request.recordedAfter],
Expand All @@ -148,6 +131,7 @@ export class API extends ParentAPI {
unmarshalListCombinedEventsResponse,
)


/**
* Retrieve the list of Scaleway resources for which you have Audit Trail events.
*
Expand All @@ -159,14 +143,14 @@ export class API extends ParentAPI {
{
method: 'GET',
path: `/audit-trail/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/products`,
urlParams: urlParams([
'organization_id',
request.organizationId ?? this.client.settings.defaultOrganizationId,
]),
urlParams: urlParams(
['organization_id', request.organizationId ?? this.client.settings.defaultOrganizationId],
),
},
unmarshalListProductsResponse,
)


/**
* Create an export job. Create an export job for a specified organization. This allows you to export audit trail events to a destination, such as an S3 bucket. The request requires the organization ID, a name for the export, and a destination configuration.
*
Expand All @@ -186,43 +170,41 @@ export class API extends ParentAPI {
unmarshalExportJob,
)


/**
* Delete an export job. Deletes an export job for a specified id.
*
* @param request - The request {@link DeleteExportJobRequest}
*/
deleteExportJob = (request: Readonly<DeleteExportJobRequest>) =>
this.client.fetch<void>({
method: 'DELETE',
path: `/audit-trail/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/export-jobs/${validatePathParam('exportJobId', request.exportJobId)}`,
})
this.client.fetch<void>(
{
method: 'DELETE',
path: `/audit-trail/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/export-jobs/${validatePathParam('exportJobId', request.exportJobId)}`,
},
)

protected pageOfListExportJobs = (
request: Readonly<ListExportJobsRequest> = {},
) =>

protected pageOfListExportJobs = (request: Readonly<ListExportJobsRequest> = {}) =>
this.client.fetch<ListExportJobsResponse>(
{
method: 'GET',
path: `/audit-trail/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/export-jobs`,
urlParams: urlParams(
['name', request.name],
['order_by', request.orderBy],
[
'organization_id',
request.organizationId ??
this.client.settings.defaultOrganizationId,
],
['organization_id', request.organizationId ?? this.client.settings.defaultOrganizationId],
['page', request.page],
[
'page_size',
request.pageSize ?? this.client.settings.defaultPageSize,
],
['page_size', request.pageSize ?? this.client.settings.defaultPageSize],
['tags', request.tags],
),
},
unmarshalListExportJobsResponse,
)

listExportJobs = (request: Readonly<ListExportJobsRequest> = {}) =>
enrichForPagination('exportJobs', this.pageOfListExportJobs, request)


}

4 changes: 3 additions & 1 deletion packages_generated/audit_trail/src/v1alpha1/index.gen.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
// This file was automatically generated. DO NOT EDIT.
// If you have any remark or suggestion do not hesitate to open an issue.
export { API } from './api.gen.js'
export {
API,
} from './api.gen.js'
export * from './marshalling.gen.js'
export type {
AccountOrganizationInfo,
Expand Down
Loading