Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions packages_generated/webhosting/src/v1/api.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -644,6 +644,7 @@ export class HostingAPI extends ParentAPI {
],
['project_id', request.projectId],
['statuses', request.statuses],
['subdomain', request.subdomain],
['tags', request.tags],
),
},
Expand Down
2 changes: 2 additions & 0 deletions packages_generated/webhosting/src/v1/index.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@ export type {
HostingApiListHostingsRequest,
HostingApiResetHostingPasswordRequest,
HostingApiUpdateHostingRequest,
HostingDomain,
HostingDomainCustomDomain,
HostingStatus,
HostingSummary,
HostingUser,
Expand Down
47 changes: 45 additions & 2 deletions packages_generated/webhosting/src/v1/marshalling.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ import type {
Hosting,
HostingApiCreateHostingRequest,
HostingApiUpdateHostingRequest,
HostingDomain,
HostingDomainCustomDomain,
HostingSummary,
HostingUser,
ListControlPanelsResponse,
Expand Down Expand Up @@ -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(
Expand Down Expand Up @@ -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(
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
})

Expand Down
108 changes: 77 additions & 31 deletions packages_generated/webhosting/src/v1/types.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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.
Expand Down Expand Up @@ -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 {
Expand Down Expand Up @@ -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.
*/
Expand All @@ -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 {
Expand Down Expand Up @@ -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.
*/
Expand All @@ -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
/**
Expand All @@ -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 = {
Expand Down Expand Up @@ -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.
*/
Expand Down Expand Up @@ -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 = {
Expand Down
Loading