/* * 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 GCPPubSubConfig = { /** * The GCP project ID. */ projectId: string; /** * The Pub/Sub topic name. */ topic: string; /** * Optional. Custom endpoint URL (e.g., localhost:8085 for emulator). */ endpoint?: string | undefined; }; /** @internal */ export const GCPPubSubConfig$inboundSchema: z.ZodType< GCPPubSubConfig, z.ZodTypeDef, unknown > = z.object({ project_id: z.string(), topic: z.string(), endpoint: z.string().optional(), }).transform((v) => { return remap$(v, { "project_id": "projectId", }); }); /** @internal */ export type GCPPubSubConfig$Outbound = { project_id: string; topic: string; endpoint?: string | undefined; }; /** @internal */ export const GCPPubSubConfig$outboundSchema: z.ZodType< GCPPubSubConfig$Outbound, z.ZodTypeDef, GCPPubSubConfig > = z.object({ projectId: z.string(), topic: z.string(), endpoint: z.string().optional(), }).transform((v) => { return remap$(v, { projectId: "project_id", }); }); export function gcpPubSubConfigToJSON( gcpPubSubConfig: GCPPubSubConfig, ): string { return JSON.stringify(GCPPubSubConfig$outboundSchema.parse(gcpPubSubConfig)); } export function gcpPubSubConfigFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => GCPPubSubConfig$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GCPPubSubConfig' from JSON`, ); }