/* * 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 { lazySchema as lazySchema$, safeParse } from "../../lib/schemas.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import * as types from "../../types/primitives.js"; import * as components from "../components/index.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; export type VaultConnectionsOneGlobals = { /** * ID of the consumer which you want to get or push data from */ consumerId?: string | undefined; /** * The ID of your Unify application */ appId?: string | undefined; }; export type VaultConnectionsOneRequest = { /** * ID of the consumer which you want to get or push data from */ consumerId?: string | undefined; /** * The ID of your Unify application */ appId?: string | undefined; /** * Service ID of the resource to return */ serviceId: string; /** * Unified API */ unifiedApi: string; }; export type VaultConnectionsOneResponse = { httpMeta: components.HTTPMetadata; /** * Connection */ getConnectionResponse?: components.GetConnectionResponse | undefined; /** * Unexpected error */ unexpectedErrorResponse?: components.UnexpectedErrorResponse | undefined; }; /** @internal */ export type VaultConnectionsOneRequest$Outbound = { consumerId?: string | undefined; appId?: string | undefined; service_id: string; unified_api: string; }; /** @internal */ export const VaultConnectionsOneRequest$outboundSchema: z.ZodType< VaultConnectionsOneRequest$Outbound, z.ZodTypeDef, VaultConnectionsOneRequest > = /* @__PURE__ */ lazySchema$(() => z.object({ consumerId: z.string().optional(), appId: z.string().optional(), serviceId: z.string(), unifiedApi: z.string(), }).transform((v) => { return remap$(v, { serviceId: "service_id", unifiedApi: "unified_api", }); }) ); export function vaultConnectionsOneRequestToJSON( vaultConnectionsOneRequest: VaultConnectionsOneRequest, ): string { return JSON.stringify( VaultConnectionsOneRequest$outboundSchema.parse(vaultConnectionsOneRequest), ); } /** @internal */ export const VaultConnectionsOneResponse$inboundSchema: z.ZodType< VaultConnectionsOneResponse, z.ZodTypeDef, unknown > = /* @__PURE__ */ lazySchema$(() => z.object({ HttpMeta: components.HTTPMetadata$inboundSchema, GetConnectionResponse: types.optional( components.GetConnectionResponse$inboundSchema, ), UnexpectedErrorResponse: types.optional( components.UnexpectedErrorResponse$inboundSchema, ), }).transform((v) => { return remap$(v, { "HttpMeta": "httpMeta", "GetConnectionResponse": "getConnectionResponse", "UnexpectedErrorResponse": "unexpectedErrorResponse", }); }) ); export function vaultConnectionsOneResponseFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => VaultConnectionsOneResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'VaultConnectionsOneResponse' from JSON`, ); }