diff --git a/packages_generated/webhosting/src/v1/api.gen.ts b/packages_generated/webhosting/src/v1/api.gen.ts index bd9c486ad..a0a3562b0 100644 --- a/packages_generated/webhosting/src/v1/api.gen.ts +++ b/packages_generated/webhosting/src/v1/api.gen.ts @@ -644,6 +644,7 @@ export class HostingAPI extends ParentAPI { ], ['project_id', request.projectId], ['statuses', request.statuses], + ['subdomain', request.subdomain], ['tags', request.tags], ), }, diff --git a/packages_generated/webhosting/src/v1/index.gen.ts b/packages_generated/webhosting/src/v1/index.gen.ts index dc38e03fd..b1203d752 100644 --- a/packages_generated/webhosting/src/v1/index.gen.ts +++ b/packages_generated/webhosting/src/v1/index.gen.ts @@ -64,6 +64,8 @@ export type { HostingApiListHostingsRequest, HostingApiResetHostingPasswordRequest, HostingApiUpdateHostingRequest, + HostingDomain, + HostingDomainCustomDomain, HostingStatus, HostingSummary, HostingUser, diff --git a/packages_generated/webhosting/src/v1/marshalling.gen.ts b/packages_generated/webhosting/src/v1/marshalling.gen.ts index c2650fc37..257a28746 100644 --- a/packages_generated/webhosting/src/v1/marshalling.gen.ts +++ b/packages_generated/webhosting/src/v1/marshalling.gen.ts @@ -34,6 +34,8 @@ import type { Hosting, HostingApiCreateHostingRequest, HostingApiUpdateHostingRequest, + HostingDomain, + HostingDomainCustomDomain, HostingSummary, HostingUser, ListControlPanelsResponse, @@ -232,6 +234,25 @@ const unmarshalPlatformControlPanelUrls = ( } as PlatformControlPanelUrls } +const unmarshalHostingDomainCustomDomain = ( + data: unknown, +): HostingDomainCustomDomain => { + if (!isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'HostingDomainCustomDomain' failed as data isn't a dictionary.`, + ) + } + + return { + autoConfigDomainDns: data.auto_config_domain_dns + ? unmarshalAutoConfigDomainDns(data.auto_config_domain_dns) + : undefined, + dnsStatus: data.dns_status, + domain: data.domain, + domainStatus: data.domain_status, + } as HostingDomainCustomDomain +} + const unmarshalOfferOption = (data: unknown): OfferOption => { if (!isJSONObject(data)) { throw new TypeError( @@ -264,6 +285,21 @@ const unmarshalPlatformControlPanel = (data: unknown): PlatformControlPanel => { } as PlatformControlPanel } +const unmarshalHostingDomain = (data: unknown): HostingDomain => { + if (!isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'HostingDomain' failed as data isn't a dictionary.`, + ) + } + + return { + customDomain: data.custom_domain + ? unmarshalHostingDomainCustomDomain(data.custom_domain) + : undefined, + subdomain: data.subdomain, + } as HostingDomain +} + const unmarshalHostingUser = (data: unknown): HostingUser => { if (!isJSONObject(data)) { throw new TypeError( @@ -329,7 +365,10 @@ export const unmarshalHosting = (data: unknown): Hosting => { createdAt: unmarshalDate(data.created_at), dnsStatus: data.dns_status ? data.dns_status : undefined, domain: data.domain, - domainStatus: data.domain_status, + domainInfo: data.domain_info + ? unmarshalHostingDomain(data.domain_info) + : undefined, + domainStatus: data.domain_status ? data.domain_status : undefined, id: data.id, ipv4: data.ipv4, offer: data.offer ? unmarshalOffer(data.offer) : undefined, @@ -433,7 +472,10 @@ const unmarshalHostingSummary = (data: unknown): HostingSummary => { createdAt: unmarshalDate(data.created_at), dnsStatus: data.dns_status ? data.dns_status : undefined, domain: data.domain, - domainStatus: data.domain_status, + domainInfo: data.domain_info + ? unmarshalHostingDomain(data.domain_info) + : undefined, + domainStatus: data.domain_status ? data.domain_status : undefined, id: data.id, offerName: data.offer_name, projectId: data.project_id, @@ -758,6 +800,7 @@ export const marshalHostingApiCreateHostingRequest = ( : undefined, project_id: request.projectId ?? defaults.defaultProjectId, skip_welcome_email: request.skipWelcomeEmail, + subdomain: request.subdomain, tags: request.tags, }) diff --git a/packages_generated/webhosting/src/v1/types.gen.ts b/packages_generated/webhosting/src/v1/types.gen.ts index 780dc3524..34f60114b 100644 --- a/packages_generated/webhosting/src/v1/types.gen.ts +++ b/packages_generated/webhosting/src/v1/types.gen.ts @@ -110,6 +110,29 @@ export type OfferOptionWarning = export type PlatformPlatformGroup = 'unknown_group' | 'default' | 'premium' +export interface AutoConfigDomainDns { + /** + * Whether or not to synchronize domain nameservers. + */ + nameservers: boolean + /** + * Whether or not to synchronize web records. + */ + webRecords: boolean + /** + * Whether or not to synchronize mail records. + */ + mailRecords: boolean + /** + * Whether or not to synchronize all types of records. Takes priority over the other fields. + */ + allRecords: boolean + /** + * No automatic domain configuration. Users must configure their domain for the Web Hosting to work. + */ + none: boolean +} + export interface PlatformControlPanelUrls { /** * URL to connect to the hosting control panel dashboard. @@ -121,6 +144,25 @@ export interface PlatformControlPanelUrls { webmail: string } +export interface HostingDomainCustomDomain { + /** + * Custom domain linked to the hosting plan. + */ + domain: string + /** + * Status of the custom domain verification. + */ + domainStatus: DomainStatus + /** + * Status of the DNS configuration for the custom domain. + */ + dnsStatus: DnsRecordsStatus + /** + * Indicates whether to auto-configure DNS for this domain. + */ + autoConfigDomainDns?: AutoConfigDomainDns +} + export interface OfferOption { /** * Option ID. @@ -167,32 +209,20 @@ export interface PlatformControlPanel { urls?: PlatformControlPanelUrls } -export interface CreateDatabaseRequestUser { - username: string - password: string -} - -export interface AutoConfigDomainDns { - /** - * Whether or not to synchronize domain nameservers. - */ - nameservers: boolean - /** - * Whether or not to synchronize web records. - */ - webRecords: boolean - /** - * Whether or not to synchronize mail records. - */ - mailRecords: boolean +export interface HostingDomain { /** - * Whether or not to synchronize all types of records. Takes priority over the other fields. + * Optional free subdomain linked to the Web Hosting plan. */ - allRecords: boolean + subdomain: string /** - * No automatic domain configuration. Users must configure their domain for the Web Hosting to work. + * Optional custom domain linked to the Web Hosting plan. */ - none: boolean + customDomain?: HostingDomainCustomDomain +} + +export interface CreateDatabaseRequestUser { + username: string + password: string } export interface CreateHostingRequestDomainConfiguration { @@ -423,9 +453,9 @@ export interface HostingSummary { */ status: HostingStatus /** - * Main domain associated with the Web Hosting plan. + * @deprecated Main domain associated with the Web Hosting plan (deprecated, use domain_info). */ - domain: string + domain?: string /** * Whether the hosting is protected or not. */ @@ -439,13 +469,17 @@ export interface HostingSummary { */ offerName: string /** - * Main domain status of the Web Hosting plan. + * @deprecated Main domain status of the Web Hosting plan. */ - domainStatus: DomainStatus + domainStatus?: DomainStatus /** * Region where the Web Hosting plan is hosted. */ region: ScwRegion + /** + * Domain configuration block (subdomain, optional custom domain, and DNS settings). + */ + domainInfo?: HostingDomain } export interface MailAccount { @@ -983,9 +1017,9 @@ export interface Hosting { */ status: HostingStatus /** - * Main domain associated with the Web Hosting plan. + * @deprecated Main domain associated with the Web Hosting plan (deprecated, use domain_info). */ - domain: string + domain?: string /** * Details of the Web Hosting plan offer and options. */ @@ -999,7 +1033,7 @@ export interface Hosting { */ tags: string[] /** - * @deprecated DNS status of the Web Hosting plan. + * @deprecated DNS status of the Web Hosting plan (deprecated, use domain_info). */ dnsStatus?: DnsRecordsStatus /** @@ -1015,13 +1049,17 @@ export interface Hosting { */ user?: HostingUser /** - * Main domain status of the Web Hosting plan. + * @deprecated Main domain status of the Web Hosting plan (deprecated, use domain_info). */ - domainStatus: DomainStatus + domainStatus?: DomainStatus /** * Region where the Web Hosting plan is hosted. */ region: ScwRegion + /** + * Domain configuration block (subdomain, optional custom domain, and DNS settings). + */ + domainInfo?: HostingDomain } export type HostingApiCreateHostingRequest = { @@ -1049,6 +1087,10 @@ export type HostingApiCreateHostingRequest = { * Domain name to link to the Web Hosting plan. You must already own this domain name, and have completed the DNS validation process beforehand. */ domain: string + /** + * The name prefix to use as a free subdomain (for example, `mysite`) assigned to the Web Hosting plan. The full domain will be automatically created by adding it to the fixed base domain (e.g. `mysite.scw.site`). You do not need to include the base domain yourself. + */ + subdomain?: string /** * List of the Web Hosting plan options IDs with their quantities. */ @@ -1156,6 +1198,10 @@ export type HostingApiListHostingsRequest = { * Name of the control panel to filter for, only Web Hosting plans from this control panel will be returned. */ controlPanels?: string[] + /** + * Optional free subdomain linked to the Web Hosting plan. + */ + subdomain?: string } export type HostingApiResetHostingPasswordRequest = {