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
1 change: 1 addition & 0 deletions packages_generated/audit_trail/src/v1alpha1/index.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ export type {
BaremetalSettingInfo,
Event,
EventPrincipal,
EventSystem,
InstanceServerInfo,
KeyManagerKeyInfo,
KubernetesACLInfo,
Expand Down
14 changes: 14 additions & 0 deletions packages_generated/audit_trail/src/v1alpha1/marshalling.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import type {
BaremetalSettingInfo,
Event,
EventPrincipal,
EventSystem,
InstanceServerInfo,
KeyManagerKeyInfo,
KubernetesACLInfo,
Expand Down Expand Up @@ -217,6 +218,18 @@ const unmarshalEventPrincipal = (data: unknown): EventPrincipal => {
} as EventPrincipal
}

const unmarshalEventSystem = (data: unknown): EventSystem => {
if (!isJSONObject(data)) {
throw new TypeError(
`Unmarshalling the type 'EventSystem' failed as data isn't a dictionary.`,
)
}

return {
name: data.name,
} as EventSystem
}

export const unmarshalResource = (data: unknown): Resource => {
if (!isJSONObject(data)) {
throw new TypeError(
Expand Down Expand Up @@ -311,6 +324,7 @@ export const unmarshalEvent = (data: unknown): Event => {
serviceName: data.service_name,
sourceIp: data.source_ip,
statusCode: data.status_code,
system: data.system ? unmarshalEventSystem(data.system) : undefined,
userAgent: data.user_agent,
} as Event
}
Expand Down
12 changes: 12 additions & 0 deletions packages_generated/audit_trail/src/v1alpha1/types.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,10 @@ export interface EventPrincipal {
id: string
}

export interface EventSystem {
name: string
}

export interface Resource {
id: string
type: ResourceType
Expand Down Expand Up @@ -206,8 +210,16 @@ export interface Event {
locality: string
/**
* User or IAM application at the origin of the event.
*
* One-of ('source'): at most one of 'principal', 'system' could be set.
*/
principal?: EventPrincipal
/**
* The Scaleway system that performed an action on behalf of the client.
*
* One-of ('source'): at most one of 'principal', 'system' could be set.
*/
system?: EventSystem
/**
* Organization ID containing the event.
*/
Expand Down
Loading