From a52ba4b93ef90726f507998b6b582b13b0fb195b Mon Sep 17 00:00:00 2001 From: scaleway-bot Date: Tue, 18 Nov 2025 16:20:49 +0000 Subject: [PATCH] feat: update generated APIs --- packages_generated/instance/src/v1/api.gen.ts | 493 ++++++----- .../instance/src/v1/content.gen.ts | 23 +- .../instance/src/v1/index.gen.ts | 4 +- .../instance/src/v1/marshalling.gen.ts | 831 ++++++------------ .../instance/src/v1/types.gen.ts | 250 +++++- .../instance/src/v1/types.private.gen.ts | 39 +- 6 files changed, 769 insertions(+), 871 deletions(-) diff --git a/packages_generated/instance/src/v1/api.gen.ts b/packages_generated/instance/src/v1/api.gen.ts index 2fb525ae0..6d30a3e85 100644 --- a/packages_generated/instance/src/v1/api.gen.ts +++ b/packages_generated/instance/src/v1/api.gen.ts @@ -3,61 +3,41 @@ import { API as ParentAPI, enrichForPagination, - toApiLocality, urlParams, validatePathParam, + toApiLocality, } from '@scaleway/sdk-client' -import type { ApiLocality } from '@scaleway/sdk-client' +import type { ApiLocality,} from '@scaleway/sdk-client' import { marshalApplyBlockMigrationRequest, marshalAttachServerFileSystemRequest, + unmarshalAttachServerFileSystemResponse, marshalAttachServerVolumeRequest, + unmarshalAttachServerVolumeResponse, marshalCheckBlockMigrationOrganizationQuotasRequest, marshalCreateImageRequest, - marshalCreateIpRequest, - marshalCreatePlacementGroupRequest, - marshalCreatePrivateNICRequest, - marshalCreateSecurityGroupRequest, - marshalCreateSecurityGroupRuleRequest, - marshalCreateServerRequest, - marshalCreateSnapshotRequest, - marshalCreateVolumeRequest, - marshalDetachServerFileSystemRequest, - marshalDetachServerVolumeRequest, - marshalExportSnapshotRequest, - marshalPlanBlockMigrationRequest, - marshalServerActionRequest, - marshalSetImageRequest, - marshalSetPlacementGroupRequest, - marshalSetPlacementGroupServersRequest, - marshalSetSecurityGroupRequest, - marshalSetSecurityGroupRuleRequest, - marshalSetSecurityGroupRulesRequest, - marshalSetServerRequest, - marshalSetSnapshotRequest, - marshalUpdateImageRequest, - marshalUpdateIpRequest, - marshalUpdatePlacementGroupRequest, - marshalUpdatePlacementGroupServersRequest, - marshalUpdatePrivateNICRequest, - marshalUpdateSecurityGroupRequest, - marshalUpdateSecurityGroupRuleRequest, - marshalUpdateServerRequest, - marshalUpdateSnapshotRequest, - marshalUpdateVolumeRequest, - unmarshalAttachServerFileSystemResponse, - unmarshalAttachServerVolumeResponse, unmarshalCreateImageResponse, + marshalCreateIpRequest, unmarshalCreateIpResponse, + marshalCreatePlacementGroupRequest, unmarshalCreatePlacementGroupResponse, + marshalCreatePrivateNICRequest, unmarshalCreatePrivateNICResponse, + marshalCreateSecurityGroupRequest, unmarshalCreateSecurityGroupResponse, + marshalCreateSecurityGroupRuleRequest, unmarshalCreateSecurityGroupRuleResponse, + marshalCreateServerRequest, unmarshalCreateServerResponse, + marshalCreateSnapshotRequest, unmarshalCreateSnapshotResponse, + marshalCreateVolumeRequest, unmarshalCreateVolumeResponse, + marshalDetachServerFileSystemRequest, unmarshalDetachServerFileSystemResponse, + marshalDetachServerVolumeRequest, unmarshalDetachServerVolumeResponse, + marshalExportSnapshotRequest, unmarshalExportSnapshotResponse, unmarshalGetDashboardResponse, unmarshalGetImageResponse, @@ -85,25 +65,45 @@ import { unmarshalListVolumesResponse, unmarshalListVolumesTypesResponse, unmarshalMigrationPlan, + marshalPlanBlockMigrationRequest, unmarshalPrivateNIC, + marshalServerActionRequest, unmarshalServerActionResponse, unmarshalServerCompatibleTypes, + marshalSetImageRequest, unmarshalSetImageResponse, + marshalSetPlacementGroupRequest, unmarshalSetPlacementGroupResponse, + marshalSetPlacementGroupServersRequest, unmarshalSetPlacementGroupServersResponse, + marshalSetSecurityGroupRequest, unmarshalSetSecurityGroupResponse, + marshalSetSecurityGroupRuleRequest, unmarshalSetSecurityGroupRuleResponse, + marshalSetSecurityGroupRulesRequest, unmarshalSetSecurityGroupRulesResponse, + marshalSetServerRequest, unmarshalSetServerResponse, + marshalSetSnapshotRequest, unmarshalSetSnapshotResponse, + marshalUpdateImageRequest, unmarshalUpdateImageResponse, + marshalUpdateIpRequest, unmarshalUpdateIpResponse, + marshalUpdatePlacementGroupRequest, unmarshalUpdatePlacementGroupResponse, + marshalUpdatePlacementGroupServersRequest, unmarshalUpdatePlacementGroupServersResponse, + marshalUpdatePrivateNICRequest, + marshalUpdateSecurityGroupRequest, unmarshalUpdateSecurityGroupResponse, + marshalUpdateSecurityGroupRuleRequest, unmarshalUpdateSecurityGroupRuleResponse, + marshalUpdateServerRequest, unmarshalUpdateServerResponse, + marshalUpdateSnapshotRequest, unmarshalUpdateSnapshotResponse, + marshalUpdateVolumeRequest, unmarshalUpdateVolumeResponse, } from './marshalling.gen.js' import type { @@ -259,29 +259,28 @@ export class API extends ParentAPI { * Locality of this API. * type ∈ {'zone','region','global','unspecified'} */ - public static readonly LOCALITY: ApiLocality = toApiLocality({ - zones: [ - 'fr-par-1', - 'fr-par-2', - 'fr-par-3', - 'nl-ams-1', - 'nl-ams-2', - 'nl-ams-3', - 'pl-waw-1', - 'pl-waw-2', - 'pl-waw-3', - ], - }) - + public static readonly LOCALITY: ApiLocality = + toApiLocality({ + zones: [ + 'fr-par-1', + 'fr-par-2', + 'fr-par-3', + 'nl-ams-1', + 'nl-ams-2', + 'nl-ams-3', + 'pl-waw-1', + 'pl-waw-2', + 'pl-waw-3', + ], + }) + /** * Get availability. Get availability for all Instance types. * * @param request - The request {@link GetServerTypesAvailabilityRequest} * @returns A Promise of GetServerTypesAvailabilityResponse */ - getServerTypesAvailability = ( - request: Readonly = {}, - ) => + getServerTypesAvailability = (request: Readonly = {}) => this.client.fetch( { method: 'GET', @@ -294,6 +293,7 @@ export class API extends ParentAPI { unmarshalGetServerTypesAvailabilityResponse, ) + /** * List Instance types. List available Instance types and their technical details. * @@ -313,6 +313,7 @@ export class API extends ParentAPI { unmarshalListServersTypesResponse, ) + /** * List volume types. List all volume types and their technical details. * @@ -332,6 +333,7 @@ export class API extends ParentAPI { unmarshalListVolumesTypesResponse, ) + protected pageOfListServers = (request: Readonly = {}) => this.client.fetch( { @@ -346,34 +348,22 @@ export class API extends ParentAPI { ['per_page', request.perPage ?? this.client.settings.defaultPageSize], ['private_ip', request.privateIp], ['private_network', request.privateNetwork], - [ - 'private_networks', - request.privateNetworks && request.privateNetworks.length > 0 - ? request.privateNetworks.join(',') - : undefined, - ], + ['private_networks', request.privateNetworks + && request.privateNetworks.length > 0 ? request.privateNetworks.join(',') : undefined], ['private_nic_mac_address', request.privateNicMacAddress], ['project', request.project], - [ - 'servers', - request.servers && request.servers.length > 0 - ? request.servers.join(',') - : undefined, - ], + ['servers', request.servers + && request.servers.length > 0 ? request.servers.join(',') : undefined], ['state', request.state], - [ - 'tags', - request.tags && request.tags.length > 0 - ? request.tags.join(',') - : undefined, - ], + ['tags', request.tags + && request.tags.length > 0 ? request.tags.join(',') : undefined], ['with_ip', request.withIp], ['without_ip', request.withoutIp], ), }, unmarshalListServersResponse, ) - + /** * List all Instances. List all Instances in a specified Availability Zone, e.g. `fr-par-1`. * @@ -383,6 +373,7 @@ export class API extends ParentAPI { listServers = (request: Readonly = {}) => enrichForPagination('servers', this.pageOfListServers, request) + protected _createServer = (request: Readonly) => this.client.fetch( { @@ -396,17 +387,21 @@ export class API extends ParentAPI { unmarshalCreateServerResponse, ) + /** * Delete an Instance. Delete the Instance with the specified ID. * * @param request - The request {@link DeleteServerRequest} */ deleteServer = (request: Readonly) => - this.client.fetch({ - method: 'DELETE', - path: `/instance/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}`, - }) + this.client.fetch( + { + method: 'DELETE', + path: `/instance/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}`, + }, + ) + /** * Get an Instance. Get the details of a specified Instance. * @@ -422,6 +417,7 @@ export class API extends ParentAPI { unmarshalGetServerResponse, ) + protected _setServer = (request: Readonly) => this.client.fetch( { @@ -435,6 +431,7 @@ export class API extends ParentAPI { unmarshalSetServerResponse, ) + protected _updateServer = (request: Readonly) => this.client.fetch( { @@ -448,6 +445,7 @@ export class API extends ParentAPI { unmarshalUpdateServerResponse, ) + /** * List Instance actions. List all actions (e.g. power on, power off, reboot) that can currently be performed on an Instance. * @@ -463,6 +461,7 @@ export class API extends ParentAPI { unmarshalListServerActionsResponse, ) + /** * Perform action. Perform an action on an Instance. Available actions are: @@ -497,6 +496,7 @@ The `backup` action can be done with: unmarshalServerActionResponse, ) + /** * List user data. List all user data keys registered on a specified Instance. * @@ -512,17 +512,21 @@ The `backup` action can be done with: unmarshalListServerUserDataResponse, ) + /** * Delete user data. Delete the specified key from an Instance's user data. * * @param request - The request {@link DeleteServerUserDataRequest} */ deleteServerUserData = (request: Readonly) => - this.client.fetch({ - method: 'DELETE', - path: `/instance/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}/user_data/${validatePathParam('key', request.key)}`, - }) + this.client.fetch( + { + method: 'DELETE', + path: `/instance/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}/user_data/${validatePathParam('key', request.key)}`, + }, + ) + /** * Get Instance compatible types. Get compatible commercial types that can be used to update the Instance. The compatibility of an Instance offer is based on: * the CPU architecture @@ -534,9 +538,7 @@ If the specified Instance offer is flagged as end of service, the best compatibl * @param request - The request {@link GetServerCompatibleTypesRequest} * @returns A Promise of ServerCompatibleTypes */ - getServerCompatibleTypes = ( - request: Readonly, - ) => + getServerCompatibleTypes = (request: Readonly) => this.client.fetch( { method: 'GET', @@ -545,6 +547,7 @@ If the specified Instance offer is flagged as end of service, the best compatibl unmarshalServerCompatibleTypes, ) + /** * Attach a volume to an Instance. * @@ -564,6 +567,7 @@ If the specified Instance offer is flagged as end of service, the best compatibl unmarshalAttachServerVolumeResponse, ) + /** * Detach a volume from an Instance. * @@ -583,6 +587,7 @@ If the specified Instance offer is flagged as end of service, the best compatibl unmarshalDetachServerVolumeResponse, ) + /** * Attach a filesystem volume to an Instance. * @@ -602,6 +607,7 @@ If the specified Instance offer is flagged as end of service, the best compatibl unmarshalAttachServerFileSystemResponse, ) + /** * Detach a filesystem volume from an Instance. * @@ -621,6 +627,7 @@ If the specified Instance offer is flagged as end of service, the best compatibl unmarshalDetachServerFileSystemResponse, ) + protected pageOfListImages = (request: Readonly = {}) => this.client.fetch( { @@ -639,7 +646,7 @@ If the specified Instance offer is flagged as end of service, the best compatibl }, unmarshalListImagesResponse, ) - + /** * List Instance images. List all existing Instance images. * @@ -649,6 +656,7 @@ If the specified Instance offer is flagged as end of service, the best compatibl listImages = (request: Readonly = {}) => enrichForPagination('images', this.pageOfListImages, request) + /** * Get an Instance image. Get details of an image with the specified ID. * @@ -664,6 +672,7 @@ If the specified Instance offer is flagged as end of service, the best compatibl unmarshalGetImageResponse, ) + /** * Create an Instance image. Create an Instance image from the specified snapshot ID. * @@ -683,6 +692,7 @@ If the specified Instance offer is flagged as end of service, the best compatibl unmarshalCreateImageResponse, ) + protected _setImage = (request: Readonly) => this.client.fetch( { @@ -696,6 +706,7 @@ If the specified Instance offer is flagged as end of service, the best compatibl unmarshalSetImageResponse, ) + /** * Update image. Update the properties of an image. * @@ -715,20 +726,22 @@ If the specified Instance offer is flagged as end of service, the best compatibl unmarshalUpdateImageResponse, ) + /** * Delete an Instance image. Delete the image with the specified ID. * * @param request - The request {@link DeleteImageRequest} */ deleteImage = (request: Readonly) => - this.client.fetch({ - method: 'DELETE', - path: `/instance/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/images/${validatePathParam('imageId', request.imageId)}`, - }) + this.client.fetch( + { + method: 'DELETE', + path: `/instance/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/images/${validatePathParam('imageId', request.imageId)}`, + }, + ) - protected pageOfListSnapshots = ( - request: Readonly = {}, - ) => + + protected pageOfListSnapshots = (request: Readonly = {}) => this.client.fetch( { method: 'GET', @@ -745,7 +758,7 @@ If the specified Instance offer is flagged as end of service, the best compatibl }, unmarshalListSnapshotsResponse, ) - + /** * List snapshots. List all snapshots of an Organization in a specified Availability Zone. * @@ -755,6 +768,7 @@ If the specified Instance offer is flagged as end of service, the best compatibl listSnapshots = (request: Readonly = {}) => enrichForPagination('snapshots', this.pageOfListSnapshots, request) + /** * Create a snapshot from a specified volume or from a QCOW2 file. Create a snapshot from a specified volume or from a QCOW2 file in a specified Availability Zone. * @@ -774,6 +788,7 @@ If the specified Instance offer is flagged as end of service, the best compatibl unmarshalCreateSnapshotResponse, ) + /** * Get a snapshot. Get details of a snapshot with the specified ID. * @@ -789,6 +804,7 @@ If the specified Instance offer is flagged as end of service, the best compatibl unmarshalGetSnapshotResponse, ) + protected _setSnapshot = (request: Readonly) => this.client.fetch( { @@ -802,6 +818,7 @@ If the specified Instance offer is flagged as end of service, the best compatibl unmarshalSetSnapshotResponse, ) + /** * Update a snapshot. Update the properties of a snapshot. * @@ -821,17 +838,21 @@ If the specified Instance offer is flagged as end of service, the best compatibl unmarshalUpdateSnapshotResponse, ) + /** * Delete a snapshot. Delete the snapshot with the specified ID. * * @param request - The request {@link DeleteSnapshotRequest} */ deleteSnapshot = (request: Readonly) => - this.client.fetch({ - method: 'DELETE', - path: `/instance/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/snapshots/${validatePathParam('snapshotId', request.snapshotId)}`, - }) + this.client.fetch( + { + method: 'DELETE', + path: `/instance/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/snapshots/${validatePathParam('snapshotId', request.snapshotId)}`, + }, + ) + /** * Export a snapshot. Export a snapshot to a specified Object Storage bucket in the same region. * @@ -851,6 +872,7 @@ If the specified Instance offer is flagged as end of service, the best compatibl unmarshalExportSnapshotResponse, ) + protected pageOfListVolumes = (request: Readonly = {}) => this.client.fetch( { @@ -862,18 +884,14 @@ If the specified Instance offer is flagged as end of service, the best compatibl ['page', request.page], ['per_page', request.perPage ?? this.client.settings.defaultPageSize], ['project', request.project], - [ - 'tags', - request.tags && request.tags.length > 0 - ? request.tags.join(',') - : undefined, - ], + ['tags', request.tags + && request.tags.length > 0 ? request.tags.join(',') : undefined], ['volume_type', request.volumeType], ), }, unmarshalListVolumesResponse, ) - + /** * List volumes. List volumes in the specified Availability Zone. You can filter the output by volume type. * @@ -883,6 +901,7 @@ If the specified Instance offer is flagged as end of service, the best compatibl listVolumes = (request: Readonly = {}) => enrichForPagination('volumes', this.pageOfListVolumes, request) + /** * Create a volume. Create a volume of a specified type in an Availability Zone. * @@ -902,6 +921,7 @@ If the specified Instance offer is flagged as end of service, the best compatibl unmarshalCreateVolumeResponse, ) + /** * Get a volume. Get details of a volume with the specified ID. * @@ -917,6 +937,7 @@ If the specified Instance offer is flagged as end of service, the best compatibl unmarshalGetVolumeResponse, ) + /** * Update a volume. Replace the name and/or size properties of a volume specified by its ID, with the specified value(s). * @@ -936,20 +957,22 @@ If the specified Instance offer is flagged as end of service, the best compatibl unmarshalUpdateVolumeResponse, ) + /** * Delete a volume. Delete the volume with the specified ID. * * @param request - The request {@link DeleteVolumeRequest} */ deleteVolume = (request: Readonly) => - this.client.fetch({ - method: 'DELETE', - path: `/instance/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/volumes/${validatePathParam('volumeId', request.volumeId)}`, - }) + this.client.fetch( + { + method: 'DELETE', + path: `/instance/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/volumes/${validatePathParam('volumeId', request.volumeId)}`, + }, + ) - protected pageOfListSecurityGroups = ( - request: Readonly = {}, - ) => + + protected pageOfListSecurityGroups = (request: Readonly = {}) => this.client.fetch( { method: 'GET', @@ -961,17 +984,13 @@ If the specified Instance offer is flagged as end of service, the best compatibl ['per_page', request.perPage ?? this.client.settings.defaultPageSize], ['project', request.project], ['project_default', request.projectDefault], - [ - 'tags', - request.tags && request.tags.length > 0 - ? request.tags.join(',') - : undefined, - ], + ['tags', request.tags + && request.tags.length > 0 ? request.tags.join(',') : undefined], ), }, unmarshalListSecurityGroupsResponse, ) - + /** * List security groups. List all existing security groups. * @@ -979,12 +998,9 @@ If the specified Instance offer is flagged as end of service, the best compatibl * @returns A Promise of ListSecurityGroupsResponse */ listSecurityGroups = (request: Readonly = {}) => - enrichForPagination( - 'securityGroups', - this.pageOfListSecurityGroups, - request, - ) + enrichForPagination('securityGroups', this.pageOfListSecurityGroups, request) + /** * Create a security group. Create a security group with a specified name and description. * @@ -1004,6 +1020,7 @@ If the specified Instance offer is flagged as end of service, the best compatibl unmarshalCreateSecurityGroupResponse, ) + /** * Get a security group. Get the details of a security group with the specified ID. * @@ -1019,17 +1036,21 @@ If the specified Instance offer is flagged as end of service, the best compatibl unmarshalGetSecurityGroupResponse, ) + /** * Delete a security group. Delete a security group with the specified ID. * * @param request - The request {@link DeleteSecurityGroupRequest} */ deleteSecurityGroup = (request: Readonly) => - this.client.fetch({ - method: 'DELETE', - path: `/instance/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/security_groups/${validatePathParam('securityGroupId', request.securityGroupId)}`, - }) + this.client.fetch( + { + method: 'DELETE', + path: `/instance/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/security_groups/${validatePathParam('securityGroupId', request.securityGroupId)}`, + }, + ) + protected _setSecurityGroup = (request: Readonly) => this.client.fetch( { @@ -1043,6 +1064,7 @@ If the specified Instance offer is flagged as end of service, the best compatibl unmarshalSetSecurityGroupResponse, ) + /** * Update a security group. Update the properties of security group. * @@ -1062,15 +1084,14 @@ If the specified Instance offer is flagged as end of service, the best compatibl unmarshalUpdateSecurityGroupResponse, ) + /** * Get default rules. Lists the default rules applied to all the security groups. * * @param request - The request {@link ListDefaultSecurityGroupRulesRequest} * @returns A Promise of ListSecurityGroupRulesResponse */ - listDefaultSecurityGroupRules = ( - request: Readonly = {}, - ) => + listDefaultSecurityGroupRules = (request: Readonly = {}) => this.client.fetch( { method: 'GET', @@ -1079,9 +1100,8 @@ If the specified Instance offer is flagged as end of service, the best compatibl unmarshalListSecurityGroupRulesResponse, ) - protected pageOfListSecurityGroupRules = ( - request: Readonly, - ) => + + protected pageOfListSecurityGroupRules = (request: Readonly) => this.client.fetch( { method: 'GET', @@ -1093,7 +1113,7 @@ If the specified Instance offer is flagged as end of service, the best compatibl }, unmarshalListSecurityGroupRulesResponse, ) - + /** * List rules. List the rules of the a specified security group ID. * @@ -1103,15 +1123,14 @@ If the specified Instance offer is flagged as end of service, the best compatibl listSecurityGroupRules = (request: Readonly) => enrichForPagination('rules', this.pageOfListSecurityGroupRules, request) + /** * Create rule. Create a rule in the specified security group ID. * * @param request - The request {@link CreateSecurityGroupRuleRequest} * @returns A Promise of CreateSecurityGroupRuleResponse */ - createSecurityGroupRule = ( - request: Readonly, - ) => + createSecurityGroupRule = (request: Readonly) => this.client.fetch( { body: JSON.stringify( @@ -1124,6 +1143,7 @@ If the specified Instance offer is flagged as end of service, the best compatibl unmarshalCreateSecurityGroupRuleResponse, ) + /** * Update all the rules of a security group. Replaces the existing rules of the security group with the rules provided. This endpoint supports the update of existing rules, creation of new rules and deletion of existing rules when they are not passed in the request. * @@ -1143,19 +1163,21 @@ If the specified Instance offer is flagged as end of service, the best compatibl unmarshalSetSecurityGroupRulesResponse, ) + /** * Delete rule. Delete a security group rule with the specified ID. * * @param request - The request {@link DeleteSecurityGroupRuleRequest} */ - deleteSecurityGroupRule = ( - request: Readonly, - ) => - this.client.fetch({ - method: 'DELETE', - path: `/instance/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/security_groups/${validatePathParam('securityGroupId', request.securityGroupId)}/rules/${validatePathParam('securityGroupRuleId', request.securityGroupRuleId)}`, - }) + deleteSecurityGroupRule = (request: Readonly) => + this.client.fetch( + { + method: 'DELETE', + path: `/instance/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/security_groups/${validatePathParam('securityGroupId', request.securityGroupId)}/rules/${validatePathParam('securityGroupRuleId', request.securityGroupRuleId)}`, + }, + ) + /** * Get rule. Get details of a security group rule with the specified ID. * @@ -1171,9 +1193,8 @@ If the specified Instance offer is flagged as end of service, the best compatibl unmarshalGetSecurityGroupRuleResponse, ) - protected _setSecurityGroupRule = ( - request: Readonly, - ) => + + protected _setSecurityGroupRule = (request: Readonly) => this.client.fetch( { body: JSON.stringify( @@ -1186,15 +1207,14 @@ If the specified Instance offer is flagged as end of service, the best compatibl unmarshalSetSecurityGroupRuleResponse, ) + /** * Update security group rule. Update the properties of a rule from a specified security group. * * @param request - The request {@link UpdateSecurityGroupRuleRequest} * @returns A Promise of UpdateSecurityGroupRuleResponse */ - updateSecurityGroupRule = ( - request: Readonly, - ) => + updateSecurityGroupRule = (request: Readonly) => this.client.fetch( { body: JSON.stringify( @@ -1207,9 +1227,8 @@ If the specified Instance offer is flagged as end of service, the best compatibl unmarshalUpdateSecurityGroupRuleResponse, ) - protected pageOfListPlacementGroups = ( - request: Readonly = {}, - ) => + + protected pageOfListPlacementGroups = (request: Readonly = {}) => this.client.fetch( { method: 'GET', @@ -1220,17 +1239,13 @@ If the specified Instance offer is flagged as end of service, the best compatibl ['page', request.page], ['per_page', request.perPage ?? this.client.settings.defaultPageSize], ['project', request.project], - [ - 'tags', - request.tags && request.tags.length > 0 - ? request.tags.join(',') - : undefined, - ], + ['tags', request.tags + && request.tags.length > 0 ? request.tags.join(',') : undefined], ), }, unmarshalListPlacementGroupsResponse, ) - + /** * List placement groups. List all placement groups in a specified Availability Zone. * @@ -1238,21 +1253,16 @@ If the specified Instance offer is flagged as end of service, the best compatibl * @returns A Promise of ListPlacementGroupsResponse */ listPlacementGroups = (request: Readonly = {}) => - enrichForPagination( - 'placementGroups', - this.pageOfListPlacementGroups, - request, - ) + enrichForPagination('placementGroups', this.pageOfListPlacementGroups, request) + /** * Create a placement group. Create a new placement group in a specified Availability Zone. * * @param request - The request {@link CreatePlacementGroupRequest} * @returns A Promise of CreatePlacementGroupResponse */ - createPlacementGroup = ( - request: Readonly = {}, - ) => + createPlacementGroup = (request: Readonly = {}) => this.client.fetch( { body: JSON.stringify( @@ -1265,6 +1275,7 @@ If the specified Instance offer is flagged as end of service, the best compatibl unmarshalCreatePlacementGroupResponse, ) + /** * Get a placement group. Get the specified placement group. * @@ -1280,6 +1291,7 @@ If the specified Instance offer is flagged as end of service, the best compatibl unmarshalGetPlacementGroupResponse, ) + /** * Set placement group. Set all parameters of the specified placement group. * @@ -1299,6 +1311,7 @@ If the specified Instance offer is flagged as end of service, the best compatibl unmarshalSetPlacementGroupResponse, ) + /** * Update a placement group. Update one or more parameter of the specified placement group. * @@ -1318,26 +1331,28 @@ If the specified Instance offer is flagged as end of service, the best compatibl unmarshalUpdatePlacementGroupResponse, ) + /** * Delete the specified placement group. * * @param request - The request {@link DeletePlacementGroupRequest} */ deletePlacementGroup = (request: Readonly) => - this.client.fetch({ - method: 'DELETE', - path: `/instance/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/placement_groups/${validatePathParam('placementGroupId', request.placementGroupId)}`, - }) + this.client.fetch( + { + method: 'DELETE', + path: `/instance/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/placement_groups/${validatePathParam('placementGroupId', request.placementGroupId)}`, + }, + ) + /** * Get placement group servers. Get all Instances belonging to the specified placement group. * * @param request - The request {@link GetPlacementGroupServersRequest} * @returns A Promise of GetPlacementGroupServersResponse */ - getPlacementGroupServers = ( - request: Readonly, - ) => + getPlacementGroupServers = (request: Readonly) => this.client.fetch( { method: 'GET', @@ -1346,15 +1361,14 @@ If the specified Instance offer is flagged as end of service, the best compatibl unmarshalGetPlacementGroupServersResponse, ) + /** * Set placement group servers. Set all Instances belonging to the specified placement group. * * @param request - The request {@link SetPlacementGroupServersRequest} * @returns A Promise of SetPlacementGroupServersResponse */ - setPlacementGroupServers = ( - request: Readonly, - ) => + setPlacementGroupServers = (request: Readonly) => this.client.fetch( { body: JSON.stringify( @@ -1367,22 +1381,18 @@ If the specified Instance offer is flagged as end of service, the best compatibl unmarshalSetPlacementGroupServersResponse, ) + /** * Update placement group servers. Update all Instances belonging to the specified placement group. * * @param request - The request {@link UpdatePlacementGroupServersRequest} * @returns A Promise of UpdatePlacementGroupServersResponse */ - updatePlacementGroupServers = ( - request: Readonly, - ) => + updatePlacementGroupServers = (request: Readonly) => this.client.fetch( { body: JSON.stringify( - marshalUpdatePlacementGroupServersRequest( - request, - this.client.settings, - ), + marshalUpdatePlacementGroupServersRequest(request, this.client.settings), ), headers: jsonContentHeaders, method: 'PATCH', @@ -1391,6 +1401,7 @@ If the specified Instance offer is flagged as end of service, the best compatibl unmarshalUpdatePlacementGroupServersResponse, ) + protected pageOfListIps = (request: Readonly = {}) => this.client.fetch( { @@ -1402,18 +1413,14 @@ If the specified Instance offer is flagged as end of service, the best compatibl ['page', request.page], ['per_page', request.perPage ?? this.client.settings.defaultPageSize], ['project', request.project], - [ - 'tags', - request.tags && request.tags.length > 0 - ? request.tags.join(',') - : undefined, - ], + ['tags', request.tags + && request.tags.length > 0 ? request.tags.join(',') : undefined], ['type', request.type], ), }, unmarshalListIpsResponse, ) - + /** * List all flexible IPs. List all flexible IPs in a specified zone. * @@ -1423,6 +1430,7 @@ If the specified Instance offer is flagged as end of service, the best compatibl listIps = (request: Readonly = {}) => enrichForPagination('ips', this.pageOfListIps, request) + /** * Reserve a flexible IP. Reserve a flexible IP and attach it to the specified Instance. * @@ -1442,6 +1450,7 @@ If the specified Instance offer is flagged as end of service, the best compatibl unmarshalCreateIpResponse, ) + /** * Get a flexible IP. Get details of an IP with the specified ID or address. * @@ -1457,6 +1466,7 @@ If the specified Instance offer is flagged as end of service, the best compatibl unmarshalGetIpResponse, ) + /** * Update a flexible IP. Update a flexible IP in the specified zone with the specified ID. * @@ -1476,20 +1486,22 @@ If the specified Instance offer is flagged as end of service, the best compatibl unmarshalUpdateIpResponse, ) + /** * Delete a flexible IP. Delete the IP with the specified ID. * * @param request - The request {@link DeleteIpRequest} */ deleteIp = (request: Readonly) => - this.client.fetch({ - method: 'DELETE', - path: `/instance/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/ips/${validatePathParam('ip', request.ip)}`, - }) + this.client.fetch( + { + method: 'DELETE', + path: `/instance/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/ips/${validatePathParam('ip', request.ip)}`, + }, + ) - protected pageOfListPrivateNICs = ( - request: Readonly, - ) => + + protected pageOfListPrivateNICs = (request: Readonly) => this.client.fetch( { method: 'GET', @@ -1497,17 +1509,13 @@ If the specified Instance offer is flagged as end of service, the best compatibl urlParams: urlParams( ['page', request.page], ['per_page', request.perPage ?? this.client.settings.defaultPageSize], - [ - 'tags', - request.tags && request.tags.length > 0 - ? request.tags.join(',') - : undefined, - ], + ['tags', request.tags + && request.tags.length > 0 ? request.tags.join(',') : undefined], ), }, unmarshalListPrivateNICsResponse, ) - + /** * List all private NICs. List all private NICs of a specified Instance. * @@ -1517,6 +1525,7 @@ If the specified Instance offer is flagged as end of service, the best compatibl listPrivateNICs = (request: Readonly) => enrichForPagination('privateNics', this.pageOfListPrivateNICs, request) + /** * Create a private NIC connecting an Instance to a Private Network. * @@ -1536,6 +1545,7 @@ If the specified Instance offer is flagged as end of service, the best compatibl unmarshalCreatePrivateNICResponse, ) + /** * Get a private NIC. Get private NIC properties. * @@ -1551,6 +1561,7 @@ If the specified Instance offer is flagged as end of service, the best compatibl unmarshalGetPrivateNICResponse, ) + /** * Update a private NIC. Update one or more parameter(s) of a specified private NIC. * @@ -1570,17 +1581,21 @@ If the specified Instance offer is flagged as end of service, the best compatibl unmarshalPrivateNIC, ) + /** * Delete a private NIC. * * @param request - The request {@link DeletePrivateNICRequest} */ deletePrivateNIC = (request: Readonly) => - this.client.fetch({ - method: 'DELETE', - path: `/instance/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}/private_nics/${validatePathParam('privateNicId', request.privateNicId)}`, - }) + this.client.fetch( + { + method: 'DELETE', + path: `/instance/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}/private_nics/${validatePathParam('privateNicId', request.privateNicId)}`, + }, + ) + getDashboard = (request: Readonly = {}) => this.client.fetch( { @@ -1594,6 +1609,7 @@ If the specified Instance offer is flagged as end of service, the best compatibl unmarshalGetDashboardResponse, ) + /** * Get a volume or snapshot's migration plan. Given a volume or snapshot, returns the migration plan but does not perform the actual migration. To perform the migration, you have to call the [Migrate a volume and/or snapshots to SBS](#path-volumes-migrate-a-volume-andor-snapshots-to-sbs-scaleway-block-storage) endpoint afterward. The endpoint returns the resources that should be migrated together: @@ -1617,46 +1633,53 @@ The endpoint also returns the validation_key, which must be provided to the [Mig unmarshalMigrationPlan, ) + /** * Migrate a volume and/or snapshots to SBS (Scaleway Block Storage). To be used, the call to this endpoint must be preceded by a call to the [Get a volume or snapshot's migration plan](#path-volumes-get-a-volume-or-snapshots-migration-plan) endpoint. To migrate all resources mentioned in the migration plan, the validation_key returned in the plan must be provided. * * @param request - The request {@link ApplyBlockMigrationRequest} */ applyBlockMigration = (request: Readonly) => - this.client.fetch({ - body: JSON.stringify( - marshalApplyBlockMigrationRequest(request, this.client.settings), - ), - headers: jsonContentHeaders, - method: 'POST', - path: `/instance/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/block-migration/apply`, - }) + this.client.fetch( + { + body: JSON.stringify( + marshalApplyBlockMigrationRequest(request, this.client.settings), + ), + headers: jsonContentHeaders, + method: 'POST', + path: `/instance/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/block-migration/apply`, + }, + ) - checkBlockMigrationOrganizationQuotas = ( - request: Readonly = {}, - ) => - this.client.fetch({ - body: JSON.stringify( - marshalCheckBlockMigrationOrganizationQuotasRequest( - request, - this.client.settings, + + checkBlockMigrationOrganizationQuotas = (request: Readonly = {}) => + this.client.fetch( + { + body: JSON.stringify( + marshalCheckBlockMigrationOrganizationQuotasRequest(request, this.client.settings), ), - ), - headers: jsonContentHeaders, - method: 'POST', - path: `/instance/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/block-migration/check-organization-quotas`, - }) + headers: jsonContentHeaders, + method: 'POST', + path: `/instance/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/block-migration/check-organization-quotas`, + }, + ) + /** * Releases the reserved IP without deleting the reservation.. **The IP remains available in IPAM**, which means that it is still reserved by the Organization, and can be reattached to another resource (Instance or other product). * * @param request - The request {@link ReleaseIpToIpamRequest} */ releaseIpToIpam = (request: Readonly) => - this.client.fetch({ - body: '{}', - headers: jsonContentHeaders, - method: 'POST', - path: `/instance/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/ips/${validatePathParam('ipId', request.ipId)}/release-to-ipam`, - }) + this.client.fetch( + { + body: '{}', + headers: jsonContentHeaders, + method: 'POST', + path: `/instance/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/ips/${validatePathParam('ipId', request.ipId)}/release-to-ipam`, + }, + ) + + } + diff --git a/packages_generated/instance/src/v1/content.gen.ts b/packages_generated/instance/src/v1/content.gen.ts index e36ea263c..839c2e6cc 100644 --- a/packages_generated/instance/src/v1/content.gen.ts +++ b/packages_generated/instance/src/v1/content.gen.ts @@ -14,14 +14,21 @@ import type { VolumeState, } from './types.gen.js' + /** Lists transient statutes of the enum {@link ImageState}. */ -export const IMAGE_TRANSIENT_STATUSES: ImageState[] = ['creating'] +export const IMAGE_TRANSIENT_STATUSES: ImageState[] = [ + 'creating', +] /** Lists transient statutes of the enum {@link IpState}. */ -export const IP_TRANSIENT_STATUSES: IpState[] = ['pending'] +export const IP_TRANSIENT_STATUSES: IpState[] = [ + 'pending', +] /** Lists transient statutes of the enum {@link PrivateNICState}. */ -export const PRIVATE_NIC_TRANSIENT_STATUSES: PrivateNICState[] = ['syncing'] +export const PRIVATE_NIC_TRANSIENT_STATUSES: PrivateNICState[] = [ + 'syncing', +] /** Lists transient statutes of the enum {@link SecurityGroupState}. */ export const SECURITY_GROUP_TRANSIENT_STATUSES: SecurityGroupState[] = [ @@ -35,10 +42,15 @@ export const SERVER_FILESYSTEM_TRANSIENT_STATUSES: ServerFilesystemState[] = [ ] /** Lists transient statutes of the enum {@link ServerIpState}. */ -export const SERVER_IP_TRANSIENT_STATUSES: ServerIpState[] = ['pending'] +export const SERVER_IP_TRANSIENT_STATUSES: ServerIpState[] = [ + 'pending', +] /** Lists transient statutes of the enum {@link ServerState}. */ -export const SERVER_TRANSIENT_STATUSES: ServerState[] = ['starting', 'stopping'] +export const SERVER_TRANSIENT_STATUSES: ServerState[] = [ + 'starting', + 'stopping', +] /** Lists transient statutes of the enum {@link SnapshotState}. */ export const SNAPSHOT_TRANSIENT_STATUSES: SnapshotState[] = [ @@ -73,3 +85,4 @@ export const VOLUME_TRANSIENT_STATUSES: VolumeState[] = [ 'resizing', 'hotsyncing', ] + diff --git a/packages_generated/instance/src/v1/index.gen.ts b/packages_generated/instance/src/v1/index.gen.ts index e61342883..9d7fd3456 100644 --- a/packages_generated/instance/src/v1/index.gen.ts +++ b/packages_generated/instance/src/v1/index.gen.ts @@ -1,6 +1,8 @@ // This file was automatically generated. DO NOT EDIT. // If you have any remark or suggestion do not hesitate to open an issue. -export { API } from './api.gen.js' +export { + API, +} from './api.gen.js' export * from './content.gen.js' export * from './marshalling.gen.js' export type { diff --git a/packages_generated/instance/src/v1/marshalling.gen.ts b/packages_generated/instance/src/v1/marshalling.gen.ts index 9429b8ddf..fb9ded79e 100644 --- a/packages_generated/instance/src/v1/marshalling.gen.ts +++ b/packages_generated/instance/src/v1/marshalling.gen.ts @@ -1,62 +1,59 @@ // This file was automatically generated. DO NOT EDIT. // If you have any remark or suggestion do not hesitate to open an issue. import randomName from '@scaleway/random-name' -import { - isJSONObject, - resolveOneOf, - unmarshalArrayOfObject, - unmarshalDate, - unmarshalMapOfObject, -} from '@scaleway/sdk-client' +import { isJSONObject, resolveOneOf, unmarshalArrayOfObject, unmarshalDate, unmarshalMapOfObject, } from '@scaleway/sdk-client' import type { DefaultValues } from '@scaleway/sdk-client' import type { - ApplyBlockMigrationRequest, - AttachServerFileSystemRequest, + PrivateNIC, + ServerSummary, + Bootscript, + Volume, + VolumeSummary, + Image, + PlacementGroup, + SecurityGroupSummary, + ServerFilesystem, + ServerIp, + ServerIpv6, + ServerLocation, + ServerMaintenance, + VolumeServer, + Server, AttachServerFileSystemResponse, - AttachServerVolumeRequest, AttachServerVolumeResponse, - Bootscript, - CheckBlockMigrationOrganizationQuotasRequest, - CreateImageRequest, CreateImageResponse, - CreateIpRequest, + Ip, CreateIpResponse, - CreatePlacementGroupRequest, CreatePlacementGroupResponse, - CreatePrivateNICRequest, CreatePrivateNICResponse, - CreateSecurityGroupRequest, + SecurityGroup, CreateSecurityGroupResponse, - CreateSecurityGroupRuleRequest, + SecurityGroupRule, CreateSecurityGroupRuleResponse, - CreateServerRequest, CreateServerResponse, - CreateSnapshotRequest, + SnapshotBaseVolume, + Snapshot, + Task, CreateSnapshotResponse, - CreateVolumeRequest, CreateVolumeResponse, - Dashboard, - DetachServerFileSystemRequest, DetachServerFileSystemResponse, - DetachServerVolumeRequest, DetachServerVolumeResponse, - ExportSnapshotRequest, ExportSnapshotResponse, + Dashboard, GetDashboardResponse, GetImageResponse, GetIpResponse, GetPlacementGroupResponse, + PlacementGroupServer, GetPlacementGroupServersResponse, GetPrivateNICResponse, GetSecurityGroupResponse, GetSecurityGroupRuleResponse, GetServerResponse, - GetServerTypesAvailabilityResponse, GetServerTypesAvailabilityResponseAvailability, + GetServerTypesAvailabilityResponse, GetSnapshotResponse, GetVolumeResponse, - Image, - Ip, ListImagesResponse, ListIpsResponse, ListPlacementGroupsResponse, @@ -66,87 +63,84 @@ import type { ListServerActionsResponse, ListServerUserDataResponse, ListServersResponse, + ServerTypeNetworkInterface, + ServerTypeVolumeConstraintSizes, + ServerTypeCapabilities, + ServerTypeGPUInfo, + ServerTypeNetwork, + ServerTypeVolumeConstraintsByType, + ServerType, ListServersTypesResponse, ListSnapshotsResponse, ListVolumesResponse, + VolumeTypeCapabilities, + VolumeTypeConstraints, + VolumeType, ListVolumesTypesResponse, MigrationPlan, - PlacementGroup, - PlacementGroupServer, - PlanBlockMigrationRequest, - PrivateNIC, - SecurityGroup, - SecurityGroupRule, - SecurityGroupSummary, - SecurityGroupTemplate, - Server, - ServerActionRequest, - ServerActionRequestVolumeBackupTemplate, ServerActionResponse, ServerCompatibleTypes, - ServerFilesystem, - ServerIp, - ServerIpv6, - ServerLocation, - ServerMaintenance, - ServerSummary, - ServerType, - ServerTypeCapabilities, - ServerTypeGPUInfo, - ServerTypeNetwork, - ServerTypeNetworkInterface, - ServerTypeVolumeConstraintSizes, - ServerTypeVolumeConstraintsByType, + SetPlacementGroupResponse, + SetPlacementGroupServersResponse, + SetSecurityGroupRulesResponse, + UpdateImageResponse, + UpdateIpResponse, + UpdatePlacementGroupResponse, + UpdatePlacementGroupServersResponse, + UpdateSecurityGroupResponse, + UpdateSecurityGroupRuleResponse, + UpdateServerResponse, + UpdateSnapshotResponse, + UpdateVolumeResponse, + ApplyBlockMigrationRequest, + AttachServerFileSystemRequest, + AttachServerVolumeRequest, + CheckBlockMigrationOrganizationQuotasRequest, + VolumeTemplate, + CreateImageRequest, + CreateIpRequest, + CreatePlacementGroupRequest, + CreatePrivateNICRequest, + CreateSecurityGroupRequest, + CreateSecurityGroupRuleRequest, + VolumeServerTemplate, + CreateServerRequest, + CreateSnapshotRequest, + CreateVolumeRequest, + DetachServerFileSystemRequest, + DetachServerVolumeRequest, + ExportSnapshotRequest, + PlanBlockMigrationRequest, + ServerActionRequestVolumeBackupTemplate, + ServerActionRequest, SetImageRequest, SetPlacementGroupRequest, - SetPlacementGroupResponse, SetPlacementGroupServersRequest, - SetPlacementGroupServersResponse, - SetSecurityGroupRulesRequest, SetSecurityGroupRulesRequestRule, - SetSecurityGroupRulesResponse, - Snapshot, - SnapshotBaseVolume, - Task, + SetSecurityGroupRulesRequest, + VolumeImageUpdateTemplate, UpdateImageRequest, - UpdateImageResponse, UpdateIpRequest, - UpdateIpResponse, UpdatePlacementGroupRequest, - UpdatePlacementGroupResponse, UpdatePlacementGroupServersRequest, - UpdatePlacementGroupServersResponse, UpdatePrivateNICRequest, UpdateSecurityGroupRequest, - UpdateSecurityGroupResponse, UpdateSecurityGroupRuleRequest, - UpdateSecurityGroupRuleResponse, + SecurityGroupTemplate, UpdateServerRequest, - UpdateServerResponse, UpdateSnapshotRequest, - UpdateSnapshotResponse, UpdateVolumeRequest, - UpdateVolumeResponse, - Volume, - VolumeImageUpdateTemplate, - VolumeServer, - VolumeServerTemplate, - VolumeSummary, - VolumeTemplate, - VolumeType, - VolumeTypeCapabilities, - VolumeTypeConstraints, } from './types.gen.js' import type { SetImageResponse, - SetSecurityGroupRequest, SetSecurityGroupResponse, - SetSecurityGroupRuleRequest, SetSecurityGroupRuleResponse, - SetServerRequest, SetServerResponse, - SetSnapshotRequest, SetSnapshotResponse, + SetSecurityGroupRequest, + SetSecurityGroupRuleRequest, + SetServerRequest, + SetSnapshotRequest, } from './types.private.gen.js' export const unmarshalPrivateNIC = (data: unknown): PrivateNIC => { @@ -252,9 +246,7 @@ const unmarshalImage = (data: unknown): Image => { return { arch: data.arch, creationDate: unmarshalDate(data.creation_date), - defaultBootscript: data.default_bootscript - ? unmarshalBootscript(data.default_bootscript) - : undefined, + defaultBootscript: data.default_bootscript ? unmarshalBootscript(data.default_bootscript) : undefined, extraVolumes: unmarshalMapOfObject(data.extra_volumes, unmarshalVolume), fromServer: data.from_server, id: data.id, @@ -263,9 +255,7 @@ const unmarshalImage = (data: unknown): Image => { organization: data.organization, project: data.project, public: data.public, - rootVolume: data.root_volume - ? unmarshalVolumeSummary(data.root_volume) - : undefined, + rootVolume: data.root_volume ? unmarshalVolumeSummary(data.root_volume) : undefined, state: data.state, tags: data.tags, zone: data.zone, @@ -424,28 +414,18 @@ const unmarshalServer = (data: unknown): Server => { dynamicIpRequired: data.dynamic_ip_required, enableIpv6: data.enable_ipv6, endOfService: data.end_of_service, - filesystems: unmarshalArrayOfObject( - data.filesystems, - unmarshalServerFilesystem, - ), + filesystems: unmarshalArrayOfObject(data.filesystems, unmarshalServerFilesystem), hostname: data.hostname, id: data.id, image: data.image ? unmarshalImage(data.image) : undefined, ipv6: data.ipv6 ? unmarshalServerIpv6(data.ipv6) : undefined, - location: data.location - ? unmarshalServerLocation(data.location) - : undefined, + location: data.location ? unmarshalServerLocation(data.location) : undefined, macAddress: data.mac_address, - maintenances: unmarshalArrayOfObject( - data.maintenances, - unmarshalServerMaintenance, - ), + maintenances: unmarshalArrayOfObject(data.maintenances, unmarshalServerMaintenance), modificationDate: unmarshalDate(data.modification_date), name: data.name, organization: data.organization, - placementGroup: data.placement_group - ? unmarshalPlacementGroup(data.placement_group) - : undefined, + placementGroup: data.placement_group ? unmarshalPlacementGroup(data.placement_group) : undefined, privateIp: data.private_ip, privateNics: unmarshalArrayOfObject(data.private_nics, unmarshalPrivateNIC), project: data.project, @@ -453,9 +433,7 @@ const unmarshalServer = (data: unknown): Server => { publicIp: data.public_ip ? unmarshalServerIp(data.public_ip) : undefined, publicIps: unmarshalArrayOfObject(data.public_ips, unmarshalServerIp), routedIpEnabled: data.routed_ip_enabled, - securityGroup: data.security_group - ? unmarshalSecurityGroupSummary(data.security_group) - : undefined, + securityGroup: data.security_group ? unmarshalSecurityGroupSummary(data.security_group) : undefined, state: data.state, stateDetail: data.state_detail, tags: data.tags, @@ -464,9 +442,7 @@ const unmarshalServer = (data: unknown): Server => { } as Server } -export const unmarshalAttachServerFileSystemResponse = ( - data: unknown, -): AttachServerFileSystemResponse => { +export const unmarshalAttachServerFileSystemResponse = (data: unknown): AttachServerFileSystemResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'AttachServerFileSystemResponse' failed as data isn't a dictionary.`, @@ -478,9 +454,7 @@ export const unmarshalAttachServerFileSystemResponse = ( } as AttachServerFileSystemResponse } -export const unmarshalAttachServerVolumeResponse = ( - data: unknown, -): AttachServerVolumeResponse => { +export const unmarshalAttachServerVolumeResponse = (data: unknown): AttachServerVolumeResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'AttachServerVolumeResponse' failed as data isn't a dictionary.`, @@ -492,9 +466,7 @@ export const unmarshalAttachServerVolumeResponse = ( } as AttachServerVolumeResponse } -export const unmarshalCreateImageResponse = ( - data: unknown, -): CreateImageResponse => { +export const unmarshalCreateImageResponse = (data: unknown): CreateImageResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'CreateImageResponse' failed as data isn't a dictionary.`, @@ -541,9 +513,7 @@ export const unmarshalCreateIpResponse = (data: unknown): CreateIpResponse => { } as CreateIpResponse } -export const unmarshalCreatePlacementGroupResponse = ( - data: unknown, -): CreatePlacementGroupResponse => { +export const unmarshalCreatePlacementGroupResponse = (data: unknown): CreatePlacementGroupResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'CreatePlacementGroupResponse' failed as data isn't a dictionary.`, @@ -551,15 +521,11 @@ export const unmarshalCreatePlacementGroupResponse = ( } return { - placementGroup: data.placement_group - ? unmarshalPlacementGroup(data.placement_group) - : undefined, + placementGroup: data.placement_group ? unmarshalPlacementGroup(data.placement_group) : undefined, } as CreatePlacementGroupResponse } -export const unmarshalCreatePrivateNICResponse = ( - data: unknown, -): CreatePrivateNICResponse => { +export const unmarshalCreatePrivateNICResponse = (data: unknown): CreatePrivateNICResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'CreatePrivateNICResponse' failed as data isn't a dictionary.`, @@ -567,9 +533,7 @@ export const unmarshalCreatePrivateNICResponse = ( } return { - privateNic: data.private_nic - ? unmarshalPrivateNIC(data.private_nic) - : undefined, + privateNic: data.private_nic ? unmarshalPrivateNIC(data.private_nic) : undefined, } as CreatePrivateNICResponse } @@ -601,9 +565,7 @@ const unmarshalSecurityGroup = (data: unknown): SecurityGroup => { } as SecurityGroup } -export const unmarshalCreateSecurityGroupResponse = ( - data: unknown, -): CreateSecurityGroupResponse => { +export const unmarshalCreateSecurityGroupResponse = (data: unknown): CreateSecurityGroupResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'CreateSecurityGroupResponse' failed as data isn't a dictionary.`, @@ -611,9 +573,7 @@ export const unmarshalCreateSecurityGroupResponse = ( } return { - securityGroup: data.security_group - ? unmarshalSecurityGroup(data.security_group) - : undefined, + securityGroup: data.security_group ? unmarshalSecurityGroup(data.security_group) : undefined, } as CreateSecurityGroupResponse } @@ -638,9 +598,7 @@ const unmarshalSecurityGroupRule = (data: unknown): SecurityGroupRule => { } as SecurityGroupRule } -export const unmarshalCreateSecurityGroupRuleResponse = ( - data: unknown, -): CreateSecurityGroupRuleResponse => { +export const unmarshalCreateSecurityGroupRuleResponse = (data: unknown): CreateSecurityGroupRuleResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'CreateSecurityGroupRuleResponse' failed as data isn't a dictionary.`, @@ -652,9 +610,7 @@ export const unmarshalCreateSecurityGroupRuleResponse = ( } as CreateSecurityGroupRuleResponse } -export const unmarshalCreateServerResponse = ( - data: unknown, -): CreateServerResponse => { +export const unmarshalCreateServerResponse = (data: unknown): CreateServerResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'CreateServerResponse' failed as data isn't a dictionary.`, @@ -687,9 +643,7 @@ const unmarshalSnapshot = (data: unknown): Snapshot => { } return { - baseVolume: data.base_volume - ? unmarshalSnapshotBaseVolume(data.base_volume) - : undefined, + baseVolume: data.base_volume ? unmarshalSnapshotBaseVolume(data.base_volume) : undefined, creationDate: unmarshalDate(data.creation_date), errorReason: data.error_reason, id: data.id, @@ -725,9 +679,7 @@ const unmarshalTask = (data: unknown): Task => { } as Task } -export const unmarshalCreateSnapshotResponse = ( - data: unknown, -): CreateSnapshotResponse => { +export const unmarshalCreateSnapshotResponse = (data: unknown): CreateSnapshotResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'CreateSnapshotResponse' failed as data isn't a dictionary.`, @@ -740,9 +692,7 @@ export const unmarshalCreateSnapshotResponse = ( } as CreateSnapshotResponse } -export const unmarshalCreateVolumeResponse = ( - data: unknown, -): CreateVolumeResponse => { +export const unmarshalCreateVolumeResponse = (data: unknown): CreateVolumeResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'CreateVolumeResponse' failed as data isn't a dictionary.`, @@ -754,9 +704,7 @@ export const unmarshalCreateVolumeResponse = ( } as CreateVolumeResponse } -export const unmarshalDetachServerFileSystemResponse = ( - data: unknown, -): DetachServerFileSystemResponse => { +export const unmarshalDetachServerFileSystemResponse = (data: unknown): DetachServerFileSystemResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'DetachServerFileSystemResponse' failed as data isn't a dictionary.`, @@ -768,9 +716,7 @@ export const unmarshalDetachServerFileSystemResponse = ( } as DetachServerFileSystemResponse } -export const unmarshalDetachServerVolumeResponse = ( - data: unknown, -): DetachServerVolumeResponse => { +export const unmarshalDetachServerVolumeResponse = (data: unknown): DetachServerVolumeResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'DetachServerVolumeResponse' failed as data isn't a dictionary.`, @@ -782,9 +728,7 @@ export const unmarshalDetachServerVolumeResponse = ( } as DetachServerVolumeResponse } -export const unmarshalExportSnapshotResponse = ( - data: unknown, -): ExportSnapshotResponse => { +export const unmarshalExportSnapshotResponse = (data: unknown): ExportSnapshotResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ExportSnapshotResponse' failed as data isn't a dictionary.`, @@ -822,9 +766,7 @@ const unmarshalDashboard = (data: unknown): Dashboard => { } as Dashboard } -export const unmarshalGetDashboardResponse = ( - data: unknown, -): GetDashboardResponse => { +export const unmarshalGetDashboardResponse = (data: unknown): GetDashboardResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'GetDashboardResponse' failed as data isn't a dictionary.`, @@ -860,9 +802,7 @@ export const unmarshalGetIpResponse = (data: unknown): GetIpResponse => { } as GetIpResponse } -export const unmarshalGetPlacementGroupResponse = ( - data: unknown, -): GetPlacementGroupResponse => { +export const unmarshalGetPlacementGroupResponse = (data: unknown): GetPlacementGroupResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'GetPlacementGroupResponse' failed as data isn't a dictionary.`, @@ -870,9 +810,7 @@ export const unmarshalGetPlacementGroupResponse = ( } return { - placementGroup: data.placement_group - ? unmarshalPlacementGroup(data.placement_group) - : undefined, + placementGroup: data.placement_group ? unmarshalPlacementGroup(data.placement_group) : undefined, } as GetPlacementGroupResponse } @@ -890,9 +828,7 @@ const unmarshalPlacementGroupServer = (data: unknown): PlacementGroupServer => { } as PlacementGroupServer } -export const unmarshalGetPlacementGroupServersResponse = ( - data: unknown, -): GetPlacementGroupServersResponse => { +export const unmarshalGetPlacementGroupServersResponse = (data: unknown): GetPlacementGroupServersResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'GetPlacementGroupServersResponse' failed as data isn't a dictionary.`, @@ -900,16 +836,11 @@ export const unmarshalGetPlacementGroupServersResponse = ( } return { - servers: unmarshalArrayOfObject( - data.servers, - unmarshalPlacementGroupServer, - ), + servers: unmarshalArrayOfObject(data.servers, unmarshalPlacementGroupServer), } as GetPlacementGroupServersResponse } -export const unmarshalGetPrivateNICResponse = ( - data: unknown, -): GetPrivateNICResponse => { +export const unmarshalGetPrivateNICResponse = (data: unknown): GetPrivateNICResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'GetPrivateNICResponse' failed as data isn't a dictionary.`, @@ -917,15 +848,11 @@ export const unmarshalGetPrivateNICResponse = ( } return { - privateNic: data.private_nic - ? unmarshalPrivateNIC(data.private_nic) - : undefined, + privateNic: data.private_nic ? unmarshalPrivateNIC(data.private_nic) : undefined, } as GetPrivateNICResponse } -export const unmarshalGetSecurityGroupResponse = ( - data: unknown, -): GetSecurityGroupResponse => { +export const unmarshalGetSecurityGroupResponse = (data: unknown): GetSecurityGroupResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'GetSecurityGroupResponse' failed as data isn't a dictionary.`, @@ -933,15 +860,11 @@ export const unmarshalGetSecurityGroupResponse = ( } return { - securityGroup: data.security_group - ? unmarshalSecurityGroup(data.security_group) - : undefined, + securityGroup: data.security_group ? unmarshalSecurityGroup(data.security_group) : undefined, } as GetSecurityGroupResponse } -export const unmarshalGetSecurityGroupRuleResponse = ( - data: unknown, -): GetSecurityGroupRuleResponse => { +export const unmarshalGetSecurityGroupRuleResponse = (data: unknown): GetSecurityGroupRuleResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'GetSecurityGroupRuleResponse' failed as data isn't a dictionary.`, @@ -953,9 +876,7 @@ export const unmarshalGetSecurityGroupRuleResponse = ( } as GetSecurityGroupRuleResponse } -export const unmarshalGetServerResponse = ( - data: unknown, -): GetServerResponse => { +export const unmarshalGetServerResponse = (data: unknown): GetServerResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'GetServerResponse' failed as data isn't a dictionary.`, @@ -967,9 +888,7 @@ export const unmarshalGetServerResponse = ( } as GetServerResponse } -const unmarshalGetServerTypesAvailabilityResponseAvailability = ( - data: unknown, -): GetServerTypesAvailabilityResponseAvailability => { +const unmarshalGetServerTypesAvailabilityResponseAvailability = (data: unknown): GetServerTypesAvailabilityResponseAvailability => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'GetServerTypesAvailabilityResponseAvailability' failed as data isn't a dictionary.`, @@ -981,9 +900,7 @@ const unmarshalGetServerTypesAvailabilityResponseAvailability = ( } as GetServerTypesAvailabilityResponseAvailability } -export const unmarshalGetServerTypesAvailabilityResponse = ( - data: unknown, -): GetServerTypesAvailabilityResponse => { +export const unmarshalGetServerTypesAvailabilityResponse = (data: unknown): GetServerTypesAvailabilityResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'GetServerTypesAvailabilityResponse' failed as data isn't a dictionary.`, @@ -991,17 +908,12 @@ export const unmarshalGetServerTypesAvailabilityResponse = ( } return { - servers: unmarshalMapOfObject( - data.servers, - unmarshalGetServerTypesAvailabilityResponseAvailability, - ), + servers: unmarshalMapOfObject(data.servers, unmarshalGetServerTypesAvailabilityResponseAvailability), totalCount: data.total_count, } as GetServerTypesAvailabilityResponse } -export const unmarshalGetSnapshotResponse = ( - data: unknown, -): GetSnapshotResponse => { +export const unmarshalGetSnapshotResponse = (data: unknown): GetSnapshotResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'GetSnapshotResponse' failed as data isn't a dictionary.`, @@ -1013,9 +925,7 @@ export const unmarshalGetSnapshotResponse = ( } as GetSnapshotResponse } -export const unmarshalGetVolumeResponse = ( - data: unknown, -): GetVolumeResponse => { +export const unmarshalGetVolumeResponse = (data: unknown): GetVolumeResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'GetVolumeResponse' failed as data isn't a dictionary.`, @@ -1027,9 +937,7 @@ export const unmarshalGetVolumeResponse = ( } as GetVolumeResponse } -export const unmarshalListImagesResponse = ( - data: unknown, -): ListImagesResponse => { +export const unmarshalListImagesResponse = (data: unknown): ListImagesResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ListImagesResponse' failed as data isn't a dictionary.`, @@ -1055,9 +963,7 @@ export const unmarshalListIpsResponse = (data: unknown): ListIpsResponse => { } as ListIpsResponse } -export const unmarshalListPlacementGroupsResponse = ( - data: unknown, -): ListPlacementGroupsResponse => { +export const unmarshalListPlacementGroupsResponse = (data: unknown): ListPlacementGroupsResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ListPlacementGroupsResponse' failed as data isn't a dictionary.`, @@ -1065,17 +971,12 @@ export const unmarshalListPlacementGroupsResponse = ( } return { - placementGroups: unmarshalArrayOfObject( - data.placement_groups, - unmarshalPlacementGroup, - ), + placementGroups: unmarshalArrayOfObject(data.placement_groups, unmarshalPlacementGroup), totalCount: data.total_count, } as ListPlacementGroupsResponse } -export const unmarshalListPrivateNICsResponse = ( - data: unknown, -): ListPrivateNICsResponse => { +export const unmarshalListPrivateNICsResponse = (data: unknown): ListPrivateNICsResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ListPrivateNICsResponse' failed as data isn't a dictionary.`, @@ -1088,9 +989,7 @@ export const unmarshalListPrivateNICsResponse = ( } as ListPrivateNICsResponse } -export const unmarshalListSecurityGroupRulesResponse = ( - data: unknown, -): ListSecurityGroupRulesResponse => { +export const unmarshalListSecurityGroupRulesResponse = (data: unknown): ListSecurityGroupRulesResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ListSecurityGroupRulesResponse' failed as data isn't a dictionary.`, @@ -1103,9 +1002,7 @@ export const unmarshalListSecurityGroupRulesResponse = ( } as ListSecurityGroupRulesResponse } -export const unmarshalListSecurityGroupsResponse = ( - data: unknown, -): ListSecurityGroupsResponse => { +export const unmarshalListSecurityGroupsResponse = (data: unknown): ListSecurityGroupsResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ListSecurityGroupsResponse' failed as data isn't a dictionary.`, @@ -1113,17 +1010,12 @@ export const unmarshalListSecurityGroupsResponse = ( } return { - securityGroups: unmarshalArrayOfObject( - data.security_groups, - unmarshalSecurityGroup, - ), + securityGroups: unmarshalArrayOfObject(data.security_groups, unmarshalSecurityGroup), totalCount: data.total_count, } as ListSecurityGroupsResponse } -export const unmarshalListServerActionsResponse = ( - data: unknown, -): ListServerActionsResponse => { +export const unmarshalListServerActionsResponse = (data: unknown): ListServerActionsResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ListServerActionsResponse' failed as data isn't a dictionary.`, @@ -1135,9 +1027,7 @@ export const unmarshalListServerActionsResponse = ( } as ListServerActionsResponse } -export const unmarshalListServerUserDataResponse = ( - data: unknown, -): ListServerUserDataResponse => { +export const unmarshalListServerUserDataResponse = (data: unknown): ListServerUserDataResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ListServerUserDataResponse' failed as data isn't a dictionary.`, @@ -1149,9 +1039,7 @@ export const unmarshalListServerUserDataResponse = ( } as ListServerUserDataResponse } -export const unmarshalListServersResponse = ( - data: unknown, -): ListServersResponse => { +export const unmarshalListServersResponse = (data: unknown): ListServersResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ListServersResponse' failed as data isn't a dictionary.`, @@ -1164,9 +1052,7 @@ export const unmarshalListServersResponse = ( } as ListServersResponse } -const unmarshalServerTypeNetworkInterface = ( - data: unknown, -): ServerTypeNetworkInterface => { +const unmarshalServerTypeNetworkInterface = (data: unknown): ServerTypeNetworkInterface => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ServerTypeNetworkInterface' failed as data isn't a dictionary.`, @@ -1179,9 +1065,7 @@ const unmarshalServerTypeNetworkInterface = ( } as ServerTypeNetworkInterface } -const unmarshalServerTypeVolumeConstraintSizes = ( - data: unknown, -): ServerTypeVolumeConstraintSizes => { +const unmarshalServerTypeVolumeConstraintSizes = (data: unknown): ServerTypeVolumeConstraintSizes => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ServerTypeVolumeConstraintSizes' failed as data isn't a dictionary.`, @@ -1194,9 +1078,7 @@ const unmarshalServerTypeVolumeConstraintSizes = ( } as ServerTypeVolumeConstraintSizes } -const unmarshalServerTypeCapabilities = ( - data: unknown, -): ServerTypeCapabilities => { +const unmarshalServerTypeCapabilities = (data: unknown): ServerTypeCapabilities => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ServerTypeCapabilities' failed as data isn't a dictionary.`, @@ -1232,19 +1114,14 @@ const unmarshalServerTypeNetwork = (data: unknown): ServerTypeNetwork => { } return { - interfaces: unmarshalArrayOfObject( - data.interfaces, - unmarshalServerTypeNetworkInterface, - ), + interfaces: unmarshalArrayOfObject(data.interfaces, unmarshalServerTypeNetworkInterface), ipv6Support: data.ipv6_support, sumInternalBandwidth: data.sum_internal_bandwidth, sumInternetBandwidth: data.sum_internet_bandwidth, } as ServerTypeNetwork } -const unmarshalServerTypeVolumeConstraintsByType = ( - data: unknown, -): ServerTypeVolumeConstraintsByType => { +const unmarshalServerTypeVolumeConstraintsByType = (data: unknown): ServerTypeVolumeConstraintsByType => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ServerTypeVolumeConstraintsByType' failed as data isn't a dictionary.`, @@ -1252,9 +1129,7 @@ const unmarshalServerTypeVolumeConstraintsByType = ( } return { - lSsd: data.l_ssd - ? unmarshalServerTypeVolumeConstraintSizes(data.l_ssd) - : undefined, + lSsd: data.l_ssd ? unmarshalServerTypeVolumeConstraintSizes(data.l_ssd) : undefined, } as ServerTypeVolumeConstraintsByType } @@ -1269,34 +1144,22 @@ const unmarshalServerType = (data: unknown): ServerType => { altNames: data.alt_names, arch: data.arch, blockBandwidth: data.block_bandwidth, - capabilities: data.capabilities - ? unmarshalServerTypeCapabilities(data.capabilities) - : undefined, + capabilities: data.capabilities ? unmarshalServerTypeCapabilities(data.capabilities) : undefined, endOfService: data.end_of_service, gpu: data.gpu, - gpuInfo: data.gpu_info - ? unmarshalServerTypeGPUInfo(data.gpu_info) - : undefined, + gpuInfo: data.gpu_info ? unmarshalServerTypeGPUInfo(data.gpu_info) : undefined, hourlyPrice: data.hourly_price, monthlyPrice: data.monthly_price, ncpus: data.ncpus, - network: data.network - ? unmarshalServerTypeNetwork(data.network) - : undefined, - perVolumeConstraint: data.per_volume_constraint - ? unmarshalServerTypeVolumeConstraintsByType(data.per_volume_constraint) - : undefined, + network: data.network ? unmarshalServerTypeNetwork(data.network) : undefined, + perVolumeConstraint: data.per_volume_constraint ? unmarshalServerTypeVolumeConstraintsByType(data.per_volume_constraint) : undefined, ram: data.ram, scratchStorageMaxSize: data.scratch_storage_max_size, - volumesConstraint: data.volumes_constraint - ? unmarshalServerTypeVolumeConstraintSizes(data.volumes_constraint) - : undefined, + volumesConstraint: data.volumes_constraint ? unmarshalServerTypeVolumeConstraintSizes(data.volumes_constraint) : undefined, } as ServerType } -export const unmarshalListServersTypesResponse = ( - data: unknown, -): ListServersTypesResponse => { +export const unmarshalListServersTypesResponse = (data: unknown): ListServersTypesResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ListServersTypesResponse' failed as data isn't a dictionary.`, @@ -1309,9 +1172,7 @@ export const unmarshalListServersTypesResponse = ( } as ListServersTypesResponse } -export const unmarshalListSnapshotsResponse = ( - data: unknown, -): ListSnapshotsResponse => { +export const unmarshalListSnapshotsResponse = (data: unknown): ListSnapshotsResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ListSnapshotsResponse' failed as data isn't a dictionary.`, @@ -1324,9 +1185,7 @@ export const unmarshalListSnapshotsResponse = ( } as ListSnapshotsResponse } -export const unmarshalListVolumesResponse = ( - data: unknown, -): ListVolumesResponse => { +export const unmarshalListVolumesResponse = (data: unknown): ListVolumesResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ListVolumesResponse' failed as data isn't a dictionary.`, @@ -1339,9 +1198,7 @@ export const unmarshalListVolumesResponse = ( } as ListVolumesResponse } -const unmarshalVolumeTypeCapabilities = ( - data: unknown, -): VolumeTypeCapabilities => { +const unmarshalVolumeTypeCapabilities = (data: unknown): VolumeTypeCapabilities => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'VolumeTypeCapabilities' failed as data isn't a dictionary.`, @@ -1353,9 +1210,7 @@ const unmarshalVolumeTypeCapabilities = ( } as VolumeTypeCapabilities } -const unmarshalVolumeTypeConstraints = ( - data: unknown, -): VolumeTypeConstraints => { +const unmarshalVolumeTypeConstraints = (data: unknown): VolumeTypeConstraints => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'VolumeTypeConstraints' failed as data isn't a dictionary.`, @@ -1376,19 +1231,13 @@ const unmarshalVolumeType = (data: unknown): VolumeType => { } return { - capabilities: data.capabilities - ? unmarshalVolumeTypeCapabilities(data.capabilities) - : undefined, - constraints: data.constraints - ? unmarshalVolumeTypeConstraints(data.constraints) - : undefined, + capabilities: data.capabilities ? unmarshalVolumeTypeCapabilities(data.capabilities) : undefined, + constraints: data.constraints ? unmarshalVolumeTypeConstraints(data.constraints) : undefined, displayName: data.display_name, } as VolumeType } -export const unmarshalListVolumesTypesResponse = ( - data: unknown, -): ListVolumesTypesResponse => { +export const unmarshalListVolumesTypesResponse = (data: unknown): ListVolumesTypesResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ListVolumesTypesResponse' failed as data isn't a dictionary.`, @@ -1415,9 +1264,7 @@ export const unmarshalMigrationPlan = (data: unknown): MigrationPlan => { } as MigrationPlan } -export const unmarshalServerActionResponse = ( - data: unknown, -): ServerActionResponse => { +export const unmarshalServerActionResponse = (data: unknown): ServerActionResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ServerActionResponse' failed as data isn't a dictionary.`, @@ -1429,9 +1276,7 @@ export const unmarshalServerActionResponse = ( } as ServerActionResponse } -export const unmarshalServerCompatibleTypes = ( - data: unknown, -): ServerCompatibleTypes => { +export const unmarshalServerCompatibleTypes = (data: unknown): ServerCompatibleTypes => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ServerCompatibleTypes' failed as data isn't a dictionary.`, @@ -1455,9 +1300,7 @@ export const unmarshalSetImageResponse = (data: unknown): SetImageResponse => { } as SetImageResponse } -export const unmarshalSetPlacementGroupResponse = ( - data: unknown, -): SetPlacementGroupResponse => { +export const unmarshalSetPlacementGroupResponse = (data: unknown): SetPlacementGroupResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'SetPlacementGroupResponse' failed as data isn't a dictionary.`, @@ -1465,15 +1308,11 @@ export const unmarshalSetPlacementGroupResponse = ( } return { - placementGroup: data.placement_group - ? unmarshalPlacementGroup(data.placement_group) - : undefined, + placementGroup: data.placement_group ? unmarshalPlacementGroup(data.placement_group) : undefined, } as SetPlacementGroupResponse } -export const unmarshalSetPlacementGroupServersResponse = ( - data: unknown, -): SetPlacementGroupServersResponse => { +export const unmarshalSetPlacementGroupServersResponse = (data: unknown): SetPlacementGroupServersResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'SetPlacementGroupServersResponse' failed as data isn't a dictionary.`, @@ -1481,16 +1320,11 @@ export const unmarshalSetPlacementGroupServersResponse = ( } return { - servers: unmarshalArrayOfObject( - data.servers, - unmarshalPlacementGroupServer, - ), + servers: unmarshalArrayOfObject(data.servers, unmarshalPlacementGroupServer), } as SetPlacementGroupServersResponse } -export const unmarshalSetSecurityGroupResponse = ( - data: unknown, -): SetSecurityGroupResponse => { +export const unmarshalSetSecurityGroupResponse = (data: unknown): SetSecurityGroupResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'SetSecurityGroupResponse' failed as data isn't a dictionary.`, @@ -1498,15 +1332,11 @@ export const unmarshalSetSecurityGroupResponse = ( } return { - securityGroup: data.security_group - ? unmarshalSecurityGroup(data.security_group) - : undefined, + securityGroup: data.security_group ? unmarshalSecurityGroup(data.security_group) : undefined, } as SetSecurityGroupResponse } -export const unmarshalSetSecurityGroupRuleResponse = ( - data: unknown, -): SetSecurityGroupRuleResponse => { +export const unmarshalSetSecurityGroupRuleResponse = (data: unknown): SetSecurityGroupRuleResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'SetSecurityGroupRuleResponse' failed as data isn't a dictionary.`, @@ -1518,9 +1348,7 @@ export const unmarshalSetSecurityGroupRuleResponse = ( } as SetSecurityGroupRuleResponse } -export const unmarshalSetSecurityGroupRulesResponse = ( - data: unknown, -): SetSecurityGroupRulesResponse => { +export const unmarshalSetSecurityGroupRulesResponse = (data: unknown): SetSecurityGroupRulesResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'SetSecurityGroupRulesResponse' failed as data isn't a dictionary.`, @@ -1532,9 +1360,7 @@ export const unmarshalSetSecurityGroupRulesResponse = ( } as SetSecurityGroupRulesResponse } -export const unmarshalSetServerResponse = ( - data: unknown, -): SetServerResponse => { +export const unmarshalSetServerResponse = (data: unknown): SetServerResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'SetServerResponse' failed as data isn't a dictionary.`, @@ -1546,9 +1372,7 @@ export const unmarshalSetServerResponse = ( } as SetServerResponse } -export const unmarshalSetSnapshotResponse = ( - data: unknown, -): SetSnapshotResponse => { +export const unmarshalSetSnapshotResponse = (data: unknown): SetSnapshotResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'SetSnapshotResponse' failed as data isn't a dictionary.`, @@ -1560,9 +1384,7 @@ export const unmarshalSetSnapshotResponse = ( } as SetSnapshotResponse } -export const unmarshalUpdateImageResponse = ( - data: unknown, -): UpdateImageResponse => { +export const unmarshalUpdateImageResponse = (data: unknown): UpdateImageResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'UpdateImageResponse' failed as data isn't a dictionary.`, @@ -1586,9 +1408,7 @@ export const unmarshalUpdateIpResponse = (data: unknown): UpdateIpResponse => { } as UpdateIpResponse } -export const unmarshalUpdatePlacementGroupResponse = ( - data: unknown, -): UpdatePlacementGroupResponse => { +export const unmarshalUpdatePlacementGroupResponse = (data: unknown): UpdatePlacementGroupResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'UpdatePlacementGroupResponse' failed as data isn't a dictionary.`, @@ -1596,15 +1416,11 @@ export const unmarshalUpdatePlacementGroupResponse = ( } return { - placementGroup: data.placement_group - ? unmarshalPlacementGroup(data.placement_group) - : undefined, + placementGroup: data.placement_group ? unmarshalPlacementGroup(data.placement_group) : undefined, } as UpdatePlacementGroupResponse } -export const unmarshalUpdatePlacementGroupServersResponse = ( - data: unknown, -): UpdatePlacementGroupServersResponse => { +export const unmarshalUpdatePlacementGroupServersResponse = (data: unknown): UpdatePlacementGroupServersResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'UpdatePlacementGroupServersResponse' failed as data isn't a dictionary.`, @@ -1612,16 +1428,11 @@ export const unmarshalUpdatePlacementGroupServersResponse = ( } return { - servers: unmarshalArrayOfObject( - data.servers, - unmarshalPlacementGroupServer, - ), + servers: unmarshalArrayOfObject(data.servers, unmarshalPlacementGroupServer), } as UpdatePlacementGroupServersResponse } -export const unmarshalUpdateSecurityGroupResponse = ( - data: unknown, -): UpdateSecurityGroupResponse => { +export const unmarshalUpdateSecurityGroupResponse = (data: unknown): UpdateSecurityGroupResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'UpdateSecurityGroupResponse' failed as data isn't a dictionary.`, @@ -1629,15 +1440,11 @@ export const unmarshalUpdateSecurityGroupResponse = ( } return { - securityGroup: data.security_group - ? unmarshalSecurityGroup(data.security_group) - : undefined, + securityGroup: data.security_group ? unmarshalSecurityGroup(data.security_group) : undefined, } as UpdateSecurityGroupResponse } -export const unmarshalUpdateSecurityGroupRuleResponse = ( - data: unknown, -): UpdateSecurityGroupRuleResponse => { +export const unmarshalUpdateSecurityGroupRuleResponse = (data: unknown): UpdateSecurityGroupRuleResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'UpdateSecurityGroupRuleResponse' failed as data isn't a dictionary.`, @@ -1649,9 +1456,7 @@ export const unmarshalUpdateSecurityGroupRuleResponse = ( } as UpdateSecurityGroupRuleResponse } -export const unmarshalUpdateServerResponse = ( - data: unknown, -): UpdateServerResponse => { +export const unmarshalUpdateServerResponse = (data: unknown): UpdateServerResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'UpdateServerResponse' failed as data isn't a dictionary.`, @@ -1663,9 +1468,7 @@ export const unmarshalUpdateServerResponse = ( } as UpdateServerResponse } -export const unmarshalUpdateSnapshotResponse = ( - data: unknown, -): UpdateSnapshotResponse => { +export const unmarshalUpdateSnapshotResponse = (data: unknown): UpdateSnapshotResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'UpdateSnapshotResponse' failed as data isn't a dictionary.`, @@ -1677,9 +1480,7 @@ export const unmarshalUpdateSnapshotResponse = ( } as UpdateSnapshotResponse } -export const unmarshalUpdateVolumeResponse = ( - data: unknown, -): UpdateVolumeResponse => { +export const unmarshalUpdateVolumeResponse = (data: unknown): UpdateVolumeResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'UpdateVolumeResponse' failed as data isn't a dictionary.`, @@ -1695,10 +1496,14 @@ export const marshalApplyBlockMigrationRequest = ( request: ApplyBlockMigrationRequest, defaults: DefaultValues, ): Record => ({ - validation_key: request.validationKey, + validation_key: request.validationKey, ...resolveOneOf([ - { param: 'volume_id', value: request.volumeId }, - { param: 'snapshot_id', value: request.snapshotId }, + {param: 'volume_id', + value: request.volumeId, + }, + {param: 'snapshot_id', + value: request.snapshotId, + }, ]), }) @@ -1732,10 +1537,14 @@ const marshalVolumeTemplate = ( id: request.id, name: request.name, size: request.size, - volume_type: request.volumeType, + volume_type: request.volumeType, ...resolveOneOf([ - { param: 'project', value: request.project }, - { param: 'organization', value: request.organization }, + {param: 'project', + value: request.project, + }, + {param: 'organization', + value: request.organization, + }, ]), }) @@ -1744,29 +1553,16 @@ export const marshalCreateImageRequest = ( defaults: DefaultValues, ): Record => ({ arch: request.arch, - extra_volumes: - request.extraVolumes !== undefined - ? Object.entries(request.extraVolumes).reduce( - (acc, [key, value]) => ({ - ...acc, - [key]: marshalVolumeTemplate(value, defaults), - }), - {}, - ) - : undefined, + extra_volumes: ((request.extraVolumes !== undefined) ? Object.entries(request.extraVolumes).reduce((acc, [key, value]) => ({ ...acc, [key]: marshalVolumeTemplate(value, defaults) }), {}): undefined), name: request.name || randomName('img'), public: request.public, root_volume: request.rootVolume, - tags: request.tags, + tags: request.tags, ...resolveOneOf([ - { - default: defaults.defaultProjectId, - param: 'project', + {default: defaults.defaultProjectId,param: 'project', value: request.project, }, - { - default: defaults.defaultOrganizationId, - param: 'organization', + {default: defaults.defaultOrganizationId,param: 'organization', value: request.organization, }, ]), @@ -1778,16 +1574,12 @@ export const marshalCreateIpRequest = ( ): Record => ({ server: request.server, tags: request.tags, - type: request.type, + type: request.type, ...resolveOneOf([ - { - default: defaults.defaultProjectId, - param: 'project', + {default: defaults.defaultProjectId,param: 'project', value: request.project, }, - { - default: defaults.defaultOrganizationId, - param: 'organization', + {default: defaults.defaultOrganizationId,param: 'organization', value: request.organization, }, ]), @@ -1800,16 +1592,12 @@ export const marshalCreatePlacementGroupRequest = ( name: request.name || randomName('pg'), policy_mode: request.policyMode, policy_type: request.policyType, - tags: request.tags, + tags: request.tags, ...resolveOneOf([ - { - default: defaults.defaultProjectId, - param: 'project', + {default: defaults.defaultProjectId,param: 'project', value: request.project, }, - { - default: defaults.defaultOrganizationId, - param: 'organization', + {default: defaults.defaultOrganizationId,param: 'organization', value: request.organization, }, ]), @@ -1835,22 +1623,22 @@ export const marshalCreateSecurityGroupRequest = ( name: request.name || randomName('sg'), outbound_default_policy: request.outboundDefaultPolicy, stateful: request.stateful, - tags: request.tags, + tags: request.tags, ...resolveOneOf([ - { - default: defaults.defaultProjectId, - param: 'project', + {default: defaults.defaultProjectId,param: 'project', value: request.project, }, - { - default: defaults.defaultOrganizationId, - param: 'organization', + {default: defaults.defaultOrganizationId,param: 'organization', value: request.organization, }, - ]), + ]), ...resolveOneOf([ - { param: 'organization_default', value: request.organizationDefault }, - { param: 'project_default', value: request.projectDefault }, + {param: 'organization_default', + value: request.organizationDefault, + }, + {param: 'project_default', + value: request.projectDefault, + }, ]), }) @@ -1900,25 +1688,12 @@ export const marshalCreateServerRequest = ( routed_ip_enabled: request.routedIpEnabled, security_group: request.securityGroup, tags: request.tags, - volumes: - request.volumes !== undefined - ? Object.entries(request.volumes).reduce( - (acc, [key, value]) => ({ - ...acc, - [key]: marshalVolumeServerTemplate(value, defaults), - }), - {}, - ) - : undefined, + volumes: ((request.volumes !== undefined) ? Object.entries(request.volumes).reduce((acc, [key, value]) => ({ ...acc, [key]: marshalVolumeServerTemplate(value, defaults) }), {}): undefined), ...resolveOneOf([ - { - default: defaults.defaultProjectId, - param: 'project', + {default: defaults.defaultProjectId,param: 'project', value: request.project, }, - { - default: defaults.defaultOrganizationId, - param: 'organization', + {default: defaults.defaultOrganizationId,param: 'organization', value: request.organization, }, ]), @@ -1934,16 +1709,12 @@ export const marshalCreateSnapshotRequest = ( size: request.size, tags: request.tags, volume_id: request.volumeId, - volume_type: request.volumeType, + volume_type: request.volumeType, ...resolveOneOf([ - { - default: defaults.defaultProjectId, - param: 'project', + {default: defaults.defaultProjectId,param: 'project', value: request.project, }, - { - default: defaults.defaultOrganizationId, - param: 'organization', + {default: defaults.defaultOrganizationId,param: 'organization', value: request.organization, }, ]), @@ -1955,22 +1726,22 @@ export const marshalCreateVolumeRequest = ( ): Record => ({ name: request.name || randomName('vol'), tags: request.tags, - volume_type: request.volumeType, + volume_type: request.volumeType, ...resolveOneOf([ - { - default: defaults.defaultProjectId, - param: 'project', + {default: defaults.defaultProjectId,param: 'project', value: request.project, }, - { - default: defaults.defaultOrganizationId, - param: 'organization', + {default: defaults.defaultOrganizationId,param: 'organization', value: request.organization, }, - ]), + ]), ...resolveOneOf([ - { param: 'size', value: request.size }, - { param: 'base_snapshot', value: request.baseSnapshot }, + {param: 'size', + value: request.size, + }, + {param: 'base_snapshot', + value: request.baseSnapshot, + }, ]), }) @@ -1999,10 +1770,14 @@ export const marshalExportSnapshotRequest = ( export const marshalPlanBlockMigrationRequest = ( request: PlanBlockMigrationRequest, defaults: DefaultValues, -): Record => ({ +): Record => ({ ...resolveOneOf([ - { param: 'volume_id', value: request.volumeId }, - { param: 'snapshot_id', value: request.snapshotId }, + {param: 'volume_id', + value: request.volumeId, + }, + {param: 'snapshot_id', + value: request.snapshotId, + }, ]), }) @@ -2020,19 +1795,7 @@ export const marshalServerActionRequest = ( action: request.action, disable_ipv6: request.disableIpv6, name: request.name, - volumes: - request.volumes !== undefined - ? Object.entries(request.volumes).reduce( - (acc, [key, value]) => ({ - ...acc, - [key]: marshalServerActionRequestVolumeBackupTemplate( - value, - defaults, - ), - }), - {}, - ) - : undefined, + volumes: ((request.volumes !== undefined) ? Object.entries(request.volumes).reduce((acc, [key, value]) => ({ ...acc, [key]: marshalServerActionRequestVolumeBackupTemplate(value, defaults) }), {}): undefined), }) const marshalServerSummary = ( @@ -2071,10 +1834,7 @@ const marshalVolume = ( name: request.name, organization: request.organization, project: request.project, - server: - request.server !== undefined - ? marshalServerSummary(request.server, defaults) - : undefined, + server: ((request.server !== undefined) ? marshalServerSummary(request.server, defaults): undefined), size: request.size, state: request.state, tags: request.tags, @@ -2098,30 +1858,15 @@ export const marshalSetImageRequest = ( ): Record => ({ arch: request.arch, creation_date: request.creationDate, - default_bootscript: - request.defaultBootscript !== undefined - ? marshalBootscript(request.defaultBootscript, defaults) - : undefined, - extra_volumes: - request.extraVolumes !== undefined - ? Object.entries(request.extraVolumes).reduce( - (acc, [key, value]) => ({ - ...acc, - [key]: marshalVolume(value, defaults), - }), - {}, - ) - : undefined, + default_bootscript: ((request.defaultBootscript !== undefined) ? marshalBootscript(request.defaultBootscript, defaults): undefined), + extra_volumes: ((request.extraVolumes !== undefined) ? Object.entries(request.extraVolumes).reduce((acc, [key, value]) => ({ ...acc, [key]: marshalVolume(value, defaults) }), {}): undefined), from_server: request.fromServer, modification_date: request.modificationDate, name: request.name, organization: request.organization ?? defaults.defaultOrganizationId, project: request.project ?? defaults.defaultProjectId, public: request.public, - root_volume: - request.rootVolume !== undefined - ? marshalVolumeSummary(request.rootVolume, defaults) - : undefined, + root_volume: ((request.rootVolume !== undefined) ? marshalVolumeSummary(request.rootVolume, defaults): undefined), state: request.state, tags: request.tags, }) @@ -2160,10 +1905,7 @@ export const marshalSetSecurityGroupRequest = ( outbound_default_policy: request.outboundDefaultPolicy, project: request.project ?? defaults.defaultProjectId, project_default: request.projectDefault, - servers: - request.servers !== undefined - ? request.servers.map(elt => marshalServerSummary(elt, defaults)) - : undefined, + servers: ((request.servers !== undefined) ? request.servers.map(elt => marshalServerSummary(elt, defaults)): undefined), stateful: request.stateful, tags: request.tags, }) @@ -2203,12 +1945,7 @@ export const marshalSetSecurityGroupRulesRequest = ( request: SetSecurityGroupRulesRequest, defaults: DefaultValues, ): Record => ({ - rules: - request.rules !== undefined - ? request.rules.map(elt => - marshalSetSecurityGroupRulesRequestRule(elt, defaults), - ) - : undefined, + rules: ((request.rules !== undefined) ? request.rules.map(elt => marshalSetSecurityGroupRulesRequestRule(elt, defaults)): undefined), }) const marshalImage = ( @@ -2217,14 +1954,8 @@ const marshalImage = ( ): Record => ({ arch: request.arch, creation_date: request.creationDate, - default_bootscript: - request.defaultBootscript !== undefined - ? marshalBootscript(request.defaultBootscript, defaults) - : undefined, - extra_volumes: Object.entries(request.extraVolumes).reduce( - (acc, [key, value]) => ({ ...acc, [key]: marshalVolume(value, defaults) }), - {}, - ), + default_bootscript: ((request.defaultBootscript !== undefined) ? marshalBootscript(request.defaultBootscript, defaults): undefined), + extra_volumes: Object.entries(request.extraVolumes).reduce((acc, [key, value]) => ({ ...acc, [key]: marshalVolume(value, defaults) }), {}), from_server: request.fromServer, id: request.id, modification_date: request.modificationDate, @@ -2232,10 +1963,7 @@ const marshalImage = ( organization: request.organization, project: request.project, public: request.public, - root_volume: - request.rootVolume !== undefined - ? marshalVolumeSummary(request.rootVolume, defaults) - : undefined, + root_volume: ((request.rootVolume !== undefined) ? marshalVolumeSummary(request.rootVolume, defaults): undefined), state: request.state, tags: request.tags, zone: request.zone, @@ -2327,8 +2055,7 @@ export const marshalSetServerRequest = ( defaults: DefaultValues, ): Record => ({ admin_password_encryption_ssh_key_id: request.adminPasswordEncryptionSshKeyId, - allowed_actions: - request.allowedActions !== undefined ? request.allowedActions : undefined, + allowed_actions: ((request.allowedActions !== undefined) ? request.allowedActions: undefined), arch: request.arch, boot_type: request.bootType, commercial_type: request.commercialType, @@ -2336,62 +2063,26 @@ export const marshalSetServerRequest = ( dynamic_ip_required: request.dynamicIpRequired, enable_ipv6: request.enableIpv6, hostname: request.hostname, - image: - request.image !== undefined - ? marshalImage(request.image, defaults) - : undefined, - ipv6: - request.ipv6 !== undefined - ? marshalServerIpv6(request.ipv6, defaults) - : undefined, - location: - request.location !== undefined - ? marshalServerLocation(request.location, defaults) - : undefined, - maintenances: - request.maintenances !== undefined - ? request.maintenances.map(elt => marshalServerMaintenance(elt, defaults)) - : undefined, + image: ((request.image !== undefined) ? marshalImage(request.image, defaults): undefined), + ipv6: ((request.ipv6 !== undefined) ? marshalServerIpv6(request.ipv6, defaults): undefined), + location: ((request.location !== undefined) ? marshalServerLocation(request.location, defaults): undefined), + maintenances: ((request.maintenances !== undefined) ? request.maintenances.map(elt => marshalServerMaintenance(elt, defaults)): undefined), modification_date: request.modificationDate, name: request.name, organization: request.organization ?? defaults.defaultOrganizationId, - placement_group: - request.placementGroup !== undefined - ? marshalPlacementGroup(request.placementGroup, defaults) - : undefined, + placement_group: ((request.placementGroup !== undefined) ? marshalPlacementGroup(request.placementGroup, defaults): undefined), private_ip: request.privateIp, - private_nics: - request.privateNics !== undefined - ? request.privateNics.map(elt => marshalPrivateNIC(elt, defaults)) - : undefined, + private_nics: ((request.privateNics !== undefined) ? request.privateNics.map(elt => marshalPrivateNIC(elt, defaults)): undefined), project: request.project ?? defaults.defaultProjectId, protected: request.protected, - public_ip: - request.publicIp !== undefined - ? marshalServerIp(request.publicIp, defaults) - : undefined, - public_ips: - request.publicIps !== undefined - ? request.publicIps.map(elt => marshalServerIp(elt, defaults)) - : undefined, + public_ip: ((request.publicIp !== undefined) ? marshalServerIp(request.publicIp, defaults): undefined), + public_ips: ((request.publicIps !== undefined) ? request.publicIps.map(elt => marshalServerIp(elt, defaults)): undefined), routed_ip_enabled: request.routedIpEnabled, - security_group: - request.securityGroup !== undefined - ? marshalSecurityGroupSummary(request.securityGroup, defaults) - : undefined, + security_group: ((request.securityGroup !== undefined) ? marshalSecurityGroupSummary(request.securityGroup, defaults): undefined), state: request.state, state_detail: request.stateDetail, tags: request.tags, - volumes: - request.volumes !== undefined - ? Object.entries(request.volumes).reduce( - (acc, [key, value]) => ({ - ...acc, - [key]: marshalVolume(value, defaults), - }), - {}, - ) - : undefined, + volumes: ((request.volumes !== undefined) ? Object.entries(request.volumes).reduce((acc, [key, value]) => ({ ...acc, [key]: marshalVolume(value, defaults) }), {}): undefined), }) const marshalSnapshotBaseVolume = ( @@ -2406,10 +2097,7 @@ export const marshalSetSnapshotRequest = ( request: SetSnapshotRequest, defaults: DefaultValues, ): Record => ({ - base_volume: - request.baseVolume !== undefined - ? marshalSnapshotBaseVolume(request.baseVolume, defaults) - : undefined, + base_volume: ((request.baseVolume !== undefined) ? marshalSnapshotBaseVolume(request.baseVolume, defaults): undefined), creation_date: request.creationDate, id: request.id, modification_date: request.modificationDate, @@ -2434,16 +2122,7 @@ export const marshalUpdateImageRequest = ( defaults: DefaultValues, ): Record => ({ arch: request.arch, - extra_volumes: - request.extraVolumes !== undefined - ? Object.entries(request.extraVolumes).reduce( - (acc, [key, value]) => ({ - ...acc, - [key]: marshalVolumeImageUpdateTemplate(value, defaults), - }), - {}, - ) - : undefined, + extra_volumes: ((request.extraVolumes !== undefined) ? Object.entries(request.extraVolumes).reduce((acc, [key, value]) => ({ ...acc, [key]: marshalVolumeImageUpdateTemplate(value, defaults) }), {}): undefined), name: request.name, public: request.public, tags: request.tags, @@ -2534,21 +2213,9 @@ export const marshalUpdateServerRequest = ( protected: request.protected, public_ips: request.publicIps, routed_ip_enabled: request.routedIpEnabled, - security_group: - request.securityGroup !== undefined - ? marshalSecurityGroupTemplate(request.securityGroup, defaults) - : undefined, + security_group: ((request.securityGroup !== undefined) ? marshalSecurityGroupTemplate(request.securityGroup, defaults): undefined), tags: request.tags, - volumes: - request.volumes !== undefined - ? Object.entries(request.volumes).reduce( - (acc, [key, value]) => ({ - ...acc, - [key]: marshalVolumeServerTemplate(value, defaults), - }), - {}, - ) - : undefined, + volumes: ((request.volumes !== undefined) ? Object.entries(request.volumes).reduce((acc, [key, value]) => ({ ...acc, [key]: marshalVolumeServerTemplate(value, defaults) }), {}): undefined), }) export const marshalUpdateSnapshotRequest = ( diff --git a/packages_generated/instance/src/v1/types.gen.ts b/packages_generated/instance/src/v1/types.gen.ts index ce7c0c55b..230219940 100644 --- a/packages_generated/instance/src/v1/types.gen.ts +++ b/packages_generated/instance/src/v1/types.gen.ts @@ -1,8 +1,13 @@ // This file was automatically generated. DO NOT EDIT. // If you have any remark or suggestion do not hesitate to open an issue. -import type { Zone as ScwZone } from '@scaleway/sdk-client' +import type { Zone as ScwZone} from '@scaleway/sdk-client' -export type Arch = 'unknown_arch' | 'x86_64' | 'arm' | 'arm64' + +export type Arch = + | 'unknown_arch' + | 'x86_64' + | 'arm' + | 'arm64' export type AttachServerVolumeRequestVolumeType = | 'unknown_volume_type' @@ -10,9 +15,15 @@ export type AttachServerVolumeRequestVolumeType = | 'b_ssd' | 'sbs_volume' -export type BootType = 'local' | 'bootscript' | 'rescue' +export type BootType = + | 'local' + | 'bootscript' + | 'rescue' -export type ImageState = 'available' | 'creating' | 'error' +export type ImageState = + | 'available' + | 'creating' + | 'error' export type IpState = | 'unknown_state' @@ -21,7 +32,10 @@ export type IpState = | 'pending' | 'error' -export type IpType = 'unknown_iptype' | 'routed_ipv4' | 'routed_ipv6' +export type IpType = + | 'unknown_iptype' + | 'routed_ipv4' + | 'routed_ipv6' export type ListServersRequestOrder = | 'creation_date_desc' @@ -29,15 +43,28 @@ export type ListServersRequestOrder = | 'modification_date_desc' | 'modification_date_asc' -export type PlacementGroupPolicyMode = 'optional' | 'enforced' +export type PlacementGroupPolicyMode = + | 'optional' + | 'enforced' -export type PlacementGroupPolicyType = 'max_availability' | 'low_latency' +export type PlacementGroupPolicyType = + | 'max_availability' + | 'low_latency' -export type PrivateNICState = 'available' | 'syncing' | 'syncing_error' +export type PrivateNICState = + | 'available' + | 'syncing' + | 'syncing_error' -export type SecurityGroupPolicy = 'unknown_policy' | 'accept' | 'drop' +export type SecurityGroupPolicy = + | 'unknown_policy' + | 'accept' + | 'drop' -export type SecurityGroupRuleAction = 'unknown_action' | 'accept' | 'drop' +export type SecurityGroupRuleAction = + | 'unknown_action' + | 'accept' + | 'drop' export type SecurityGroupRuleDirection = | 'unknown_direction' @@ -51,7 +78,10 @@ export type SecurityGroupRuleProtocol = | 'ICMP' | 'ANY' -export type SecurityGroupState = 'available' | 'syncing' | 'syncing_error' +export type SecurityGroupState = + | 'available' + | 'syncing' + | 'syncing_error' export type ServerAction = | 'poweron' @@ -68,9 +98,14 @@ export type ServerFilesystemState = | 'available' | 'detaching' -export type ServerIpIpFamily = 'inet' | 'inet6' +export type ServerIpIpFamily = + | 'inet' + | 'inet6' -export type ServerIpProvisioningMode = 'manual' | 'dhcp' | 'slaac' +export type ServerIpProvisioningMode = + | 'manual' + | 'dhcp' + | 'slaac' export type ServerIpState = | 'unknown_state' @@ -87,7 +122,10 @@ export type ServerState = | 'stopping' | 'locked' -export type ServerTypesAvailability = 'available' | 'scarce' | 'shortage' +export type ServerTypesAvailability = + | 'available' + | 'scarce' + | 'shortage' export type SnapshotState = | 'available' @@ -103,7 +141,12 @@ export type SnapshotVolumeType = | 'b_ssd' | 'unified' -export type TaskStatus = 'pending' | 'started' | 'success' | 'failure' | 'retry' +export type TaskStatus = + | 'pending' + | 'started' + | 'success' + | 'failure' + | 'retry' export type VolumeServerState = | 'available' @@ -144,6 +187,7 @@ export interface ServerSummary { name: string } + export interface Bootscript { architecture: Arch bootcmdargs: string @@ -162,6 +206,7 @@ export interface Bootscript { zone: ScwZone } + export interface Volume { /** * Volume unique ID. @@ -213,6 +258,7 @@ export interface Volume { zone: ScwZone } + export interface VolumeSummary { id: string name: string @@ -220,6 +266,7 @@ export interface VolumeSummary { volumeType: VolumeVolumeType } + export interface ServerTypeNetworkInterface { /** * Maximum internal bandwidth in bits per seconds. @@ -231,6 +278,7 @@ export interface ServerTypeNetworkInterface { internetBandwidth?: number } + export interface ServerTypeVolumeConstraintSizes { /** * Minimum volume size in bytes. @@ -242,6 +290,7 @@ export interface ServerTypeVolumeConstraintSizes { maxSize: number } + export interface Image { id: string name: string @@ -249,7 +298,7 @@ export interface Image { creationDate?: Date modificationDate?: Date /** - * @deprecated + * @deprecated */ defaultBootscript?: Bootscript extraVolumes: Record @@ -266,6 +315,7 @@ export interface Image { zone: ScwZone } + export interface PlacementGroup { /** * Placement group unique ID. @@ -306,6 +356,7 @@ In the placement group endpoints the value is correct. zone: ScwZone } + export interface PrivateNIC { /** * Private NIC unique ID. @@ -341,16 +392,19 @@ export interface PrivateNIC { zone: ScwZone } + export interface SecurityGroupSummary { id: string name: string } + export interface ServerFilesystem { filesystemId: string state: ServerFilesystemState } + export interface ServerIp { /** * Unique ID of the IP address. @@ -394,6 +448,7 @@ export interface ServerIp { state: ServerIpState } + export interface ServerIpv6 { /** * Instance IPv6 IP-Address. @@ -409,6 +464,7 @@ export interface ServerIpv6 { netmask: string } + export interface ServerLocation { clusterId: string hypervisorId: string @@ -417,16 +473,18 @@ export interface ServerLocation { zoneId: string } + export interface ServerMaintenance { reason: string startDate?: Date } + export interface VolumeServer { id: string name?: string /** - * @deprecated + * @deprecated */ exportUri?: string organization?: string @@ -444,6 +502,7 @@ export interface VolumeServer { zone: ScwZone } + export interface SnapshotBaseVolume { /** * Volume ID on which the snapshot is based. @@ -455,6 +514,7 @@ export interface SnapshotBaseVolume { name: string } + export interface ServerTypeCapabilities { /** * Defines whether the Instance supports block storage. @@ -470,6 +530,7 @@ export interface ServerTypeCapabilities { maxFileSystems: number } + export interface ServerTypeGPUInfo { /** * GPU manufacturer. @@ -485,6 +546,7 @@ export interface ServerTypeGPUInfo { gpuMemory: number } + export interface ServerTypeNetwork { /** * List of available network interfaces. @@ -504,6 +566,7 @@ export interface ServerTypeNetwork { ipv6Support: boolean } + export interface ServerTypeVolumeConstraintsByType { /** * Local SSD volumes. @@ -511,15 +574,18 @@ export interface ServerTypeVolumeConstraintsByType { lSsd?: ServerTypeVolumeConstraintSizes } + export interface VolumeTypeCapabilities { snapshot: boolean } + export interface VolumeTypeConstraints { min: number max: number } + export interface Server { /** * Instance unique ID. @@ -663,6 +729,7 @@ export interface Server { endOfService: boolean } + export interface VolumeTemplate { /** * UUID of the volume. @@ -694,6 +761,7 @@ export interface VolumeTemplate { project?: string } + export interface Ip { id: string address: string @@ -712,6 +780,7 @@ export interface Ip { zone: ScwZone } + export interface SecurityGroup { /** * Security group unique ID. @@ -783,6 +852,7 @@ export interface SecurityGroup { zone: ScwZone } + export interface SecurityGroupRule { id: string protocol: SecurityGroupRuleProtocol @@ -799,6 +869,7 @@ export interface SecurityGroupRule { zone: ScwZone } + export interface VolumeServerTemplate { /** * UUID of the volume. @@ -834,6 +905,7 @@ export interface VolumeServerTemplate { project?: string } + export interface Snapshot { /** * Snapshot ID. @@ -889,6 +961,7 @@ export interface Snapshot { errorReason?: string } + export interface Task { /** * Unique ID of the task. @@ -922,6 +995,7 @@ export interface Task { zone: ScwZone } + export interface Dashboard { volumesCount: number runningServersCount: number @@ -934,18 +1008,19 @@ export interface Dashboard { ipsUnused: number volumesLSsdCount: number /** - * @deprecated + * @deprecated */ volumesBSsdCount?: number volumesLSsdTotalSize: number /** - * @deprecated + * @deprecated */ volumesBSsdTotalSize?: number privateNicsCount: number placementGroupsCount: number } + export interface PlacementGroupServer { /** * Instance UUID. @@ -961,10 +1036,12 @@ export interface PlacementGroupServer { policyRespected: boolean } + export interface GetServerTypesAvailabilityResponseAvailability { availability: ServerTypesAvailability } + export interface ServerType { /** * @deprecated Estimated monthly price, for a 30 days month, in Euro. @@ -1028,12 +1105,14 @@ export interface ServerType { endOfService: boolean } + export interface VolumeType { displayName: string capabilities?: VolumeTypeCapabilities constraints?: VolumeTypeConstraints } + export interface ServerActionRequestVolumeBackupTemplate { /** * Overrides the `volume_type` of the snapshot for this volume. @@ -1042,6 +1121,7 @@ If omitted, the volume type of the original volume will be used. volumeType: SnapshotVolumeType } + export interface SetSecurityGroupRulesRequestRule { /** * UUID of the security rule to update. If no value is provided, a new rule will be created. @@ -1085,6 +1165,7 @@ export interface SetSecurityGroupRulesRequestRule { zone?: ScwZone } + export interface VolumeImageUpdateTemplate { /** * UUID of the snapshot. @@ -1092,11 +1173,13 @@ export interface VolumeImageUpdateTemplate { id: string } + export interface SecurityGroupTemplate { id: string name: string } + export type ApplyBlockMigrationRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -1120,6 +1203,7 @@ export type ApplyBlockMigrationRequest = { validationKey: string } + export type AttachServerFileSystemRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -1129,10 +1213,12 @@ export type AttachServerFileSystemRequest = { filesystemId: string } + export interface AttachServerFileSystemResponse { server?: Server } + export type AttachServerVolumeRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -1144,10 +1230,12 @@ export type AttachServerVolumeRequest = { boot?: boolean } + export interface AttachServerVolumeResponse { server?: Server } + export type CheckBlockMigrationOrganizationQuotasRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -1156,6 +1244,7 @@ export type CheckBlockMigrationOrganizationQuotasRequest = { organization?: string } + export type CreateImageRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -1199,10 +1288,12 @@ export type CreateImageRequest = { public?: boolean } + export interface CreateImageResponse { image?: Image } + export type CreateIpRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -1234,10 +1325,12 @@ export type CreateIpRequest = { type?: IpType } + export interface CreateIpResponse { ip?: Ip } + export type CreatePlacementGroupRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -1273,10 +1366,12 @@ export type CreatePlacementGroupRequest = { policyType?: PlacementGroupPolicyType } + export interface CreatePlacementGroupResponse { placementGroup?: PlacementGroup } + export type CreatePrivateNICRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -1304,10 +1399,12 @@ export type CreatePrivateNICRequest = { ipamIpIds?: string[] } + export interface CreatePrivateNICResponse { privateNic?: PrivateNIC } + export type CreateSecurityGroupRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -1367,10 +1464,12 @@ export type CreateSecurityGroupRequest = { enableDefaultSecurity?: boolean } + export interface CreateSecurityGroupResponse { securityGroup?: SecurityGroup } + export type CreateSecurityGroupRuleRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -1402,10 +1501,12 @@ export type CreateSecurityGroupRuleRequest = { editable: boolean } + export interface CreateSecurityGroupRuleResponse { rule?: SecurityGroupRule } + export type CreateServerRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -1485,10 +1586,12 @@ export type CreateServerRequest = { protected: boolean } + export interface CreateServerResponse { server?: Server } + export type CreateSnapshotRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -1537,11 +1640,13 @@ If omitted, the volume type of the original volume will be used. size?: number } + export interface CreateSnapshotResponse { snapshot?: Snapshot task?: Task } + export type CreateVolumeRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -1585,10 +1690,12 @@ export type CreateVolumeRequest = { baseSnapshot?: string } + export interface CreateVolumeResponse { volume?: Volume } + export type DeleteImageRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -1600,6 +1707,7 @@ export type DeleteImageRequest = { imageId: string } + export type DeleteIpRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -1611,6 +1719,7 @@ export type DeleteIpRequest = { ip: string } + export type DeletePlacementGroupRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -1622,6 +1731,7 @@ export type DeletePlacementGroupRequest = { placementGroupId: string } + export type DeletePrivateNICRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -1637,6 +1747,7 @@ export type DeletePrivateNICRequest = { privateNicId: string } + export type DeleteSecurityGroupRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -1648,6 +1759,7 @@ export type DeleteSecurityGroupRequest = { securityGroupId: string } + export type DeleteSecurityGroupRuleRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -1657,6 +1769,7 @@ export type DeleteSecurityGroupRuleRequest = { securityGroupRuleId: string } + export type DeleteServerRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -1665,6 +1778,7 @@ export type DeleteServerRequest = { serverId: string } + export type DeleteServerUserDataRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -1680,6 +1794,7 @@ export type DeleteServerUserDataRequest = { key: string } + export type DeleteSnapshotRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -1691,6 +1806,7 @@ export type DeleteSnapshotRequest = { snapshotId: string } + export type DeleteVolumeRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -1702,6 +1818,7 @@ export type DeleteVolumeRequest = { volumeId: string } + export type DetachServerFileSystemRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -1711,10 +1828,12 @@ export type DetachServerFileSystemRequest = { filesystemId: string } + export interface DetachServerFileSystemResponse { server?: Server } + export type DetachServerVolumeRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -1724,10 +1843,12 @@ export type DetachServerVolumeRequest = { volumeId: string } + export interface DetachServerVolumeResponse { server?: Server } + export type ExportSnapshotRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -1747,10 +1868,12 @@ export type ExportSnapshotRequest = { key: string } + export interface ExportSnapshotResponse { task?: Task } + export type GetDashboardRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -1760,10 +1883,12 @@ export type GetDashboardRequest = { project?: string } + export interface GetDashboardResponse { dashboard?: Dashboard } + export type GetImageRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -1775,10 +1900,12 @@ export type GetImageRequest = { imageId: string } + export interface GetImageResponse { image?: Image } + export type GetIpRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -1790,10 +1917,12 @@ export type GetIpRequest = { ip: string } + export interface GetIpResponse { ip?: Ip } + export type GetPlacementGroupRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -1805,10 +1934,12 @@ export type GetPlacementGroupRequest = { placementGroupId: string } + export interface GetPlacementGroupResponse { placementGroup?: PlacementGroup } + export type GetPlacementGroupServersRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -1820,6 +1951,7 @@ export type GetPlacementGroupServersRequest = { placementGroupId: string } + export interface GetPlacementGroupServersResponse { /** * Instances attached to the placement group. @@ -1827,6 +1959,7 @@ export interface GetPlacementGroupServersResponse { servers: PlacementGroupServer[] } + export type GetPrivateNICRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -1842,10 +1975,12 @@ export type GetPrivateNICRequest = { privateNicId: string } + export interface GetPrivateNICResponse { privateNic?: PrivateNIC } + export type GetSecurityGroupRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -1857,10 +1992,12 @@ export type GetSecurityGroupRequest = { securityGroupId: string } + export interface GetSecurityGroupResponse { securityGroup?: SecurityGroup } + export type GetSecurityGroupRuleRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -1870,10 +2007,12 @@ export type GetSecurityGroupRuleRequest = { securityGroupRuleId: string } + export interface GetSecurityGroupRuleResponse { rule?: SecurityGroupRule } + export type GetServerCompatibleTypesRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -1885,6 +2024,7 @@ export type GetServerCompatibleTypesRequest = { serverId: string } + export type GetServerRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -1896,10 +2036,12 @@ export type GetServerRequest = { serverId: string } + export interface GetServerResponse { server?: Server } + export type GetServerTypesAvailabilityRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -1915,6 +2057,7 @@ export type GetServerTypesAvailabilityRequest = { page?: number } + export interface GetServerTypesAvailabilityResponse { /** * Map of server types. @@ -1923,6 +2066,7 @@ export interface GetServerTypesAvailabilityResponse { totalCount: number } + export type GetSnapshotRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -1934,10 +2078,12 @@ export type GetSnapshotRequest = { snapshotId: string } + export interface GetSnapshotResponse { snapshot?: Snapshot } + export type GetVolumeRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -1949,10 +2095,12 @@ export type GetVolumeRequest = { volumeId: string } + export interface GetVolumeResponse { volume?: Volume } + export type ListDefaultSecurityGroupRulesRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -1960,6 +2108,7 @@ export type ListDefaultSecurityGroupRulesRequest = { zone?: ScwZone } + export type ListImagesRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -1975,6 +2124,7 @@ export type ListImagesRequest = { tags?: string } + export interface ListImagesResponse { /** * Total number of images. @@ -1986,6 +2136,7 @@ export interface ListImagesResponse { images: Image[] } + export type ListIpsRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -2021,6 +2172,7 @@ export type ListIpsRequest = { type?: string } + export interface ListIpsResponse { /** * Total number of ips. @@ -2032,6 +2184,7 @@ export interface ListIpsResponse { ips: Ip[] } + export type ListPlacementGroupsRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -2063,6 +2216,7 @@ export type ListPlacementGroupsRequest = { name?: string } + export interface ListPlacementGroupsResponse { /** * Total number of placement groups. @@ -2074,6 +2228,7 @@ export interface ListPlacementGroupsResponse { placementGroups: PlacementGroup[] } + export type ListPrivateNICsRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -2097,11 +2252,13 @@ export type ListPrivateNICsRequest = { page?: number } + export interface ListPrivateNICsResponse { privateNics: PrivateNIC[] totalCount: number } + export type ListSecurityGroupRulesRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -2121,6 +2278,7 @@ export type ListSecurityGroupRulesRequest = { page?: number } + export interface ListSecurityGroupRulesResponse { /** * Total number of security groups. @@ -2132,6 +2290,7 @@ export interface ListSecurityGroupRulesResponse { rules: SecurityGroupRule[] } + export type ListSecurityGroupsRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -2167,6 +2326,7 @@ export type ListSecurityGroupsRequest = { page?: number } + export interface ListSecurityGroupsResponse { /** * Total number of security groups. @@ -2178,6 +2338,7 @@ export interface ListSecurityGroupsResponse { securityGroups: SecurityGroup[] } + export type ListServerActionsRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -2186,10 +2347,12 @@ export type ListServerActionsRequest = { serverId: string } + export interface ListServerActionsResponse { actions: ServerAction[] } + export type ListServerUserDataRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -2201,10 +2364,12 @@ export type ListServerUserDataRequest = { serverId: string } + export interface ListServerUserDataResponse { userData: string[] } + export type ListServersRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -2276,6 +2441,7 @@ export type ListServersRequest = { servers?: string[] } + export interface ListServersResponse { /** * Total number of Instances. @@ -2287,6 +2453,7 @@ export interface ListServersResponse { servers: Server[] } + export type ListServersTypesRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -2296,6 +2463,7 @@ export type ListServersTypesRequest = { page?: number } + export interface ListServersTypesResponse { /** * Total number of Instance types. @@ -2307,6 +2475,7 @@ export interface ListServersTypesResponse { servers: Record } + export type ListSnapshotsRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -2342,6 +2511,7 @@ export type ListSnapshotsRequest = { baseVolumeId?: string } + export interface ListSnapshotsResponse { /** * Total number of snapshots. @@ -2353,6 +2523,7 @@ export interface ListSnapshotsResponse { snapshots: Snapshot[] } + export type ListVolumesRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -2388,6 +2559,7 @@ export type ListVolumesRequest = { name?: string } + export interface ListVolumesResponse { /** * Total number of volumes. @@ -2399,6 +2571,7 @@ export interface ListVolumesResponse { volumes: Volume[] } + export type ListVolumesTypesRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -2408,6 +2581,7 @@ export type ListVolumesTypesRequest = { page?: number } + export interface ListVolumesTypesResponse { /** * Total number of volume types. @@ -2419,6 +2593,7 @@ export interface ListVolumesTypesResponse { volumes: Record } + export interface MigrationPlan { /** * A volume which will be migrated to SBS together with the snapshots, if present. @@ -2434,6 +2609,7 @@ export interface MigrationPlan { validationKey: string } + export type PlanBlockMigrationRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -2453,6 +2629,7 @@ export type PlanBlockMigrationRequest = { snapshotId?: string } + export type ReleaseIpToIpamRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -2464,6 +2641,7 @@ export type ReleaseIpToIpamRequest = { ipId: string } + export type ServerActionRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -2494,10 +2672,12 @@ This field should only be specified when performing a enable_routed_ip action. disableIpv6?: boolean } + export interface ServerActionResponse { task?: Task } + export interface ServerCompatibleTypes { /** * Instance compatible types. @@ -2505,6 +2685,7 @@ export interface ServerCompatibleTypes { compatibleTypes: string[] } + export type SetImageRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -2516,7 +2697,7 @@ export type SetImageRequest = { creationDate?: Date modificationDate?: Date /** - * @deprecated + * @deprecated */ defaultBootscript?: Bootscript extraVolumes?: Record @@ -2529,6 +2710,7 @@ export type SetImageRequest = { tags?: string[] } + export type SetPlacementGroupRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -2543,10 +2725,12 @@ export type SetPlacementGroupRequest = { tags?: string[] } + export interface SetPlacementGroupResponse { placementGroup?: PlacementGroup } + export type SetPlacementGroupServersRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -2562,6 +2746,7 @@ export type SetPlacementGroupServersRequest = { servers: string[] } + export interface SetPlacementGroupServersResponse { /** * Instances attached to the placement group. @@ -2569,6 +2754,7 @@ export interface SetPlacementGroupServersResponse { servers: PlacementGroupServer[] } + export type SetSecurityGroupRulesRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -2584,10 +2770,12 @@ export type SetSecurityGroupRulesRequest = { rules?: SetSecurityGroupRulesRequestRule[] } + export interface SetSecurityGroupRulesResponse { rules: SecurityGroupRule[] } + export type UpdateImageRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -2619,10 +2807,12 @@ export type UpdateImageRequest = { public?: boolean } + export interface UpdateImageResponse { image?: Image } + export type UpdateIpRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -2647,10 +2837,12 @@ export type UpdateIpRequest = { server?: string | null } + export interface UpdateIpResponse { ip?: Ip } + export type UpdatePlacementGroupRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -2678,10 +2870,12 @@ export type UpdatePlacementGroupRequest = { policyType?: PlacementGroupPolicyType } + export interface UpdatePlacementGroupResponse { placementGroup?: PlacementGroup } + export type UpdatePlacementGroupServersRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -2697,6 +2891,7 @@ export type UpdatePlacementGroupServersRequest = { servers: string[] } + export interface UpdatePlacementGroupServersResponse { /** * Instances attached to the placement group. @@ -2704,6 +2899,7 @@ export interface UpdatePlacementGroupServersResponse { servers: PlacementGroupServer[] } + export type UpdatePrivateNICRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -2723,6 +2919,7 @@ export type UpdatePrivateNICRequest = { tags?: string[] } + export type UpdateSecurityGroupRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -2770,10 +2967,12 @@ export type UpdateSecurityGroupRequest = { stateful?: boolean } + export interface UpdateSecurityGroupResponse { securityGroup?: SecurityGroup } + export type UpdateSecurityGroupRuleRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -2817,10 +3016,12 @@ export type UpdateSecurityGroupRuleRequest = { position?: number } + export interface UpdateSecurityGroupRuleResponse { rule?: SecurityGroupRule } + export type UpdateServerRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -2850,7 +3051,7 @@ export type UpdateServerRequest = { */ publicIps?: string[] /** - * @deprecated + * @deprecated */ enableIpv6?: boolean /** @@ -2880,10 +3081,12 @@ export type UpdateServerRequest = { adminPasswordEncryptionSshKeyId?: string } + export interface UpdateServerResponse { server?: Server } + export type UpdateSnapshotRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -2903,10 +3106,12 @@ export type UpdateSnapshotRequest = { tags?: string[] } + export interface UpdateSnapshotResponse { snapshot?: Snapshot } + export type UpdateVolumeRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -2930,6 +3135,9 @@ export type UpdateVolumeRequest = { size?: number } + export interface UpdateVolumeResponse { volume?: Volume } + + diff --git a/packages_generated/instance/src/v1/types.private.gen.ts b/packages_generated/instance/src/v1/types.private.gen.ts index 4799bfa9f..94775bca5 100644 --- a/packages_generated/instance/src/v1/types.private.gen.ts +++ b/packages_generated/instance/src/v1/types.private.gen.ts @@ -1,38 +1,14 @@ // This file was automatically generated. DO NOT EDIT. // If you have any remark or suggestion do not hesitate to open an issue. import type { Zone as ScwZone } from '@scaleway/sdk-client' -import type { - Arch, - BootType, - Image, - PlacementGroup, - PrivateNIC, - SecurityGroup, - SecurityGroupPolicy, - SecurityGroupRule, - SecurityGroupRuleAction, - SecurityGroupRuleDirection, - SecurityGroupRuleProtocol, - SecurityGroupSummary, - Server, - ServerAction, - ServerIp, - ServerIpv6, - ServerLocation, - ServerMaintenance, - ServerState, - ServerSummary, - Snapshot, - SnapshotBaseVolume, - SnapshotState, - Volume, - VolumeVolumeType, -} from './types.gen.js' +import type {Arch,BootType,SecurityGroupPolicy,SecurityGroupRuleAction,SecurityGroupRuleDirection,SecurityGroupRuleProtocol,ServerAction,ServerState,SnapshotState,VolumeVolumeType,ServerSummary,Volume,Image,PlacementGroup,PrivateNIC,SecurityGroupSummary,ServerIp,ServerIpv6,ServerLocation,ServerMaintenance,SnapshotBaseVolume,Server,SecurityGroup,SecurityGroupRule,Snapshot,} from './types.gen.js' + export interface SetImageResponse { image?: Image } + export type SetSecurityGroupRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -100,10 +76,12 @@ export type SetSecurityGroupRequest = { stateful: boolean } + export interface SetSecurityGroupResponse { securityGroup?: SecurityGroup } + export type SetSecurityGroupRuleRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -122,10 +100,12 @@ export type SetSecurityGroupRuleRequest = { editable: boolean } + export interface SetSecurityGroupRuleResponse { rule?: SecurityGroupRule } + export type SetServerRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -253,10 +233,12 @@ export type SetServerRequest = { adminPasswordEncryptionSshKeyId?: string } + export interface SetServerResponse { server?: Server } + export type SetSnapshotRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -276,6 +258,9 @@ export type SetSnapshotRequest = { tags?: string[] } + export interface SetSnapshotResponse { snapshot?: Snapshot } + +