Skip to content

Commit 477d534

Browse files
feat(audit_trail): add last status to export job (#2485)
Co-authored-by: Laure-di <62625835+Laure-di@users.noreply.github.com>
1 parent 9b35ebb commit 477d534

File tree

3 files changed

+33
-3
lines changed

3 files changed

+33
-3
lines changed

packages_generated/audit_trail/src/v1alpha1/index.gen.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ export type {
2121
EventPrincipal,
2222
ExportJob,
2323
ExportJobS3,
24+
ExportJobStatus,
25+
ExportJobStatusCode,
2426
InstanceServerInfo,
2527
IpamIpInfo,
2628
KeyManagerKeyInfo,

packages_generated/audit_trail/src/v1alpha1/marshalling.gen.ts

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ import type {
2121
EventPrincipal,
2222
ExportJob,
2323
ExportJobS3,
24+
ExportJobStatus,
2425
InstanceServerInfo,
2526
IpamIpInfo,
2627
KeyManagerKeyInfo,
@@ -64,6 +65,19 @@ const unmarshalExportJobS3 = (data: unknown): ExportJobS3 => {
6465
} as ExportJobS3
6566
}
6667

68+
const unmarshalExportJobStatus = (data: unknown): ExportJobStatus => {
69+
if (!isJSONObject(data)) {
70+
throw new TypeError(
71+
`Unmarshalling the type 'ExportJobStatus' failed as data isn't a dictionary.`,
72+
)
73+
}
74+
75+
return {
76+
code: data.code,
77+
message: data.message,
78+
} as ExportJobStatus
79+
}
80+
6781
export const unmarshalExportJob = (data: unknown): ExportJob => {
6882
if (!isJSONObject(data)) {
6983
throw new TypeError(
@@ -75,6 +89,9 @@ export const unmarshalExportJob = (data: unknown): ExportJob => {
7589
createdAt: unmarshalDate(data.created_at),
7690
id: data.id,
7791
lastRunAt: unmarshalDate(data.last_run_at),
92+
lastStatus: data.last_status
93+
? unmarshalExportJobStatus(data.last_status)
94+
: undefined,
7895
name: data.name,
7996
organizationId: data.organization_id,
8097
s3: data.s3 ? unmarshalExportJobS3(data.s3) : undefined,

packages_generated/audit_trail/src/v1alpha1/types.gen.ts

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ export type AuthenticationEventOrigin =
2424

2525
export type AuthenticationEventResult = 'unknown_result' | 'success' | 'failure'
2626

27+
export type ExportJobStatusCode = 'unknown_code' | 'success' | 'failure'
28+
2729
export type ListAuthenticationEventsRequestOrderBy =
2830
| 'recorded_at_desc'
2931
| 'recorded_at_asc'
@@ -460,6 +462,11 @@ export interface ExportJobS3 {
460462
projectId?: string
461463
}
462464

465+
export interface ExportJobStatus {
466+
code: ExportJobStatusCode
467+
message?: string
468+
}
469+
463470
export interface ProductService {
464471
name: string
465472
methods: string[]
@@ -493,7 +500,7 @@ export interface ExportJob {
493500
*/
494501
organizationId: string
495502
/**
496-
* Name of the export.
503+
* Name of the export job.
497504
*/
498505
name: string
499506
/**
@@ -507,13 +514,17 @@ export interface ExportJob {
507514
*/
508515
createdAt?: Date
509516
/**
510-
* Last export date.
517+
* Last run of export job.
511518
*/
512519
lastRunAt?: Date
513520
/**
514-
* Tags of the export.
521+
* Tags of the export job.
515522
*/
516523
tags: Record<string, string>
524+
/**
525+
* Status of last export job.
526+
*/
527+
lastStatus?: ExportJobStatus
517528
}
518529

519530
export interface Product {

0 commit comments

Comments
 (0)