Skip to content

Commit 3ecdca1

Browse files
authored
feat(webhosting): add domain configuration (#1173)
1 parent 72e87a3 commit 3ecdca1

File tree

3 files changed

+31
-0
lines changed

3 files changed

+31
-0
lines changed

packages/clients/src/api/webhosting/v1alpha1/index.gen.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ export * from './content.gen'
55
export type {
66
ControlPanel,
77
CreateHostingRequest,
8+
CreateHostingRequestDomainConfiguration,
89
DeleteHostingRequest,
910
DnsRecord,
1011
DnsRecordStatus,

packages/clients/src/api/webhosting/v1alpha1/marshalling.gen.ts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import type { DefaultValues } from '../../../bridge'
1010
import type {
1111
ControlPanel,
1212
CreateHostingRequest,
13+
CreateHostingRequestDomainConfiguration,
1314
DnsRecord,
1415
DnsRecords,
1516
Hosting,
@@ -231,11 +232,28 @@ export const unmarshalListOffersResponse = (
231232
} as ListOffersResponse
232233
}
233234

235+
const marshalCreateHostingRequestDomainConfiguration = (
236+
request: CreateHostingRequestDomainConfiguration,
237+
defaults: DefaultValues,
238+
): Record<string, unknown> => ({
239+
update_all_records: request.updateAllRecords,
240+
update_mail_record: request.updateMailRecord,
241+
update_nameservers: request.updateNameservers,
242+
update_web_record: request.updateWebRecord,
243+
})
244+
234245
export const marshalCreateHostingRequest = (
235246
request: CreateHostingRequest,
236247
defaults: DefaultValues,
237248
): Record<string, unknown> => ({
238249
domain: request.domain,
250+
domain_configuration:
251+
request.domainConfiguration !== undefined
252+
? marshalCreateHostingRequestDomainConfiguration(
253+
request.domainConfiguration,
254+
defaults,
255+
)
256+
: undefined,
239257
email: request.email,
240258
language: request.language,
241259
offer_id: request.offerId,

packages/clients/src/api/webhosting/v1alpha1/types.gen.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,13 @@ export interface OfferProduct {
7474
maxAddonDomains: number
7575
}
7676

77+
export interface CreateHostingRequestDomainConfiguration {
78+
updateNameservers: boolean
79+
updateWebRecord: boolean
80+
updateMailRecord: boolean
81+
updateAllRecords: boolean
82+
}
83+
7784
export interface DnsRecord {
7885
/** Record name. */
7986
name: string
@@ -199,6 +206,11 @@ export type CreateHostingRequest = {
199206
optionIds?: string[]
200207
/** Default language for the control panel interface. */
201208
language?: StdLanguageCode
209+
/**
210+
* Indicates whether to update hosting domain name servers and DNS records for
211+
* domains managed by Scaleway Elements.
212+
*/
213+
domainConfiguration?: CreateHostingRequestDomainConfiguration
202214
}
203215

204216
export type DeleteHostingRequest = {

0 commit comments

Comments
 (0)