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
102 changes: 51 additions & 51 deletions packages_generated/k8s/src/v1/marshalling.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ import randomName from '@scaleway/random-name'
import { isJSONObject, resolveOneOf, unmarshalArrayOfObject, unmarshalDate, } from '@scaleway/sdk-client'
import type { DefaultValues } from '@scaleway/sdk-client'
import type {
PoolUpgradePolicy,
Pool,
Version,
MaintenanceWindow,
ClusterAutoUpgrade,
ClusterAutoscalerConfig,
ClusterOpenIDConnectConfig,
Cluster,
Node,
PoolUpgradePolicy,
Pool,
ACLRule,
AddClusterACLRulesResponse,
ExternalNodeCoreV1Taint,
Expand Down Expand Up @@ -53,55 +53,6 @@ import type {
UpgradePoolRequest,
} from './types.gen.js'

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

return {
maxSurge: data.max_surge,
maxUnavailable: data.max_unavailable,
} as PoolUpgradePolicy
}

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

return {
autohealing: data.autohealing,
autoscaling: data.autoscaling,
clusterId: data.cluster_id,
containerRuntime: data.container_runtime,
createdAt: unmarshalDate(data.created_at),
id: data.id,
kubeletArgs: data.kubelet_args,
maxSize: data.max_size,
minSize: data.min_size,
name: data.name,
newImagesEnabled: data.new_images_enabled,
nodeType: data.node_type,
placementGroupId: data.placement_group_id,
publicIpDisabled: data.public_ip_disabled,
region: data.region,
rootVolumeSize: data.root_volume_size,
rootVolumeType: data.root_volume_type,
securityGroupId: data.security_group_id,
size: data.size,
status: data.status,
tags: data.tags,
updatedAt: unmarshalDate(data.updated_at),
upgradePolicy: data.upgrade_policy ? unmarshalPoolUpgradePolicy(data.upgrade_policy) : undefined,
version: data.version,
zone: data.zone,
} as Pool
}

export const unmarshalVersion = (data: unknown): Version => {
if (!isJSONObject(data)) {
throw new TypeError(
Expand Down Expand Up @@ -254,6 +205,55 @@ export const unmarshalNode = (data: unknown): Node => {
} as Node
}

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

return {
maxSurge: data.max_surge,
maxUnavailable: data.max_unavailable,
} as PoolUpgradePolicy
}

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

return {
autohealing: data.autohealing,
autoscaling: data.autoscaling,
clusterId: data.cluster_id,
containerRuntime: data.container_runtime,
createdAt: unmarshalDate(data.created_at),
id: data.id,
kubeletArgs: data.kubelet_args,
maxSize: data.max_size,
minSize: data.min_size,
name: data.name,
newImagesEnabled: data.new_images_enabled,
nodeType: data.node_type,
placementGroupId: data.placement_group_id,
publicIpDisabled: data.public_ip_disabled,
region: data.region,
rootVolumeSize: data.root_volume_size,
rootVolumeType: data.root_volume_type,
securityGroupId: data.security_group_id,
size: data.size,
status: data.status,
tags: data.tags,
updatedAt: unmarshalDate(data.updated_at),
upgradePolicy: data.upgrade_policy ? unmarshalPoolUpgradePolicy(data.upgrade_policy) : undefined,
version: data.version,
zone: data.zone,
} as Pool
}

const unmarshalACLRule = (data: unknown): ACLRule => {
if (!isJSONObject(data)) {
throw new TypeError(
Expand Down
Loading