diff --git a/packages/clients/src/api/baremetal/v1/index.gen.ts b/packages/clients/src/api/baremetal/v1/index.gen.ts index 6c69500dd..f0ee7b32d 100644 --- a/packages/clients/src/api/baremetal/v1/index.gen.ts +++ b/packages/clients/src/api/baremetal/v1/index.gen.ts @@ -6,6 +6,7 @@ export type { AddOptionServerRequest, BMCAccess, CPU, + CertificationOption, CreateServerRequest, CreateServerRequestInstall, DeleteOptionServerRequest, @@ -22,6 +23,7 @@ export type { IPReverseStatus, IPVersion, InstallServerRequest, + LicenseOption, ListOSRequest, ListOSResponse, ListOffersRequest, @@ -52,8 +54,11 @@ export type { PrivateNetworkApiDeleteServerPrivateNetworkRequest, PrivateNetworkApiListServerPrivateNetworksRequest, PrivateNetworkApiSetServerPrivateNetworksRequest, + PrivateNetworkOption, + PublicBandwidthOption, RaidController, RebootServerRequest, + RemoteAccessOption, Server, ServerBootType, ServerEvent, diff --git a/packages/clients/src/api/baremetal/v1/marshalling.gen.ts b/packages/clients/src/api/baremetal/v1/marshalling.gen.ts index f1b2e9253..5ae2e5bf4 100644 --- a/packages/clients/src/api/baremetal/v1/marshalling.gen.ts +++ b/packages/clients/src/api/baremetal/v1/marshalling.gen.ts @@ -13,12 +13,14 @@ import type { AddOptionServerRequest, BMCAccess, CPU, + CertificationOption, CreateServerRequest, CreateServerRequestInstall, Disk, GetServerMetricsResponse, IP, InstallServerRequest, + LicenseOption, ListOSResponse, ListOffersResponse, ListOptionsResponse, @@ -35,8 +37,11 @@ import type { PersistentMemory, PrivateNetworkApiAddServerPrivateNetworkRequest, PrivateNetworkApiSetServerPrivateNetworksRequest, + PrivateNetworkOption, + PublicBandwidthOption, RaidController, RebootServerRequest, + RemoteAccessOption, Server, ServerEvent, ServerInstall, @@ -92,6 +97,7 @@ export const unmarshalOS = (data: unknown): OS => { return { allowed: data.allowed, + customPartitioningSupported: data.custom_partitioning_supported, enabled: data.enabled, id: data.id, licenseRequired: data.license_required, @@ -110,6 +116,62 @@ export const unmarshalOS = (data: unknown): OS => { } as OS } +const unmarshalCertificationOption = (data: unknown): CertificationOption => { + if (!isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'CertificationOption' failed as data isn't a dictionary.`, + ) + } + + return {} as CertificationOption +} + +const unmarshalLicenseOption = (data: unknown): LicenseOption => { + if (!isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'LicenseOption' failed as data isn't a dictionary.`, + ) + } + + return { + osId: data.os_id, + } as LicenseOption +} + +const unmarshalPrivateNetworkOption = (data: unknown): PrivateNetworkOption => { + if (!isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'PrivateNetworkOption' failed as data isn't a dictionary.`, + ) + } + + return {} as PrivateNetworkOption +} + +const unmarshalPublicBandwidthOption = ( + data: unknown, +): PublicBandwidthOption => { + if (!isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'PublicBandwidthOption' failed as data isn't a dictionary.`, + ) + } + + return { + bandwidthInBps: data.bandwidth_in_bps, + } as PublicBandwidthOption +} + +const unmarshalRemoteAccessOption = (data: unknown): RemoteAccessOption => { + if (!isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'RemoteAccessOption' failed as data isn't a dictionary.`, + ) + } + + return {} as RemoteAccessOption +} + const unmarshalCPU = (data: unknown): CPU => { if (!isJSONObject(data)) { throw new TypeError( @@ -162,12 +224,25 @@ const unmarshalOfferOptionOffer = (data: unknown): OfferOptionOffer => { } return { + certification: data.certification + ? unmarshalCertificationOption(data.certification) + : undefined, enabled: data.enabled, id: data.id, + license: data.license ? unmarshalLicenseOption(data.license) : undefined, manageable: data.manageable, name: data.name, osId: data.os_id, price: data.price ? unmarshalMoney(data.price) : undefined, + privateNetwork: data.private_network + ? unmarshalPrivateNetworkOption(data.private_network) + : undefined, + publicBandwidth: data.public_bandwidth + ? unmarshalPublicBandwidthOption(data.public_bandwidth) + : undefined, + remoteAccess: data.remote_access + ? unmarshalRemoteAccessOption(data.remote_access) + : undefined, subscriptionPeriod: data.subscription_period, } as OfferOptionOffer } @@ -251,9 +326,22 @@ export const unmarshalOption = (data: unknown): Option => { } return { + certification: data.certification + ? unmarshalCertificationOption(data.certification) + : undefined, id: data.id, + license: data.license ? unmarshalLicenseOption(data.license) : undefined, manageable: data.manageable, name: data.name, + privateNetwork: data.private_network + ? unmarshalPrivateNetworkOption(data.private_network) + : undefined, + publicBandwidth: data.public_bandwidth + ? unmarshalPublicBandwidthOption(data.public_bandwidth) + : undefined, + remoteAccess: data.remote_access + ? unmarshalRemoteAccessOption(data.remote_access) + : undefined, } as Option } @@ -304,10 +392,23 @@ const unmarshalServerOption = (data: unknown): ServerOption => { } return { + certification: data.certification + ? unmarshalCertificationOption(data.certification) + : undefined, expiresAt: unmarshalDate(data.expires_at), id: data.id, + license: data.license ? unmarshalLicenseOption(data.license) : undefined, manageable: data.manageable, name: data.name, + privateNetwork: data.private_network + ? unmarshalPrivateNetworkOption(data.private_network) + : undefined, + publicBandwidth: data.public_bandwidth + ? unmarshalPublicBandwidthOption(data.public_bandwidth) + : undefined, + remoteAccess: data.remote_access + ? unmarshalRemoteAccessOption(data.remote_access) + : undefined, status: data.status, } as ServerOption } diff --git a/packages/clients/src/api/baremetal/v1/types.gen.ts b/packages/clients/src/api/baremetal/v1/types.gen.ts index 7341f3175..1479764c3 100644 --- a/packages/clients/src/api/baremetal/v1/types.gen.ts +++ b/packages/clients/src/api/baremetal/v1/types.gen.ts @@ -72,6 +72,20 @@ export type ServerStatus = export type SettingType = 'unknown' | 'smtp' +export interface CertificationOption {} + +export interface LicenseOption { + osId: string +} + +export interface PrivateNetworkOption {} + +export interface PublicBandwidthOption { + bandwidthInBps: number +} + +export interface RemoteAccessOption {} + export interface OSOSField { editable: boolean required: boolean @@ -125,8 +139,43 @@ export interface OfferOptionOffer { price?: Money /** Boolean to know if option could be managed. */ manageable: boolean - /** ID of the OS linked to the option. */ + /** @deprecated Deprecated, use LicenseOptionVars.os_id instead. */ osId?: string + /** + * License option, contains the ID of the OS linked to the option. + * + * One-of ('option'): at most one of 'license', 'publicBandwidth', + * 'privateNetwork', 'remoteAccess', 'certification' could be set. + */ + license?: LicenseOption + /** + * Public_bandwidth option, contains the bandwidth_in_bps. + * + * One-of ('option'): at most one of 'license', 'publicBandwidth', + * 'privateNetwork', 'remoteAccess', 'certification' could be set. + */ + publicBandwidth?: PublicBandwidthOption + /** + * Private_network option. + * + * One-of ('option'): at most one of 'license', 'publicBandwidth', + * 'privateNetwork', 'remoteAccess', 'certification' could be set. + */ + privateNetwork?: PrivateNetworkOption + /** + * Remote_access option. + * + * One-of ('option'): at most one of 'license', 'publicBandwidth', + * 'privateNetwork', 'remoteAccess', 'certification' could be set. + */ + remoteAccess?: RemoteAccessOption + /** + * Certification option. + * + * One-of ('option'): at most one of 'license', 'publicBandwidth', + * 'privateNetwork', 'remoteAccess', 'certification' could be set. + */ + certification?: CertificationOption } export interface PersistentMemory { @@ -192,6 +241,41 @@ export interface ServerOption { manageable: boolean /** Auto expiration date for compatible options. */ expiresAt?: Date + /** + * License option, contains the ID of the OS linked to the option. + * + * One-of ('option'): at most one of 'license', 'publicBandwidth', + * 'privateNetwork', 'remoteAccess', 'certification' could be set. + */ + license?: LicenseOption + /** + * Public_bandwidth option, contains the bandwidth_in_bps. + * + * One-of ('option'): at most one of 'license', 'publicBandwidth', + * 'privateNetwork', 'remoteAccess', 'certification' could be set. + */ + publicBandwidth?: PublicBandwidthOption + /** + * Private_network option. + * + * One-of ('option'): at most one of 'license', 'publicBandwidth', + * 'privateNetwork', 'remoteAccess', 'certification' could be set. + */ + privateNetwork?: PrivateNetworkOption + /** + * Remote_access option. + * + * One-of ('option'): at most one of 'license', 'publicBandwidth', + * 'privateNetwork', 'remoteAccess', 'certification' could be set. + */ + remoteAccess?: RemoteAccessOption + /** + * Certification option. + * + * One-of ('option'): at most one of 'license', 'publicBandwidth', + * 'privateNetwork', 'remoteAccess', 'certification' could be set. + */ + certification?: CertificationOption } export interface ServerRescueServer { @@ -243,6 +327,8 @@ export interface OS { licenseRequired: boolean /** Defines if a specific Organization is allowed to install this OS type. */ allowed: boolean + /** Defines if custom partitioning is supported by this OS. */ + customPartitioningSupported: boolean } export interface Offer { @@ -310,6 +396,41 @@ export interface Option { name: string /** Defines whether the option is manageable (could be added or removed). */ manageable: boolean + /** + * License option, contains the ID of the OS linked to the option. + * + * One-of ('option'): at most one of 'license', 'publicBandwidth', + * 'privateNetwork', 'remoteAccess', 'certification' could be set. + */ + license?: LicenseOption + /** + * Public_bandwidth option, contains the bandwidth_in_bps. + * + * One-of ('option'): at most one of 'license', 'publicBandwidth', + * 'privateNetwork', 'remoteAccess', 'certification' could be set. + */ + publicBandwidth?: PublicBandwidthOption + /** + * Private_network option. + * + * One-of ('option'): at most one of 'license', 'publicBandwidth', + * 'privateNetwork', 'remoteAccess', 'certification' could be set. + */ + privateNetwork?: PrivateNetworkOption + /** + * Remote_access option. + * + * One-of ('option'): at most one of 'license', 'publicBandwidth', + * 'privateNetwork', 'remoteAccess', 'certification' could be set. + */ + remoteAccess?: RemoteAccessOption + /** + * Certification option. + * + * One-of ('option'): at most one of 'license', 'publicBandwidth', + * 'privateNetwork', 'remoteAccess', 'certification' could be set. + */ + certification?: CertificationOption } export interface ServerEvent {