/* * 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 GCPPubSubCredentials = { /** * Service account key JSON. The entire JSON key file content as a string. */ serviceAccountJson: string; }; /** @internal */ export const GCPPubSubCredentials$inboundSchema: z.ZodType< GCPPubSubCredentials, z.ZodTypeDef, unknown > = z.object({ service_account_json: z.string(), }).transform((v) => { return remap$(v, { "service_account_json": "serviceAccountJson", }); }); /** @internal */ export type GCPPubSubCredentials$Outbound = { service_account_json: string; }; /** @internal */ export const GCPPubSubCredentials$outboundSchema: z.ZodType< GCPPubSubCredentials$Outbound, z.ZodTypeDef, GCPPubSubCredentials > = z.object({ serviceAccountJson: z.string(), }).transform((v) => { return remap$(v, { serviceAccountJson: "service_account_json", }); }); export function gcpPubSubCredentialsToJSON( gcpPubSubCredentials: GCPPubSubCredentials, ): string { return JSON.stringify( GCPPubSubCredentials$outboundSchema.parse(gcpPubSubCredentials), ); } export function gcpPubSubCredentialsFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => GCPPubSubCredentials$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GCPPubSubCredentials' from JSON`, ); }