/*
 * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
 */

import * as z from "zod/v4-mini";
import { remap as remap$ } from "../../lib/primitives.js";
import {
  WebhookEndpointUpdate,
  WebhookEndpointUpdate$Outbound,
  WebhookEndpointUpdate$outboundSchema,
} from "../components/webhookendpointupdate.js";

export type WebhooksUpdateWebhookEndpointRequest = {
  /**
   * The webhook endpoint ID.
   */
  id: string;
  webhookEndpointUpdate: WebhookEndpointUpdate;
};

/** @internal */
export type WebhooksUpdateWebhookEndpointRequest$Outbound = {
  id: string;
  WebhookEndpointUpdate: WebhookEndpointUpdate$Outbound;
};

/** @internal */
export const WebhooksUpdateWebhookEndpointRequest$outboundSchema: z.ZodMiniType<
  WebhooksUpdateWebhookEndpointRequest$Outbound,
  WebhooksUpdateWebhookEndpointRequest
> = z.pipe(
  z.object({
    id: z.string(),
    webhookEndpointUpdate: WebhookEndpointUpdate$outboundSchema,
  }),
  z.transform((v) => {
    return remap$(v, {
      webhookEndpointUpdate: "WebhookEndpointUpdate",
    });
  }),
);

export function webhooksUpdateWebhookEndpointRequestToJSON(
  webhooksUpdateWebhookEndpointRequest: WebhooksUpdateWebhookEndpointRequest,
): string {
  return JSON.stringify(
    WebhooksUpdateWebhookEndpointRequest$outboundSchema.parse(
      webhooksUpdateWebhookEndpointRequest,
    ),
  );
}
