Skip to content

Commit

Permalink
feat(audit_trail): add integrated methods in ListProducts (scaleway#1644
Browse files Browse the repository at this point in the history
)
  • Loading branch information
scaleway-bot authored Dec 12, 2024
1 parent 2406e7d commit 58cb2aa
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 0 deletions.
1 change: 1 addition & 0 deletions packages/clients/src/api/audit_trail/v1alpha1/index.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ export type {
ListProductsRequest,
ListProductsResponse,
Product,
ProductService,
Resource,
ResourceType,
SecretManagerSecretInfo,
Expand Down
15 changes: 15 additions & 0 deletions packages/clients/src/api/audit_trail/v1alpha1/marshalling.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import type {
ListEventsResponse,
ListProductsResponse,
Product,
ProductService,
Resource,
SecretManagerSecretInfo,
SecretManagerSecretVersionInfo,
Expand Down Expand Up @@ -186,6 +187,19 @@ export const unmarshalListEventsResponse = (
} as ListEventsResponse
}

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

return {
methods: data.methods,
name: data.name,
} as ProductService
}

const unmarshalProduct = (data: unknown): Product => {
if (!isJSONObject(data)) {
throw new TypeError(
Expand All @@ -195,6 +209,7 @@ const unmarshalProduct = (data: unknown): Product => {

return {
name: data.name,
services: unmarshalArrayOfObject(data.services, unmarshalProductService),
title: data.title,
} as Product
}
Expand Down
10 changes: 10 additions & 0 deletions packages/clients/src/api/audit_trail/v1alpha1/types.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,11 @@ export interface Resource {
kubeAclInfo?: KubernetesACLInfo
}

export interface ProductService {
name: string
methods: string[]
}

export interface Event {
/** ID of the event. */
id: string
Expand Down Expand Up @@ -122,6 +127,11 @@ export interface Product {
title: string
/** Product name. */
name: string
/**
* Specifies the API versions of the products integrated with Audit Trail.
* Each version defines the methods logged by Audit Trail.
*/
services: ProductService[]
}

export type ListEventsRequest = {
Expand Down

0 comments on commit 58cb2aa

Please sign in to comment.