migrationsettingspost.ts•2.18 kB
/*
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
import * as z from "zod";
import { safeParse } from "../../lib/schemas.js";
import { Result as SafeParseResult } from "../../types/fp.js";
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
export type MigrationSettingsPost = {
/**
* Context kind for a migration with 6 stages, where data is being moved
*/
contextKind?: string | undefined;
stageCount: number;
};
/** @internal */
export const MigrationSettingsPost$inboundSchema: z.ZodType<
MigrationSettingsPost,
z.ZodTypeDef,
unknown
> = z.object({
contextKind: z.string().optional(),
stageCount: z.number().int(),
});
/** @internal */
export type MigrationSettingsPost$Outbound = {
contextKind?: string | undefined;
stageCount: number;
};
/** @internal */
export const MigrationSettingsPost$outboundSchema: z.ZodType<
MigrationSettingsPost$Outbound,
z.ZodTypeDef,
MigrationSettingsPost
> = z.object({
contextKind: z.string().optional(),
stageCount: z.number().int(),
});
/**
* @internal
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
*/
export namespace MigrationSettingsPost$ {
/** @deprecated use `MigrationSettingsPost$inboundSchema` instead. */
export const inboundSchema = MigrationSettingsPost$inboundSchema;
/** @deprecated use `MigrationSettingsPost$outboundSchema` instead. */
export const outboundSchema = MigrationSettingsPost$outboundSchema;
/** @deprecated use `MigrationSettingsPost$Outbound` instead. */
export type Outbound = MigrationSettingsPost$Outbound;
}
export function migrationSettingsPostToJSON(
migrationSettingsPost: MigrationSettingsPost,
): string {
return JSON.stringify(
MigrationSettingsPost$outboundSchema.parse(migrationSettingsPost),
);
}
export function migrationSettingsPostFromJSON(
jsonString: string,
): SafeParseResult<MigrationSettingsPost, SDKValidationError> {
return safeParse(
jsonString,
(x) => MigrationSettingsPost$inboundSchema.parse(JSON.parse(x)),
`Failed to parse 'MigrationSettingsPost' from JSON`,
);
}