fathom-typescript
Version:
Fathom's official TypeScript SDK.
37 lines (32 loc) • 960 B
text/typescript
/*
* 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 { Result as SafeParseResult } from "../../types/fp.js";
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
export type CallbackResponse = {
destinationUrl: string;
};
/** @internal */
export const CallbackResponse$inboundSchema: z.ZodType<
CallbackResponse,
z.ZodTypeDef,
unknown
> = z.object({
destination_url: z.string(),
}).transform((v) => {
return remap$(v, {
"destination_url": "destinationUrl",
});
});
export function callbackResponseFromJSON(
jsonString: string,
): SafeParseResult<CallbackResponse, SDKValidationError> {
return safeParse(
jsonString,
(x) => CallbackResponse$inboundSchema.parse(JSON.parse(x)),
`Failed to parse 'CallbackResponse' from JSON`,
);
}