Path: blob/main/src/publish/netlify/api/services/DnsZoneService.ts
6464 views
/* istanbul ignore file */1/* tslint:disable */2/* eslint-disable */3import type { CancelablePromise } from "../core/CancelablePromise.ts";4import type { BaseHttpRequest } from "../core/BaseHttpRequest.ts";56export class DnsZoneService {7constructor(public readonly httpRequest: BaseHttpRequest) {}89/**10* @returns any OK11* @throws ApiError12*/13public getDnsForSite({14siteId,15}: {16siteId: string;17}): CancelablePromise<18Array<{19id?: string;20name?: string;21errors?: Array<string>;22supported_record_types?: Array<string>;23user_id?: string;24created_at?: string;25updated_at?: string;26records?: Array<{27id?: string;28hostname?: string;29type?: string;30value?: string;31ttl?: number;32priority?: number;33dns_zone_id?: string;34site_id?: string;35flag?: number;36tag?: string;37managed?: boolean;38}>;39dns_servers?: Array<string>;40account_id?: string;41site_id?: string;42account_slug?: string;43account_name?: string;44domain?: string;45ipv6_enabled?: boolean;46dedicated?: boolean;47}>48> {49return this.httpRequest.request({50method: "GET",51url: "/sites/{site_id}/dns",52path: {53"site_id": siteId,54},55});56}5758/**59* @returns any OK60* @throws ApiError61*/62public configureDnsForSite({63siteId,64}: {65siteId: string;66}): CancelablePromise<67Array<{68id?: string;69name?: string;70errors?: Array<string>;71supported_record_types?: Array<string>;72user_id?: string;73created_at?: string;74updated_at?: string;75records?: Array<{76id?: string;77hostname?: string;78type?: string;79value?: string;80ttl?: number;81priority?: number;82dns_zone_id?: string;83site_id?: string;84flag?: number;85tag?: string;86managed?: boolean;87}>;88dns_servers?: Array<string>;89account_id?: string;90site_id?: string;91account_slug?: string;92account_name?: string;93domain?: string;94ipv6_enabled?: boolean;95dedicated?: boolean;96}>97> {98return this.httpRequest.request({99method: "PUT",100url: "/sites/{site_id}/dns",101path: {102"site_id": siteId,103},104});105}106107/**108* @returns any error109* @throws ApiError110*/111public createDnsZone({112dnsZoneParams,113}: {114dnsZoneParams: {115account_slug?: string;116site_id?: string;117name?: string;118};119}): CancelablePromise<{120code?: number;121message: string;122}> {123return this.httpRequest.request({124method: "POST",125url: "/dns_zones",126body: dnsZoneParams,127});128}129130/**131* @returns any get all DNS zones the user has access to132* @throws ApiError133*/134public getDnsZones({135accountSlug,136}: {137accountSlug?: string;138}): CancelablePromise<139Array<{140id?: string;141name?: string;142errors?: Array<string>;143supported_record_types?: Array<string>;144user_id?: string;145created_at?: string;146updated_at?: string;147records?: Array<{148id?: string;149hostname?: string;150type?: string;151value?: string;152ttl?: number;153priority?: number;154dns_zone_id?: string;155site_id?: string;156flag?: number;157tag?: string;158managed?: boolean;159}>;160dns_servers?: Array<string>;161account_id?: string;162site_id?: string;163account_slug?: string;164account_name?: string;165domain?: string;166ipv6_enabled?: boolean;167dedicated?: boolean;168}>169> {170return this.httpRequest.request({171method: "GET",172url: "/dns_zones",173query: {174"account_slug": accountSlug,175},176});177}178179/**180* @returns any get a single DNS zone181* @throws ApiError182*/183public getDnsZone({184zoneId,185}: {186zoneId: string;187}): CancelablePromise<{188id?: string;189name?: string;190errors?: Array<string>;191supported_record_types?: Array<string>;192user_id?: string;193created_at?: string;194updated_at?: string;195records?: Array<{196id?: string;197hostname?: string;198type?: string;199value?: string;200ttl?: number;201priority?: number;202dns_zone_id?: string;203site_id?: string;204flag?: number;205tag?: string;206managed?: boolean;207}>;208dns_servers?: Array<string>;209account_id?: string;210site_id?: string;211account_slug?: string;212account_name?: string;213domain?: string;214ipv6_enabled?: boolean;215dedicated?: boolean;216}> {217return this.httpRequest.request({218method: "GET",219url: "/dns_zones/{zone_id}",220path: {221"zone_id": zoneId,222},223});224}225226/**227* @returns any error228* @throws ApiError229*/230public deleteDnsZone({231zoneId,232}: {233zoneId: string;234}): CancelablePromise<{235code?: number;236message: string;237}> {238return this.httpRequest.request({239method: "DELETE",240url: "/dns_zones/{zone_id}",241path: {242"zone_id": zoneId,243},244});245}246247/**248* @returns any transfer a DNS zone to another account249* @throws ApiError250*/251public transferDnsZone({252zoneId,253accountId,254transferAccountId,255transferUserId,256}: {257zoneId: string;258/** the account of the dns zone **/259accountId: string;260/** the account you want to transfer the dns zone to **/261transferAccountId: string;262/** the user you want to transfer the dns zone to **/263transferUserId: string;264}): CancelablePromise<{265id?: string;266name?: string;267errors?: Array<string>;268supported_record_types?: Array<string>;269user_id?: string;270created_at?: string;271updated_at?: string;272records?: Array<{273id?: string;274hostname?: string;275type?: string;276value?: string;277ttl?: number;278priority?: number;279dns_zone_id?: string;280site_id?: string;281flag?: number;282tag?: string;283managed?: boolean;284}>;285dns_servers?: Array<string>;286account_id?: string;287site_id?: string;288account_slug?: string;289account_name?: string;290domain?: string;291ipv6_enabled?: boolean;292dedicated?: boolean;293}> {294return this.httpRequest.request({295method: "PUT",296url: "/dns_zones/{zone_id}/transfer",297path: {298"zone_id": zoneId,299},300query: {301"account_id": accountId,302"transfer_account_id": transferAccountId,303"transfer_user_id": transferUserId,304},305});306}307308/**309* @returns any get all DNS records for a single DNS zone310* @throws ApiError311*/312public getDnsRecords({313zoneId,314}: {315zoneId: string;316}): CancelablePromise<317Array<{318id?: string;319hostname?: string;320type?: string;321value?: string;322ttl?: number;323priority?: number;324dns_zone_id?: string;325site_id?: string;326flag?: number;327tag?: string;328managed?: boolean;329}>330> {331return this.httpRequest.request({332method: "GET",333url: "/dns_zones/{zone_id}/dns_records",334path: {335"zone_id": zoneId,336},337});338}339340/**341* @returns any error342* @throws ApiError343*/344public createDnsRecord({345zoneId,346dnsRecord,347}: {348zoneId: string;349dnsRecord: {350type?: string;351hostname?: string;352value?: string;353ttl?: number;354priority?: number;355weight?: number;356port?: number;357flag?: number;358tag?: string;359};360}): CancelablePromise<{361code?: number;362message: string;363}> {364return this.httpRequest.request({365method: "POST",366url: "/dns_zones/{zone_id}/dns_records",367path: {368"zone_id": zoneId,369},370body: dnsRecord,371});372}373374/**375* @returns any get a single DNS record376* @throws ApiError377*/378public getIndividualDnsRecord({379zoneId,380dnsRecordId,381}: {382zoneId: string;383dnsRecordId: string;384}): CancelablePromise<{385id?: string;386hostname?: string;387type?: string;388value?: string;389ttl?: number;390priority?: number;391dns_zone_id?: string;392site_id?: string;393flag?: number;394tag?: string;395managed?: boolean;396}> {397return this.httpRequest.request({398method: "GET",399url: "/dns_zones/{zone_id}/dns_records/{dns_record_id}",400path: {401"zone_id": zoneId,402"dns_record_id": dnsRecordId,403},404});405}406407/**408* @returns any error409* @throws ApiError410*/411public deleteDnsRecord({412zoneId,413dnsRecordId,414}: {415zoneId: string;416dnsRecordId: string;417}): CancelablePromise<{418code?: number;419message: string;420}> {421return this.httpRequest.request({422method: "DELETE",423url: "/dns_zones/{zone_id}/dns_records/{dns_record_id}",424path: {425"zone_id": zoneId,426"dns_record_id": dnsRecordId,427},428});429}430}431432433