From 0406e362031305f4792ff1f4389d85b9e6efc34a Mon Sep 17 00:00:00 2001 From: scaleway-bot Date: Tue, 30 Sep 2025 13:11:02 +0000 Subject: [PATCH 1/5] feat: update generated APIs --- .../applesilicon/src/v1alpha1/index.gen.ts | 4 + .../src/v1alpha1/marshalling.gen.ts | 82 +++++++- .../applesilicon/src/v1alpha1/types.gen.ts | 64 +++++- .../environmental_footprint/src/index.gen.ts | 6 + .../src/v1alpha1/api.gen.ts | 112 +++++++++++ .../src/v1alpha1/index.gen.ts | 19 ++ .../src/v1alpha1/marshalling.gen.ts | 142 +++++++++++++ .../src/v1alpha1/types.gen.ts | 186 ++++++++++++++++++ .../qaas/src/v1alpha1/marshalling.gen.ts | 3 + .../qaas/src/v1alpha1/types.gen.ts | 12 ++ 10 files changed, 627 insertions(+), 3 deletions(-) create mode 100644 packages_generated/environmental_footprint/src/index.gen.ts create mode 100644 packages_generated/environmental_footprint/src/v1alpha1/api.gen.ts create mode 100644 packages_generated/environmental_footprint/src/v1alpha1/index.gen.ts create mode 100644 packages_generated/environmental_footprint/src/v1alpha1/marshalling.gen.ts create mode 100644 packages_generated/environmental_footprint/src/v1alpha1/types.gen.ts diff --git a/packages_generated/applesilicon/src/v1alpha1/index.gen.ts b/packages_generated/applesilicon/src/v1alpha1/index.gen.ts index 2b86e9f37..94d27c335 100644 --- a/packages_generated/applesilicon/src/v1alpha1/index.gen.ts +++ b/packages_generated/applesilicon/src/v1alpha1/index.gen.ts @@ -33,6 +33,7 @@ export type { ListServerTypesRequest, ListServerTypesResponse, OS, + OSSupportedServerType, PrivateNetworkApiAddServerPrivateNetworkRequest, PrivateNetworkApiDeleteServerPrivateNetworkRequest, PrivateNetworkApiGetServerPrivateNetworkRequest, @@ -40,6 +41,8 @@ export type { PrivateNetworkApiSetServerPrivateNetworksRequest, RebootServerRequest, ReinstallServerRequest, + RunnerConfiguration, + RunnerConfigurationProvider, Server, ServerPrivateNetwork, ServerPrivateNetworkServerStatus, @@ -51,6 +54,7 @@ export type { ServerTypeGPU, ServerTypeMemory, ServerTypeNetwork, + ServerTypeNPU, ServerTypeStock, SetServerPrivateNetworksResponse, StartConnectivityDiagnosticRequest, diff --git a/packages_generated/applesilicon/src/v1alpha1/marshalling.gen.ts b/packages_generated/applesilicon/src/v1alpha1/marshalling.gen.ts index 90479cb9f..b2c569794 100644 --- a/packages_generated/applesilicon/src/v1alpha1/marshalling.gen.ts +++ b/packages_generated/applesilicon/src/v1alpha1/marshalling.gen.ts @@ -21,9 +21,11 @@ import type { ListServersResponse, ListServerTypesResponse, OS, + OSSupportedServerType, PrivateNetworkApiAddServerPrivateNetworkRequest, PrivateNetworkApiSetServerPrivateNetworksRequest, ReinstallServerRequest, + RunnerConfiguration, Server, ServerPrivateNetwork, ServerType, @@ -32,12 +34,28 @@ import type { ServerTypeGPU, ServerTypeMemory, ServerTypeNetwork, + ServerTypeNPU, SetServerPrivateNetworksResponse, StartConnectivityDiagnosticRequest, StartConnectivityDiagnosticResponse, UpdateServerRequest, } from './types.gen' +const unmarshalOSSupportedServerType = ( + data: unknown, +): OSSupportedServerType => { + if (!isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'OSSupportedServerType' failed as data isn't a dictionary.`, + ) + } + + return { + fastDeliveryAvailable: data.fast_delivery_available, + serverType: data.server_type, + } as OSSupportedServerType +} + export const unmarshalOS = (data: unknown): OS => { if (!isJSONObject(data)) { throw new TypeError( @@ -46,13 +64,22 @@ export const unmarshalOS = (data: unknown): OS => { } return { - compatibleServerTypes: data.compatible_server_types, + compatibleServerTypes: data.compatible_server_types + ? data.compatible_server_types + : undefined, + description: data.description, family: data.family, id: data.id, imageUrl: data.image_url, isBeta: data.is_beta, label: data.label, name: data.name, + releaseNotesUrl: data.release_notes_url, + supportedServerTypes: unmarshalArrayOfObject( + data.supported_server_types, + unmarshalOSSupportedServerType, + ), + tags: data.tags, version: data.version, xcodeVersion: data.xcode_version, } as OS @@ -71,6 +98,21 @@ const unmarshalCommitment = (data: unknown): Commitment => { } as Commitment } +const unmarshalRunnerConfiguration = (data: unknown): RunnerConfiguration => { + if (!isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'RunnerConfiguration' failed as data isn't a dictionary.`, + ) + } + + return { + name: data.name, + provider: data.provider, + token: data.token, + url: data.url, + } as RunnerConfiguration +} + export const unmarshalServer = (data: unknown): Server => { if (!isJSONObject(data)) { throw new TypeError( @@ -93,9 +135,13 @@ export const unmarshalServer = (data: unknown): Server => { os: data.os ? unmarshalOS(data.os) : undefined, projectId: data.project_id, publicBandwidthBps: data.public_bandwidth_bps, + runnerConfiguration: data.runner_configuration + ? unmarshalRunnerConfiguration(data.runner_configuration) + : undefined, sshUsername: data.ssh_username, status: data.status, sudoPassword: data.sudo_password, + tags: data.tags, type: data.type, updatedAt: unmarshalDate(data.updated_at), vncPort: data.vnc_port, @@ -138,6 +184,8 @@ const unmarshalServerTypeCPU = (data: unknown): ServerTypeCPU => { coreCount: data.core_count, frequency: data.frequency, name: data.name, + sockets: data.sockets, + threadsPerCore: data.threads_per_core, } as ServerTypeCPU } @@ -179,6 +227,18 @@ const unmarshalServerTypeMemory = (data: unknown): ServerTypeMemory => { } as ServerTypeMemory } +const unmarshalServerTypeNPU = (data: unknown): ServerTypeNPU => { + if (!isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ServerTypeNPU' failed as data isn't a dictionary.`, + ) + } + + return { + count: data.count, + } as ServerTypeNPU +} + const unmarshalServerTypeNetwork = (data: unknown): ServerTypeNetwork => { if (!isJSONObject(data)) { throw new TypeError( @@ -187,6 +247,7 @@ const unmarshalServerTypeNetwork = (data: unknown): ServerTypeNetwork => { } return { + defaultPublicBandwidth: data.default_public_bandwidth, publicBandwidthBps: data.public_bandwidth_bps, supportedBandwidth: data.supported_bandwidth, } as ServerTypeNetwork @@ -210,6 +271,7 @@ export const unmarshalServerType = (data: unknown): ServerType => { network: data.network ? unmarshalServerTypeNetwork(data.network) : undefined, + npu: data.npu ? unmarshalServerTypeNPU(data.npu) : undefined, stock: data.stock, } as ServerType } @@ -387,6 +449,16 @@ export const marshalBatchCreateServersRequest = ( type: request.type, }) +const marshalRunnerConfiguration = ( + request: RunnerConfiguration, + defaults: DefaultValues, +): Record => ({ + name: request.name, + provider: request.provider, + token: request.token, + url: request.url, +}) + export const marshalCreateServerRequest = ( request: CreateServerRequest, defaults: DefaultValues, @@ -397,6 +469,10 @@ export const marshalCreateServerRequest = ( os_id: request.osId, project_id: request.projectId ?? defaults.defaultProjectId, public_bandwidth_bps: request.publicBandwidthBps, + runner_configuration: + request.runnerConfiguration !== undefined + ? marshalRunnerConfiguration(request.runnerConfiguration, defaults) + : undefined, type: request.type, }) @@ -420,6 +496,10 @@ export const marshalReinstallServerRequest = ( defaults: DefaultValues, ): Record => ({ os_id: request.osId, + runner_configuration: + request.runnerConfiguration !== undefined + ? marshalRunnerConfiguration(request.runnerConfiguration, defaults) + : undefined, }) export const marshalStartConnectivityDiagnosticRequest = ( diff --git a/packages_generated/applesilicon/src/v1alpha1/types.gen.ts b/packages_generated/applesilicon/src/v1alpha1/types.gen.ts index be29aa3fd..f659a819d 100644 --- a/packages_generated/applesilicon/src/v1alpha1/types.gen.ts +++ b/packages_generated/applesilicon/src/v1alpha1/types.gen.ts @@ -22,6 +22,11 @@ export type ListServerPrivateNetworksRequestOrderBy = export type ListServersRequestOrderBy = 'created_at_asc' | 'created_at_desc' +export type RunnerConfigurationProvider = + | 'unknown_provider' + | 'github' + | 'gitlab' + export type ServerPrivateNetworkServerStatus = | 'unknown_status' | 'attaching' @@ -55,6 +60,11 @@ export type ServerTypeStock = | 'low_stock' | 'high_stock' +export interface OSSupportedServerType { + serverType: string + fastDeliveryAvailable: boolean +} + export interface Commitment { type: CommitmentType cancelled: boolean @@ -94,15 +104,40 @@ export interface OS { */ xcodeVersion: string /** - * List of compatible server types. + * @deprecated List of compatible server types. Deprecated. + */ + compatibleServerTypes?: string[] + /** + * Url of the release notes for the OS image or softwares pre-installed. */ - compatibleServerTypes: string[] + releaseNotesUrl: string + /** + * A summary of the OS image content and configuration. + */ + description: string + /** + * List of tags for the OS configuration. + */ + tags: string[] + /** + * List of server types which supports the OS configuration. Also gives information about immediate stock availability. + */ + supportedServerTypes: OSSupportedServerType[] +} + +export interface RunnerConfiguration { + name: string + url: string + token: string + provider: RunnerConfigurationProvider } export interface ServerTypeCPU { name: string coreCount: number frequency: number + sockets: number + threadsPerCore: number } export interface ServerTypeDisk { @@ -119,9 +154,14 @@ export interface ServerTypeMemory { type: string } +export interface ServerTypeNPU { + count: number +} + export interface ServerTypeNetwork { publicBandwidthBps: number supportedBandwidth: number[] + defaultPublicBandwidth: number } export interface BatchCreateServersRequestBatchInnerCreateServerRequest { @@ -213,6 +253,14 @@ export interface Server { * Public bandwidth configured for this server. Expressed in bits per second. */ publicBandwidthBps: number + /** + * Current runner configuration, empty if none is installed. + */ + runnerConfiguration?: RunnerConfiguration + /** + * A list of tags attached to the server. + */ + tags: string[] } export interface ConnectivityDiagnosticServerHealth { @@ -300,6 +348,10 @@ export interface ServerType { * The default OS for this server type. */ defaultOs?: OS + /** + * NPU description. + */ + npu?: ServerTypeNPU } export interface CommitmentTypeValue { @@ -390,6 +442,10 @@ export type CreateServerRequest = { * Public bandwidth to configure for this server. This defaults to the minimum bandwidth for this server type. For compatible server types, the bandwidth can be increased which incurs additional costs. */ publicBandwidthBps: number + /** + * Specify the configuration to install an optional CICD runner on the server during installation. + */ + runnerConfiguration?: RunnerConfiguration } export type DeleteServerRequest = { @@ -656,6 +712,10 @@ export type ReinstallServerRequest = { * Reinstall the server with the target OS, when no os_id provided the default OS for the server type is used. */ osId?: string + /** + * Specify the configuration to install an optional CICD runner on the server during installation. + */ + runnerConfiguration?: RunnerConfiguration } export interface SetServerPrivateNetworksResponse { diff --git a/packages_generated/environmental_footprint/src/index.gen.ts b/packages_generated/environmental_footprint/src/index.gen.ts new file mode 100644 index 000000000..0ea3ca009 --- /dev/null +++ b/packages_generated/environmental_footprint/src/index.gen.ts @@ -0,0 +1,6 @@ +/** + * This file is automatically generated + * PLEASE DO NOT EDIT HERE + */ + +export * as EnvironmentalFootprintv1alpha1 from './v1alpha1/index.gen' diff --git a/packages_generated/environmental_footprint/src/v1alpha1/api.gen.ts b/packages_generated/environmental_footprint/src/v1alpha1/api.gen.ts new file mode 100644 index 000000000..6bdca646e --- /dev/null +++ b/packages_generated/environmental_footprint/src/v1alpha1/api.gen.ts @@ -0,0 +1,112 @@ +// This file was automatically generated. DO NOT EDIT. +// If you have any remark or suggestion do not hesitate to open an issue. +import { API as ParentAPI, urlParams } from '@scaleway/sdk-client' +import { + marshalUserApiDownloadImpactReportRequest, + unmarshalImpactDataResponse, + unmarshalImpactReportAvailability, +} from './marshalling.gen' +import type { + ImpactDataResponse, + ImpactReportAvailability, + UserApiDownloadImpactReportRequest, + UserApiGetImpactDataRequest, + UserApiGetImpactReportAvailabilityRequest, +} from './types.gen' + +const jsonContentHeaders = { + 'Content-Type': 'application/json; charset=utf-8', +} + +/** + * Environmental Footprint API. + +Access and download impact reports and impact data for your Scaleway projects. Our API provides key metrics such as estimated carbon emissions and water usage to help monitor your environmental footprint. + */ +export class UserAPI extends ParentAPI { + /** + * Get available impact reports. Returns a list of dates of available impact reports. + * + * @param request - The request {@link UserApiGetImpactReportAvailabilityRequest} + * @returns A Promise of ImpactReportAvailability + */ + getImpactReportAvailability = ( + request: Readonly = {}, + ) => + this.client.fetch( + { + method: 'GET', + path: `/environmental-footprint/v1alpha1/reports/availability`, + urlParams: urlParams( + ['end_date', request.endDate], + [ + 'organization_id', + request.organizationId ?? + this.client.settings.defaultOrganizationId, + ], + ['start_date', request.startDate], + ), + }, + unmarshalImpactReportAvailability, + ) + + /** + * Download PDF impact report. Download a Scaleway impact PDF report with detailed impact data for your Scaleway projects. + * + * @param request - The request {@link UserApiDownloadImpactReportRequest} + * @returns A Promise of Blob + */ + downloadImpactReport = ( + request: Readonly = {}, + ) => + this.client.fetch({ + body: JSON.stringify( + marshalUserApiDownloadImpactReportRequest( + request, + this.client.settings, + ), + ), + headers: jsonContentHeaders, + method: 'POST', + path: `/environmental-footprint/v1alpha1/reports/download`, + urlParams: urlParams( + ['dl', 1], + ['date', request.date], + [ + 'organization_id', + request.organizationId ?? this.client.settings.defaultOrganizationId, + ], + ['type', request.type], + ), + responseType: 'blob', + }) + + /** + * Retrieve detailed impact data. Retrieve detailed impact data for your Scaleway projects within a specified date range. Filter by project ID, region, zone, service category, and/or product category. + * + * @param request - The request {@link UserApiGetImpactDataRequest} + * @returns A Promise of ImpactDataResponse + */ + getImpactData = (request: Readonly = {}) => + this.client.fetch( + { + method: 'GET', + path: `/environmental-footprint/v1alpha1/data/query`, + urlParams: urlParams( + ['end_date', request.endDate], + [ + 'organization_id', + request.organizationId ?? + this.client.settings.defaultOrganizationId, + ], + ['product_categories', request.productCategories], + ['project_ids', request.projectIds], + ['regions', request.regions], + ['service_categories', request.serviceCategories], + ['start_date', request.startDate], + ['zones', request.zones], + ), + }, + unmarshalImpactDataResponse, + ) +} diff --git a/packages_generated/environmental_footprint/src/v1alpha1/index.gen.ts b/packages_generated/environmental_footprint/src/v1alpha1/index.gen.ts new file mode 100644 index 000000000..709a03504 --- /dev/null +++ b/packages_generated/environmental_footprint/src/v1alpha1/index.gen.ts @@ -0,0 +1,19 @@ +// This file was automatically generated. DO NOT EDIT. +// If you have any remark or suggestion do not hesitate to open an issue. +export { UserAPI } from './api.gen' +export * from './marshalling.gen' +export type { + Impact, + ImpactDataResponse, + ImpactReportAvailability, + ProductCategory, + ProjectImpact, + RegionImpact, + ReportType, + ServiceCategory, + SkuImpact, + UserApiDownloadImpactReportRequest, + UserApiGetImpactDataRequest, + UserApiGetImpactReportAvailabilityRequest, + ZoneImpact, +} from './types.gen' diff --git a/packages_generated/environmental_footprint/src/v1alpha1/marshalling.gen.ts b/packages_generated/environmental_footprint/src/v1alpha1/marshalling.gen.ts new file mode 100644 index 000000000..7de93b2c9 --- /dev/null +++ b/packages_generated/environmental_footprint/src/v1alpha1/marshalling.gen.ts @@ -0,0 +1,142 @@ +// This file was automatically generated. DO NOT EDIT. +// If you have any remark or suggestion do not hesitate to open an issue. + +import type { DefaultValues } from '@scaleway/sdk-client' +import { + isJSONObject, + unmarshalArrayOfObject, + unmarshalDate, +} from '@scaleway/sdk-client' +import type { + Impact, + ImpactDataResponse, + ImpactReportAvailability, + ProjectImpact, + RegionImpact, + SkuImpact, + UserApiDownloadImpactReportRequest, + ZoneImpact, +} from './types.gen' + +const unmarshalImpact = (data: unknown): Impact => { + if (!isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'Impact' failed as data isn't a dictionary.`, + ) + } + + return { + kgCo2Equivalent: data.kg_co2_equivalent, + m3WaterUsage: data.m3_water_usage, + } as Impact +} + +const unmarshalSkuImpact = (data: unknown): SkuImpact => { + if (!isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'SkuImpact' failed as data isn't a dictionary.`, + ) + } + + return { + productCategory: data.product_category, + serviceCategory: data.service_category, + sku: data.sku, + totalSkuImpact: data.total_sku_impact + ? unmarshalImpact(data.total_sku_impact) + : undefined, + } as SkuImpact +} + +const unmarshalZoneImpact = (data: unknown): ZoneImpact => { + if (!isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ZoneImpact' failed as data isn't a dictionary.`, + ) + } + + return { + skus: unmarshalArrayOfObject(data.skus, unmarshalSkuImpact), + totalZoneImpact: data.total_zone_impact + ? unmarshalImpact(data.total_zone_impact) + : undefined, + zone: data.zone, + } as ZoneImpact +} + +const unmarshalRegionImpact = (data: unknown): RegionImpact => { + if (!isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'RegionImpact' failed as data isn't a dictionary.`, + ) + } + + return { + region: data.region, + totalRegionImpact: data.total_region_impact + ? unmarshalImpact(data.total_region_impact) + : undefined, + zones: unmarshalArrayOfObject(data.zones, unmarshalZoneImpact), + } as RegionImpact +} + +const unmarshalProjectImpact = (data: unknown): ProjectImpact => { + if (!isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ProjectImpact' failed as data isn't a dictionary.`, + ) + } + + return { + projectId: data.project_id, + regions: unmarshalArrayOfObject(data.regions, unmarshalRegionImpact), + totalProjectImpact: data.total_project_impact + ? unmarshalImpact(data.total_project_impact) + : undefined, + } as ProjectImpact +} + +export const unmarshalImpactDataResponse = ( + data: unknown, +): ImpactDataResponse => { + if (!isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ImpactDataResponse' failed as data isn't a dictionary.`, + ) + } + + return { + endDate: unmarshalDate(data.end_date), + projects: unmarshalArrayOfObject(data.projects, unmarshalProjectImpact), + startDate: unmarshalDate(data.start_date), + totalImpact: data.total_impact + ? unmarshalImpact(data.total_impact) + : undefined, + } as ImpactDataResponse +} + +export const unmarshalImpactReportAvailability = ( + data: unknown, +): ImpactReportAvailability => { + if (!isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ImpactReportAvailability' failed as data isn't a dictionary.`, + ) + } + + return { + monthSummaryReports: unmarshalArrayOfObject( + data.month_summary_reports, + unmarshalDate, + ), + } as ImpactReportAvailability +} + +export const marshalUserApiDownloadImpactReportRequest = ( + request: UserApiDownloadImpactReportRequest, + defaults: DefaultValues, +): Record => ({ + date: request.date, + organization_id: request.organizationId ?? defaults.defaultOrganizationId, + type: request.type, +}) diff --git a/packages_generated/environmental_footprint/src/v1alpha1/types.gen.ts b/packages_generated/environmental_footprint/src/v1alpha1/types.gen.ts new file mode 100644 index 000000000..92298280a --- /dev/null +++ b/packages_generated/environmental_footprint/src/v1alpha1/types.gen.ts @@ -0,0 +1,186 @@ +// This file was automatically generated. DO NOT EDIT. +// If you have any remark or suggestion do not hesitate to open an issue. +import type { Region as ScwRegion, Zone as ScwZone } from '@scaleway/sdk-client' + +export type ProductCategory = + | 'unknown_product_category' + | 'apple_silicon' + | 'block_storage' + | 'dedibox' + | 'elastic_metal' + | 'instances' + | 'object_storage' + +export type ReportType = 'unknown_report_type' | 'monthly' | 'yearly' + +export type ServiceCategory = + | 'unknown_service_category' + | 'baremetal' + | 'compute' + | 'storage' + +export interface Impact { + /** + * The estimated carbon emissions in kilograms of CO₂ equivalent (kgCO₂e). + */ + kgCo2Equivalent: number + /** + * The estimated water consumption in cubic meters (m³). + */ + m3WaterUsage: number +} + +export interface SkuImpact { + /** + * Unique ID of the combination of product, region and zone. + */ + sku: string + /** + * The total estimated impact for this SKU during the given period. + */ + totalSkuImpact?: Impact + /** + * The service category associated with this SKU. + */ + serviceCategory: ServiceCategory + /** + * The product category associated with this SKU. + */ + productCategory: ProductCategory +} + +export interface ZoneImpact { + /** + * ID of the zone. + */ + zone: ScwZone + /** + * The total estimated impact for this zone across all given service categories, and product categories during the given period. + */ + totalZoneImpact?: Impact + /** + * List of estimated impact values per SKU. + */ + skus: SkuImpact[] +} + +export interface RegionImpact { + /** + * ID of the region. + */ + region: ScwRegion + /** + * The total estimated impact for this region across all given zones, service categories, and product categories during the given period. + */ + totalRegionImpact?: Impact + /** + * List of estimated impact values per zone. + */ + zones: ZoneImpact[] +} + +export interface ProjectImpact { + /** + * ID of the project. + */ + projectId: string + /** + * The total estimated impact for this Project across all given regions, zones, service categories, and product categories during the given period. + */ + totalProjectImpact?: Impact + /** + * List of estimated impact values per region. + */ + regions: RegionImpact[] +} + +export interface ImpactDataResponse { + /** + * Start date of the impact data period (inclusive). + */ + startDate?: Date + /** + * End date of the impact data period (exclusive). + */ + endDate?: Date + /** + * The total estimated impact across all given Projects, regions, zones, service categories, and product categories during the given period. + */ + totalImpact?: Impact + /** + * List of estimated impact values per Project. + */ + projects: ProjectImpact[] +} + +export interface ImpactReportAvailability { + /** + * The list of calendar months for which impact reports are available. + */ + monthSummaryReports: Date[] +} + +export type UserApiDownloadImpactReportRequest = { + /** + * The UUID of the Organization for which you want to download a report. + */ + organizationId?: string + /** + * The start date of the period for which you want to download a report (ISO 8601 format, e.g., 2025-05-01T00:00:00Z). + */ + date?: Date + /** + * Type of report to download (e.g., monthly). Defaults to monthly. + */ + type?: ReportType +} + +export type UserApiGetImpactDataRequest = { + /** + * The UUID of the Organization for which you want to download a report. + */ + organizationId?: string + /** + * Start date (inclusive) of the period for which you want to retrieve impact data (ISO 8601 format, e.g., 2025-05-01T00:00:00Z). + */ + startDate?: Date + /** + * End date (exclusive) of the period for which you want to retrieve impact data (ISO 8601 format, with time in UTC, `YYYY-MM-DDTHH:MM:SSZ`). Defaults to today's date. + */ + endDate?: Date + /** + * List of regions to filter by (\"fr-par\"). Defaults to all regions. + */ + regions?: string[] + /** + * List of zones to filter by (\"fr-par-1\"). Defaults to all zones. + */ + zones?: string[] + /** + * List of Project IDs to filter by. Defaults to all Projects in the Organization. + */ + projectIds?: string[] + /** + * List of service categories to filter by. Defaults to all service categories. + */ + serviceCategories?: ServiceCategory[] + /** + * List of product categories to filter by. Defaults to all product categories. + */ + productCategories?: ProductCategory[] +} + +export type UserApiGetImpactReportAvailabilityRequest = { + /** + * The UUID of the Organization for which you want to download a report. + */ + organizationId?: string + /** + * Start date of the search period (ISO 8601 format, with time in UTC, `YYYY-MM-DDTHH:MM:SSZ`). The date is inclusive. + */ + startDate?: Date + /** + * End date of the search period (ISO 8601 format, with time in UTC, `YYYY-MM-DDTHH:MM:SSZ`). The date is exclusive. Defaults to today's date. + */ + endDate?: Date +} diff --git a/packages_generated/qaas/src/v1alpha1/marshalling.gen.ts b/packages_generated/qaas/src/v1alpha1/marshalling.gen.ts index 0ed8a3a3d..2a9259506 100644 --- a/packages_generated/qaas/src/v1alpha1/marshalling.gen.ts +++ b/packages_generated/qaas/src/v1alpha1/marshalling.gen.ts @@ -140,10 +140,13 @@ const unmarshalPlatformBookingRequirement = ( } return { + maxBookingPerDay: data.max_booking_per_day, + maxBookingPerWeek: data.max_booking_per_week, maxCancellationDuration: data.max_cancellation_duration, maxDuration: data.max_duration, maxPlanificationDuration: data.max_planification_duration, minDuration: data.min_duration, + minPlanificationDuration: data.min_planification_duration, } as PlatformBookingRequirement } diff --git a/packages_generated/qaas/src/v1alpha1/types.gen.ts b/packages_generated/qaas/src/v1alpha1/types.gen.ts index d74d97e78..c7c66b92f 100644 --- a/packages_generated/qaas/src/v1alpha1/types.gen.ts +++ b/packages_generated/qaas/src/v1alpha1/types.gen.ts @@ -150,6 +150,18 @@ export interface PlatformBookingRequirement { * Allowed planification time from now where the platform can be booked in the future. */ maxPlanificationDuration?: string + /** + * Minimum planification time before a platform can be booked. + */ + minPlanificationDuration?: string + /** + * Maximum amount of booking allowed for one organization per week. + */ + maxBookingPerWeek: number + /** + * Maximum amount of booking allowed for one organization per day. + */ + maxBookingPerDay: number } export interface PlatformHardware { From 002e7a7f05142ed014b9e972c7849acbd8bccc8c Mon Sep 17 00:00:00 2001 From: Jonathan Remy Date: Tue, 30 Sep 2025 15:19:50 +0200 Subject: [PATCH 2/5] chore: generate config files --- packages/sdk/src/index.gen.ts | 9 ++++ .../environmental_footprint/package.json | 48 +++++++++++++++++++ .../tsconfig.build.json | 17 +++++++ .../environmental_footprint/tsconfig.json | 4 ++ .../environmental_footprint/vite.config.ts | 14 ++++++ 5 files changed, 92 insertions(+) create mode 100644 packages_generated/environmental_footprint/package.json create mode 100644 packages_generated/environmental_footprint/tsconfig.build.json create mode 100644 packages_generated/environmental_footprint/tsconfig.json create mode 100644 packages_generated/environmental_footprint/vite.config.ts diff --git a/packages/sdk/src/index.gen.ts b/packages/sdk/src/index.gen.ts index 324bee238..6fe375b93 100644 --- a/packages/sdk/src/index.gen.ts +++ b/packages/sdk/src/index.gen.ts @@ -15,6 +15,7 @@ import { Datawarehousev1beta1 } from '@scaleway/sdk-datawarehouse' import { Dediboxv1 } from '@scaleway/sdk-dedibox' import { Domainv2beta1 } from '@scaleway/sdk-domain' import { EdgeServicesv1beta1 } from '@scaleway/sdk-edge-services' +import { EnvironmentalFootprintv1alpha1 } from '@scaleway/sdk-environmental-footprint' import { Filev1alpha1 } from '@scaleway/sdk-file' import { Flexibleipv1alpha1 } from '@scaleway/sdk-flexibleip' import { Functionv1beta1 } from '@scaleway/sdk-function' @@ -153,6 +154,14 @@ export const EdgeServices = { v1beta1: EdgeServicesv1beta1, } +/** + * @deprecated Direct version exports are deprecated. Use the 'EnvironmentalFootprint' namespace instead (e.g., EnvironmentalFootprint.v1). + */ +export { EnvironmentalFootprintv1alpha1 } +export const EnvironmentalFootprint = { + v1alpha1: EnvironmentalFootprintv1alpha1, +} + /** * @deprecated Direct version exports are deprecated. Use the 'File' namespace instead (e.g., File.v1). */ diff --git a/packages_generated/environmental_footprint/package.json b/packages_generated/environmental_footprint/package.json new file mode 100644 index 000000000..9ca437042 --- /dev/null +++ b/packages_generated/environmental_footprint/package.json @@ -0,0 +1,48 @@ +{ + "name": "@scaleway/sdk-environmental-footprint", + "version": "1.0.0", + "description": "Scaleway SDK environmental-footprint", + "license": "Apache-2.0", + "files": [ + "dist" + ], + "type": "module", + "exports": { + ".": { + "types": "./dist/index.gen.d.ts", + "import": "./dist/index.gen.js", + "require": "./dist/index.gen.cjs", + "default": "./dist/index.gen.js" + }, + "./*": { + "types": "./dist/*/index.gen.d.ts", + "import": "./dist/*/index.gen.js", + "require": "./dist/*/index.gen.cjs", + "default": "./dist/*/index.gen.js" + } + }, + "repository": { + "type": "git", + "directory": "packages_generated/environmental-footprint" + }, + "engines": { + "node": ">=20.18.3" + }, + "scripts": { + "package:check": "pnpm publint", + "typecheck": "tsc --noEmit", + "type:generate": "tsc --declaration -p tsconfig.build.json", + "build": "vite build --config vite.config.ts && pnpm run type:generate", + "build:profile": "npx vite-bundle-visualizer -c vite.config.ts" + }, + "dependencies": { + "@scaleway/sdk-std": "workspace:*", + "@scaleway/random-name": "5.1.1" + }, + "peerDependencies": { + "@scaleway/sdk-client": "workspace:^" + }, + "devDependencies": { + "@scaleway/sdk-client": "workspace:^" + } +} \ No newline at end of file diff --git a/packages_generated/environmental_footprint/tsconfig.build.json b/packages_generated/environmental_footprint/tsconfig.build.json new file mode 100644 index 000000000..19ca82000 --- /dev/null +++ b/packages_generated/environmental_footprint/tsconfig.build.json @@ -0,0 +1,17 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "noEmit": false, + "emitDeclarationOnly": true, + "rootDir": "src", + "outDir": "dist" + }, + "exclude": [ + "dist/*", + "*.config.ts", + "*.setup.ts", + "**/__tests__", + "**/__mocks__", + "src/**/*.test.tsx" + ] +} diff --git a/packages_generated/environmental_footprint/tsconfig.json b/packages_generated/environmental_footprint/tsconfig.json new file mode 100644 index 000000000..7c2b0759a --- /dev/null +++ b/packages_generated/environmental_footprint/tsconfig.json @@ -0,0 +1,4 @@ +{ + "extends": "../../tsconfig.json", + "include": ["src/**/*.ts", "src/**/*.tsx", "*.config.ts"] +} diff --git a/packages_generated/environmental_footprint/vite.config.ts b/packages_generated/environmental_footprint/vite.config.ts new file mode 100644 index 000000000..5c0513828 --- /dev/null +++ b/packages_generated/environmental_footprint/vite.config.ts @@ -0,0 +1,14 @@ +/* eslint-disable eslint-comments/disable-enable-pair */ +/* eslint-disable import/no-default-export */ +/* eslint-disable import/no-relative-packages */ +/* eslint-disable import/no-extraneous-dependencies */ +import { defineConfig, mergeConfig } from 'vite' +import { defaultConfig } from '../../vite.config' + +export default mergeConfig(defineConfig(defaultConfig), { + build: { + lib: { + entry: 'src/index.gen.ts', + }, + }, +}) From 4ef3ccf3fa7ac2501c6ae13c728f17b637f34d7a Mon Sep 17 00:00:00 2001 From: Jonathan Remy Date: Tue, 30 Sep 2025 15:26:19 +0200 Subject: [PATCH 3/5] chore: add pnpml-lock --- pnpm-lock.yaml | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index b7157b04b..15518808e 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -413,6 +413,19 @@ importers: specifier: workspace:^ version: link:../../packages/client + packages_generated/environmental_footprint: + dependencies: + '@scaleway/random-name': + specifier: 5.1.1 + version: 5.1.1 + '@scaleway/sdk-std': + specifier: workspace:* + version: link:../std + devDependencies: + '@scaleway/sdk-client': + specifier: workspace:^ + version: link:../../packages/client + packages_generated/file: dependencies: '@scaleway/random-name': From f4fc5ae8a054a7ee7758fded839f7ba23775e9da Mon Sep 17 00:00:00 2001 From: Jonathan Remy Date: Tue, 30 Sep 2025 15:34:41 +0200 Subject: [PATCH 4/5] chore: add package.json sdk --- packages/sdk/package.json | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/sdk/package.json b/packages/sdk/package.json index 62dbae37a..3cb17af40 100644 --- a/packages/sdk/package.json +++ b/packages/sdk/package.json @@ -45,6 +45,7 @@ "@scaleway/sdk-dedibox": "workspace:*", "@scaleway/sdk-domain": "workspace:*", "@scaleway/sdk-edge-services": "workspace:*", + "@scaleway/sdk-environmental-footprint": "workspace:*", "@scaleway/sdk-file": "workspace:*", "@scaleway/sdk-flexibleip": "workspace:*", "@scaleway/sdk-function": "workspace:*", From b4916a737df67f647a0d80b0d1e55b940a52ab19 Mon Sep 17 00:00:00 2001 From: Jonathan Remy Date: Tue, 30 Sep 2025 15:35:57 +0200 Subject: [PATCH 5/5] chore: add pnpm lock --- pnpm-lock.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 15518808e..71dfa57c9 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -153,6 +153,9 @@ importers: '@scaleway/sdk-edge-services': specifier: workspace:* version: link:../../packages_generated/edge_services + '@scaleway/sdk-environmental-footprint': + specifier: workspace:* + version: link:../../packages_generated/environmental_footprint '@scaleway/sdk-file': specifier: workspace:* version: link:../../packages_generated/file