@vercel/sdk
Version:
<p align="center"> <a href="https://vercel.com"> <img src="https://assets.vercel.com/image/upload/v1588805858/repositories/vercel/logo.png" height="96"> <h3 align="center">Vercel</h3> </a> <p align="center">Develop. Preview. Ship.</p> </p>
109 lines • 3.64 kB
JavaScript
/*
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
import * as z from "zod/v3";
import { remap as remap$ } from "../lib/primitives.js";
import { safeParse } from "../lib/schemas.js";
import * as types from "../types/primitives.js";
/**
* The type of the DNS record
*/
export const UpdateRecordType = {
A: "A",
Aaaa: "AAAA",
Alias: "ALIAS",
Caa: "CAA",
Cname: "CNAME",
Https: "HTTPS",
Mx: "MX",
Srv: "SRV",
Txt: "TXT",
Ns: "NS",
};
export const UpdateRecordDnsType = {
Record: "record",
RecordSys: "record-sys",
};
export const UpdateRecordRecordType = {
A: "A",
Aaaa: "AAAA",
Alias: "ALIAS",
Caa: "CAA",
Cname: "CNAME",
Https: "HTTPS",
Mx: "MX",
Ns: "NS",
Srv: "SRV",
Txt: "TXT",
};
/** @internal */
export const UpdateRecordType$outboundSchema = z.nativeEnum(UpdateRecordType);
/** @internal */
export const Srv$outboundSchema = z
.object({
target: z.nullable(z.string()),
weight: z.nullable(z.number().int()),
port: z.nullable(z.number().int()),
priority: z.nullable(z.number().int()),
});
export function srvToJSON(srv) {
return JSON.stringify(Srv$outboundSchema.parse(srv));
}
/** @internal */
export const Https$outboundSchema = z.object({
priority: z.nullable(z.number().int()),
target: z.nullable(z.string()),
params: z.nullable(z.string()).optional(),
});
export function httpsToJSON(https) {
return JSON.stringify(Https$outboundSchema.parse(https));
}
/** @internal */
export const UpdateRecordRequestBody$outboundSchema = z.object({
name: z.nullable(z.string()).optional(),
value: z.nullable(z.string()).optional(),
type: z.nullable(UpdateRecordType$outboundSchema).optional(),
ttl: z.nullable(z.number().int()).optional(),
mxPriority: z.nullable(z.number().int()).optional(),
srv: z.nullable(z.lazy(() => Srv$outboundSchema)).optional(),
https: z.nullable(z.lazy(() => Https$outboundSchema)).optional(),
comment: z.string().optional(),
});
export function updateRecordRequestBodyToJSON(updateRecordRequestBody) {
return JSON.stringify(UpdateRecordRequestBody$outboundSchema.parse(updateRecordRequestBody));
}
/** @internal */
export const UpdateRecordRequest$outboundSchema = z.object({
recordId: z.string(),
teamId: z.string().optional(),
slug: z.string().optional(),
requestBody: z.lazy(() => UpdateRecordRequestBody$outboundSchema),
}).transform((v) => {
return remap$(v, {
requestBody: "RequestBody",
});
});
export function updateRecordRequestToJSON(updateRecordRequest) {
return JSON.stringify(UpdateRecordRequest$outboundSchema.parse(updateRecordRequest));
}
/** @internal */
export const UpdateRecordDnsType$inboundSchema = z.nativeEnum(UpdateRecordDnsType);
/** @internal */
export const UpdateRecordRecordType$inboundSchema = z.nativeEnum(UpdateRecordRecordType);
/** @internal */
export const UpdateRecordResponseBody$inboundSchema = z.object({
id: types.string(),
name: types.string(),
type: UpdateRecordDnsType$inboundSchema,
value: types.string(),
creator: types.string(),
domain: types.string(),
ttl: types.optional(types.number()),
comment: types.optional(types.string()),
recordType: UpdateRecordRecordType$inboundSchema,
createdAt: z.nullable(types.number()).optional(),
});
export function updateRecordResponseBodyFromJSON(jsonString) {
return safeParse(jsonString, (x) => UpdateRecordResponseBody$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'UpdateRecordResponseBody' from JSON`);
}
//# sourceMappingURL=updaterecordop.js.map