From 7a731d152f94dd415826561c21f2371218ce93da Mon Sep 17 00:00:00 2001 From: scaleway-bot Date: Tue, 25 Feb 2025 15:05:50 +0000 Subject: [PATCH] feat: update generated APIs --- .../src/api/edge_services/index.gen.ts | 1 + .../api/edge_services/v1beta1/index.gen.ts | 128 ++++++++++++++++++ .../clients/src/api/instance/v1/api.gen.ts | 25 ++++ .../clients/src/api/instance/v1/index.gen.ts | 2 + .../src/api/instance/v1/marshalling.gen.ts | 16 +++ .../clients/src/api/instance/v1/types.gen.ts | 14 ++ 6 files changed, 186 insertions(+) create mode 100644 packages/clients/src/api/edge_services/v1beta1/index.gen.ts diff --git a/packages/clients/src/api/edge_services/index.gen.ts b/packages/clients/src/api/edge_services/index.gen.ts index 6dec29b44..72d281d6b 100644 --- a/packages/clients/src/api/edge_services/index.gen.ts +++ b/packages/clients/src/api/edge_services/index.gen.ts @@ -4,3 +4,4 @@ */ export * as v1alpha1 from './v1alpha1/index.gen' +export * as v1beta1 from './v1beta1/index.gen' diff --git a/packages/clients/src/api/edge_services/v1beta1/index.gen.ts b/packages/clients/src/api/edge_services/v1beta1/index.gen.ts new file mode 100644 index 000000000..526f90544 --- /dev/null +++ b/packages/clients/src/api/edge_services/v1beta1/index.gen.ts @@ -0,0 +1,128 @@ +// 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' +export * from './content.gen' +export type { + AddRouteRulesRequest, + AddRouteRulesResponse, + BackendStage, + CacheStage, + CheckDomainRequest, + CheckDomainResponse, + CheckLbOriginRequest, + CheckLbOriginResponse, + CheckPEMChainRequest, + CheckPEMChainRequestSecretChain, + CheckPEMChainResponse, + CreateBackendStageRequest, + CreateCacheStageRequest, + CreateDNSStageRequest, + CreatePipelineRequest, + CreatePurgeRequestRequest, + CreateRouteStageRequest, + CreateTLSStageRequest, + CreateWafStageRequest, + DNSStage, + DNSStageType, + DeleteBackendStageRequest, + DeleteCacheStageRequest, + DeleteCurrentPlanRequest, + DeleteDNSStageRequest, + DeletePipelineRequest, + DeleteRouteStageRequest, + DeleteTLSStageRequest, + DeleteWafStageRequest, + GetBackendStageRequest, + GetBillingRequest, + GetBillingResponse, + GetCacheStageRequest, + GetCurrentPlanRequest, + GetDNSStageRequest, + GetPipelineRequest, + GetPurgeRequestRequest, + GetRouteStageRequest, + GetTLSStageRequest, + GetWafStageRequest, + HeadStageResponse, + HeadStageResponseHeadStage, + LbOriginError, + ListBackendStagesRequest, + ListBackendStagesRequestOrderBy, + ListBackendStagesResponse, + ListCacheStagesRequest, + ListCacheStagesRequestOrderBy, + ListCacheStagesResponse, + ListDNSStagesRequest, + ListDNSStagesRequestOrderBy, + ListDNSStagesResponse, + ListHeadStagesRequest, + ListHeadStagesResponse, + ListHeadStagesResponseHeadStage, + ListPipelinesRequest, + ListPipelinesRequestOrderBy, + ListPipelinesResponse, + ListPipelinesWithStagesRequest, + ListPipelinesWithStagesRequestOrderBy, + ListPipelinesWithStagesResponse, + ListPlansResponse, + ListPurgeRequestsRequest, + ListPurgeRequestsRequestOrderBy, + ListPurgeRequestsResponse, + ListRouteRulesRequest, + ListRouteRulesResponse, + ListRouteStagesRequest, + ListRouteStagesRequestOrderBy, + ListRouteStagesResponse, + ListTLSStagesRequest, + ListTLSStagesRequestOrderBy, + ListTLSStagesResponse, + ListWafStagesRequest, + ListWafStagesRequestOrderBy, + ListWafStagesResponse, + Pipeline, + PipelineError, + PipelineErrorCode, + PipelineErrorSeverity, + PipelineErrorStage, + PipelineErrorType, + PipelineStages, + PipelineStatus, + Plan, + PlanDetails, + PlanName, + PlanUsageDetails, + PurgeRequest, + PurgeRequestStatus, + RouteRule, + RouteStage, + RuleHttpMatch, + RuleHttpMatchMethodFilter, + RuleHttpMatchPathFilter, + RuleHttpMatchPathFilterPathFilterType, + ScalewayLb, + ScalewayLbBackendConfig, + ScalewayS3BackendConfig, + SearchBackendStagesRequest, + SearchBackendStagesRequestOrderBy, + SelectPlanRequest, + SetHeadStageRequest, + SetHeadStageRequestAddNewHeadStage, + SetHeadStageRequestRemoveHeadStage, + SetHeadStageRequestSwapHeadStage, + SetRouteRulesRequest, + SetRouteRulesRequestRouteRule, + SetRouteRulesResponse, + TLSSecret, + TLSSecretsConfig, + TLSStage, + UpdateBackendStageRequest, + UpdateCacheStageRequest, + UpdateDNSStageRequest, + UpdatePipelineRequest, + UpdateRouteStageRequest, + UpdateTLSStageRequest, + UpdateWafStageRequest, + WafStage, + WafStageMode, +} from './types.gen' +export * as ValidationRules from './validation-rules.gen' diff --git a/packages/clients/src/api/instance/v1/api.gen.ts b/packages/clients/src/api/instance/v1/api.gen.ts index 82e3f695f..92c68df04 100644 --- a/packages/clients/src/api/instance/v1/api.gen.ts +++ b/packages/clients/src/api/instance/v1/api.gen.ts @@ -82,6 +82,7 @@ import { unmarshalMigrationPlan, unmarshalPrivateNIC, unmarshalServerActionResponse, + unmarshalServerCompatibleTypes, unmarshalSetImageResponse, unmarshalSetPlacementGroupResponse, unmarshalSetPlacementGroupServersResponse, @@ -153,6 +154,7 @@ import type { GetSecurityGroupResponse, GetSecurityGroupRuleRequest, GetSecurityGroupRuleResponse, + GetServerCompatibleTypesRequest, GetServerRequest, GetServerResponse, GetServerTypesAvailabilityRequest, @@ -193,6 +195,7 @@ import type { PrivateNIC, ServerActionRequest, ServerActionResponse, + ServerCompatibleTypes, SetImageRequest, SetPlacementGroupRequest, SetPlacementGroupResponse, @@ -512,6 +515,28 @@ export class API extends ParentAPI { 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 the OS type the required l_ssd storage size + * the required scratch storage size If the specified Instance offer is + * flagged as end of service, the best compatible offer is the first + * returned. + * + * @param request - The request {@link GetServerCompatibleTypesRequest} + * @returns A Promise of ServerCompatibleTypes + */ + getServerCompatibleTypes = ( + request: Readonly, + ) => + this.client.fetch( + { + method: 'GET', + path: `/instance/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}/compatible-types`, + }, + unmarshalServerCompatibleTypes, + ) + attachServerVolume = (request: Readonly) => this.client.fetch( { diff --git a/packages/clients/src/api/instance/v1/index.gen.ts b/packages/clients/src/api/instance/v1/index.gen.ts index 36921af14..8d6c9153e 100644 --- a/packages/clients/src/api/instance/v1/index.gen.ts +++ b/packages/clients/src/api/instance/v1/index.gen.ts @@ -60,6 +60,7 @@ export type { GetSecurityGroupResponse, GetSecurityGroupRuleRequest, GetSecurityGroupRuleResponse, + GetServerCompatibleTypesRequest, GetServerRequest, GetServerResponse, GetServerTypesAvailabilityRequest, @@ -124,6 +125,7 @@ export type { ServerActionRequest, ServerActionRequestVolumeBackupTemplate, ServerActionResponse, + ServerCompatibleTypes, ServerIp, ServerIpIpFamily, ServerIpProvisioningMode, diff --git a/packages/clients/src/api/instance/v1/marshalling.gen.ts b/packages/clients/src/api/instance/v1/marshalling.gen.ts index a896202d8..c462f2d09 100644 --- a/packages/clients/src/api/instance/v1/marshalling.gen.ts +++ b/packages/clients/src/api/instance/v1/marshalling.gen.ts @@ -79,6 +79,7 @@ import type { ServerActionRequest, ServerActionRequestVolumeBackupTemplate, ServerActionResponse, + ServerCompatibleTypes, ServerIp, ServerIpv6, ServerLocation, @@ -1204,6 +1205,7 @@ const unmarshalServerType = (data: unknown): ServerType => { capabilities: data.capabilities ? unmarshalServerTypeCapabilities(data.capabilities) : undefined, + endOfService: data.end_of_service, gpu: data.gpu, hourlyPrice: data.hourly_price, monthlyPrice: data.monthly_price, @@ -1357,6 +1359,20 @@ export const unmarshalServerActionResponse = ( } as ServerActionResponse } +export const unmarshalServerCompatibleTypes = ( + data: unknown, +): ServerCompatibleTypes => { + if (!isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ServerCompatibleTypes' failed as data isn't a dictionary.`, + ) + } + + return { + compatibleTypes: data.compatible_types, + } as ServerCompatibleTypes +} + export const unmarshalSetImageResponse = (data: unknown): SetImageResponse => { if (!isJSONObject(data)) { throw new TypeError( diff --git a/packages/clients/src/api/instance/v1/types.gen.ts b/packages/clients/src/api/instance/v1/types.gen.ts index bcdabf05a..a357ddee2 100644 --- a/packages/clients/src/api/instance/v1/types.gen.ts +++ b/packages/clients/src/api/instance/v1/types.gen.ts @@ -696,6 +696,8 @@ export interface ServerType { * second). */ blockBandwidth?: number + /** True if this Instance type has reached end of service. */ + endOfService: boolean } export interface VolumeType { @@ -1335,6 +1337,13 @@ export interface GetSecurityGroupRuleResponse { rule?: SecurityGroupRule } +export type GetServerCompatibleTypesRequest = { + /** Zone to target. If none is passed will use default zone from the config. */ + zone?: ScwZone + /** UUID of the Instance you want to get. */ + serverId: string +} + export type GetServerRequest = { /** Zone to target. If none is passed will use default zone from the config. */ zone?: ScwZone @@ -1787,6 +1796,11 @@ export interface ServerActionResponse { task?: Task } +export interface ServerCompatibleTypes { + /** Instance compatible types. */ + compatibleTypes: string[] +} + export type SetImageRequest = { /** Zone to target. If none is passed will use default zone from the config. */ zone?: ScwZone