@@ -15,15 +15,18 @@ import {
1515 marshalDatabaseApiCreateDatabaseRequest ,
1616 marshalDatabaseApiCreateDatabaseUserRequest ,
1717 marshalDatabaseApiUnassignDatabaseUserRequest ,
18+ marshalDnsApiCheckUserOwnsDomainRequest ,
1819 marshalFtpAccountApiChangeFtpAccountPasswordRequest ,
1920 marshalFtpAccountApiCreateFtpAccountRequest ,
2021 marshalHostingApiCreateHostingRequest ,
2122 marshalHostingApiUpdateHostingRequest ,
2223 marshalMailAccountApiChangeMailAccountPasswordRequest ,
2324 marshalMailAccountApiCreateMailAccountRequest ,
2425 marshalMailAccountApiRemoveMailAccountRequest ,
26+ unmarshalCheckUserOwnsDomainResponse ,
2527 unmarshalDatabase ,
2628 unmarshalDatabaseUser ,
29+ unmarshalDnsRecords ,
2730 unmarshalFtpAccount ,
2831 unmarshalHosting ,
2932 unmarshalListControlPanelsResponse ,
@@ -40,6 +43,7 @@ import {
4043 unmarshalSession ,
4144} from './marshalling.gen'
4245import type {
46+ CheckUserOwnsDomainResponse ,
4347 ControlPanelApiListControlPanelsRequest ,
4448 Database ,
4549 DatabaseApiAssignDatabaseUserRequest ,
@@ -54,6 +58,9 @@ import type {
5458 DatabaseApiListDatabasesRequest ,
5559 DatabaseApiUnassignDatabaseUserRequest ,
5660 DatabaseUser ,
61+ DnsApiCheckUserOwnsDomainRequest ,
62+ DnsApiGetDomainDnsRecordsRequest ,
63+ DnsRecords ,
5764 FtpAccount ,
5865 FtpAccountApiChangeFtpAccountPasswordRequest ,
5966 FtpAccountApiCreateFtpAccountRequest ,
@@ -93,13 +100,13 @@ const jsonContentHeaders = {
93100}
94101
95102/**
96- * Web Hosting API.
103+ * Web Hosting Control Panel API.
97104 *
98105 * This API allows you to manage your Web Hosting services.
99106 */
100107export class ControlPanelAPI extends ParentAPI {
101108 /** Lists the available regions of the API. */
102- public static readonly LOCALITIES : Region [ ] = [ 'fr-par' , 'nl-ams' ]
109+ public static readonly LOCALITIES : Region [ ] = [ 'fr-par' , 'nl-ams' , 'pl-waw' ]
103110
104111 protected pageOfListControlPanels = (
105112 request : Readonly < ControlPanelApiListControlPanelsRequest > = { } ,
@@ -380,6 +387,54 @@ export class DatabaseAPI extends ParentAPI {
380387 )
381388}
382389
390+ /**
391+ * Web Hosting Dns API.
392+ *
393+ * This API allows you to manage your Web Hosting services.
394+ */
395+ export class DnsAPI extends ParentAPI {
396+ /** Lists the available regions of the API. */
397+ public static readonly LOCALITIES : Region [ ] = [ 'fr-par' , 'nl-ams' , 'pl-waw' ]
398+
399+ /**
400+ * Get DNS records. Get the set of DNS records of a specified domain
401+ * associated with a Web Hosting plan's domain.
402+ *
403+ * @param request - The request {@link DnsApiGetDomainDnsRecordsRequest}
404+ * @returns A Promise of DnsRecords
405+ */
406+ getDomainDnsRecords = ( request : Readonly < DnsApiGetDomainDnsRecordsRequest > ) =>
407+ this . client . fetch < DnsRecords > (
408+ {
409+ method : 'GET' ,
410+ path : `/webhosting/v1/regions/${ validatePathParam ( 'region' , request . region ?? this . client . settings . defaultRegion ) } /domains/${ validatePathParam ( 'domain' , request . domain ) } /dns-records` ,
411+ } ,
412+ unmarshalDnsRecords ,
413+ )
414+
415+ /**
416+ * "Check whether you own this domain or not.".
417+ *
418+ * @param request - The request {@link DnsApiCheckUserOwnsDomainRequest}
419+ * @returns A Promise of CheckUserOwnsDomainResponse
420+ */
421+ checkUserOwnsDomain = ( request : Readonly < DnsApiCheckUserOwnsDomainRequest > ) =>
422+ this . client . fetch < CheckUserOwnsDomainResponse > (
423+ {
424+ body : JSON . stringify (
425+ marshalDnsApiCheckUserOwnsDomainRequest (
426+ request ,
427+ this . client . settings ,
428+ ) ,
429+ ) ,
430+ headers : jsonContentHeaders ,
431+ method : 'POST' ,
432+ path : `/webhosting/v1/regions/${ validatePathParam ( 'region' , request . region ?? this . client . settings . defaultRegion ) } /domains/${ validatePathParam ( 'domain' , request . domain ) } /check-ownership` ,
433+ } ,
434+ unmarshalCheckUserOwnsDomainResponse ,
435+ )
436+ }
437+
383438/**
384439 * Web Hosting Offer API.
385440 *
@@ -428,7 +483,7 @@ export class OfferAPI extends ParentAPI {
428483 */
429484export class HostingAPI extends ParentAPI {
430485 /** Lists the available regions of the API. */
431- public static readonly LOCALITIES : Region [ ] = [ 'fr-par' , 'nl-ams' ]
486+ public static readonly LOCALITIES : Region [ ] = [ 'fr-par' , 'nl-ams' , 'pl-waw' ]
432487
433488 /**
434489 * Order a Web Hosting plan. Order a Web Hosting plan, specifying the offer
0 commit comments