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
4 changes: 2 additions & 2 deletions packages/clients/src/api/audit_trail/v1alpha1/api.gen.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// This file was automatically generated. DO NOT EDIT.
// If you have any remark or suggestion do not hesitate to open an issue.
import { API as ParentAPI, urlParams, validatePathParam } from '../../../bridge'
import type { Region } from '../../../bridge'
import type { Region as ScwRegion } from '../../../bridge'
import {
unmarshalListEventsResponse,
unmarshalListProductsResponse,
Expand All @@ -21,7 +21,7 @@ import type {
*/
export class API extends ParentAPI {
/** Lists the available regions of the API. */
public static readonly LOCALITIES: Region[] = ['fr-par', 'nl-ams']
public static readonly LOCALITIES: ScwRegion[] = ['fr-par', 'nl-ams']

/**
* List events. Retrieve the list of Audit Trail events for a Scaleway
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ export { API } from './api.gen'
export type {
Event,
EventPrincipal,
KeyManagerKeyInfo,
KubernetesACLInfo,
KubernetesClusterInfo,
KubernetesNodeInfo,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import {
import type {
Event,
EventPrincipal,
KeyManagerKeyInfo,
KubernetesACLInfo,
KubernetesClusterInfo,
KubernetesNodeInfo,
Expand All @@ -21,6 +22,16 @@ import type {
SecretManagerSecretVersionInfo,
} from './types.gen'

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

return {} as KeyManagerKeyInfo
}

const unmarshalKubernetesACLInfo = (data: unknown): KubernetesACLInfo => {
if (!isJSONObject(data)) {
throw new TypeError(
Expand Down Expand Up @@ -120,6 +131,9 @@ export const unmarshalResource = (data: unknown): Resource => {
createdAt: unmarshalDate(data.created_at),
deletedAt: unmarshalDate(data.deleted_at),
id: data.id,
keymKeyInfo: data.keym_key_info
? unmarshalKeyManagerKeyInfo(data.keym_key_info)
: undefined,
kubeAclInfo: data.kube_acl_info
? unmarshalKubernetesACLInfo(data.kube_acl_info)
: undefined,
Expand Down
39 changes: 24 additions & 15 deletions packages/clients/src/api/audit_trail/v1alpha1/types.gen.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// This file was automatically generated. DO NOT EDIT.
// If you have any remark or suggestion do not hesitate to open an issue.
import type { Region } from '../../../bridge'
import type { Region as ScwRegion } from '../../../bridge'

export type ListEventsRequestOrderBy = 'recorded_at_desc' | 'recorded_at_asc'

Expand All @@ -12,6 +12,9 @@ export type ResourceType =
| 'kube_pool'
| 'kube_node'
| 'kube_acl'
| 'keym_key'

export interface KeyManagerKeyInfo {}

export interface KubernetesACLInfo {}

Expand Down Expand Up @@ -48,40 +51,46 @@ export interface Resource {
name?: string
/**
* One-of ('info'): at most one of 'secmSecretInfo', 'secmSecretVersionInfo',
* 'kubeClusterInfo', 'kubePoolInfo', 'kubeNodeInfo', 'kubeAclInfo' could be
* set.
* 'kubeClusterInfo', 'kubePoolInfo', 'kubeNodeInfo', 'kubeAclInfo',
* 'keymKeyInfo' could be set.
*/
secmSecretInfo?: SecretManagerSecretInfo
/**
* One-of ('info'): at most one of 'secmSecretInfo', 'secmSecretVersionInfo',
* 'kubeClusterInfo', 'kubePoolInfo', 'kubeNodeInfo', 'kubeAclInfo' could be
* set.
* 'kubeClusterInfo', 'kubePoolInfo', 'kubeNodeInfo', 'kubeAclInfo',
* 'keymKeyInfo' could be set.
*/
secmSecretVersionInfo?: SecretManagerSecretVersionInfo
/**
* One-of ('info'): at most one of 'secmSecretInfo', 'secmSecretVersionInfo',
* 'kubeClusterInfo', 'kubePoolInfo', 'kubeNodeInfo', 'kubeAclInfo' could be
* set.
* 'kubeClusterInfo', 'kubePoolInfo', 'kubeNodeInfo', 'kubeAclInfo',
* 'keymKeyInfo' could be set.
*/
kubeClusterInfo?: KubernetesClusterInfo
/**
* One-of ('info'): at most one of 'secmSecretInfo', 'secmSecretVersionInfo',
* 'kubeClusterInfo', 'kubePoolInfo', 'kubeNodeInfo', 'kubeAclInfo' could be
* set.
* 'kubeClusterInfo', 'kubePoolInfo', 'kubeNodeInfo', 'kubeAclInfo',
* 'keymKeyInfo' could be set.
*/
kubePoolInfo?: KubernetesPoolInfo
/**
* One-of ('info'): at most one of 'secmSecretInfo', 'secmSecretVersionInfo',
* 'kubeClusterInfo', 'kubePoolInfo', 'kubeNodeInfo', 'kubeAclInfo' could be
* set.
* 'kubeClusterInfo', 'kubePoolInfo', 'kubeNodeInfo', 'kubeAclInfo',
* 'keymKeyInfo' could be set.
*/
kubeNodeInfo?: KubernetesNodeInfo
/**
* One-of ('info'): at most one of 'secmSecretInfo', 'secmSecretVersionInfo',
* 'kubeClusterInfo', 'kubePoolInfo', 'kubeNodeInfo', 'kubeAclInfo' could be
* set.
* 'kubeClusterInfo', 'kubePoolInfo', 'kubeNodeInfo', 'kubeAclInfo',
* 'keymKeyInfo' could be set.
*/
kubeAclInfo?: KubernetesACLInfo
/**
* One-of ('info'): at most one of 'secmSecretInfo', 'secmSecretVersionInfo',
* 'kubeClusterInfo', 'kubePoolInfo', 'kubeNodeInfo', 'kubeAclInfo',
* 'keymKeyInfo' could be set.
*/
keymKeyInfo?: KeyManagerKeyInfo
}

export interface ProductService {
Expand Down Expand Up @@ -139,7 +148,7 @@ export type ListEventsRequest = {
* Region to target. If none is passed will use default region from the
* config.
*/
region?: Region
region?: ScwRegion
/** (Optional) ID of the Project containing the Audit Trail events. */
projectId?: string
/** ID of the Organization containing the Audit Trail events. */
Expand Down Expand Up @@ -183,7 +192,7 @@ export type ListProductsRequest = {
* Region to target. If none is passed will use default region from the
* config.
*/
region?: Region
region?: ScwRegion
}

export interface ListProductsResponse {
Expand Down
Loading