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 @@ -14,6 +14,7 @@ export type {
ListProductsRequest,
ListProductsResponse,
Product,
ProductService,
Resource,
ResourceType,
SecretManagerSecretInfo,
Expand Down
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
Loading