/* * 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 HttpPushCallbackUpdate = { /** * A string that will be used to generate a signature for each event push request; This value cannot be more than 64KiB */ clientSecret?: string | undefined; /** * 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 | undefined; }; /** @internal */ export const HttpPushCallbackUpdate$inboundSchema: z.ZodType< HttpPushCallbackUpdate, z.ZodTypeDef, unknown > = z.object({ client_secret: z.string().optional(), timeout_seconds: z.number().int().optional(), url: z.string().optional(), }).transform((v) => { return remap$(v, { "client_secret": "clientSecret", "timeout_seconds": "timeoutSeconds", }); }); /** @internal */ export type HttpPushCallbackUpdate$Outbound = { client_secret?: string | undefined; timeout_seconds?: number | undefined; url?: string | undefined; }; /** @internal */ export const HttpPushCallbackUpdate$outboundSchema: z.ZodType< HttpPushCallbackUpdate$Outbound, z.ZodTypeDef, HttpPushCallbackUpdate > = z.object({ clientSecret: z.string().optional(), timeoutSeconds: z.number().int().optional(), url: z.string().optional(), }).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 HttpPushCallbackUpdate$ { /** @deprecated use `HttpPushCallbackUpdate$inboundSchema` instead. */ export const inboundSchema = HttpPushCallbackUpdate$inboundSchema; /** @deprecated use `HttpPushCallbackUpdate$outboundSchema` instead. */ export const outboundSchema = HttpPushCallbackUpdate$outboundSchema; /** @deprecated use `HttpPushCallbackUpdate$Outbound` instead. */ export type Outbound = HttpPushCallbackUpdate$Outbound; } export function httpPushCallbackUpdateToJSON( httpPushCallbackUpdate: HttpPushCallbackUpdate, ): string { return JSON.stringify( HttpPushCallbackUpdate$outboundSchema.parse(httpPushCallbackUpdate), ); } export function httpPushCallbackUpdateFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => HttpPushCallbackUpdate$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'HttpPushCallbackUpdate' from JSON`, ); }