/* * 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 UpdateWebhookEndpointPayload = { name?: string | null | undefined; url?: string | null | undefined; active?: boolean | null | undefined; partitionPattern?: string | null | undefined; }; /** @internal */ export const UpdateWebhookEndpointPayload$inboundSchema: z.ZodType< UpdateWebhookEndpointPayload, z.ZodTypeDef, unknown > = z.object({ name: z.nullable(z.string()).optional(), url: z.nullable(z.string()).optional(), active: z.nullable(z.boolean()).optional(), partition_pattern: z.nullable(z.string()).optional(), }).transform((v) => { return remap$(v, { "partition_pattern": "partitionPattern", }); }); /** @internal */ export type UpdateWebhookEndpointPayload$Outbound = { name?: string | null | undefined; url?: string | null | undefined; active?: boolean | null | undefined; partition_pattern?: string | null | undefined; }; /** @internal */ export const UpdateWebhookEndpointPayload$outboundSchema: z.ZodType< UpdateWebhookEndpointPayload$Outbound, z.ZodTypeDef, UpdateWebhookEndpointPayload > = z.object({ name: z.nullable(z.string()).optional(), url: z.nullable(z.string()).optional(), active: z.nullable(z.boolean()).optional(), partitionPattern: z.nullable(z.string()).optional(), }).transform((v) => { return remap$(v, { partitionPattern: "partition_pattern", }); }); export function updateWebhookEndpointPayloadToJSON( updateWebhookEndpointPayload: UpdateWebhookEndpointPayload, ): string { return JSON.stringify( UpdateWebhookEndpointPayload$outboundSchema.parse( updateWebhookEndpointPayload, ), ); } export function updateWebhookEndpointPayloadFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => UpdateWebhookEndpointPayload$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'UpdateWebhookEndpointPayload' from JSON`, ); }