/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod"; 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"; /** * Configuration information about an HTTP target callback */ export type HttpPushCallbackCreate = { /** * A string that will be used to generate a signature for each event push request; This value cannot be more than 64KiB */ clientSecret: string; /** * The maximum amount of time, in seconds, the service will wait for an acknowledgement of a delivery; If a value of 0 or no value is specified, the timeout will default to 10 seconds */ timeoutSeconds?: number | undefined; /** * The URL address of the client HTTP server that will receive the events via POST; URLs must be in the form of https://{domain}[/{path}] */ url: string; }; /** @internal */ export const HttpPushCallbackCreate$inboundSchema: z.ZodType< HttpPushCallbackCreate, z.ZodTypeDef, unknown > = z.object({ client_secret: z.string(), timeout_seconds: z.number().int().optional(), url: z.string(), }).transform((v) => { return remap$(v, { "client_secret": "clientSecret", "timeout_seconds": "timeoutSeconds", }); }); /** @internal */ export type HttpPushCallbackCreate$Outbound = { client_secret: string; timeout_seconds?: number | undefined; url: string; }; /** @internal */ export const HttpPushCallbackCreate$outboundSchema: z.ZodType< HttpPushCallbackCreate$Outbound, z.ZodTypeDef, HttpPushCallbackCreate > = z.object({ clientSecret: z.string(), timeoutSeconds: z.number().int().optional(), url: z.string(), }).transform((v) => { return remap$(v, { clientSecret: "client_secret", timeoutSeconds: "timeout_seconds", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace HttpPushCallbackCreate$ { /** @deprecated use `HttpPushCallbackCreate$inboundSchema` instead. */ export const inboundSchema = HttpPushCallbackCreate$inboundSchema; /** @deprecated use `HttpPushCallbackCreate$outboundSchema` instead. */ export const outboundSchema = HttpPushCallbackCreate$outboundSchema; /** @deprecated use `HttpPushCallbackCreate$Outbound` instead. */ export type Outbound = HttpPushCallbackCreate$Outbound; } export function httpPushCallbackCreateToJSON( httpPushCallbackCreate: HttpPushCallbackCreate, ): string { return JSON.stringify( HttpPushCallbackCreate$outboundSchema.parse(httpPushCallbackCreate), ); } export function httpPushCallbackCreateFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => HttpPushCallbackCreate$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'HttpPushCallbackCreate' from JSON`, ); }