/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod"; import { remap as remap$ } from "../../lib/primitives.js"; import { safeParse } from "../../lib/schemas.js"; import { Result as SafeParseResult } from "../../types/fp.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 = { /** * 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 const VaultConnectionsOneGlobals$inboundSchema: z.ZodType< VaultConnectionsOneGlobals, z.ZodTypeDef, unknown > = z.object({ consumerId: z.string().optional(), appId: z.string().optional(), }); /** @internal */ export type VaultConnectionsOneGlobals$Outbound = { consumerId?: string | undefined; appId?: string | undefined; }; /** @internal */ export const VaultConnectionsOneGlobals$outboundSchema: z.ZodType< VaultConnectionsOneGlobals$Outbound, z.ZodTypeDef, VaultConnectionsOneGlobals > = z.object({ consumerId: z.string().optional(), appId: z.string().optional(), }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace VaultConnectionsOneGlobals$ { /** @deprecated use `VaultConnectionsOneGlobals$inboundSchema` instead. */ export const inboundSchema = VaultConnectionsOneGlobals$inboundSchema; /** @deprecated use `VaultConnectionsOneGlobals$outboundSchema` instead. */ export const outboundSchema = VaultConnectionsOneGlobals$outboundSchema; /** @deprecated use `VaultConnectionsOneGlobals$Outbound` instead. */ export type Outbound = VaultConnectionsOneGlobals$Outbound; } export function vaultConnectionsOneGlobalsToJSON( vaultConnectionsOneGlobals: VaultConnectionsOneGlobals, ): string { return JSON.stringify( VaultConnectionsOneGlobals$outboundSchema.parse(vaultConnectionsOneGlobals), ); } export function vaultConnectionsOneGlobalsFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => VaultConnectionsOneGlobals$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'VaultConnectionsOneGlobals' from JSON`, ); } /** @internal */ export const VaultConnectionsOneRequest$inboundSchema: z.ZodType< VaultConnectionsOneRequest, z.ZodTypeDef, unknown > = z.object({ service_id: z.string(), unified_api: z.string(), }).transform((v) => { return remap$(v, { "service_id": "serviceId", "unified_api": "unifiedApi", }); }); /** @internal */ export type VaultConnectionsOneRequest$Outbound = { service_id: string; unified_api: string; }; /** @internal */ export const VaultConnectionsOneRequest$outboundSchema: z.ZodType< VaultConnectionsOneRequest$Outbound, z.ZodTypeDef, VaultConnectionsOneRequest > = z.object({ serviceId: z.string(), unifiedApi: z.string(), }).transform((v) => { return remap$(v, { serviceId: "service_id", unifiedApi: "unified_api", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace VaultConnectionsOneRequest$ { /** @deprecated use `VaultConnectionsOneRequest$inboundSchema` instead. */ export const inboundSchema = VaultConnectionsOneRequest$inboundSchema; /** @deprecated use `VaultConnectionsOneRequest$outboundSchema` instead. */ export const outboundSchema = VaultConnectionsOneRequest$outboundSchema; /** @deprecated use `VaultConnectionsOneRequest$Outbound` instead. */ export type Outbound = VaultConnectionsOneRequest$Outbound; } export function vaultConnectionsOneRequestToJSON( vaultConnectionsOneRequest: VaultConnectionsOneRequest, ): string { return JSON.stringify( VaultConnectionsOneRequest$outboundSchema.parse(vaultConnectionsOneRequest), ); } export function vaultConnectionsOneRequestFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => VaultConnectionsOneRequest$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'VaultConnectionsOneRequest' from JSON`, ); } /** @internal */ export const VaultConnectionsOneResponse$inboundSchema: z.ZodType< VaultConnectionsOneResponse, z.ZodTypeDef, unknown > = z.object({ HttpMeta: components.HTTPMetadata$inboundSchema, GetConnectionResponse: components.GetConnectionResponse$inboundSchema .optional(), UnexpectedErrorResponse: components.UnexpectedErrorResponse$inboundSchema .optional(), }).transform((v) => { return remap$(v, { "HttpMeta": "httpMeta", "GetConnectionResponse": "getConnectionResponse", "UnexpectedErrorResponse": "unexpectedErrorResponse", }); }); /** @internal */ export type VaultConnectionsOneResponse$Outbound = { HttpMeta: components.HTTPMetadata$Outbound; GetConnectionResponse?: components.GetConnectionResponse$Outbound | undefined; UnexpectedErrorResponse?: | components.UnexpectedErrorResponse$Outbound | undefined; }; /** @internal */ export const VaultConnectionsOneResponse$outboundSchema: z.ZodType< VaultConnectionsOneResponse$Outbound, z.ZodTypeDef, VaultConnectionsOneResponse > = z.object({ httpMeta: components.HTTPMetadata$outboundSchema, getConnectionResponse: components.GetConnectionResponse$outboundSchema .optional(), unexpectedErrorResponse: components.UnexpectedErrorResponse$outboundSchema .optional(), }).transform((v) => { return remap$(v, { httpMeta: "HttpMeta", getConnectionResponse: "GetConnectionResponse", unexpectedErrorResponse: "UnexpectedErrorResponse", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace VaultConnectionsOneResponse$ { /** @deprecated use `VaultConnectionsOneResponse$inboundSchema` instead. */ export const inboundSchema = VaultConnectionsOneResponse$inboundSchema; /** @deprecated use `VaultConnectionsOneResponse$outboundSchema` instead. */ export const outboundSchema = VaultConnectionsOneResponse$outboundSchema; /** @deprecated use `VaultConnectionsOneResponse$Outbound` instead. */ export type Outbound = VaultConnectionsOneResponse$Outbound; } export function vaultConnectionsOneResponseToJSON( vaultConnectionsOneResponse: VaultConnectionsOneResponse, ): string { return JSON.stringify( VaultConnectionsOneResponse$outboundSchema.parse( vaultConnectionsOneResponse, ), ); } export function vaultConnectionsOneResponseFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => VaultConnectionsOneResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'VaultConnectionsOneResponse' from JSON`, ); }