Skip to content

Commit 0689fa6

Browse files
authored
Merge branch 'main' into v1.6235.0
2 parents b36ac2c + db74be4 commit 0689fa6

File tree

2 files changed

+92
-13
lines changed

2 files changed

+92
-13
lines changed

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

Lines changed: 40 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import {
99
} from '../../../bridge'
1010
import type { DefaultValues } from '../../../bridge'
1111
import type {
12+
AutoConfigDomainDns,
1213
CheckUserOwnsDomainResponse,
1314
ControlPanel,
1415
CreateDatabaseRequestUser,
@@ -174,6 +175,21 @@ export const unmarshalDnsRecords = (data: unknown): DnsRecords => {
174175
} as DnsRecords
175176
}
176177

178+
const unmarshalAutoConfigDomainDns = (data: unknown): AutoConfigDomainDns => {
179+
if (!isJSONObject(data)) {
180+
throw new TypeError(
181+
`Unmarshalling the type 'AutoConfigDomainDns' failed as data isn't a dictionary.`,
182+
)
183+
}
184+
185+
return {
186+
allRecords: data.all_records,
187+
mailRecords: data.mail_records,
188+
nameservers: data.nameservers,
189+
webRecords: data.web_records,
190+
} as AutoConfigDomainDns
191+
}
192+
177193
export const unmarshalDomain = (data: unknown): Domain => {
178194
if (!isJSONObject(data)) {
179195
throw new TypeError(
@@ -182,8 +198,13 @@ export const unmarshalDomain = (data: unknown): Domain => {
182198
}
183199

184200
return {
201+
autoConfigDomainDns: data.auto_config_domain_dns
202+
? unmarshalAutoConfigDomainDns(data.auto_config_domain_dns)
203+
: undefined,
185204
availableActions: data.available_actions,
186-
availableDnsActions: data.available_dns_actions,
205+
availableDnsActions: data.available_dns_actions
206+
? data.available_dns_actions
207+
: undefined,
187208
name: data.name,
188209
owner: data.owner,
189210
status: data.status,
@@ -629,6 +650,16 @@ export const marshalDnsApiCheckUserOwnsDomainRequest = (
629650
project_id: request.projectId ?? defaults.defaultProjectId,
630651
})
631652

653+
const marshalAutoConfigDomainDns = (
654+
request: AutoConfigDomainDns,
655+
defaults: DefaultValues,
656+
): Record<string, unknown> => ({
657+
all_records: request.allRecords,
658+
mail_records: request.mailRecords,
659+
nameservers: request.nameservers,
660+
web_records: request.webRecords,
661+
})
662+
632663
const marshalSyncDomainDnsRecordsRequestRecord = (
633664
request: SyncDomainDnsRecordsRequestRecord,
634665
defaults: DefaultValues,
@@ -641,6 +672,10 @@ export const marshalDnsApiSyncDomainDnsRecordsRequest = (
641672
request: DnsApiSyncDomainDnsRecordsRequest,
642673
defaults: DefaultValues,
643674
): Record<string, unknown> => ({
675+
auto_config_domain_dns:
676+
request.autoConfigDomainDns !== undefined
677+
? marshalAutoConfigDomainDns(request.autoConfigDomainDns, defaults)
678+
: undefined,
644679
custom_records:
645680
request.customRecords !== undefined
646681
? request.customRecords.map(elt =>
@@ -691,6 +726,10 @@ export const marshalHostingApiCreateHostingRequest = (
691726
request: HostingApiCreateHostingRequest,
692727
defaults: DefaultValues,
693728
): Record<string, unknown> => ({
729+
auto_config_domain_dns:
730+
request.autoConfigDomainDns !== undefined
731+
? marshalAutoConfigDomainDns(request.autoConfigDomainDns, defaults)
732+
: undefined,
694733
domain: request.domain,
695734
domain_configuration:
696735
request.domainConfiguration !== undefined

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

Lines changed: 52 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,20 @@ export interface CreateDatabaseRequestUser {
150150
password: string
151151
}
152152

153+
export interface AutoConfigDomainDns {
154+
/** Whether or not to synchronize domain nameservers. */
155+
nameservers: boolean
156+
/** Whether or not to synchronize web records. */
157+
webRecords: boolean
158+
/** Whether or not to synchronize mail records. */
159+
mailRecords: boolean
160+
/**
161+
* Whether or not to synchronize all types of records. Takes priority over the
162+
* other fields.
163+
*/
164+
allRecords: boolean
165+
}
166+
153167
export interface CreateHostingRequestDomainConfiguration {
154168
updateNameservers: boolean
155169
updateWebRecord: boolean
@@ -586,16 +600,30 @@ export type DnsApiSyncDomainDnsRecordsRequest = {
586600
region?: ScwRegion
587601
/** Domain for which the DNS records will be synchronized. */
588602
domain: string
589-
/** Whether or not to synchronize the web records. */
590-
updateWebRecords: boolean
591-
/** Whether or not to synchronize the mail records. */
592-
updateMailRecords: boolean
593-
/** Whether or not to synchronize all types of records. This one has priority. */
594-
updateAllRecords: boolean
595-
/** Whether or not to synchronize domain nameservers. */
596-
updateNameservers: boolean
603+
/**
604+
* @deprecated Whether or not to synchronize the web records (deprecated, use
605+
* auto_config_domain_dns).
606+
*/
607+
updateWebRecords?: boolean
608+
/**
609+
* @deprecated Whether or not to synchronize the mail records (deprecated, use
610+
* auto_config_domain_dns).
611+
*/
612+
updateMailRecords?: boolean
613+
/**
614+
* @deprecated Whether or not to synchronize all types of records. This one
615+
* has priority (deprecated, use auto_config_domain_dns).
616+
*/
617+
updateAllRecords?: boolean
618+
/**
619+
* @deprecated Whether or not to synchronize domain nameservers (deprecated,
620+
* use auto_config_domain_dns).
621+
*/
622+
updateNameservers?: boolean
597623
/** Custom records to synchronize. */
598624
customRecords?: SyncDomainDnsRecordsRequestRecord[]
625+
/** Whether or not to synchronize each types of records. */
626+
autoConfigDomainDns?: AutoConfigDomainDns
599627
}
600628

601629
export interface DnsRecords {
@@ -618,8 +646,13 @@ export interface Domain {
618646
owner: DomainZoneOwner
619647
/** A list of actions that can be performed on the domain. */
620648
availableActions: DomainAction[]
621-
/** A list of DNS-related actions that can be auto configured for the domain. */
622-
availableDnsActions: DomainDnsAction[]
649+
/**
650+
* @deprecated A list of DNS-related actions that can be auto configured for
651+
* the domain (deprecated, use auto_config_domain_dns instead).
652+
*/
653+
availableDnsActions?: DomainDnsAction[]
654+
/** Whether or not to synchronize each type of record. */
655+
autoConfigDomainDns?: AutoConfigDomainDns
623656
}
624657

625658
export type FtpAccountApiChangeFtpAccountPasswordRequest = {
@@ -742,15 +775,22 @@ export type HostingApiCreateHostingRequest = {
742775
/** Default language for the control panel interface. */
743776
language?: StdLanguageCode
744777
/**
745-
* Indicates whether to update hosting domain name servers and DNS records for
746-
* domains managed by Scaleway Elements.
778+
* @deprecated Indicates whether to update hosting domain name servers and DNS
779+
* records for domains managed by Scaleway Elements (deprecated, use
780+
* auto_config_domain_dns instead).
747781
*/
748782
domainConfiguration?: CreateHostingRequestDomainConfiguration
749783
/**
750784
* Indicates whether to skip a welcome email to the contact email containing
751785
* hosting info.
752786
*/
753787
skipWelcomeEmail?: boolean
788+
/**
789+
* Indicates whether to update hosting domain name servers and DNS records for
790+
* domains managed by Scaleway Elements (deprecated, use auto_update_* fields
791+
* instead).
792+
*/
793+
autoConfigDomainDns?: AutoConfigDomainDns
754794
}
755795

756796
export type HostingApiCreateSessionRequest = {

0 commit comments

Comments
 (0)